Project

General

Profile

Pipe the result of cdo select

Added by David Wang over 10 years ago

cdo select takes arbitrary number of input files, which is great. However, I'm not able to pipe the result to another operator, such as

cdo ymonmean -select,year=1970/1999 $ifiles $ofile

gives the following message:
Error (cdo ymonmean) : Too many streams! Operator needs 1 input and 1 output streams.

Does cdo select returns one input stream, or am I mistaken?


Replies (2)

RE: Pipe the result of cdo select - Added by Uwe Schulzweida over 10 years ago

All operators with an arbitrary number of input streams (ifiles) can't be combined with other operators if these operators are used with more than one input stream. Here is an incomplete list of these operators:

  copy, cat, merge, mergetime, select, ens<STAT >
If the input stream names have the same structure than you can try to use wildcards (? and *) to generate only one input stream name. In this case you have to use single quotes around the input stream argument. Here is an example:
  cdo ymonmean -select,year=1970/1999  ifile1 ifile2 ifile3 ofile  <-- error
  cdo ymonmean -select,year=1970/1999 'ifile?'              ofile  <-- works
This feature is available since CDO version 1.5.9.

RE: Pipe the result of cdo select - Added by David Wang over 10 years ago

Thanks. It works like a charm.

    (1-2/2)