Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
b7339103
Commit
b7339103
authored
Mar 07, 2013
by
Uwe Schulzweida
Browse files
netCDF: ignore the attribute valid_min/valid_max, if the data type is inconsistent
parent
4370c5a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
b7339103
2013-03-
??
Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
2013-03-
14
Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* Version 1.6.0 released
* using CGRIBEX library version 1.6.0
* using CGRIBEX library version 1.6.0
2013-03-07 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* netCDF: ignore the attribute valid_min/valid_max, if the data type is inconsistent
2013-02-18 Florian Prill <Florian.Prill@dwd.de>
...
...
src/stream_cdf.c
View file @
b7339103
...
...
@@ -4761,13 +4761,39 @@ void cdfScanVarAttributes(int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
}
else
if
(
strcmp
(
attname
,
"valid_min"
)
==
0
&&
attlen
==
1
)
{
cdfGetAttDouble
(
ncid
,
ncvarid
,
attname
,
1
,
&
(
ncvars
[
ncvarid
].
validrange
)[
0
]);
ncvars
[
ncvarid
].
lvalidrange
=
TRUE
;
if
(
ncvars
[
ncvarid
].
lvalidrange
==
FALSE
)
{
extern
int
cdiIgnoreValidRange
;
int
lignore
=
FALSE
;
if
(
(
atttype
==
NC_FLOAT
||
atttype
==
NC_DOUBLE
)
&&
xtype
!=
NC_FLOAT
&&
xtype
!=
NC_DOUBLE
)
lignore
=
TRUE
;
if
(
cdiIgnoreValidRange
==
FALSE
&&
lignore
==
FALSE
)
{
cdfGetAttDouble
(
ncid
,
ncvarid
,
attname
,
1
,
&
(
ncvars
[
ncvarid
].
validrange
)[
0
]);
ncvars
[
ncvarid
].
lvalidrange
=
TRUE
;
}
else
if
(
lignore
)
{
Warning
(
"Inconsistent data type for attribute %s:valid_min, ignored!"
,
name
);
}
}
}
else
if
(
strcmp
(
attname
,
"valid_max"
)
==
0
&&
attlen
==
1
)
{
cdfGetAttDouble
(
ncid
,
ncvarid
,
attname
,
1
,
&
(
ncvars
[
ncvarid
].
validrange
)[
1
]);
ncvars
[
ncvarid
].
lvalidrange
=
TRUE
;
if
(
ncvars
[
ncvarid
].
lvalidrange
==
FALSE
)
{
extern
int
cdiIgnoreValidRange
;
int
lignore
=
FALSE
;
if
(
(
atttype
==
NC_FLOAT
||
atttype
==
NC_DOUBLE
)
&&
xtype
!=
NC_FLOAT
&&
xtype
!=
NC_DOUBLE
)
lignore
=
TRUE
;
if
(
cdiIgnoreValidRange
==
FALSE
&&
lignore
==
FALSE
)
{
cdfGetAttDouble
(
ncid
,
ncvarid
,
attname
,
1
,
&
(
ncvars
[
ncvarid
].
validrange
)[
1
]);
ncvars
[
ncvarid
].
lvalidrange
=
TRUE
;
}
else
if
(
lignore
)
{
Warning
(
"Inconsistent data type for attribute %s:valid_max, ignored!"
,
name
);
}
}
}
else
if
(
strcmp
(
attname
,
"_Unsigned"
)
==
0
&&
atttype
==
NC_CHAR
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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