Commit d3e35563 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdfInqContents: check type of coordinates attribute

parent 26eb0ae5
......@@ -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 \
......
......@@ -4350,8 +4350,6 @@ void scanVarAttributes(int fileID, int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
cdfGetAttInt(fileID, ncvarid, attname, 1, &ncvars[ncvarid].truncation);
}
else if ( strcmp(attname, "add_offset") == 0 && atttype != NC_CHAR )
{
if ( atttype != NC_CHAR )
{
cdfGetAttDouble(fileID, ncvarid, attname, 1, &ncvars[ncvarid].addoffset);
/*
......@@ -4361,10 +4359,7 @@ void scanVarAttributes(int fileID, int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
*/
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);
/*
......@@ -4374,7 +4369,6 @@ void scanVarAttributes(int fileID, int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
*/
cdfSetVar(ncvars, ncvarid, TRUE);
}
}
else if ( strcmp(attname, "bounds") == 0 && atttype == NC_CHAR )
{
int status, ncboundsid;
......@@ -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,19 +4523,14 @@ 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 )
{
if ( atttype != NC_CHAR )
else if ( (strcmp(attname, "_FillValue") == 0 || strcmp(attname, "missing_value") == 0) &&
atttype != NC_CHAR )
{
cdfGetAttDouble(fileID, ncvarid, attname, 1, &ncvars[ncvarid].missval);
ncvars[ncvarid].defmiss = TRUE;
/* cdfSetVar(ncvars, ncvarid, TRUE); */
}
}
else if ( strcmp(attname, "cdi") == 0 )
{
if ( atttype == NC_CHAR )
else if ( strcmp(attname, "cdi") == 0 && atttype == NC_CHAR )
{
cdfGetAttText(fileID, ncvarid, attname, attstringlen-1, attstring);
strtolower(attstring);
......@@ -4552,7 +4541,6 @@ void scanVarAttributes(int fileID, int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
cdfSetVar(ncvars, ncvarid, FALSE);
}
}
}
else if ( strcmp(attname, "axis") == 0 && atttype == NC_CHAR )
{
cdfGetAttText(fileID, ncvarid, attname, attstringlen-1, attstring);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment