WSL/SLF GitLab Repository
Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
snow-models
meteoio
Commits
bc4e2fca
Commit
bc4e2fca
authored
Aug 21, 2014
by
Thomas Egger
Browse files
NetCDFIO: checkEpsilonEquality for modified julian dates instead of test for double equality
parent
3872edb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
meteoio/plugins/NetCDFIO.cc
View file @
bc4e2fca
...
@@ -77,6 +77,7 @@ namespace mio {
...
@@ -77,6 +77,7 @@ namespace mio {
*/
*/
const
double
NetCDFIO
::
plugin_nodata
=
-
9999999.
;
//CNRM-GAME nodata value
const
double
NetCDFIO
::
plugin_nodata
=
-
9999999.
;
//CNRM-GAME nodata value
const
double
NetCDFIO
::
epsilon
=
1.0e-10
;
//when comparing timestamps
const
std
::
string
NetCDFIO
::
cf_time
=
"time"
;
const
std
::
string
NetCDFIO
::
cf_time
=
"time"
;
const
std
::
string
NetCDFIO
::
cf_units
=
"units"
;
const
std
::
string
NetCDFIO
::
cf_units
=
"units"
;
...
@@ -939,7 +940,8 @@ void NetCDFIO::get_parameters(const std::vector< std::vector<MeteoData> >& vecMe
...
@@ -939,7 +940,8 @@ void NetCDFIO::get_parameters(const std::vector< std::vector<MeteoData> >& vecMe
for
(
size_t
jj
=
0
;
jj
<
vecMeteo
[
ii
].
size
();
++
jj
)
{
for
(
size_t
jj
=
0
;
jj
<
vecMeteo
[
ii
].
size
();
++
jj
)
{
const
MeteoData
&
meteo_data
=
vecMeteo
[
ii
][
jj
];
const
MeteoData
&
meteo_data
=
vecMeteo
[
ii
][
jj
];
if
(
dates
[
jj
]
!=
meteo_data
.
date
.
getModifiedJulianDate
())
inconsistent
=
true
;
if
(
!
IOUtils
::
checkEpsilonEquality
(
dates
[
jj
],
meteo_data
.
date
.
getModifiedJulianDate
(),
NetCDFIO
::
epsilon
))
inconsistent
=
true
;
if
(
jj
==
0
)
{
if
(
jj
==
0
)
{
map_data_1D
[
cnrm_latitude
][
ii
]
=
meteo_data
.
meta
.
position
.
getLat
();
map_data_1D
[
cnrm_latitude
][
ii
]
=
meteo_data
.
meta
.
position
.
getLat
();
...
...
meteoio/plugins/NetCDFIO.h
View file @
bc4e2fca
...
@@ -98,6 +98,7 @@ class NetCDFIO : public IOInterface {
...
@@ -98,6 +98,7 @@ class NetCDFIO : public IOInterface {
// Private variables
// Private variables
static
const
double
plugin_nodata
;
//plugin specific nodata value, e.g. -999
static
const
double
plugin_nodata
;
//plugin specific nodata value, e.g. -999
static
const
double
epsilon
;
//for numerical comparisons of double values
static
const
std
::
string
cf_time
,
cf_units
,
cf_days
,
cf_hours
,
cf_seconds
,
cf_latitude
,
cf_longitude
,
cf_altitude
,
cf_ta
,
cf_rh
,
cf_p
;
static
const
std
::
string
cf_time
,
cf_units
,
cf_days
,
cf_hours
,
cf_seconds
,
cf_latitude
,
cf_longitude
,
cf_altitude
,
cf_ta
,
cf_rh
,
cf_p
;
static
const
std
::
string
cnrm_points
,
cnrm_latitude
,
cnrm_longitude
,
cnrm_altitude
,
cnrm_aspect
,
cnrm_slope
,
cnrm_ta
,
cnrm_rh
,
cnrm_vw
,
cnrm_dw
,
cnrm_qair
;
static
const
std
::
string
cnrm_points
,
cnrm_latitude
,
cnrm_longitude
,
cnrm_altitude
,
cnrm_aspect
,
cnrm_slope
,
cnrm_ta
,
cnrm_rh
,
cnrm_vw
,
cnrm_dw
,
cnrm_qair
;
static
const
std
::
string
cnrm_co2air
,
cnrm_theorsw
,
cnrm_neb
,
cnrm_hnw
,
cnrm_snowf
,
cnrm_swr_direct
,
cnrm_swr_diffuse
,
cnrm_p
,
cnrm_ilwr
,
cnrm_timestep
;
static
const
std
::
string
cnrm_co2air
,
cnrm_theorsw
,
cnrm_neb
,
cnrm_hnw
,
cnrm_snowf
,
cnrm_swr_direct
,
cnrm_swr_diffuse
,
cnrm_p
,
cnrm_ilwr
,
cnrm_timestep
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment