remapcon
Added by Iris Hinrichs almost 14 years ago
Hello,
I am trying to do a conservative remapping from a curvilinear orthogonal grid to a regular lat-lon grid. The fields on the curvilinear grid have periodic boundaries, meaning that grid points from the beginngin of the field are repeated in the end. The field dimensions in lonxlat are 122x101. The dimensions would be 120x101 without periodic boundaries.
The conservative remapping works so far, but the land mask (missing values) seems to have shrunk during the remapping and the area of the periodic boundaries shows exceptionally high and low values.
The command I used is:
cdo remapcon,r120x60 -setgrid,gridfile_122x101.txt bgcmean_2d.nc con_lat_lon_bgcmean_2d.nc
I thought getting rid of the periodic boundaries with selindexbox would help, but I got the problem of the unsupported grid type: "Unsupported grid type: generic"
The command I used here is:
cdo selindexbox,1,120,1,101 -setgrid,gridfile_122x101.txt bgcmean_2d.nc bgcmean_2d_120x101.nc
I wonder why setgrid worked in the first remapcon command but not in the selindexbox command.
I append the files.
I'd be very grateful for help with this.
Kind regards,
Iris
con_lat_lon_bgcmean_2d.nc (11.6 MB) con_lat_lon_bgcmean_2d.nc | |||
gridfile_122x101.txt (1010 KB) gridfile_122x101.txt | |||
bgcmean_2d.nc (32 MB) bgcmean_2d.nc |
Replies (5)
RE: remapcon - Added by Uwe Schulzweida almost 14 years ago
Hi Iris,
The input file contains variables on two different grids. Here is the corresponting section from sinfo:
Horizontal grids : 1 : generic > size : dim = 12322 nx = 122 ny = 101 2 : generic > size : dim = 1So there is at least one variable on a 'generic' grid which has the size 1. For selindexbox all input fields muss have the same horizontal grid. Use 'selgrid,1' to select all variable on the first grid:
cdo remapcon,r120x60 -selindexbox,1,120,1,101 -setgrid,gridfile_122x101.txt -selgrid,1 bgcmean_2d.nc result.nc
Best regards,
Uwe
PS: Unfortunately your grid description file 'gridfile_122x101.txt' seems to be incorrect!
RE: remapcon - Added by Iris Hinrichs almost 14 years ago
Hi Uwe,
thanks for the answer.
Using the cdo-operators in that way you suggested above, the conservatively remapped fields look quite ok. At least, the very high and very low values in the area of the periodic boundary do not exist anymore. Only the land mask is still shrunk. How can I avoid this with remapcon?
You mentioned that my 'gridfile_122x101.txt' is incorrect. Do you think this causes the shrunk land mask? I have a .nc-file describing the grid, but could not find anything about how to use this with setgrid. That's why I made my own grid description out of the .nc-file (I append it) following the example in the cdo-manual.
So, my third and last question: How do I correctly apply the .nc-file with the grid description to setgrid.
In hope to get answers to all three questions,
Iris
grob30s.nc (522 KB) grob30s.nc |
RE: remapcon - Added by Uwe Schulzweida almost 14 years ago
You can use this grid description file directly with setgrid. It contains the description of the grid without periodic boundaries. Therefor you have to remove the periodic boundaries first:
cdo remapcon,r120x60 -setgrid,grob30s.nc -selindexbox,1,120,1,101 -selgrid,1 bgcmean_2d.nc result.nc
RE: remapcon - Added by Iris Hinrichs almost 14 years ago
ok, thanks, this works, but still the land mask is shrunk. ???
Iris
RE: remapcon - Added by Uwe Schulzweida almost 14 years ago
Shrinking of the mask is normal for this remapping method!