remapcon from curvilinear, get cell boundary information from NetCDF
Added by Joel Zeder over 1 year ago
Dear CDO community,
I'm aware that the remapcon question has been raised previously, that it requires grid cell boundaries for it to work (if the source grid is curvilinear), and that CDO is unable to compute them from the source file directly. However, if the NetCDF file itself contains information about the grid cell boundaries, can this information be accessed for conservatively remapping data from a curvilinear to a regular lon/lat grid?
My target grid is "grid_out_025.txt", and a time slice of my input NetCDF (with the cell boundary information) is "pr_file_in.nc".
Have a great Easter break everyone!
Best,
Joel
grid_out_025.txt (316 Bytes) grid_out_025.txt | Target grid file | ||
pr_file_in.nc (5.65 MB) pr_file_in.nc | Input data (on curvilinear grid with grid cell boundary information) |
Replies (2)
RE: remapcon from curvilinear, get cell boundary information from NetCDF - Added by Uwe Schulzweida over 1 year ago
Dear Joel,
If the geographic coordinates are removed, they are recalculated including the bounds from the projection parameters.
Here are two ways to remove the geographic coordinates:
NCO: ncks -C -O -x -v latitude,longitude pr_file_in.nc newfile.nc ncatted -a coordinates,pr,d,, newfile.nc cdo remapcon,grid_out_025.txt newfile.nc result.nc CDO: cdo remapcon,grid_out_025.txt -setgridtype,projection pr_file_in.nc result.ncThe projection parameter of the CDO operator setgridtype is not documented yet, it will be documented in the next CDO release 2.2.0.
Best,
Uwe
RE: remapcon from curvilinear, get cell boundary information from NetCDF - Added by Joel Zeder over 1 year ago
Uwe Schulzweida wrote in RE: remapcon from curvilinear, get cell boundary informat...:
Dear Joel,
If the geographic coordinates are removed, they are recalculated including the bounds from the projection parameters.
Here are two ways to remove the geographic coordinates:
[...]The projection parameter of the CDO operator setgridtype is not documented yet, it will be documented in the next CDO release 2.2.0.Best,
Uwe
Dear Uwe,
the CDO solution works like a charm, thank you so much!
Cheers!
Joel