Project

General

Profile

Piping issue - combining 'seldate' and 'ymonmean' on daily data

Added by Alessia Prospero about 3 years ago

Hello,

I'm trying to select ~20-y periods and make a monthly mean from a .nc (ifile below) file containing daily data from 1981-2099 but my code always aborts saying "too many imput streams for operator 'seldate'" (I'm using Cygwin).

The current code I'm running is (actually, it goes untill 2099 but this is rapresentative enough):

$cdo ymonmean -seldate,1981-01-01,2020-12-31 *ifile* -ymonmean -seldate,2021-01-01,2040-12-31 *ifile* -ymonmean -seldate,2041-01-01,2060-12-31 *ifile* *ofile*

Any idea if there is a way to obtain my aimed file? If I run single "ymonmean -seldates" it works but I have a lot of files I want to do the same with and if I have to go step-by-step it would take me ages.

Thank you in advance!

Alessia


Replies (2)

RE: Piping issue - combining 'seldate' and 'ymonmean' on daily data - Added by Karin Meier-Fleischer about 3 years ago

Hi Alessia,

you have to use separate calls for each 20 year period.

cdo -ymonmean -seldate,1981-01-01,2020-12-31 infile tmp1.nc
cdo -ymonmean -seldate,2021-01-01,2040-12-31 infile tmp2.nc
cdo -ymonmean -seldate,2041-01-01,2060-12-31 infile tmp3.nc

cdo -mergetime tmp*.nc outfile

rm tmp*.nc

-Karin

RE: Piping issue - combining 'seldate' and 'ymonmean' on daily data - Added by Alessia Prospero about 3 years ago

Dear Karin,

thank you for your reply.
I was hoping for something quicker but this way works perfectly anyway!

Alessia

    (1-2/2)