Commit 7152540f authored by Ralf Mueller's avatar Ralf Mueller
Browse files

merge latest development state

parents d4b879e6 6e46aa90
......@@ -3,6 +3,11 @@
* using CDI library version 1.7.2
* Version 1.7.2 released
2016-06-28 Uwe Schulzweida
* replace option -Q by --sort
* delete, delcode, delname: wrong variable check (bug fix)
2016-06-27 Uwe Schulzweida
* round doesn't work as expected, replaced by lround()
......
......@@ -35,6 +35,8 @@ The following options are available for all operators:
\> to {\tt L}ittle or {\tt B}ig endian. \\
\makebox[1.5in][l]{\hspace*{1cm}\sl -\,-cmor}
\> CMOR conform NetCDF output. \\
\makebox[1.5in][l]{\hspace*{1cm}\sl -C, -\,-color}
\> Colorized output messages. \\
\makebox[1.5in][l]{\hspace*{1cm}\sl -f $<$format$>$}
\> Set the output file format. The valid file formats are: \\
\> \parbox[r]{3in}{
......@@ -88,8 +90,6 @@ The following options are available for all operators:
\> \\
\makebox[1.5in][l]{\hspace*{1cm}}
\> Percentile method: {\tt nrank nist numpy numpy\_lower numpy\_higher numpy\_nearest} \\
\makebox[1.5in][l]{\hspace*{1cm}\sl -Q}
\> Alphanumeric sorting of NetCDF parameter names. \\
\makebox[1.5in][l]{\hspace*{1cm}\sl -\,-reduce\_dim}
\> Reduce NetCDF dimensions (module: TIMSTAT, FLDSTAT). \\
\makebox[1.5in][l]{\hspace*{1cm}\sl -R, -\,-regular}
......@@ -101,6 +101,8 @@ The following options are available for all operators:
\> the number of non missing values for each output period. \\
\makebox[1.5in][l]{\hspace*{1cm}\sl -s, -\,-silent}
\> Silent mode. \\
\makebox[1.5in][l]{\hspace*{1cm}\sl -\,-sort}
\> Alphanumeric sorting of NetCDF parameter names. \\
\makebox[1.5in][l]{\hspace*{1cm}\sl -t $<$partab$>$}
\> Set the GRIB1 (cgribex) default parameter table name or file (see chapter 1.6 on page \pageref{PARAMETER_TABLE}).\\
\> Predefined tables are: {\tt echam4 echam5 echam6 mpiom1 ecmwf remo}\\
......
......@@ -63,9 +63,9 @@ double dayofyear(int calendar, int vdate, int vtime)
doy += (second+minute*60+hour*3600)/86400.;
if ( cdoVerbose )
cdoPrint("%d %d %d %g\n", vdate, vtime, dpy, doy);
cdoPrint("vdate, vtime, dpy, doy: %d %d %d %g", vdate, vtime, dpy, doy);
return (doy);
return doy;
}
......
......@@ -30,25 +30,16 @@
void *Diff(void *argument)
{
int lhead = TRUE;
int i;
int varID1, varID2, recID;
int ndiff;
int code, param;
int gridID, zaxisID;
int checkrel;
bool lhead = true;
int nrecs, nrecs2;
int varID1, varID2;
int levelID;
int dsgn, zero;
int nmiss1, nmiss2;
int ndrec = 0, nd2rec = 0, ngrec = 0;
char varname[CDI_MAX_NAME];
char paramstr[32];
char vdatestr[32], vtimestr[32];
double absdiff;
double abslim = 0., abslim2 = 1.e-3, rellim = 1.0;
double absm, relm;
double missval1, missval2;
cdoInitialize(argument);
......@@ -60,9 +51,9 @@ void *Diff(void *argument)
int operatorID = cdoOperatorID();
if ( operatorArgc() >= 1 ) abslim = parameter2double(operatorArgv()[0]);
if ( abslim < -1.e33 || abslim > 1.e+33 ) cdoAbort("Abs. limit out of range\n");
if ( abslim < -1.e33 || abslim > 1.e+33 ) cdoAbort("Abs. limit out of range!");
if ( operatorArgc() == 2 ) rellim = parameter2double(operatorArgv()[1]);
if ( rellim < -1.e33 || rellim > 1.e+33 ) cdoAbort("Rel. limit out of range\n");
if ( rellim < -1.e33 || rellim > 1.e+33 ) cdoAbort("Rel. limit out of range!");
int streamID1 = streamOpenRead(cdoStreamName(0));
int streamID2 = streamOpenRead(cdoStreamName(1));
......@@ -93,36 +84,37 @@ void *Diff(void *argument)
if ( nrecs == 0 || nrecs2 == 0 ) break;
for ( recID = 0; recID < nrecs; recID++ )
for ( int recID = 0; recID < nrecs; recID++ )
{
streamInqRecord(streamID1, &varID1, &levelID);
streamInqRecord(streamID2, &varID2, &levelID);
indg += 1;
param = vlistInqVarParam(vlistID1, varID1);
code = vlistInqVarCode(vlistID1, varID1);
gridID = vlistInqVarGrid(vlistID1, varID1);
zaxisID = vlistInqVarZaxis(vlistID1, varID1);
gridsize = gridInqSize(gridID);
missval1 = vlistInqVarMissval(vlistID1, varID1);
missval2 = vlistInqVarMissval(vlistID2, varID2);
int param = vlistInqVarParam(vlistID1, varID1);
int code = vlistInqVarCode(vlistID1, varID1);
int gridID = vlistInqVarGrid(vlistID1, varID1);
int zaxisID = vlistInqVarZaxis(vlistID1, varID1);
int gridsize = gridInqSize(gridID);
double missval1 = vlistInqVarMissval(vlistID1, varID1);
double missval2 = vlistInqVarMissval(vlistID2, varID2);
//checkrel = gridInqType(gridID) != GRID_SPECTRAL;
checkrel = TRUE;
bool checkrel = true;
cdiParamToString(param, paramstr, sizeof(paramstr));
streamReadRecord(streamID1, array1, &nmiss1);
streamReadRecord(streamID2, array2, &nmiss2);
ndiff = 0;
absm = 0.0;
relm = 0.0;
dsgn = FALSE;
zero = FALSE;
int ndiff = 0;
bool dsgn = false;
bool zero = false;
double absm = 0.0;
double relm = 0.0;
double absdiff;
for ( i = 0; i < gridsize; i++ )
for ( int i = 0; i < gridsize; i++ )
{
if ( (DBL_IS_NAN(array1[i]) && !DBL_IS_NAN(array2[i])) ||
(!DBL_IS_NAN(array1[i]) && DBL_IS_NAN(array2[i])) )
......@@ -138,9 +130,9 @@ void *Diff(void *argument)
absm = MAX(absm, absdiff);
if ( array1[i]*array2[i] < 0. )
dsgn = TRUE;
dsgn = true;
else if ( IS_EQUAL(array1[i]*array2[i], 0.) )
zero = TRUE;
zero = true;
else
relm = MAX(relm, absdiff / MAX(fabs(array1[i]), fabs(array2[i])));
}
......@@ -158,7 +150,7 @@ void *Diff(void *argument)
{
if ( lhead )
{
lhead = FALSE;
lhead = false;
set_text_color(stdout, BRIGHT, BLACK);
fprintf(stdout, " Date Time Level Gridsize Miss ");
......
......@@ -40,7 +40,7 @@ void *Duplicate(void *argument)
if ( operatorArgc() > 1 ) cdoAbort("Too many arguments!");
else if ( operatorArgc() == 1 ) ndup = parameter2int(operatorArgv()[0]);
if ( cdoVerbose ) cdoPrint("ndup = %d\n", ndup);
if ( cdoVerbose ) cdoPrint("ndup = %d", ndup);
int streamID1 = streamOpenRead(cdoStreamName(0));
......
......@@ -162,7 +162,7 @@ void *Ensval(void *argument)
/* check for identical contents of all ensemble members */
nvars = vlistNvars(ef[0].vlistID);
if ( cdoVerbose )
cdoPrint("nvars %i\n",nvars);
cdoPrint("nvars %i",nvars);
for ( fileID = 1; fileID < nfiles; fileID++ )
vlistCompare(ef[0].vlistID, ef[fileID].vlistID, CMP_ALL);
......@@ -236,7 +236,7 @@ void *Ensval(void *argument)
}
if ( cdoVerbose )
cdoPrint(" sum_weights %10.6f\n",sum_weights);
cdoPrint(" sum_weights %10.6f",sum_weights);
tsID = 0;
do
......
......@@ -1393,7 +1393,8 @@ void *Gradsdes(void *argument)
}
if ( filetype == FILETYPE_GRB2 )
{
cdoAbort("\nThe fileformat GRIB2 is not fully supported yet\nfor the gradsdes operator.\nThe .ctl file %s was generated.\nYou can add the necessary .idx file by running\n\tgribmap -i %s", ctlfile, ctlfile);
cdoAbort("The fileformat GRIB2 is not fully supported yet for the gradsdes operator.\n"
"The .ctl file %s was generated. You can add the necessary .idx file by running\n\tgribmap -i %s", ctlfile, ctlfile);
// write_map_grib2(idxfile, map_version, nrecords, intnum, fltnum, bignum);
}
......
......@@ -64,7 +64,7 @@ void *Harmonic(void *argument)
if ( n_out > 9 ) cdoAbort("Maximum number of wave numbers is 9!");
if ( n < 1 || n < 2 * n_out )
cdoAbort("The wave length must be positive and smaller than\n"
cdoAbort("The wave length must be positive and smaller than "
"2 times the number of requested harmonics (=%d)!", n_out);
streamID1 = streamOpenRead(cdoStreamName(0));
......
......@@ -1195,7 +1195,7 @@ void read_dataset(hid_t loc_id, const char *name, void *opdata)
}
else
cdoWarning(" Missing value is inside the range of valid values!\n"
" Dataset %s, Missval: %g, Range: %g - %g",
"\tDataset %s, Missval: %g, Range: %g - %g",
varname, missval, minval, maxval);
}
}
......
......@@ -112,7 +112,7 @@ void *Intlevel3d(void *argument)
nlevi = nlevel; /* number of input levels for later use */
gridsizei = gridsize; /* horizontal gridsize of input z coordinate */
nrecs = streamInqTimestep(streamID0, 0);
if (cdoVerbose) cdoPrint("%d records input 3d vertical height\n",nrecs);
if (cdoVerbose) cdoPrint("%d records input 3d vertical height",nrecs);
for ( recID = 0; recID < nrecs; recID++ )
{
......@@ -148,7 +148,7 @@ void *Intlevel3d(void *argument)
nlevo = nlevel; /* number of output levels for later use */
gridsizeo = gridsize;/* horizontal gridsize of output z coordinate */
nrecs = streamInqTimestep(streamID2, 0);
if (cdoVerbose) cdoPrint("%d records target 3d vertical height and gridsize %d\n",nrecs,gridsize);
if (cdoVerbose) cdoPrint("%d records target 3d vertical height and gridsize %d",nrecs,gridsize);
for ( recID = 0; recID < nrecs; recID++ )
{
......@@ -359,7 +359,7 @@ void *Intlevel3d(void *argument)
varinterp[varID] = false;
vardata2[varID] = vardata1[varID];
varnmiss[varID] = (int*) Malloc(nlevel*sizeof(int));
if ( cdoVerbose ) cdoPrint("Ignore variable %s with %d levels\n",varname,nlevel);
if ( cdoVerbose ) cdoPrint("Ignore variable %s with %d levels",varname,nlevel);
}
else
{
......@@ -374,7 +374,7 @@ void *Intlevel3d(void *argument)
varinterp[varID] = false;
vardata2[varID] = vardata1[varID];
varnmiss[varID] = (int*) Malloc(nlevel*sizeof(int));
if ( cdoVerbose ) cdoPrint("Ignore variable %s with %d levels\n",varname,nlevel);
if ( cdoVerbose ) cdoPrint("Ignore variable %s with %d levels",varname,nlevel);
}
}
......
......@@ -107,7 +107,7 @@ void *Isosurface(void *argument)
isoval = parameter2double(operatorArgv()[0]);
if ( cdoVerbose ) cdoPrint("Isoval: %g\n", isoval);
if ( cdoVerbose ) cdoPrint("Isoval: %g", isoval);
streamID1 = streamOpenRead(cdoStreamName(0));
......
......@@ -171,7 +171,7 @@ void *Kvl(void *argument)
if ( operatorArgc() != 1 ) cdoAbort("Too few arguments!");
filename = operatorArgv()[0];
if ( cdoVerbose ) cdoPrint("Parse file: %s\n", filename);
if ( cdoVerbose ) cdoPrint("Parse file: %s", filename);
read_cmor_table(filename);
}
......@@ -180,7 +180,7 @@ void *Kvl(void *argument)
if ( operatorArgc() != 1 ) cdoAbort("Too few arguments!");
filename = operatorArgv()[0];
if ( cdoVerbose ) cdoPrint("Parse file: %s\n", filename);
if ( cdoVerbose ) cdoPrint("Parse file: %s", filename);
conv_cmor_table(filename);
}
......@@ -189,7 +189,7 @@ void *Kvl(void *argument)
if ( operatorArgc() != 1 ) cdoAbort("Too few arguments!");
filename = operatorArgv()[0];
if ( cdoVerbose ) cdoPrint("Parse file: %s\n", filename);
if ( cdoVerbose ) cdoPrint("Parse file: %s", filename);
// conv_partab(filename);
}
......
......@@ -952,7 +952,7 @@ int ReadColourTable( char *filepath )
if ( !num_colors )
{
cdoWarning("No colours found in File, proceeding with Standard Colour table!\n");
cdoWarning("No colours found in File, proceeding with Standard Colour table!");
fclose(fp);
return 1;
}
......@@ -996,7 +996,7 @@ int ReadColourTable( char *filepath )
if( USR_COLOUR_COUNT < num_colors )
{
cdoWarning( " Discarding improper format colours and continuing!\n" );
cdoWarning( " Discarding improper format colours and continuing!" );
}
for ( i = 0; i < num_colors; i++ ) Free(temp_table[i]);
......@@ -1024,7 +1024,7 @@ int checkstyle( char *style_in )
}
if( !found )
cdoWarning( " Style specified with Improper value!\n" );
cdoWarning( " Style specified with Improper value!" );
return 1;
}
......@@ -1057,7 +1057,7 @@ int checkdevice( char *device_in )
}
if( !found )
cdoWarning( " Device specified with Improper value!\n" );
cdoWarning( " Device specified with Improper value!" );
return 1;
}
......@@ -1084,9 +1084,9 @@ int checkprojection( char *projection_in )
if( !found )
{
cdoWarning( " Projection specified with Improper value!\n" );
cdoWarning( " Specify one of the following:\n" );
cdoWarning( " cylindrical polar_stereographic polar_north geos meteosat meteosat_57E geos_east lambert EPSG3857 goode collignon mollweide robinson bonne google efas EPSG4326 lambert_north_atlantic mercator cartesian taylor tephigram\n" );
cdoWarning( " Projection specified with Improper value!" );
cdoWarning( " Specify one of the following:" );
cdoWarning( " cylindrical polar_stereographic polar_north geos meteosat meteosat_57E geos_east lambert EPSG3857 goode collignon mollweide robinson bonne google efas EPSG4326 lambert_north_atlantic mercator cartesian taylor tephigram" );
}
......@@ -1180,7 +1180,7 @@ void *Magplot(void *argument)
{
if( nrecs > 1 )
{
cdoWarning("File has more than one variable! Animation creation not possible!!! \n");
cdoWarning("File has more than one variable! Animation creation not possible!!!");
break;
}
if( tsID % STEP_FREQ )
......@@ -1196,7 +1196,7 @@ void *Magplot(void *argument)
if( tsID % STEP_FREQ )
{
tsID++;
cdoWarning("NOT PLOTTING STEP %d!!!\n",tsID);
cdoWarning("NOT PLOTTING STEP %d!!!",tsID);
continue;
}
}
......
......@@ -130,7 +130,7 @@ void *Monarith(void *argument)
year2 = yearmon2/100;
mon2 = yearmon2 - (yearmon2/100)*100;
cdoAbort("Timestep %d in %s has wrong date!\nCurrent year=%4d mon=%2d, expected year=%4d mon=%2d",
cdoAbort("Timestep %d in %s has wrong date! Current year=%4d mon=%2d, expected year=%4d mon=%2d",
tsID2+1, cdoStreamName(1)->args, year2, mon2, year1, mon1);
}
......
......@@ -707,7 +707,7 @@ void *Outputgmt(void *argument)
}
else if ( lhov )
{
cdoAbort("Implementation for hovmoeller data missing!\n");
cdoAbort("Implementation for hovmoeller data missing!");
}
else
{
......
......@@ -125,7 +125,7 @@ void *Select(void *argument)
if ( cdoVerbose )
for ( int i = 0; i < nsel; ++i )
printf("name %d = %s\n", i+1, argnames[i]);
cdoPrint("name %d = %s", i+1, argnames[i]);
pml_t *pml = pml_create("SELECT");
......@@ -354,7 +354,7 @@ void *Select(void *argument)
int zaxisID = vlistInqVarZaxis(vlistID1, varID);
int nlevs = zaxisInqSize(zaxisID);
for ( int levID = 0; levID < nlevs; ++levID )
if ( vlistInqFlag(vlistID1, varID, levID) == xresult )
if ( vlistInqFlag(vlistID1, varID, levID) == TRUE )
{
npar++;
break;
......
......@@ -46,14 +46,9 @@
void *Selvar(void *argument)
{
int nlevs;
int code, tabnum, param, gridID, zaxisID, levID;
int grididx, zaxisidx;
double level;
int varID2, levelID2;
int recID, varID, levelID;
int varID, levelID;
int *intarr = NULL, nsel = 0;
int *selfound = NULL;
double *fltarr = NULL;
char paramstr[32];
char varname[CDI_MAX_NAME];
......@@ -62,12 +57,8 @@ void *Selvar(void *argument)
char zaxistypename[CDI_MAX_NAME];
char zaxisname[CDI_MAX_NAME];
char **argnames = NULL;
int isel;
int i;
int gridsize;
int nmiss;
int gridnum = 0;
double *array = NULL;
LIST *ilist = listNew(INT_LIST);
LIST *flist = listNew(FLT_LIST);
......@@ -90,15 +81,17 @@ void *Selvar(void *argument)
int SELZAXIS = cdoOperatorAdd("selzaxis", 0, 4|2, "list of zaxis types or numbers");
int SELZAXISNAME = cdoOperatorAdd("selzaxisname", 0, 2, "list of zaxis names");
int SELTABNUM = cdoOperatorAdd("seltabnum", 0, 4, "table numbers");
int DELPARAM = cdoOperatorAdd("delparam", 0, 2|1, "parameter");
int DELCODE = cdoOperatorAdd("delcode", 0, 1, "code numbers");
int DELNAME = cdoOperatorAdd("delname", 0, 2|1, "variable names");
int DELPARAM = cdoOperatorAdd("delparam", 1, 2|1, "parameter");
int DELCODE = cdoOperatorAdd("delcode", 1, 1, "code numbers");
int DELNAME = cdoOperatorAdd("delname", 1, 2|1, "variable names");
int SELLTYPE = cdoOperatorAdd("selltype", 0, 4, "GRIB level types");
int operatorID = cdoOperatorID();
operatorInputArg(cdoOperatorEnter(operatorID));
bool ldelete = (cdoOperatorF1(operatorID) == 1) ? true : false;
int args_are_numeric = operatorArgc() > 0 && isdigit(*operatorArgv()[0]);
if ( TAKES_STRINGS(operatorID) && !( TAKES_INTEGERS(operatorID) && args_are_numeric ) )
......@@ -107,8 +100,8 @@ void *Selvar(void *argument)
argnames = operatorArgv();
if ( cdoVerbose )
for ( i = 0; i < nsel; i++ )
fprintf(stderr, "name %d = %s\n", i+1, argnames[i]);
for ( int i = 0; i < nsel; i++ )
cdoPrint("name %d = %s", i+1, argnames[i]);
}
else if ( TAKES_FLOATS(operatorID) )
{
......@@ -116,8 +109,8 @@ void *Selvar(void *argument)
fltarr = (double *) listArrayPtr(flist);
if ( cdoVerbose )
for ( i = 0; i < nsel; i++ )
printf("flt %d = %g\n", i+1, fltarr[i]);
for ( int i = 0; i < nsel; i++ )
cdoPrint("flt %d = %g", i+1, fltarr[i]);
}
else
{
......@@ -125,14 +118,15 @@ void *Selvar(void *argument)
intarr = (int *) listArrayPtr(ilist);
if ( cdoVerbose )
for ( i = 0; i < nsel; i++ )
printf("int %d = %d\n", i+1, intarr[i]);
for ( int i = 0; i < nsel; i++ )
cdoPrint("int %d = %d", i+1, intarr[i]);
}
bool *selfound = NULL;
if ( nsel )
{
selfound = (int*) Malloc(nsel*sizeof(int));
for ( i = 0; i < nsel; i++ ) selfound[i] = FALSE;
selfound = (bool*) Malloc(nsel*sizeof(bool));
for ( int i = 0; i < nsel; i++ ) selfound[i] = false;
}
/*
......@@ -143,7 +137,7 @@ void *Selvar(void *argument)
int vlistID1 = streamInqVlist(streamID1);
int nvars = vlistNvars(vlistID1);
int *vars = (int*) Malloc(nvars*sizeof(int));
bool *vars = (bool*) Malloc(nvars*sizeof(bool));
if ( operatorID == SELGRID && !args_are_numeric && nsel == 1 && strncmp(argnames[0], "var=", 4) == 0 )
{
......@@ -156,7 +150,7 @@ void *Selvar(void *argument)
vlistInqVarName(vlistID1, varID, varname);
if ( strcmp(varname, gridvarname) == 0 )
{
gridID = vlistInqVarGrid(vlistID1, varID);
int gridID = vlistInqVarGrid(vlistID1, varID);
gridnum = 1 + vlistGridIndex(vlistID1, gridID);
args_are_numeric = TRUE;
intarr = &gridnum;
......@@ -170,34 +164,33 @@ void *Selvar(void *argument)
vlistClearFlag(vlistID1);
for ( varID = 0; varID < nvars; varID++ )
{
vars[varID] = FALSE;
vars[varID] = ldelete ? true : false;
vlistInqVarName(vlistID1, varID, varname);
vlistInqVarStdname(vlistID1, varID, stdname);
param = vlistInqVarParam(vlistID1, varID);
code = vlistInqVarCode(vlistID1, varID);
tabnum = tableInqNum(vlistInqVarTable(vlistID1, varID));
gridID = vlistInqVarGrid(vlistID1, varID);
grididx = vlistGridIndex(vlistID1, gridID);
zaxisID = vlistInqVarZaxis(vlistID1, varID);
zaxisidx = vlistZaxisIndex(vlistID1, zaxisID);
nlevs = zaxisInqSize(zaxisID);
int param = vlistInqVarParam(vlistID1, varID);
int code = vlistInqVarCode(vlistID1, varID);
int tabnum = tableInqNum(vlistInqVarTable(vlistID1, varID));
int gridID = vlistInqVarGrid(vlistID1, varID);
int grididx = vlistGridIndex(vlistID1, gridID);
int zaxisID = vlistInqVarZaxis(vlistID1, varID);
int zaxisidx = vlistZaxisIndex(vlistID1, zaxisID);
int nlevs = zaxisInqSize(zaxisID);
gridName(gridInqType(gridID), gridname);
zaxisInqName(zaxisID, zaxisname);
zaxisName(zaxisInqType(zaxisID), zaxistypename);
cdiParamToString(param, paramstr, sizeof(paramstr));
for ( levID = 0; levID < nlevs; levID++ )
for ( int levID = 0; levID < nlevs; levID++ )
{
level = zaxisInqLevel(zaxisID, levID);
double level = zaxisInqLevel(zaxisID, levID);
if ( operatorID == DELCODE || operatorID == DELNAME || operatorID == DELPARAM )
vlistDefFlag(vlistID1, varID, levID, TRUE);
for ( isel = 0; isel < nsel; isel++ )
if ( ldelete ) vlistDefFlag(vlistID1, varID, levID, TRUE);
for ( int isel = 0; isel < nsel; isel++ )
{
int found = 0;
bool found = false;
if ( operatorID == SELCODE )
{
found = intarr[isel] == code;
......@@ -266,8 +259,8 @@ void *Selvar(void *argument)
if ( found )
{
vlistDefFlag(vlistID1, varID, levID, !INVERTS_SELECTION(operatorID));
selfound[isel] = TRUE;
vars[varID] = TRUE;
selfound[isel] = true;
vars[varID] = ldelete ? false : true;
}
}
}
......@@ -286,16 +279,16 @@ void *Selvar(void *argument)
int psvarid = vlist_get_psvarid(vlistID1, zaxisID);
if ( psvarid != -1 && !vars[psvarid] )
{
vars[psvarid] = TRUE;
vars[psvarid] = true;
vlistDefFlag(vlistID1, psvarid, 0, !INVERTS_SELECTION(operatorID));
}
}
}
}
for ( isel = 0; isel < nsel; isel++ )
for ( int isel = 0; isel < nsel; isel++ )
{
if ( selfound[isel] == FALSE )
if ( selfound[isel] == false )
{
if ( operatorID == SELCODE || operatorID == DELCODE )
{
......@@ -372,9 +365,10 @@ void *Selvar(void *argument)
streamDefVlist(streamID2, vlistID2);
double *array = NULL;
if ( ! lcopy )
{
gridsize = vlistGridsizeMax(vlistID1);
int gridsize = vlistGridsizeMax(vlistID1);
if ( vlistNumber(vlistID1) != CDI_REAL ) gridsize *= 2;
array = (double*) Malloc(gridsize*sizeof(double));
}
......@@ -386,7 +380,7 @@ void *Selvar(void *argument)
streamDefTimestep(streamID2, tsID);
for ( recID = 0; recID < nrecs; recID++ )
for ( int recID = 0; recID < nrecs; recID++ )
{
streamInqRecord(streamID1, &varID, &levelID);
if ( vlistInqFlag(vlistID1, varID, levelID) == TRUE )
......
......@@ -209,6 +209,7 @@ void cdo_usage(void)
fprintf(stderr, " Set individual floating-point traps (DIVBYZERO, INEXACT, INVALID, OVERFLOW, UNDERFLOW, ALL_EXCEPT)\n");
}
fprintf(stderr, " --cmor CMOR conform NetCDF output\n");
fprintf(stderr, " -C, --color Colorized output messages\n");
fprintf(stderr, " -f, --format <format>\n");
fprintf(stderr, " Format of the output file. (grb/grb2/nc/nc2/nc4/nc4c/srv/ext/ieg)\n");
fprintf(stderr, " -g <grid> Set default grid name or file. Available grids: \n");
......@@ -238,13 +239,13 @@ void cdo_usage(void)
#endif
fprintf(stderr, " --percentile <method>\n");
fprintf(stderr, " Percentile method: nrank, nist, numpy, numpy_lower, numpy_higher, numpy_nearest\n");
fprintf(stderr, " -Q Alphanumeric sorting of NetCDF parameter names\n");