Commit 14ae8f74 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added template for cmor operator

parent ca97baa4
......@@ -322,6 +322,7 @@ src/Arithlat.c -text
src/CDIread.c -text
src/CDItest.c -text
src/CDIwrite.c -text
src/CMOR.c -text
src/Cat.c -text
src/CdoMagicsMapper.c -text
src/CdoMagicsMapper.h -text
......
#include <cdi.h>
#include "cdo.h"
#include "cdo_int.h"
#include "par_io.h"
#include "pstream.h"
#if defined(HAVE_LIBCMOR)
//#include "cmor.h"
#endif
void *CMOR(void *argument)
{
cdoInitialize(argument);
#if defined(HAVE_LIBCMOR)
/*
if ( cdoVerbose )
cdoPrint("Using CMOR version %d.%d.%d.", CMOR_VERSION_MAJOR, CMOR_VERSION_MINOR, CMOR_VERSION_PATCH);
*/
int streamID = streamOpenRead(cdoStreamName(0));
int vlistID = streamInqVlist(streamID);
int taxisID = vlistInqTaxis(vlistID);
int gridsize = vlistGridsizeMax(vlistID);
double *array = (double*) Malloc(gridsize*sizeof(double));
int recID, varID, levelID, nrecs, nmiss;
int tsID = 0;
while ( (nrecs = streamInqTimestep(streamID, tsID)) )
{
for ( recID = 0; recID < nrecs; recID++ )
{
streamInqRecord(streamID, &varID, &levelID);
streamReadRecord(streamID, array, &nmiss);
}
tsID++;
}
streamClose(streamID);
if ( array ) Free(array);
#else
cdoWarning("CMOR support not compiled in!");
#endif
cdoFinish();
return 0;
}
......@@ -175,6 +175,7 @@ cdo_SOURCES += Adisit.c \
Change.c \
Change_e5slm.c \
Cloudlayer.c \
CMOR.c \
Collgrid.c \
Command.c \
Comp.c \
......
......@@ -179,25 +179,25 @@ am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
am__cdo_SOURCES_DIST = cdo.c Adisit.c Afterburner.c Arith.c Arithc.c \
Arithdays.c Arithlat.c CDItest.c CDIread.c CDIwrite.c Cat.c \
Change.c Change_e5slm.c Cloudlayer.c Collgrid.c Command.c \
Comp.c Compc.c Complextorect.c Cond.c Cond2.c Condc.c \
Consecstat.c Copy.c Deltime.c Derivepar.c Detrend.c Diff.c \
Distgrid.c Duplicate.c EOFs.c Eof3d.c EcaIndices.c Echam5ini.c \
Enlarge.c Enlargegrid.c Ensstat.c Ensstat3.c Ensval.c \
Eofcoeff.c Eofcoeff3d.c Exprf.c FC.c Filedes.c Fillmiss.c \
Filter.c Fldrms.c Fldstat.c Fldstat2.c Fourier.c Gengrid.c \
Gradsdes.c Gridboxstat.c Gridcell.c Gridsearch.c Harmonic.c \
Hi.c Histogram.c Importamsr.c Importbinary.c Importcmsaf.c \
Importobs.c Info.c Input.c Intgrid.c Intgridtraj.c Intlevel.c \
Intlevel3d.c Intntime.c Inttime.c Intyear.c Invert.c \
Invertlev.c Isosurface.c Kvl.c Log.c Maskbox.c Mastrfu.c \
Math.c Merge.c Mergegrid.c Mergetime.c Merstat.c Monarith.c \
Mrotuv.c Mrotuvb.c Ninfo.c Nmltest.c Output.c Outputgmt.c \
Pack.c Pinfo.c Pressure.c Regres.c Remap.c Remapeta.c \
Replace.c Replacevalues.c Rhopot.c Rotuv.c Runpctl.c Runstat.c \
Seascount.c Seaspctl.c Seasstat.c Selbox.c Select.c \
Seloperator.c Selrec.c Seltime.c Selvar.c Set.c Setbox.c \
Setgatt.c Setgrid.c Sethalo.c Setmiss.c Setpartab.c \
Change.c Change_e5slm.c Cloudlayer.c CMOR.c Collgrid.c \
Command.c Comp.c Compc.c Complextorect.c Cond.c Cond2.c \
Condc.c Consecstat.c Copy.c Deltime.c Derivepar.c Detrend.c \
Diff.c Distgrid.c Duplicate.c EOFs.c Eof3d.c EcaIndices.c \
Echam5ini.c Enlarge.c Enlargegrid.c Ensstat.c Ensstat3.c \
Ensval.c Eofcoeff.c Eofcoeff3d.c Exprf.c FC.c Filedes.c \
Fillmiss.c Filter.c Fldrms.c Fldstat.c Fldstat2.c Fourier.c \
Gengrid.c Gradsdes.c Gridboxstat.c Gridcell.c Gridsearch.c \
Harmonic.c Hi.c Histogram.c Importamsr.c Importbinary.c \
Importcmsaf.c Importobs.c Info.c Input.c Intgrid.c \
Intgridtraj.c Intlevel.c Intlevel3d.c Intntime.c Inttime.c \
Intyear.c Invert.c Invertlev.c Isosurface.c Kvl.c Log.c \
Maskbox.c Mastrfu.c Math.c Merge.c Mergegrid.c Mergetime.c \
Merstat.c Monarith.c Mrotuv.c Mrotuvb.c Ninfo.c Nmltest.c \
Output.c Outputgmt.c Pack.c Pinfo.c Pressure.c Regres.c \
Remap.c Remapeta.c Replace.c Replacevalues.c Rhopot.c Rotuv.c \
Runpctl.c Runstat.c Seascount.c Seaspctl.c Seasstat.c Selbox.c \
Select.c Seloperator.c Selrec.c Seltime.c Selvar.c Set.c \
Setbox.c Setgatt.c Setgrid.c Sethalo.c Setmiss.c Setpartab.c \
Setrcaname.c Settime.c Setzaxis.c Showinfo.c Sinfo.c Smooth9.c \
Sort.c Sorttimestamp.c Specinfo.c Spectral.c Spectrum.c \
Split.c Splitrec.c Splitsel.c Splittime.c Splityear.c SSOpar.c \
......@@ -229,8 +229,9 @@ am_cdo_OBJECTS = cdo-cdo.$(OBJEXT) cdo-Adisit.$(OBJEXT) \
cdo-Arithlat.$(OBJEXT) cdo-CDItest.$(OBJEXT) \
cdo-CDIread.$(OBJEXT) cdo-CDIwrite.$(OBJEXT) cdo-Cat.$(OBJEXT) \
cdo-Change.$(OBJEXT) cdo-Change_e5slm.$(OBJEXT) \
cdo-Cloudlayer.$(OBJEXT) cdo-Collgrid.$(OBJEXT) \
cdo-Command.$(OBJEXT) cdo-Comp.$(OBJEXT) cdo-Compc.$(OBJEXT) \
cdo-Cloudlayer.$(OBJEXT) cdo-CMOR.$(OBJEXT) \
cdo-Collgrid.$(OBJEXT) cdo-Command.$(OBJEXT) \
cdo-Comp.$(OBJEXT) cdo-Compc.$(OBJEXT) \
cdo-Complextorect.$(OBJEXT) cdo-Cond.$(OBJEXT) \
cdo-Cond2.$(OBJEXT) cdo-Condc.$(OBJEXT) \
cdo-Consecstat.$(OBJEXT) cdo-Copy.$(OBJEXT) \
......@@ -594,25 +595,25 @@ libcdo_la_SOURCES = cdo_int.h compare.h cdo_pthread.c cdo_vlist.c \
#
cdo_SOURCES = cdo.c Adisit.c Afterburner.c Arith.c Arithc.c \
Arithdays.c Arithlat.c CDItest.c CDIread.c CDIwrite.c Cat.c \
Change.c Change_e5slm.c Cloudlayer.c Collgrid.c Command.c \
Comp.c Compc.c Complextorect.c Cond.c Cond2.c Condc.c \
Consecstat.c Copy.c Deltime.c Derivepar.c Detrend.c Diff.c \
Distgrid.c Duplicate.c EOFs.c Eof3d.c EcaIndices.c Echam5ini.c \
Enlarge.c Enlargegrid.c Ensstat.c Ensstat3.c Ensval.c \
Eofcoeff.c Eofcoeff3d.c Exprf.c FC.c Filedes.c Fillmiss.c \
Filter.c Fldrms.c Fldstat.c Fldstat2.c Fourier.c Gengrid.c \
Gradsdes.c Gridboxstat.c Gridcell.c Gridsearch.c Harmonic.c \
Hi.c Histogram.c Importamsr.c Importbinary.c Importcmsaf.c \
Importobs.c Info.c Input.c Intgrid.c Intgridtraj.c Intlevel.c \
Intlevel3d.c Intntime.c Inttime.c Intyear.c Invert.c \
Invertlev.c Isosurface.c Kvl.c Log.c Maskbox.c Mastrfu.c \
Math.c Merge.c Mergegrid.c Mergetime.c Merstat.c Monarith.c \
Mrotuv.c Mrotuvb.c Ninfo.c Nmltest.c Output.c Outputgmt.c \
Pack.c Pinfo.c Pressure.c Regres.c Remap.c Remapeta.c \
Replace.c Replacevalues.c Rhopot.c Rotuv.c Runpctl.c Runstat.c \
Seascount.c Seaspctl.c Seasstat.c Selbox.c Select.c \
Seloperator.c Selrec.c Seltime.c Selvar.c Set.c Setbox.c \
Setgatt.c Setgrid.c Sethalo.c Setmiss.c Setpartab.c \
Change.c Change_e5slm.c Cloudlayer.c CMOR.c Collgrid.c \
Command.c Comp.c Compc.c Complextorect.c Cond.c Cond2.c \
Condc.c Consecstat.c Copy.c Deltime.c Derivepar.c Detrend.c \
Diff.c Distgrid.c Duplicate.c EOFs.c Eof3d.c EcaIndices.c \
Echam5ini.c Enlarge.c Enlargegrid.c Ensstat.c Ensstat3.c \
Ensval.c Eofcoeff.c Eofcoeff3d.c Exprf.c FC.c Filedes.c \
Fillmiss.c Filter.c Fldrms.c Fldstat.c Fldstat2.c Fourier.c \
Gengrid.c Gradsdes.c Gridboxstat.c Gridcell.c Gridsearch.c \
Harmonic.c Hi.c Histogram.c Importamsr.c Importbinary.c \
Importcmsaf.c Importobs.c Info.c Input.c Intgrid.c \
Intgridtraj.c Intlevel.c Intlevel3d.c Intntime.c Inttime.c \
Intyear.c Invert.c Invertlev.c Isosurface.c Kvl.c Log.c \
Maskbox.c Mastrfu.c Math.c Merge.c Mergegrid.c Mergetime.c \
Merstat.c Monarith.c Mrotuv.c Mrotuvb.c Ninfo.c Nmltest.c \
Output.c Outputgmt.c Pack.c Pinfo.c Pressure.c Regres.c \
Remap.c Remapeta.c Replace.c Replacevalues.c Rhopot.c Rotuv.c \
Runpctl.c Runstat.c Seascount.c Seaspctl.c Seasstat.c Selbox.c \
Select.c Seloperator.c Selrec.c Seltime.c Selvar.c Set.c \
Setbox.c Setgatt.c Setgrid.c Sethalo.c Setmiss.c Setpartab.c \
Setrcaname.c Settime.c Setzaxis.c Showinfo.c Sinfo.c Smooth9.c \
Sort.c Sorttimestamp.c Specinfo.c Spectral.c Spectrum.c \
Split.c Splitrec.c Splitsel.c Splittime.c Splityear.c SSOpar.c \
......@@ -827,6 +828,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-CDIread.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-CDItest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-CDIwrite.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-CMOR.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Cat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-CdoMagicsMapper.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Change.Po@am__quote@
......@@ -1950,6 +1952,20 @@ cdo-Cloudlayer.obj: Cloudlayer.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Cloudlayer.obj `if test -f 'Cloudlayer.c'; then $(CYGPATH_W) 'Cloudlayer.c'; else $(CYGPATH_W) '$(srcdir)/Cloudlayer.c'; fi`
cdo-CMOR.o: CMOR.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-CMOR.o -MD -MP -MF $(DEPDIR)/cdo-CMOR.Tpo -c -o cdo-CMOR.o `test -f 'CMOR.c' || echo '$(srcdir)/'`CMOR.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cdo-CMOR.Tpo $(DEPDIR)/cdo-CMOR.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CMOR.c' object='cdo-CMOR.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-CMOR.o `test -f 'CMOR.c' || echo '$(srcdir)/'`CMOR.c
cdo-CMOR.obj: CMOR.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-CMOR.obj -MD -MP -MF $(DEPDIR)/cdo-CMOR.Tpo -c -o cdo-CMOR.obj `if test -f 'CMOR.c'; then $(CYGPATH_W) 'CMOR.c'; else $(CYGPATH_W) '$(srcdir)/CMOR.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cdo-CMOR.Tpo $(DEPDIR)/cdo-CMOR.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CMOR.c' object='cdo-CMOR.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-CMOR.obj `if test -f 'CMOR.c'; then $(CYGPATH_W) 'CMOR.c'; else $(CYGPATH_W) '$(srcdir)/CMOR.c'; fi`
cdo-Collgrid.o: Collgrid.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Collgrid.o -MD -MP -MF $(DEPDIR)/cdo-Collgrid.Tpo -c -o cdo-Collgrid.o `test -f 'Collgrid.c' || echo '$(srcdir)/'`Collgrid.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cdo-Collgrid.Tpo $(DEPDIR)/cdo-Collgrid.Po
......
......@@ -52,6 +52,7 @@ void *CDIwrite(void *argument);
void *Change(void *argument);
void *Change_e5slm(void *argument);
void *Cloudlayer(void *argument);
void *CMOR(void *argument);
void *Collgrid(void *argument);
void *Command(void *argument);
void *Comp(void *argument);
......@@ -286,6 +287,7 @@ void *Maggraph(void *argument);
#define ChangeOperators {"chcode", "chtabnum", "chparam", "chname", "chunit", "chlevel", "chlevelc", "chlevelv", "chltype"}
#define Change_e5slmOperators {"change_e5slm", "change_e5lsm", "change_e5mask"}
#define CloudlayerOperators {"cloudlayer"}
#define CMOROperators {"cmor"}
#define CollgridOperators {"collgrid"}
#define CommandOperators {"command", "com", "cmd"}
#define CompOperators {"eq", "ne", "le", "lt", "ge", "gt"}
......@@ -569,6 +571,7 @@ static modules_t Modules[] =
{ Change, ChangeHelp, ChangeOperators, CDI_REAL, 1, 1 },
{ Change_e5slm, NULL, Change_e5slmOperators, CDI_REAL, 1, 1 },
{ Cloudlayer, NULL, CloudlayerOperators, CDI_REAL, 1, 1 },
{ CMOR, NULL, CMOROperators, CDI_REAL, 1, 0 },
{ Collgrid, CollgridHelp, CollgridOperators, CDI_REAL, -1, 1 },
{ Command, NULL, CommandOperators, CDI_REAL, 1, 0 },
{ Comp, CompHelp, CompOperators, CDI_REAL, 2, 1 },
......
Supports Markdown
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