Project

General

Profile

Convert NETCDF4/HDF5 rotated lat/lon grid into a regular lat/lon grid

Added by David Carvalho over 9 years ago

Hello all,

I'm trying to convert a NETCDF4/HDF5 rotated lat/lon grid (output from a EURO-CORDEX climate model) into a regularly spaced LAT/LON grid. I'm trying to do:

- cdo setgridtype, regular input_file.nc output_file.nc

» Here I get the following error message: cdo setgridtype (Abort): Unsupported grid type!
HDF5-DIAG: Error detected in HDF5 (1.8.11) thread 0:
#000: H5T.c line 1761 in H5Tclose(): not a datatype
major: Invalid arguments to routine
minor: Inappropriate type
Error (cdf_close) : NetCDF: HDF error

- After, I tried to convert this NETCDF4/HDF5 into a NC3 (normal NETCDF) file using ncks -3 and then cdo setgridtype, regular input_file_in_nc3.nc output_file.nc

» Here I got the error: cdo setgridtype (Abort): Unsupported grid type!

I tried these two commands also with cdo setgridtype, lonlat, but the results are the same...

Any ideas??

Thank you


Replies (1)

RE: Convert NETCDF4/HDF5 rotated lat/lon grid into a regular lat/lon grid - Added by Uwe Schulzweida over 9 years ago

You can convert a rotated lon/lat grid only to a curvilinear grid:

cdo setgridtype,curvilinear input_file.nc output_file.nc
If you need the data on a regular lon/lat grid then you have to interpolate you data with one of the remapping operators. Here is an example for a bilinear interpolation to a global 1 degree grid:
cdo remapbil,global_1 input_file.nc output_file.nc

    (1-1/1)