Convert curvilinear to rectilinear grid
Added by Lina Teckentrup almost 4 years ago
Hi,
I'm looking at the Narclim downscaled dataset. The original dataset is curvilinear, cdo sinfo gives
File format : NetCDF4 classic
-1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter ID
1 : unknown unknown v instant 1 1 30960 1 F32 : -1
Grid coordinates :
1 : curvilinear : points=30960 (215x144)
lon : -179.9976 to 179.9986 degrees_east
lat : -55.72 to 14.57882 degrees_north
mapping : rotated_latitude_longitude
Vertical coordinates :
1 : surface : levels=1
Time coordinate : 8760 steps
[...]
I want to regrid the file to a half degree grid but I can't set the grid to lonlat. I tried
cdo setgrid,grid.txt CCRC_NARCliM_01H_1990-1990_pracc.nc test.nc
where grid.txt is the grid information of the original file and lonlat set to the grid type instead of curvilinear. This gives
cdo setgrid (Abort): xsize=30960 and size of xvals=215 differ (grid description file: grid.txt)!
The same error occurs when I try cdo remapycon. When I derive the grid.txt file from my target grid, I get the error
cdo remapcon (Abort): Source grid cell corner coordinates missing!
I alternatively tried the regrinding with Xarray ESMF but without success. Can anyone help? Thanks a lot
Replies (2)
RE: Convert curvilinear to rectilinear grid - Added by Karin Meier-Fleischer almost 4 years ago
Hi Lina,
without your grid.txt file I can only guess that it is wrong.
The following command does the remapping of the NARCLIM CORDEX domain to global lonlat 360x180 grid.
cdo -remapbil,r360x180 time1.nc outfile.nc
Is it correct? If not then upload the grid.txt file.
-Karin
RE: Convert curvilinear to rectilinear grid - Added by Lina Teckentrup almost 4 years ago
Oh great, yes that fixed it! Thanks a lot