Commit 365db31d authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

CDI_reduce_dim: wrong result when reduce time dimension (bug fix).

parent d92ff985
......@@ -4,7 +4,8 @@
2018-09-04 Uwe Schulzweida
* NetCDF: added support for single scalar variable
* CDI_reduce_dim: wrong result when reduce time dimension (bug fix)
* NetCDF: added support for single scalar variable
2018-08-10 Uwe Schulzweida
......
......@@ -1029,7 +1029,7 @@ void cdf_write_var(stream_t *streamptr, int varID, int memtype, const void *data
int zaxisindex = vlistZaxisIndex(vlistID, zaxisID);
int zid = streamptr->zaxisID[zaxisindex];
if ( timetype != TIME_CONSTANT )
if ( vlistHasTime(vlistID) && timetype != TIME_CONSTANT )
{
start[ndims] = (size_t)ntsteps - 1;
count[ndims] = 1;
......@@ -1123,7 +1123,7 @@ void cdf_write_var_chunk(stream_t *streamptr, int varID, int memtype,
int zaxisindex = vlistZaxisIndex(vlistID, zaxisID);
int zid = streamptr->zaxisID[zaxisindex];
if ( timetype != TIME_CONSTANT )
if ( vlistHasTime(vlistID) && timetype != TIME_CONSTANT )
{
start[ndims] = (size_t)ntsteps - 1;
count[ndims] = 1;
......@@ -1222,7 +1222,7 @@ void cdf_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtyp
bool swapxy = (dimorder[2] == 2 || dimorder[0] == 1) && xid != CDI_UNDEFID && yid != CDI_UNDEFID;
size_t ndims = 0;
if ( timetype != TIME_CONSTANT )
if ( vlistHasTime(vlistID) && timetype != TIME_CONSTANT )
{
start[ndims] = (size_t)ntsteps - 1;
count[ndims] = 1;
......
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