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
d3e35563
Commit
d3e35563
authored
May 25, 2011
by
Uwe Schulzweida
Browse files
cdfInqContents: check type of coordinates attribute
parent
26eb0ae5
Changes
2
Hide whitespace changes
Inline
Side-by-side
config/default
View file @
d3e35563
...
...
@@ -15,6 +15,8 @@ case "${HOSTNAME}" in
hama
*
)
./configure
--prefix
=
$HOME
/local
\
--enable-maintainer-mode
\
--enable-swig
\
--enable-python
\
--with-jasper
=
/opt/local
\
--with-grib_api
=
$HOME
/local/gribapi-1.9.8
\
--with-netcdf
=
/opt/local
\
...
...
src/stream_cdf.c
View file @
d3e35563
...
...
@@ -4351,29 +4351,23 @@ void scanVarAttributes(int fileID, int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
}
else
if
(
strcmp
(
attname
,
"add_offset"
)
==
0
&&
atttype
!=
NC_CHAR
)
{
if
(
atttype
!=
NC_CHAR
)
{
cdfGetAttDouble
(
fileID
,
ncvarid
,
attname
,
1
,
&
ncvars
[
ncvarid
].
addoffset
);
/*
if ( atttype != NC_BYTE && atttype != NC_SHORT && atttype != NC_INT )
if ( ncvars[ncvarid].addoffset != 0 )
Warning("attribute add_offset not supported for atttype %d", atttype);
*/
cdfSetVar
(
ncvars
,
ncvarid
,
TRUE
);
}
cdfGetAttDouble
(
fileID
,
ncvarid
,
attname
,
1
,
&
ncvars
[
ncvarid
].
addoffset
);
/*
if ( atttype != NC_BYTE && atttype != NC_SHORT && atttype != NC_INT )
if ( ncvars[ncvarid].addoffset != 0 )
Warning("attribute add_offset not supported for atttype %d", atttype);
*/
cdfSetVar
(
ncvars
,
ncvarid
,
TRUE
);
}
else
if
(
strcmp
(
attname
,
"scale_factor"
)
==
0
&&
atttype
!=
NC_CHAR
)
{
if
(
atttype
!=
NC_CHAR
)
{
cdfGetAttDouble
(
fileID
,
ncvarid
,
attname
,
1
,
&
ncvars
[
ncvarid
].
scalefactor
);
/*
if ( atttype != NC_BYTE && atttype != NC_SHORT && atttype != NC_INT )
if ( ncvars[ncvarid].scalefactor != 1 )
Warning("attribute scale_factor not supported for atttype %d", atttype);
*/
cdfSetVar
(
ncvars
,
ncvarid
,
TRUE
);
}
cdfGetAttDouble
(
fileID
,
ncvarid
,
attname
,
1
,
&
ncvars
[
ncvarid
].
scalefactor
);
/*
if ( atttype != NC_BYTE && atttype != NC_SHORT && atttype != NC_INT )
if ( ncvars[ncvarid].scalefactor != 1 )
Warning("attribute scale_factor not supported for atttype %d", atttype);
*/
cdfSetVar
(
ncvars
,
ncvarid
,
TRUE
);
}
else
if
(
strcmp
(
attname
,
"bounds"
)
==
0
&&
atttype
==
NC_CHAR
)
{
...
...
@@ -4457,8 +4451,8 @@ void scanVarAttributes(int fileID, int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
cdfSetVar(ncvars, ncvarid, TRUE);
}
*/
else
if
(
strcmp
(
attname
,
"associate"
)
==
0
||
strcmp
(
attname
,
"coordinates"
)
==
0
)
else
if
(
(
strcmp
(
attname
,
"associate"
)
==
0
||
strcmp
(
attname
,
"coordinates"
)
==
0
)
&&
atttype
==
NC_CHAR
)
{
int
status
;
char
*
pstring
,
*
varname
=
NULL
;
...
...
@@ -4529,29 +4523,23 @@ void scanVarAttributes(int fileID, int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
ncdims
[
ncvars
[
ncvarid
].
dimids
[
0
]].
dimtype
=
Z_AXIS
;
}
}
else
if
(
strcmp
(
attname
,
"_FillValue"
)
==
0
||
strcmp
(
attname
,
"missing_value"
)
==
0
)
else
if
(
(
strcmp
(
attname
,
"_FillValue"
)
==
0
||
strcmp
(
attname
,
"missing_value"
)
==
0
)
&&
atttype
!=
NC_CHAR
)
{
if
(
atttype
!=
NC_CHAR
)
{
cdfGetAttDouble
(
fileID
,
ncvarid
,
attname
,
1
,
&
ncvars
[
ncvarid
].
missval
);
ncvars
[
ncvarid
].
defmiss
=
TRUE
;
/* cdfSetVar(ncvars, ncvarid, TRUE); */
}
cdfGetAttDouble
(
fileID
,
ncvarid
,
attname
,
1
,
&
ncvars
[
ncvarid
].
missval
);
ncvars
[
ncvarid
].
defmiss
=
TRUE
;
/* cdfSetVar(ncvars, ncvarid, TRUE); */
}
else
if
(
strcmp
(
attname
,
"cdi"
)
==
0
)
else
if
(
strcmp
(
attname
,
"cdi"
)
==
0
&&
atttype
==
NC_CHAR
)
{
if
(
atttype
==
NC_CHAR
)
{
cdfGetAttText
(
fileID
,
ncvarid
,
attname
,
attstringlen
-
1
,
attstring
);
strtolower
(
attstring
);
cdfGetAttText
(
fileID
,
ncvarid
,
attname
,
attstringlen
-
1
,
attstring
);
strtolower
(
attstring
);
if
(
memcmp
(
attstring
,
"ignore"
,
6
)
==
0
)
{
ncvars
[
ncvarid
].
ignore
=
TRUE
;
cdfSetVar
(
ncvars
,
ncvarid
,
FALSE
);
}
}
if
(
memcmp
(
attstring
,
"ignore"
,
6
)
==
0
)
{
ncvars
[
ncvarid
].
ignore
=
TRUE
;
cdfSetVar
(
ncvars
,
ncvarid
,
FALSE
);
}
}
else
if
(
strcmp
(
attname
,
"axis"
)
==
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