Project

General

Profile

unexpected: change dimension name when regridding

Added by Jay Su about 4 years ago

CDO v1.9.7

It looks like CDO changes dimension names after regridding.

Before regridding MAT3CPMST_subset.nc:
XDim\:EOSGRID
YDim\:EOSGRID

After regridding MAT3CPMST_remap.nc:
lon
lat

Is there anyway we dont change the name? I believe it's straightforward to change variable name but not dimension name in CDO, right?

Thanks,
Jay


Replies (3)

RE: unexpected: change dimension name when regridding - Added by Uwe Schulzweida about 4 years ago

You probably used one of the predefined grids for interpolation (e.g. r180x91). This has nothing to do with the grid in your file. The predefined grids have default names for the dimensions. If you want to have other names you have to write a grid file yourself. Here is an example:

gridtype  = lonlat
xsize     = 180
ysize     = 91
xname     = "XDim:EOSGRID" 
xlongname = "longitude" 
xunits    = "degrees_east" 
yname     = "YDim:EOSGRID" 
ylongname = "latitude" 
yunits    = "degrees_north" 
xfirst    = 0
xinc      = 2
yfirst    = -90
yinc      = 2

RE: unexpected: change dimension name when regridding - Added by Jay Su about 4 years ago

Thank you Uwe,

I generated by myself:

gridtype = lonlat
xsize = 180
ysize = 91
xfirst = 0
xinc = 2
yfirst = 90
yinc = -2

Do you mean xname/yname are set as lon/lat as default? Is it possible to use the ones in the original file?

RE: unexpected: change dimension name when regridding - Added by Uwe Schulzweida about 4 years ago

Yes, the default name of the longitude and latitide coordinates is lon and lat. You can set it with xname/yname and it is not possible to use the names of the inputfile automatically.

    (1-3/3)