mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-02-17 16:50:18 +08:00
Don't call nc_inq_dimids when netCDF-3 only
This commit is contained in:
parent
a90944979f
commit
726e4b0457
@ -1795,7 +1795,14 @@ iscoordvar(int ncid, int varid)
|
||||
if (dimids)
|
||||
free(dimids);
|
||||
dimids = (int *) emalloc((ndims + 1) * sizeof(int));
|
||||
#ifdef USE_NETCDF4
|
||||
NC_CHECK( nc_inq_dimids(ncid, &ndims1, dimids, include_parents ) );
|
||||
#else
|
||||
for(int i = 0; i < ndims; i++) {
|
||||
dimids[i] = i; /* for netCDF-3, dimids are 0, 1, ..., ndims-1 */
|
||||
}
|
||||
NC_CHECK( nc_inq_ndims(ncid, &ndims1) );
|
||||
#endif /* USE_NETCDF4 */
|
||||
} while (ndims != ndims1);
|
||||
|
||||
for (dimid = 0; dimid < ndims; dimid++) {
|
||||
|
Loading…
Reference in New Issue
Block a user