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

No commit message

No commit message
parent f4db0ba1
......@@ -281,6 +281,7 @@ src/Seaspctl.c -text
src/Seasstat.c -text
src/Selbox.c -text
src/Select.c -text
src/Select2.c -text
src/Seloperator.c -text
src/Selrec.c -text
src/Seltime.c -text
......
......@@ -14,7 +14,7 @@ Version 1.3.0 (15 January 2009):
o import_cmsaf: add support for monthly mean diurnal cycle
o remap: set num_srch_bins to nlat/2 (speedup)
* Fixed bugs:
o setzaxis: change datatype from float to double
o setzaxis: changed datatype from float to double
o sellonlatbox: bug fix for curvilinear grids
o merge: bug fix for usage in CDO pipes
o gridarea, gridweights: bug fix for gridboxes with delta lon >= 180 degree
......
......@@ -199,7 +199,7 @@ case "${HOSTNAME}" in
hpc*)
${CONFPATH}configure --prefix=$HOME/local \
--with-netcdf=/usr/local/lib/netcdf/3.6.2/LP64_underscore \
--with-hdf5=/usr/local/lib/hdf5/1.6.5/LP64_underscore \
--with-hdf5=/usr/local/lib/hdf5/1.8.1/LP64_underscore \
--with-szlib=$HOME/local \
--with-proj=$HOME/local \
CC=xlc_r CFLAGS="-g -O3 -q64 -qstrict -qarch=auto -qtune=auto -qreport -qsmp=omp -DHAVE_MMAP"
......
......@@ -77,6 +77,7 @@ cdo_SOURCES = Arith.c \
Seasstat.c \
Selbox.c \
Select.c \
Select2.c \
Seloperator.c \
Selrec.c \
Seltime.c \
......
......@@ -72,45 +72,45 @@ am_cdo_OBJECTS = Arith.$(OBJEXT) Arithc.$(OBJEXT) Arithdays.$(OBJEXT) \
Replace.$(OBJEXT) Rotuv.$(OBJEXT) Runpctl.$(OBJEXT) \
Runstat.$(OBJEXT) Seascount.$(OBJEXT) Seaspctl.$(OBJEXT) \
Seasstat.$(OBJEXT) Selbox.$(OBJEXT) Select.$(OBJEXT) \
Seloperator.$(OBJEXT) Selrec.$(OBJEXT) Seltime.$(OBJEXT) \
Set.$(OBJEXT) Setbox.$(OBJEXT) Setgatt.$(OBJEXT) \
Setgrid.$(OBJEXT) Sethalo.$(OBJEXT) Setmiss.$(OBJEXT) \
Setrange.$(OBJEXT) Setrcaname.$(OBJEXT) Settime.$(OBJEXT) \
Setzaxis.$(OBJEXT) Showinfo.$(OBJEXT) Sinfo.$(OBJEXT) \
Smooth9.$(OBJEXT) Sort.$(OBJEXT) Specinfo.$(OBJEXT) \
Spectral.$(OBJEXT) Spectrum.$(OBJEXT) Split.$(OBJEXT) \
Splitrec.$(OBJEXT) Splitsel.$(OBJEXT) Splittime.$(OBJEXT) \
Splityear.$(OBJEXT) Subtrend.$(OBJEXT) Templates.$(OBJEXT) \
Test.$(OBJEXT) Tests.$(OBJEXT) Timcount.$(OBJEXT) \
Timpctl.$(OBJEXT) Timsort.$(OBJEXT) Timselpctl.$(OBJEXT) \
Timselstat.$(OBJEXT) Timstat.$(OBJEXT) Timstat2.$(OBJEXT) \
Timstat3.$(OBJEXT) Tinfo.$(OBJEXT) Trend.$(OBJEXT) \
Trms.$(OBJEXT) Vardup.$(OBJEXT) Vargen.$(OBJEXT) \
Varrms.$(OBJEXT) Vertint.$(OBJEXT) Vertstat.$(OBJEXT) \
Vertwind.$(OBJEXT) Wind.$(OBJEXT) Writegrid.$(OBJEXT) \
Writerandom.$(OBJEXT) Yhourstat.$(OBJEXT) Ydaypctl.$(OBJEXT) \
Ydaystat.$(OBJEXT) Ydrunpctl.$(OBJEXT) Ydrunstat.$(OBJEXT) \
Ymonarith.$(OBJEXT) Ymonpctl.$(OBJEXT) Ymonstat.$(OBJEXT) \
Yseaspctl.$(OBJEXT) Yseasstat.$(OBJEXT) Zonstat.$(OBJEXT) \
cdilib.$(OBJEXT) commandline.$(OBJEXT) exception.$(OBJEXT) \
expr_yacc.$(OBJEXT) expr_lex.$(OBJEXT) expr.$(OBJEXT) \
cdo.$(OBJEXT) cdo_pthread.$(OBJEXT) cdo_vlist.$(OBJEXT) \
field.$(OBJEXT) fieldc.$(OBJEXT) field2.$(OBJEXT) \
fieldmer.$(OBJEXT) fieldzon.$(OBJEXT) grid.$(OBJEXT) \
grid_gme.$(OBJEXT) grid_lcc.$(OBJEXT) grid_rot.$(OBJEXT) \
griddes.$(OBJEXT) griddes_nc.$(OBJEXT) griddes_h5.$(OBJEXT) \
hetaeta.$(OBJEXT) history.$(OBJEXT) institution.$(OBJEXT) \
interpol.$(OBJEXT) job.$(OBJEXT) modules.$(OBJEXT) \
namelist.$(OBJEXT) normal.$(OBJEXT) pipe.$(OBJEXT) \
process.$(OBJEXT) remaplib.$(OBJEXT) timer.$(OBJEXT) \
realtime.$(OBJEXT) pstream.$(OBJEXT) table.$(OBJEXT) \
userlog.$(OBJEXT) util.$(OBJEXT) legendre.$(OBJEXT) \
fourier.$(OBJEXT) specspace.$(OBJEXT) readline.$(OBJEXT) \
julian.$(OBJEXT) vinterp.$(OBJEXT) zaxis.$(OBJEXT) \
pthread_debug.$(OBJEXT) color.$(OBJEXT) list.$(OBJEXT) \
percentiles.$(OBJEXT) nth_element.$(OBJEXT) ecacore.$(OBJEXT) \
ecautil.$(OBJEXT) EcaIndices.$(OBJEXT) Hi.$(OBJEXT) \
Wct.$(OBJEXT) statistic.$(OBJEXT)
Select2.$(OBJEXT) Seloperator.$(OBJEXT) Selrec.$(OBJEXT) \
Seltime.$(OBJEXT) Set.$(OBJEXT) Setbox.$(OBJEXT) \
Setgatt.$(OBJEXT) Setgrid.$(OBJEXT) Sethalo.$(OBJEXT) \
Setmiss.$(OBJEXT) Setrange.$(OBJEXT) Setrcaname.$(OBJEXT) \
Settime.$(OBJEXT) Setzaxis.$(OBJEXT) Showinfo.$(OBJEXT) \
Sinfo.$(OBJEXT) Smooth9.$(OBJEXT) Sort.$(OBJEXT) \
Specinfo.$(OBJEXT) Spectral.$(OBJEXT) Spectrum.$(OBJEXT) \
Split.$(OBJEXT) Splitrec.$(OBJEXT) Splitsel.$(OBJEXT) \
Splittime.$(OBJEXT) Splityear.$(OBJEXT) Subtrend.$(OBJEXT) \
Templates.$(OBJEXT) Test.$(OBJEXT) Tests.$(OBJEXT) \
Timcount.$(OBJEXT) Timpctl.$(OBJEXT) Timsort.$(OBJEXT) \
Timselpctl.$(OBJEXT) Timselstat.$(OBJEXT) Timstat.$(OBJEXT) \
Timstat2.$(OBJEXT) Timstat3.$(OBJEXT) Tinfo.$(OBJEXT) \
Trend.$(OBJEXT) Trms.$(OBJEXT) Vardup.$(OBJEXT) \
Vargen.$(OBJEXT) Varrms.$(OBJEXT) Vertint.$(OBJEXT) \
Vertstat.$(OBJEXT) Vertwind.$(OBJEXT) Wind.$(OBJEXT) \
Writegrid.$(OBJEXT) Writerandom.$(OBJEXT) Yhourstat.$(OBJEXT) \
Ydaypctl.$(OBJEXT) Ydaystat.$(OBJEXT) Ydrunpctl.$(OBJEXT) \
Ydrunstat.$(OBJEXT) Ymonarith.$(OBJEXT) Ymonpctl.$(OBJEXT) \
Ymonstat.$(OBJEXT) Yseaspctl.$(OBJEXT) Yseasstat.$(OBJEXT) \
Zonstat.$(OBJEXT) cdilib.$(OBJEXT) commandline.$(OBJEXT) \
exception.$(OBJEXT) expr_yacc.$(OBJEXT) expr_lex.$(OBJEXT) \
expr.$(OBJEXT) cdo.$(OBJEXT) cdo_pthread.$(OBJEXT) \
cdo_vlist.$(OBJEXT) field.$(OBJEXT) fieldc.$(OBJEXT) \
field2.$(OBJEXT) fieldmer.$(OBJEXT) fieldzon.$(OBJEXT) \
grid.$(OBJEXT) grid_gme.$(OBJEXT) grid_lcc.$(OBJEXT) \
grid_rot.$(OBJEXT) griddes.$(OBJEXT) griddes_nc.$(OBJEXT) \
griddes_h5.$(OBJEXT) hetaeta.$(OBJEXT) history.$(OBJEXT) \
institution.$(OBJEXT) interpol.$(OBJEXT) job.$(OBJEXT) \
modules.$(OBJEXT) namelist.$(OBJEXT) normal.$(OBJEXT) \
pipe.$(OBJEXT) process.$(OBJEXT) remaplib.$(OBJEXT) \
timer.$(OBJEXT) realtime.$(OBJEXT) pstream.$(OBJEXT) \
table.$(OBJEXT) userlog.$(OBJEXT) util.$(OBJEXT) \
legendre.$(OBJEXT) fourier.$(OBJEXT) specspace.$(OBJEXT) \
readline.$(OBJEXT) julian.$(OBJEXT) vinterp.$(OBJEXT) \
zaxis.$(OBJEXT) pthread_debug.$(OBJEXT) color.$(OBJEXT) \
list.$(OBJEXT) percentiles.$(OBJEXT) nth_element.$(OBJEXT) \
ecacore.$(OBJEXT) ecautil.$(OBJEXT) EcaIndices.$(OBJEXT) \
Hi.$(OBJEXT) Wct.$(OBJEXT) statistic.$(OBJEXT)
cdo_OBJECTS = $(am_cdo_OBJECTS)
cdo_LDADD = $(LDADD)
am_cdotest_OBJECTS = cdilib.$(OBJEXT) cdotest.$(OBJEXT)
......@@ -301,6 +301,7 @@ cdo_SOURCES = Arith.c \
Seasstat.c \
Selbox.c \
Select.c \
Select2.c \
Seloperator.c \
Selrec.c \
Seltime.c \
......@@ -629,6 +630,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Seasstat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Selbox.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Select.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Select2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Seloperator.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Selrec.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Seltime.Po@am__quote@
......
/*
This file is part of CDO. CDO is a collection of Operators to
manipulate and analyse Climate model Data.
Copyright (C) 2003-2009 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
See COPYING file for copying and redistribution conditions.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
/*
This module contains the following operators:
Select2 select Select fields
*/
#include <string.h>
#include <math.h> /* fabs */
#include "cdi.h"
#include "cdo.h"
#include "cdo_int.h"
#include "pstream.h"
#include "error.h"
#include "util.h"
#include "functs.h"
#include "list.h"
#include "namelist.h"
typedef struct {
char *name;
int maxpar;
int numpar;
char *par;
}
PARAMETER;
#define PAR_DEF_INT(name, size, val) int sel##name[size]; int nsel##name = 0; int name = 0
#define PAR_DEF_FLT(name, size, val) double sel##name[size]; int nsel##name = 0; double name = 0
static PARAMETER Parameter[] =
{
{"code", 1024, 0, NULL},
};
static int NumParameter = sizeof(Parameter) / sizeof(Parameter[0]);
void *Select2(void *argument)
{
const char func[] = "Select2";
int SELECT, SELCODE, SELNAME, SELLEVEL, SELLEVIDX, SELGRID, SELGRIDNAME, SELZAXIS, SELZAXISNAME, SELLTYPE;
int SELTABNUM, DELCODE, DELNAME, SELSTDNAME;
int operatorID;
int streamID1, streamID2;
int tsID, nrecs;
int nvars, nlevs;
int code, tabnum, gridID, zaxisID, levID;
double level;
int varID2, levelID2;
int recID, varID, levelID;
int *intarr = NULL, nsel = 0;
int *selfound = NULL;
double *fltarr = NULL;
char varname[256];
char stdname[256];
char gridname[256];
char zaxisname[256];
char **argnames = NULL;
int vlistID1 = -1, vlistID2 = -1;
int isel;
int i;
int lcopy = FALSE;
int gridsize;
int nmiss;
double *array = NULL;
int taxisID1, taxisID2;
int ltype;
int sargc;
char **sargv;
LIST *ilist = listNew(INT_LIST);
LIST *flist = listNew(FLT_LIST);
NML_DEF_INT(xcode, 1024, 0);
NML_DEF_FLT(xlevel, 1024, 0);
cdoInitialize(argument);
SELECT = cdoOperatorAdd("select", 0, 0, "list of parameters");
if ( UNCHANGED_RECORD ) lcopy = TRUE;
operatorID = cdoOperatorID();
operatorInputArg(cdoOperatorEnter(operatorID));
nsel = operatorArgc();
argnames = operatorArgv();
if ( cdoVerbose )
for ( i = 0; i < nsel; i++ )
printf("name %d = %s\n", i+1, argnames[i]);
sargc = nsel;
sargv = (char **) malloc(sargc*sizeof(char *));
for ( i = 0; i < nsel; i++ )
{
argnames = operatorArgv();
if ( i == 0 )
{
if ( strncmp(argnames[i], "code=", 5) == 0 )
{
sargv[i] = strdup(argnames[i]+5);
}
else
{
cdoAbort("Parameter >code< not found");
}
}
else
{
sargv[i] = strdup(argnames[i]);
}
}
if ( cdoVerbose )
for ( i = 0; i < sargc; i++ )
printf("sargc %d = %s\n", i+1, sargv[i]);
nsel = args2intlist(sargc, sargv, ilist);
intarr = (int *) listArrayPtr(ilist);
if ( cdoVerbose )
for ( i = 0; i < nsel; i++ )
printf("int %d = %d\n", i+1, intarr[i]);
if ( operatorID == SELNAME || operatorID == DELNAME || operatorID == SELSTDNAME ||
operatorID == SELGRIDNAME || operatorID == SELZAXISNAME )
{
nsel = operatorArgc();
argnames = operatorArgv();
if ( cdoVerbose )
for ( i = 0; i < nsel; i++ )
printf("name %d = %s\n", i+1, argnames[i]);
}
else if ( operatorID == SELLEVEL )
{
nsel = args2fltlist(operatorArgc(), operatorArgv(), flist);
fltarr = (double *) listArrayPtr(flist);
if ( cdoVerbose )
for ( i = 0; i < nsel; i++ )
printf("flt %d = %g\n", i+1, fltarr[i]);
}
else
{
/* nsel = args2intlist(operatorArgc(), operatorArgv(), ilist); */
/*
nsel = args2intlist(sargc, sargv, ilist);
intarr = (int *) listArrayPtr(ilist);
if ( cdoVerbose )
for ( i = 0; i < nsel; i++ )
printf("int %d = %d\n", i+1, intarr[i]);
*/
}
operatorID = SELCODE;
if ( nsel )
{
selfound = (int *) malloc(nsel*sizeof(int));
for ( i = 0; i < nsel; i++ ) selfound[i] = FALSE;
}
/*
if ( nsel == 0 )
cdoAbort("missing code argument!");
*/
streamID1 = streamOpenRead(cdoStreamName(0));
if ( streamID1 < 0 ) cdiError(streamID1, "Open failed on %s", cdoStreamName(0));
vlistID1 = streamInqVlist(streamID1);
vlistClearFlag(vlistID1);
nvars = vlistNvars(vlistID1);
for ( varID = 0; varID < nvars; varID++ )
{
vlistInqVarName(vlistID1, varID, varname);
vlistInqVarStdname(vlistID1, varID, stdname);
code = vlistInqVarCode(vlistID1, varID);
tabnum = tableInqNum(vlistInqVarTable(vlistID1, varID));
gridID = vlistInqVarGrid(vlistID1, varID);
zaxisID = vlistInqVarZaxis(vlistID1, varID);
nlevs = zaxisInqSize(zaxisID);
gridName(gridInqType(gridID), gridname);
zaxisName(zaxisInqType(zaxisID), zaxisname);
for ( levID = 0; levID < nlevs; levID++ )
{
level = zaxisInqLevel(zaxisID, levID);
if ( operatorID == DELCODE || operatorID == DELNAME )
vlistDefFlag(vlistID1, varID, levID, TRUE);
for ( isel = 0; isel < nsel; isel++ )
{
if ( operatorID == SELCODE )
{
if ( intarr[isel] == code )
{
vlistDefFlag(vlistID1, varID, levID, TRUE);
selfound[isel] = TRUE;
}
}
else if ( operatorID == SELNAME )
{
if ( strcmp(argnames[isel], varname) == 0 )
{
vlistDefFlag(vlistID1, varID, levID, TRUE);
selfound[isel] = TRUE;
}
}
else if ( operatorID == SELSTDNAME )
{
if ( strcmp(argnames[isel], stdname) == 0 )
{
vlistDefFlag(vlistID1, varID, levID, TRUE);
selfound[isel] = TRUE;
}
}
else if ( operatorID == SELLEVEL )
{
if ( fabs(fltarr[isel] - level) < 0.0001 )
{
vlistDefFlag(vlistID1, varID, levID, TRUE);
selfound[isel] = TRUE;
}
}
else if ( operatorID == SELLEVIDX )
{
if ( intarr[isel] == (levID+1) )
{
vlistDefFlag(vlistID1, varID, levID, TRUE);
selfound[isel] = TRUE;
}
}
else if ( operatorID == SELGRID )
{
if ( intarr[isel] == (gridID+1) )
{
vlistDefFlag(vlistID1, varID, levID, TRUE);
selfound[isel] = TRUE;
}
}
else if ( operatorID == SELGRIDNAME )
{
if ( strncmp(argnames[isel], gridname, strlen(argnames[isel])) == 0 )
{
vlistDefFlag(vlistID1, varID, levID, TRUE);
selfound[isel] = TRUE;
}
}
else if ( operatorID == SELZAXIS )
{
if ( intarr[isel] == (zaxisID+1) )
{
vlistDefFlag(vlistID1, varID, levID, TRUE);
selfound[isel] = TRUE;
}
}
else if ( operatorID == SELZAXISNAME )
{
if ( strncmp(argnames[isel], zaxisname, strlen(argnames[isel])) == 0 )
{
vlistDefFlag(vlistID1, varID, levID, TRUE);
selfound[isel] = TRUE;
}
}
else if ( operatorID == SELTABNUM )
{
if ( intarr[isel] == tabnum )
{
vlistDefFlag(vlistID1, varID, levID, TRUE);
selfound[isel] = TRUE;
}
}
else if ( operatorID == DELCODE )
{
if ( intarr[isel] == code )
{
vlistDefFlag(vlistID1, varID, levID, FALSE);
selfound[isel] = TRUE;
}
}
else if ( operatorID == DELNAME )
{
if ( strcmp(argnames[isel], varname) == 0 )
{
vlistDefFlag(vlistID1, varID, levID, FALSE);
selfound[isel] = TRUE;
}
}
else if ( operatorID == SELLTYPE )
{
ltype = zaxis2ltype(zaxisID);
if ( intarr[isel] == ltype )
{
vlistDefFlag(vlistID1, varID, levID, TRUE);
selfound[isel] = TRUE;
}
}
}
}
}
for ( isel = 0; isel < nsel; isel++ )
{
if ( selfound[isel] == FALSE )
{
if ( operatorID == SELCODE || operatorID == DELCODE )
{
cdoWarning("Code number %d not found!", intarr[isel]);
}
else if ( operatorID == SELNAME || operatorID == DELNAME )
{
cdoWarning("Variable name %s not found!", argnames[isel]);
}
else if ( operatorID == SELSTDNAME )
{
cdoWarning("Variable with standard name %s not found!", argnames[isel]);
}
else if ( operatorID == SELLEVEL )
{
cdoWarning("Level %g not found!", fltarr[isel]);
}
else if ( operatorID == SELLEVIDX )
{
cdoWarning("Level index %d not found!", intarr[isel]);
}
else if ( operatorID == SELGRID )
{
cdoWarning("Grid %d not found!", intarr[isel]);
}
else if ( operatorID == SELGRIDNAME )
{
cdoWarning("Grid name %s not found!", argnames[isel]);
}
else if ( operatorID == SELZAXIS )
{
cdoWarning("Zaxis %d not found!", intarr[isel]);
}
else if ( operatorID == SELZAXISNAME )
{
cdoWarning("Zaxis name %s not found!", argnames[isel]);
}
else if ( operatorID == SELTABNUM )
{
cdoWarning("Table number %d not found!", intarr[isel]);
}
else if ( operatorID == SELLTYPE )
{
cdoWarning("GRIB level type %d not found!", intarr[isel]);
}
}
}
vlistID2 = vlistCreate();
vlistCopyFlag(vlistID2, vlistID1);
taxisID1 = vlistInqTaxis(vlistID1);
taxisID2 = taxisDuplicate(taxisID1);
vlistDefTaxis(vlistID2, taxisID2);
nrecs = vlistNrecs(vlistID2);
streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
if ( streamID2 < 0 ) cdiError(streamID2, "Open failed on %s", cdoStreamName(1));
streamDefVlist(streamID2, vlistID2);
if ( ! lcopy )
{
gridsize = vlistGridsizeMax(vlistID1);
array = (double *) malloc(gridsize*sizeof(double));
}
tsID = 0;
while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
{
taxisCopyTimestep(taxisID2, taxisID1);
streamDefTimestep(streamID2, tsID);
for ( recID = 0; recID < nrecs; recID++ )
{
streamInqRecord(streamID1, &varID, &levelID);
if ( vlistInqFlag(vlistID1, varID, levelID) == TRUE )
{
varID2 = vlistFindVar(vlistID2, varID);
levelID2 = vlistFindLevel(vlistID2, varID, levelID);
streamDefRecord(streamID2, varID2, levelID2);
if ( lcopy )
{
streamCopyRecord(streamID2, streamID1);
}
else
{
streamReadRecord(streamID1, array, &nmiss);
streamWriteRecord(streamID2, array, nmiss);
}
}
}
tsID++;
}
streamClose(streamID2);
streamClose(streamID1);
vlistDestroy(vlistID2);
if ( ! lcopy )
if ( array ) free(array);
if ( selfound ) free(selfound);
listDelete(ilist);
listDelete(flist);
cdoFinish();
return (NULL);
}
......@@ -113,6 +113,7 @@ void *Seaspctl(void *argument);
void *Seasstat(void *argument);
void *Selbox(void *argument);
void *Select(void *argument);
void *Select2(void *argument);
void *Seloperator(void *argument);
void *Selrec(void *argument);
void *Seltime(void *argument);
......@@ -323,6 +324,7 @@ void *Wct(void *argument);
#define SelboxOperators {"sellonlatbox", "selindexbox"}
#define SelectOperators {"selcode", "selname", "selstdname", "sellevel", "sellevidx", "selgrid", "selgridname", \
"selzaxis", "selzaxisname", "seltabnum", "delcode", "delname", "selltype"}
#define Select2Operators {"select"}
#define SeloperatorOperators {"seloperator"}
#define SelrecOperators {"selrec"}
#define SeltimeOperators {"seltimestep", "selyear", "selseas", "selmon", "selday", "selhour", "seldate", \
......@@ -549,6 +551,7 @@ static MODULES Modules[] =
{ Seasstat, SeasstatHelp, SeasstatOperators, 1, 1 },
{ Selbox, SelboxHelp, SelboxOperators, 1, 1 },
{ Select, SelectHelp, SelectOperators, 1, 1 },
{ Select2, NULL, Select2Operators, -1, 1 },
{ Seloperator, NULL, SeloperatorOperators, 1, 1 },
{ Selrec, SelectHelp, SelrecOperators, 1, 1 },
{ Seltime, SeltimeHelp, SeltimeOperators, 1, 1 },
......
......@@ -2,7 +2,7 @@
This file is part of CDO. CDO is a collection of Operators to
manipulate and analyse Climate model Data.
Copyright (C) 2003-2006 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
Copyright (C) 2003-2009 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
See COPYING file for copying and redistribution conditions.
This program is free software; you can redistribute it and/or modify
......@@ -26,6 +26,13 @@
#define NML_WORD 3
#define NML_TEXT 4
#define NML_DEF_INT(name, size, val) int sel##name[size]; int nsel##name = 0; int name = 0
#define NML_DEF_FLT(name, size, val) double sel##name[size]; int nsel##name = 0; double name = 0
#define NML_ADD_INT(nml, name) namelistAdd(nml, #name, NML_INT, 0, sel##name, sizeof(sel##name)/sizeof(int))
#define NML_ADD_FLT(nml, name) namelistAdd(nml, #name, NML_DOUBLE, 0, sel##name, sizeof(sel##name)/sizeof(double))
#define NML_NUM(nml, name) nsel##name = namelistNum(nml, #name)