Project

General

Profile

Pb with sellonlatbox operator: size of box depends on the value precision

Added by mondher chekki over 13 years ago

Hi:

I am having some troubles using the sellonlatbox operator..
When I try to get the range of latitudes between -30 and 30 (included) it looks like cdo is very sensitive to the precision.

Using 30.000000000001 will add the value 30 to the range whereas 30.000000000000 will stop at 30-timestep value(time step 0.125).

Is there an explanation for that or is this a normal behaviour?

Many thanks

These are the tests that I did:
- I have the same results whether file.in is a grib or a netcdf file
- I get an extra value for longitude in the first test.

I attached the file.in I am using.

TEST1:

$ cdo sellonlatbox,-30,30.000000000001,70,20 file.in file.out
cdo sellonlatbox: Processed 4150080 values from 1 variable over 1 timestep. ( 0.06s )

$ cdo infov file.out
-1 : Date Time Varname Level Size Miss : Minimum Mean Maximum
1 : 0000-00-00 00:00:00 MSL_GDS0_SFC 0 192881 0 : 96962. 1.0095e+05 1.0294e+05
cdo infov: Processed 192881 values from 1 variable over 1 timestep. ( 0.00s )

TEST2:

$ cdo sellonlatbox,-30,30.000000000000,70,20 file.in file2.out
cdo sellonlatbox: Processed 4150080 values from 1 variable over 1 timestep. ( 0.07s )

$ cdo infov file2.out
-1 : Date Time Varname Level Size Miss : Minimum Mean Maximum
1 : 0000-00-00 00:00:00 MSL_GDS0_SFC 0 192480 0 : 96962. 1.0095e+05 1.0294e+05
cdo infov: Processed 192480 values from 1 variable over 1 timestep. ( 0.00s )

$ cdo sdiff file.out file2.out

cdo sdiff (Abort): Grid size of the input fields do not match!

file.in (7.92 MB) file.in Grib File from ECMWF

Replies (1)

RE: Pb with sellonlatbox operator: size of box depends on the value precision - Added by Uwe Schulzweida over 13 years ago

Thanks for this report! This is a bug in the function sellonlatbox. We will fix this bug in the next CDO release (see also #624).
Best regards,
Uwe

    (1-1/1)