Commit fc334b2d authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added switch HAVE_MISSVAL to indicate that the input stream has missing values

parent 8bd3fabd
......@@ -690,7 +690,7 @@ int main(int argc, char *argv[])
if (Progname == 0) Progname = argv[0];
else Progname++;
while ( (c = getopt(argc, argv, "f:t:w:z:cdhlmqRrsvVZ")) != EOF )
while ( (c = getopt(argc, argv, "f:t:w:z:cdhlMmqRrsvVZ")) != EOF )
{
switch (c)
{
......@@ -706,6 +706,9 @@ int main(int argc, char *argv[])
case 'l':
Longinfo = 1;
break;
case 'M':
cdiDefGlobal("HAVE_MISSVAL", 1);
break;
case 'm':
Move = 1;
break;
......
......@@ -2016,6 +2016,8 @@ void streamDefVlist(int streamID, int vlistID)
gridID = vlistInqVarGrid(vlistID, varID);
zaxisID = vlistInqVarZaxis(vlistID, varID);
streamNewVar(streamID, gridID, zaxisID);
if ( streamptr->have_missval )
vlistDefVarMissval(vlistID, varID, vlistInqVarMissval(vlistID, varID));
}
if ( streamptr->filemode == 'w' )
......
......@@ -55,6 +55,7 @@ int CDI_Debug = 0; /* If set to 1, debugging */
int cdiDefaultLeveltype = -1;
static int cdiDataUnreduced = 0;
static int cdiSortName = 0;
static int cdiHaveMissval = 0;
long cdiGetenvInt(char *envName)
......@@ -118,6 +119,9 @@ void cdiInitialize(void)
value = cdiGetenvInt("CDI_SORTNAME");
if ( value >= 0 ) cdiSortName = (int) value;
value = cdiGetenvInt("CDI_HAVE_MISSVAL");
if ( value >= 0 ) cdiHaveMissval = (int) value;
value = cdiGetenvInt("CD_LEVELTYPE");
if ( value >= 0 ) cdiDefaultLeveltype = (int) value;
......@@ -363,6 +367,7 @@ static void stream_init_entry(stream_t *streamptr)
streamptr->vct.mlevID = UNDEFID;
streamptr->unreduced = cdiDataUnreduced;
streamptr->sortname = cdiSortName;
streamptr->have_missval = cdiHaveMissval;
streamptr->ztype = COMPRESS_NONE;
streamptr->zlevel = 0;
......@@ -485,6 +490,10 @@ void cdiDefGlobal(const char *string, int val)
{
cdiSortName = val;
}
else if ( strcmp(string, "HAVE_MISSVAL") == 0 )
{
cdiHaveMissval = val;
}
else
{
Warning(func, "Unsupported global key: %s", string);
......@@ -497,7 +506,6 @@ void cdiDefMissval(double missval)
cdiInitialize();
cdiDefaultMissval = missval;
}
......
......@@ -235,6 +235,7 @@ typedef struct {
VCT vct;
int unreduced;
int sortname;
int have_missval;
int ztype;
int zlevel;
int curfile;
......
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