Project

General

Profile

combining operators: cdo cat with multiple seldate's: why doesn't this work

Added by Ian Scott-Fleming over 11 years ago

CDO Documentation says that commands with fixed # of inputs at one output can be combined

seldate takes one input and one output

The following works:
cdo copy file1 file2 file3 outfile

Why does the following not work? Am I missing something obvious?

cdo copy -seldate,2005-01-01,2100-12-31 file1
cdo copy -seldate,2005-01-01,2100-12-31 file1 -seldate,2005-01-01,2100-12-31 file2 outfile

When I try it, I get the following, and the command hangs (i.e., never returns to bash prompt) :
$ cdo copy -seldate,2006-01-01,2100-12-31 pr_Amon_HadGEM2-ES_rcp45_r1i1p1_200512-203011.nc -seldate,2006-01-01,2100-12-31 pr_Amon_HadGEM2-ES_rcp45_r1i1p1_203012-205511.nc $outfile
cdo copy: Started child process "seldate,2006-01-01,2100-12-31 pr_Amon_HadGEM2-ES_rcp45_r1i1p1_200512-203011.nc (pipe1.1)".
Warning (cdfScanVarAttributes) : NetCDF: Variable not found - areacella
cdo(2) seldate: Processed 8324160 values from 1 variable over 300 timesteps ( 0.44s )
cdo copy: Started child process "seldate,2006-01-01,2100-12-31 pr_Amon_HadGEM2-ES_rcp45_r1i1p1_203012-205511.nc (pipe1.2)".
Syntax error in >2006-01-01<! Character - not allowed.
Syntax error in >2006-01-01<! Character - not allowed.
Syntax error in >2100-12-31<! Character - not allowed.
Syntax error in >2100-12-31<! Character - not allowed.
Warning (cdfScanVarAttributes) : NetCDF: Variable not found - areacella
cdo(2) seldate: Processed 1 variable over 300 timesteps ( 0.45s )


Replies (2)

RE: combining operators: cdo cat with multiple seldate's: why doesn't this work - Added by Ian Scott-Fleming over 11 years ago

minor correction to above. the first "cdo copy -seldate" line should be ignored above...couldn't figure out how to get back to edit it and remove it from my post.
sorry.

RE: combining operators: cdo cat with multiple seldate's: why doesn't this work - Added by Uwe Schulzweida over 11 years ago

Thanks for this report! There was a bug in the implementation of using the same operator twice. This bug happens if one of the same operator has finished before the other operator starts. The user has no influence of the execution order. There is no workaround for this problem. It could be possible that the command runs if you try it a second or third time.
If the second file already includes all selected time steps you can omit this seldate command:

cdo copy -seldate,2006-01-01,2100-12-31 file_200512-203011.nc file_203012-205511.nc $outfile

This bug is already fixed in the current CDO release.

    (1-2/2)