Project

General

Profile

Piping - how many operators?

Added by Byman Hamududu over 13 years ago

I am just curious.... how many operators can be piped at one instance. I am carrying out several operations on several files and would not like to save the intermediate files; for example:
step1: mask an area (maskregion)
step2: select data range by date(seldate)
step3: compute the mean the selcted data ranges (ymonmean)
step4: compute the difference (ymonsub)
etc....
Can I, for example, cdo ymonsub -ymonmean -seldate -maskregion ... final.nc

Is there a limit? Can the results be realistic? just wondering... I am trying now... any experiences?

Your views and help would be appreciated

Byman


Replies (2)

RE: Piping - how many operators? - Added by Ralf Mueller over 13 years ago

Byman Hamududu wrote:

I am just curious.... how many operators can be piped at one instance.

128 is the current limit. But you can change it (MAX_OPERATOR , src/process.c, line 40) and recompile CDO.

I am carrying out several operations on several files and would not like to save the intermediate files; for example:
step1: mask an area (maskregion)
step2: select data range by date(seldate)
step3: compute the mean the selcted data ranges (ymonmean)
step4: compute the difference (ymonsub)
etc....
Can I, for example, cdo ymonsub -ymonmean -seldate -maskregion ... final.nc

You can, but you should have in mind, that chaining operators is not possible with all operators, see Tutorial

Is there a limit? Can the results be realistic? just wondering... I am trying now... any experiences?

I'd like to have a users contest on the longest (reasonable) cdo command and to see, what's comming out!

Ralf

RE: Piping - how many operators? - Added by Byman Hamududu over 13 years ago

Thanks Ralf

I was computing the changes (19960-1990 and 2020s )using NetCDF files on monthly basis. This was what I used and it work very well. The results looked reasonable (as expected). Not very long but I achieved the purpose. First I selected by date (1961 - 1990) and compute the monthly averages for this period while I do the same for another future period (2011-2040) and finally I compute the difference between the results of the 2 operations ending up with one file. It was great!

cdo ymonsub -ymonmean -seldate,date1[,date2] file1 -ymonmean -seldate,date3[,date4] file1 ofile

Many thanks once more

Byman

    (1-2/2)