Commit 0879f664 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Skip unavailable coordinate variables (bug fix).

parent 7bf3024d
......@@ -2,6 +2,10 @@
* Version 1.9.3 released
2018-01-16 Uwe Schulzweida
* Skip unavailable coordinate variables (bug fix)
2018-01-13 Uwe Schulzweida
* streamFilesuffix(): refactoring (bug fix)
......
......@@ -1343,6 +1343,8 @@ void cdf_scan_var_attr(int nvars, ncvar_t *ncvars, ncdim_t *ncdims, int timedimi
}
else
{
if ( !cdiIgnoreAttCoordinates ) ncvars[ncvarid].ncoordvars++;
int k;
for ( k = 0; k < nchecked_vars; ++k )
if ( strcmp(checked_vars[k], varname) == 0 ) break;
......@@ -3874,13 +3876,16 @@ int cdfInqContents(stream_t *streamptr)
int ncoordvars = ncvar->ncoordvars;
for ( int i = 0; i < ncoordvars; i++ )
{
if ( ncvars[ncvar->coordvarids[i]].islon ||
ncvars[ncvar->coordvarids[i]].isx ) ncvar->xvarid = ncvar->coordvarids[i];
else if ( ncvars[ncvar->coordvarids[i]].islat ||
ncvars[ncvar->coordvarids[i]].isy ) ncvar->yvarid = ncvar->coordvarids[i];
else if ( ncvars[ncvar->coordvarids[i]].islev ) ncvar->zvarid = ncvar->coordvarids[i];
else if ( ncvars[ncvar->coordvarids[i]].isc ) ncvar->cvarids[i] = ncvar->coordvarids[i];
}
if ( ncvar->coordvarids[i] != CDI_UNDEFID )
{
if ( ncvars[ncvar->coordvarids[i]].islon ||
ncvars[ncvar->coordvarids[i]].isx ) ncvar->xvarid = ncvar->coordvarids[i];
else if ( ncvars[ncvar->coordvarids[i]].islat ||
ncvars[ncvar->coordvarids[i]].isy ) ncvar->yvarid = ncvar->coordvarids[i];
else if ( ncvars[ncvar->coordvarids[i]].islev ) ncvar->zvarid = ncvar->coordvarids[i];
else if ( ncvars[ncvar->coordvarids[i]].isc ) ncvar->cvarids[i] = ncvar->coordvarids[i];
}
}
}
}
......
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