Project

General

Profile

setgridtype,lonlat error

Added by Abdoulaye SARR about 9 years ago

The file can't be put in lonlat using setgridtype.
Te output of sinfon is below. Is there any hint to sole this

bash-3.2$ cdo setgridtype,lonlat clrrdly9812.nc clrrdlylonlat9812.nc

cdo setgridtype (Abort): Unsupported grid name: lonlat
HDF5-DIAG: Error detected in HDF5 (1.8.13) thread 0:
#000: H5T.c line 1766 in H5Tclose(): not a datatype
major: Invalid arguments to routine
minor: Inappropriate type

Error (cdf_close) : NetCDF: HDF error
bash-3.2$ cdo sinfon clrrdly9812.nc
File format: netCDF4
-1 : Institut Source Ttype Levels Num Gridsize Num Dtype : Parameter name
1 : unknown cclm.exe constant 1 1 41 1 F32 : vcoord
2 : unknown cclm.exe instant 1 1 12500 2 F32 : RAIN_CON
3 : unknown cclm.exe instant 1 1 12500 2 F32 : RAIN_GSP
4 : unknown cclm.exe instant 1 1 12500 2 F32 : TOT_PREC
Grid coordinates :
1 : generic > size : dim = 41 nx = 41 ny = 0
2 : curvilinear > size : dim = 12500 nx = 125 ny = 100
lon : min = -30 max = 24.5599995 degrees_east
lat : min = -10 max = 33.5600014 degrees_north
available : xvals yvals
Vertical coordinates :
1 : surface : 0
Time coordinate : 5298 steps


Replies (11)

RE: setgridtype,lonlat error - Added by Abdoulaye SARR about 9 years ago

maybe I add a sample file for folks to help on this urgent problem. How to put this on lonlat type

cheers,

RE: setgridtype,lonlat error - Added by Jaison-Thomas Ambadan about 9 years ago

try,

cdo sinfo -setgrid,r125x100 lffd1998020100.nc

cdo setgridtype (Abort): Unsupported grid name: lonlat

I don't think there is an option "lontat" for setgridtype operator

RE: setgridtype,lonlat error - Added by Jaison-Thomas Ambadan about 9 years ago

I just realized the above solution won't work on your data since your input file is regional - it only works for global grids - sorry!

RE: setgridtype,lonlat error - Added by Jaison-Thomas Ambadan about 9 years ago

Hi,

you could try defining your own grid and use setgrid like,

cat > mygrid << EOF
gridtype  = lonlat
gridsize  = 12500
xname     = lon
xlongname = longitude
xunits    = degrees_east
yname     = lat
ylongname = latitude
yunits    = degrees_north
xsize     = 125
ysize     = 100
xfirst    = -30
xinc      = 0.5
yfirst    = -10
yinc      = 0.5
EOF

cdo sinfo -setgrid,mygrid lffd1998020100.nc

it looks okay but make sure it's correct!

RE: setgridtype,lonlat error - Added by Jaison-Thomas Ambadan about 9 years ago

Hi again,

[ just for your info ] it is better to use appropriate remap operator to remap to lonlat/regular grid using the grid info rather than simply using setgrid (simply using setgrid may lead to incorrect results)

Cheers,
J

RE: setgridtype,lonlat error - Added by Abdoulaye SARR about 9 years ago

Hi Jaison,
Thank you very much, could you clarify a bit the remap part? in which step I don't understand very well. the native resolution of the simulation is 0.44.

Cheers,

RE: setgridtype,lonlat error - Added by Jaison-Thomas Ambadan about 9 years ago

for example,

cdo -remapnn,mygrid -select,name=RAIN_CON,RAIN_GSP,TOT_PREC lffd1998020100.nc out_file.nc

will remap/interpolate your variables to 0.5 regular lon-lat using nearest neighbor method. For more info, please have a look at the CDO doc section 2.12.1 REMAPGRID - SCRIP grid interpolation

https://code.zmaw.de/projects/cdo/embedded/1.6.4/cdo.html#x1-5200002.12.1

RE: setgridtype,lonlat error - Added by Abdoulaye SARR about 9 years ago

Oops, back again,I am haing an error message .

cdo -remapnn,cclmgrid -select,name=RAIN_CON,RAIN_GSP,TOT_PREC /Users/sarr/lffd1998020100.nc essai.nc
cdo remapnn: Started child process "select,name=RAIN_CON,RAIN_GSP,TOT_PREC /Users/sarr/lffd1998020100.nc (pipe1.1)".
cdo remapnn: SCRIP nearest neighbor remapping from curvilinear (125x100) to lonlat (125x100) grid
Segmentation fault: 11

as

RE: setgridtype,lonlat error - Added by Jaison-Thomas Ambadan about 9 years ago

It works fine on my machine. I'm using the latest version (v1.6.7) of CDO. If you are using an older version of CDO, I recommend updating CDO to the latest version.

Neverthless, re-run your command with -v option (ie, cdo -v -remapnn,cclmgrid ...) and post its output here. Also post the output of "cdo -V". It may help the CDO developers to fix the problem if there is any.

Cheers,
J

RE: setgridtype,lonlat error - Added by Abdoulaye SARR about 9 years ago

I am using the current version. I suspect a memory problem on mac. I'll try on a linux box to see if i have the same problem.

    (1-11/11)