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

Add operator selall

parent 338595c4
......@@ -33,9 +33,12 @@
void *Copy(void *argument)
{
static char func[] = "Copy";
int COPY, SELALL;
int operatorID;
int streamID1, streamID2 = CDI_UNDEFID;
int nrecs;
int tsID1, tsID2, recID, varID, levelID;
int lcopy = FALSE;
int gridsize;
int vlistID1, vlistID2;
int nmiss;
......@@ -45,6 +48,13 @@ void *Copy(void *argument)
cdoInitialize(argument);
COPY = cdoOperatorAdd("copy", 0, 0, NULL);
SELALL = cdoOperatorAdd("selall", 0, 0, NULL);
if ( UNCHANGED_RECORD ) lcopy = TRUE;
operatorID = cdoOperatorID();
streamCnt = cdoStreamCnt();
nfiles = streamCnt - 1;
......@@ -84,12 +94,20 @@ void *Copy(void *argument)
streamInqRecord(streamID1, &varID, &levelID);
streamDefRecord(streamID2, varID, levelID);
streamReadRecord(streamID1, array, &nmiss);
streamWriteRecord(streamID2, array, nmiss);
if ( lcopy && operatorID == SELALL )
{
streamCopyRecord(streamID2, streamID1);
}
else
{
streamReadRecord(streamID1, array, &nmiss);
streamWriteRecord(streamID2, array, nmiss);
}
}
tsID1++;
tsID2++;
}
streamClose(streamID1);
}
......
......@@ -22,7 +22,7 @@
Select delcode Delete codes
Select selvar Select variables
Select delvar Delete variables
Select selstdname Select variables by CF name
Select selstdname Select variables by CF standard name
Select sellevel Select levels
Select selgrid Select grids
Select selgridname Select grid by name
......
......@@ -513,7 +513,7 @@ int main(int argc, char *argv[])
if ( noff ) setDefaultFileType(Progname+noff, 0);
while ( (c = cdoGetopt(argc, argv, "f:b:p:g:i:l:m:t:D:z:aBdhRrsTuVvZ")) != -1 )
while ( (c = cdoGetopt(argc, argv, "f:b:p:g:i:l:m:t:D:z:aBdhRrsTVvZ")) != -1 )
{
switch (c)
{
......
......@@ -143,7 +143,7 @@ void *Zonstat(void *argument);
#define CondOperators {"ifthen", "ifnotthen"}
#define Cond2Operators {"ifthenelse"}
#define CondcOperators {"ifthenc", "ifnotthenc"}
#define CopyOperators {"copy"}
#define CopyOperators {"copy", "selall"}
#define DetrendOperators {"detrend"}
#define DiffOperators {"diff", "diffv"}
#define EnlargeOperators {"enlarge"}
......
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