Project

General

Profile

delete with negative timesteps does not work in a piped command

Added by Ileana Bladé almost 10 years ago

Hello,

I find that when piping commands, a negative timestep will not be recognized.
For instance this command
cdo -f nc -r -b 64 -delete,timestep=-1,1,2 -selmon,12,1,2 -selyear,2006/2099 psl_Amon_ACCESS1-0_rcp45_r1i1p1_200601-210012.nc ala.nc
will not work. It does not recognize the -1 Timestep.

cdo delete: Started child process "selmon,12,1,2 -selyear,2006/2099 psl_Amon_ACCESS1-0_rcp45_r1i1p1_200601-210012.nc (pipe1.1)".
cdo(2) selmon: Started child process "selyear,2006/2099 psl_Amon_ACCESS1-0_rcp45_r1i1p1_200601-210012.nc (pipe2.1)".
cdo(3) selyear: Processed 73094400 values from 1 variable over 1140 timesteps ( 3.27s )
cdo(2) selmon: Processed 18273600 values from 1 variable over 1128 timesteps ( 3.27s )
cdo delete (Warning): Timestep >-1< not found!
cdo delete: Processed 18144000 values from 1 variable over 282 timesteps ( 3.27s )

Unpiping the delete command and doing it sequentially works fine.

cdo -f nc -r -b 64 -selmon,12,1,2 -selyear,2006/2099 psl_Amon_ACCESS1-0_rcp45_r1i1p1_200601-210012.nc ala.nc
cdo selmon: Started child process "selyear,2006/2099 psl_Amon_ACCESS1-0_rcp45_r1i1p1_200601-210012.nc (pipe1.1)".
cdo(2) selyear: Processed 73094400 values from 1 variable over 1140 timesteps ( 3.00s )
cdo selmon: Processed 18273600 values from 1 variable over 1128 timesteps ( 3.00s )

airsea% cdo -f nc -r -b 64 -delete,timestep=-1,1,2 ala.nc ala2.nc
cdo delete: Processed 18079200 values from 1 variable over 282 timesteps ( 1.26s )

Any workarounds or explanations?

Thanks
ileana


Replies (1)

RE: delete with negative timesteps does not work in a piped command - Added by Uwe Schulzweida almost 10 years ago

Hi Ileana,

The feature to select the last timestep with -1 is only available directly on netCDF files. If you combine the operators then you are working on an intermediate format and not netCDF anymore.

Cheers,
Uwe

    (1-1/1)