Commit 4d3e3d64 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

have_missval bug fix

parent fc334b2d
......@@ -11,7 +11,7 @@
#include <math.h>
#include "cdi.h"
int vlistInqVarMissvalUsed(int vlistID, int varID);
#ifndef DBL_IS_NAN
#if defined (HAVE_ISNAN)
# define DBL_IS_NAN(x) (isnan(x))
......
......@@ -2017,7 +2017,7 @@ void streamDefVlist(int streamID, int vlistID)
zaxisID = vlistInqVarZaxis(vlistID, varID);
streamNewVar(streamID, gridID, zaxisID);
if ( streamptr->have_missval )
vlistDefVarMissval(vlistID, varID, vlistInqVarMissval(vlistID, varID));
vlistDefVarMissval(streamptr->vlistID, varID, vlistInqVarMissval(vlistID, varID));
}
if ( streamptr->filemode == 'w' )
......
......@@ -652,7 +652,7 @@ void cdfDefVarSzip(int ncid, int ncvarid)
#endif
static
void cdfDefMissval(int streamID, int varID, int dtype, int lcheck)
void cdfDefVarMissval(int streamID, int varID, int dtype, int lcheck)
{
#if defined (HAVE_LIBNETCDF)
stream_t *streamptr;
......@@ -2879,7 +2879,7 @@ int cdfDefVar(int streamID, int varID)
streamptr->vars[varID].ncvarid = ncvarid;
if ( vlistInqVarMissvalUsed(vlistID, varID) )
cdfDefMissval(streamID, varID, vlistInqVarDatatype(vlistID, varID), 0);
cdfDefVarMissval(streamID, varID, vlistInqVarDatatype(vlistID, varID), 0);
/* Attributes */
defineAttributes(vlistID, varID, fileID, ncvarid);
......@@ -3120,7 +3120,7 @@ void cdfWriteVarDP(int streamID, int varID, const double *data, int nmiss)
dtype = vlistInqVarDatatype(vlistID, varID);
if ( nmiss > 0 ) cdfDefMissval(streamID, varID, dtype, 1);
if ( nmiss > 0 ) cdfDefVarMissval(streamID, varID, dtype, 1);
/* if ( dtype == DATATYPE_INT8 || dtype == DATATYPE_INT16 || dtype == DATATYPE_INT32 ) */
{
......@@ -3530,7 +3530,7 @@ int cdfWriteVarSliceDP(int streamID, int varID, int levelID, const double *data,
dtype = vlistInqVarDatatype(vlistID, varID);
if ( nmiss > 0 ) cdfDefMissval(streamID, varID, dtype, 1);
if ( nmiss > 0 ) cdfDefVarMissval(streamID, varID, dtype, 1);
/* if ( dtype == DATATYPE_INT8 || dtype == DATATYPE_INT16 || dtype == DATATYPE_INT32 ) */
{
......
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