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
5490f8b4
Commit
5490f8b4
authored
Feb 04, 2013
by
Uwe Schulzweida
Browse files
netCDF: ignore the attribute valid_range, if the data type is inconsitent
parent
0b5ac45d
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
5490f8b4
...
...
@@ -5,6 +5,7 @@
2013-02-04 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* netCDF: ignore the attribute valid_range, if the data type is inconsitent
* netCDF: added env IGNORE_VALID_RANGE to ignore the attribute valid_range
2013-01-31 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
...
...
src/stream_cdf.c
View file @
5490f8b4
...
...
@@ -4723,7 +4723,9 @@ void cdfScanVarAttributes(int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
if
(
ncvars
[
ncvarid
].
lvalidrange
==
FALSE
)
{
extern
int
cdiIgnoreValidRange
;
if
(
cdiIgnoreValidRange
==
FALSE
)
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
,
2
,
ncvars
[
ncvarid
].
validrange
);
ncvars
[
ncvarid
].
lvalidrange
=
TRUE
;
...
...
@@ -4731,6 +4733,10 @@ void cdfScanVarAttributes(int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
ncvars
[
ncvarid
].
lunsigned
=
TRUE
;
/* cdfSetVar(ncvars, ncvarid, TRUE); */
}
else
if
(
lignore
)
{
Warning
(
"Inconsistent data type for attribute %s:valid_range, ignored!"
,
name
);
}
}
}
else
if
(
strcmp
(
attname
,
"valid_min"
)
==
0
&&
attlen
==
1
)
...
...
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