sellonlatbox with curvlinear grid
Added by Thorsten Muzs over 5 years ago
Hi all,
I'm trying to select a region using sellonlatbox from a curvlinear grid:
Specifically, in the Indian Ocean from
40°E - 120°E, and 10°S - 10°N
While
cdo sellonlatbox,40,120,-10,10 test.nc test_selected.nc
works fine for most models I process, for some models this function ends up selecting the whole area from -180 to +180°E from 10°S to 10°N.
I'm not sure why that is the case.
I attached two sample files: working_file.nc the area is correctly selected, not_working_file.nc the area is not correctly selected and it's not clear to me why that is the case. I would be grateful for advice on how I can avoid this problem. For other regions, like in the eastern Pacific or the Atlantic, cdo sellonlatbox selects the correct grid for both files.
working_file.nc (1.38 MB) working_file.nc | |||
not_working_file.nc (8.22 MB) not_working_file.nc |
Replies (3)
RE: sellonlatbox with curvlinear grid - Added by Ralf Mueller over 5 years ago
hi Thorsten!
thx for this report - both files look good regarding the coordinate definitions and I can reproduce this behavior with the current CDO release. Interestingly there is a break point when prcessing the not_working file 73 n degE:
- fail
% cdo -sinfov -sellonlatbox,40,73,-10,10 not_working_file.nc cdo(1) sellonlatbox: Process started Warning (find_time_vars): Time variable >time< not found! File format : NetCDF4 zip -1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter name 1 : unknown CNRM-ESM2-1 c instant 1 1 17689 1 F32z : areacello Grid coordinates : 1 : curvilinear : points=17689 (361x49) lon : -179.5 to 179.5 degrees_east circular lat : -9.849413 to 9.849413 degrees_north available : cellbounds Vertical coordinates : 1 : surface : levels=1 cdo(1) sellonlatbox: Processed 1 variable over 1 timestep. cdo sinfon: Processed 1 variable [0.03s 69MB].
- correct
% cdo -sinfov -sellonlatbox,40,72,-10,10 not_working_file.nc cdo(1) sellonlatbox: Process started Warning (find_time_vars): Time variable >time< not found! File format : NetCDF4 zip -1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter name 1 : unknown CNRM-ESM2-1 c instant 1 1 1568 1 F32z : areacello Grid coordinates : 1 : curvilinear : points=1568 (32x49) lon : 40.5 to 71.5 by 1 degrees_east lat : -9.849413 to 9.849413 degrees_north available : cellbounds Vertical coordinates : 1 : surface : levels=1 cdo(1) sellonlatbox: Processed 1 variable over 1 timestep. cdo sinfon: Processed 1 variable [0.02s 68MB].
Will have to dig a little deeper for sure.
73 degE is also a special case for the lower latitude give in the command: -sellonlatbox,74,120,-10,10
works and -sellonlatbox,73,120,-10,10
fails
cheers
ralf
RE: sellonlatbox with curvlinear grid - Added by Uwe Schulzweida over 5 years ago
For the application of sellonlatbox on curvilinear grids the coordinates must be correct.
Otherwise, it cannot be determined whether the longitudes are cyclic or not.
The first and last column are duplicated. And the first and last row contain wrong values for the corners of the cell.
These rows and columns must be removed before sellonatbox can be applied. Here is an example:
cdo sellonlatbox,40,120,-10,10 -selindexbox,2,361,2,293 not_working_file.nc result
RE: sellonlatbox with curvlinear grid - Added by Thorsten Muzs over 5 years ago
Dear Ralf and Uwe,
Thank you very much for your help, now it is working!