Commit 387f1746 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Simplify assignment of dimension.

parent eb1fc987
...@@ -1595,10 +1595,9 @@ void cdf_set_dimtype(int nvars, ncvar_t *ncvars, ncdim_t *ncdims) ...@@ -1595,10 +1595,9 @@ void cdf_set_dimtype(int nvars, ncvar_t *ncvars, ncdim_t *ncdims)
for ( int i = 0; i < ndims; i++ ) for ( int i = 0; i < ndims; i++ )
{ {
int ncdimid = ncvars[ncvarid].dimids[i]; int ncdimid = ncvars[ncvarid].dimids[i];
if ( ncdims[ncdimid].dimtype == X_AXIS ) cdf_set_dim(ncvars, ncvarid, i, X_AXIS); int dimtype = ncdims[ncdimid].dimtype;
else if ( ncdims[ncdimid].dimtype == Y_AXIS ) cdf_set_dim(ncvars, ncvarid, i, Y_AXIS); if ( dimtype >= X_AXIS && dimtype <= T_AXIS )
else if ( ncdims[ncdimid].dimtype == Z_AXIS ) cdf_set_dim(ncvars, ncvarid, i, Z_AXIS); cdf_set_dim(ncvars, ncvarid, i, dimtype);
else if ( ncdims[ncdimid].dimtype == T_AXIS ) cdf_set_dim(ncvars, ncvarid, i, T_AXIS);
} }
if ( CDI_Debug ) if ( CDI_Debug )
......
Supports Markdown
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