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

Skip unavailable coordinate variables (bug fix).

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