Commit 1e3ab1cd authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

preparation for reduce_dim of z axis.

parent 5cbc4e9d
......@@ -986,6 +986,7 @@ void cdf_write_var_data(int fileID, int vlistID, int varID, int ncvarid, int dty
void cdf_write_var(stream_t *streamptr, int varID, int memtype, const void *data, int nmiss)
{
if ( streamptr->accessmode == 0 ) cdfEndDef(streamptr);
// if ( streamptr->ncmode == 0 ) { cdfEndDef(streamptr); streamptr->ncmode = 2; }
size_t xsize = 0, ysize = 0;
size_t size;
......@@ -1081,6 +1082,7 @@ void cdf_write_var_chunk(stream_t *streamptr, int varID, int memtype,
const int rect[][2], const void *data, int nmiss)
{
if ( streamptr->accessmode == 0 ) cdfEndDef(streamptr);
// if ( streamptr->ncmode == 0 ) { cdfEndDef(streamptr); streamptr->ncmode = 2; }
int xid = CDI_UNDEFID, yid = CDI_UNDEFID;
size_t xsize = 0, ysize = 0;
......@@ -1182,6 +1184,7 @@ void cdf_write_var_chunk(stream_t *streamptr, int varID, int memtype,
void cdf_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtype, const void *data, int nmiss)
{
if ( streamptr->accessmode == 0 ) cdfEndDef(streamptr);
// if ( streamptr->ncmode == 0 ) { streamptr->ncmode = 2; cdfEndDef(streamptr); }
size_t xsize = 0, ysize = 0;
size_t start[5];
......
......@@ -1493,39 +1493,40 @@ void cdfDefZaxis(stream_t *streamptr, int zaxisID)
int nzaxis = vlistNzaxis(vlistID);
size_t dimlen = (size_t)zaxisInqSize(zaxisID);
int type = zaxisInqType(zaxisID);
int type = zaxisInqType(zaxisID);
int ndims = 1;
bool is_scalar = false;
if ( dimlen == 1 )
{
is_scalar = zaxisInqScalar(zaxisID) > 0;
bool is_scalar = zaxisInqScalar(zaxisID) > 0;
if ( !is_scalar && CDI_cmor_mode )
{
is_scalar = true;
zaxisDefScalar(zaxisID);
}
}
int ndims = is_scalar ? 0 : 1;
if ( is_scalar ) ndims = 0;
// if ( CDI_reduce_dim ) return;
if ( dimlen == 1 )
switch (type)
{
case ZAXIS_SURFACE:
case ZAXIS_CLOUD_BASE:
case ZAXIS_CLOUD_TOP:
case ZAXIS_ISOTHERM_ZERO:
case ZAXIS_TOA:
case ZAXIS_SEA_BOTTOM:
case ZAXIS_ATMOSPHERE:
case ZAXIS_MEANSEA:
case ZAXIS_LAKE_BOTTOM:
case ZAXIS_SEDIMENT_BOTTOM:
case ZAXIS_SEDIMENT_BOTTOM_TA:
case ZAXIS_SEDIMENT_BOTTOM_TW:
case ZAXIS_MIX_LAYER:
return;
}
switch (type)
{
case ZAXIS_SURFACE:
case ZAXIS_CLOUD_BASE:
case ZAXIS_CLOUD_TOP:
case ZAXIS_ISOTHERM_ZERO:
case ZAXIS_TOA:
case ZAXIS_SEA_BOTTOM:
case ZAXIS_ATMOSPHERE:
case ZAXIS_MEANSEA:
case ZAXIS_LAKE_BOTTOM:
case ZAXIS_SEDIMENT_BOTTOM:
case ZAXIS_SEDIMENT_BOTTOM_TA:
case ZAXIS_SEDIMENT_BOTTOM_TW:
case ZAXIS_MIX_LAYER:
return;
}
}
zaxisInqName(zaxisID, axisname);
......
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