Regrid a NetCDF file from a rotated grid to a geographical coordinate system
Added by Ghaith Ben Hamouda almost 5 years ago
Hello,
I have a Cordex NetCDF file with rotated pole coordinates. I would like to transform those coordinates to regular lat/lon coordinates. I am completely new to CDO and I have tried a lot of solutions on this forum and elsewhere, but it doesn't seem to work! Here is the "cdo sinfo" of my NetCDF file:
File format : netCDF4 classic ZIP
-1 : Institut Source Ttype Levels Num Points Num Dtype : Parameter ID
1 : unknown unknown instant 1 1 174688 1 F32z : -1
Grid coordinates :
1 : curvilinear : points=174688 (424x412)
lon : -44.5939 to 64.9644 degrees_east
lat : 21.9878 to 72.585 degrees_north
Vertical coordinates :
1 : height : levels=1
height : 2 m
Time coordinate : 1826 steps
RefTime = 1949-12-01 00:00:00 Units = days Calendar = standard Bounds = true
YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss
1981-01-01 12:00:00 1981-01-02 12:00:00 1981-01-03 12:00:00 1981-01-04 12:00:00
1981-01-05 12:00:00 1981-01-06 12:00:00 1981-01-07 12:00:00 1981-01-08 12:00:00
1981-01-09 12:00:00 1981-01-10 12:00:00 1981-01-11 12:00:00 1981-01-12 12:00:00
1981-01-13 12:00:00 1981-01-14 12:00:00 1981-01-15 12:00:00 1981-01-16 12:00:00
1981-01-17 12:00:00 1981-01-18 12:00:00 1981-01-19 12:00:00 1981-01-20 12:00:00
1981-01-21 12:00:00 1981-01-22 12:00:00 1981-01-23 12:00:00 1981-01-24 12:00:00
1981-01-25 12:00:00 1981-01-26 12:00:00 1981-01-27 12:00:00 1981-01-28 12:00:00
1981-01-29 12:00:00 1981-01-30 12:00:00 1981-01-31 12:00:00 1981-02-01 12:00:00
1981-02-02 12:00:00 1981-02-03 12:00:00 1981-02-04 12:00:00 1981-02-05 12:00:00
1981-02-06 12:00:00 1981-02-07 12:00:00 1981-02-08 12:00:00 1981-02-09 12:00:00
1981-02-10 12:00:00 1981-02-11 12:00:00 1981-02-12 12:00:00 1981-02-13 12:00:00
1981-02-14 12:00:00 1981-02-15 12:00:00 1981-02-16 12:00:00 1981-02-17 12:00:00
1981-02-18 12:00:00 1981-02-19 12:00:00 1981-02-20 12:00:00 1981-02-21 12:00:00
1981-02-22 12:00:00 1981-02-23 12:00:00 1981-02-24 12:00:00 1981-02-25 12:00:00
1981-02-26 12:00:00 1981-02-27 12:00:00 1981-02-28 12:00:00 1981-03-01 12:00:00
................................................................................
................................................................................
.........
1985-11-04 12:00:00 1985-11-05 12:00:00 1985-11-06 12:00:00 1985-11-07 12:00:00
1985-11-08 12:00:00 1985-11-09 12:00:00 1985-11-10 12:00:00 1985-11-11 12:00:00
1985-11-12 12:00:00 1985-11-13 12:00:00 1985-11-14 12:00:00 1985-11-15 12:00:00
1985-11-16 12:00:00 1985-11-17 12:00:00 1985-11-18 12:00:00 1985-11-19 12:00:00
1985-11-20 12:00:00 1985-11-21 12:00:00 1985-11-22 12:00:00 1985-11-23 12:00:00
1985-11-24 12:00:00 1985-11-25 12:00:00 1985-11-26 12:00:00 1985-11-27 12:00:00
1985-11-28 12:00:00 1985-11-29 12:00:00 1985-11-30 12:00:00 1985-12-01 12:00:00
1985-12-02 12:00:00 1985-12-03 12:00:00 1985-12-04 12:00:00 1985-12-05 12:00:00
1985-12-06 12:00:00 1985-12-07 12:00:00 1985-12-08 12:00:00 1985-12-09 12:00:00
1985-12-10 12:00:00 1985-12-11 12:00:00 1985-12-12 12:00:00 1985-12-13 12:00:00
1985-12-14 12:00:00 1985-12-15 12:00:00 1985-12-16 12:00:00 1985-12-17 12:00:00
1985-12-18 12:00:00 1985-12-19 12:00:00 1985-12-20 12:00:00 1985-12-21 12:00:00
1985-12-22 12:00:00 1985-12-23 12:00:00 1985-12-24 12:00:00 1985-12-25 12:00:00
1985-12-26 12:00:00 1985-12-27 12:00:00 1985-12-28 12:00:00 1985-12-29 12:00:00
1985-12-30 12:00:00 1985-12-31 12:00:00
Thank you
Replies (3)
RE: Regrid a NetCDF file from a rotated grid to a geographical coordinate system - Added by Ralf Mueller almost 5 years ago
hi! could you upload a small sample of the data? the first timestep is sufficient
thx
ralf
RE: Regrid a NetCDF file from a rotated grid to a geographical coordinate system - Added by Ghaith Ben Hamouda almost 5 years ago
Hi Ralf,
I attach a sample.
Thx
RE: Regrid a NetCDF file from a rotated grid to a geographical coordinate system - Added by Ralf Mueller almost 5 years ago
ok, I see no issues with your file. Read through chaper 2.12 Interpolation of the pdf or here
When going from one coordinate system to another you have to think about how to compute the values on the new locations. CDO offers multiple options here. Some of them will not be possible for you because your grid is lacking the bounds of each grid cell. Hence the area of each cell cannot be computed and so conservative remapping is excluded. But all methods based only on the target cell location (bilinear, nearest neighbor, distance weighted, ...) will work here.
there is on thing with your input file
tas:coordinates = "height lat lon" ;this is not correct, because height is not a dimension. But CDO is agnostic about this detail.
hth
ralf