Project

General

Profile

help on cdo -f grb setgrid,mygrid cc.nc cc.grb

Added by Gualberto Hernandez over 12 years ago

Hi friends.

I am learning the CDO tool which I find very interesting, I have the following questions, I hope can help me to resolve it.

to convert my file NetCDF to GRIB resulted as follows:

root@ubuntu:/home/toshiba/MM5V3/cdo-1.5.6.1# cdo -f grb copy MMOUT_DOMAIN1.nc MMOUT_DOMAIN1.grb
Warning (cgribexDefGrid) : The CGRIBEX library can not store fields on the used grid
!Error (cgribexDefGrid) : Unsupported grid type: generic

Reading found:
The generic grid type variables Means That Have Either the information grid or not the grid information is not supported in CDO. In Both cases it is not possible to store the data in GRIB format.

And use the following:

root@ubuntu:/home/toshiba/MM5V3/cdo-1.5.6.1# cdo setgrid,n32 MMOUT_DOMAIN1.nc MMOUT_DOMAIN1.grb
cdo setgrid (Warning): No grid with 8192 points found!

Does it mean that the type of projection I chose (n32) is limited and my grid exceeds the limit?
If I choose a different projection n32, for example Lambert, as it should write the following:

cdo setgrid,???? MMOUT_DOMAIN1.nc MMOUT_DOMAIN1.grb

use n32 because it is what comes as an example in the manual but is not as if I want a different call

I'll be awaiting your responses. Thanks for help.

Greetings from Mexico.
Gualberto

Replies (5)

RE: help on cdo -f grb setgrid,mygrid cc.nc cc.grb - Added by Ralf Mueller over 12 years ago

If you want interpolation, use the remap operators. setgrid only changed meta data, but does not do any computation.

BTW: The grid type does not seem to representable in GRIB. You may upload some example data getting this clear.

regards
ralf

RE: help on cdo -f grb setgrid,mygrid cc.nc cc.grb - Added by Gualberto Hernandez over 12 years ago

Dear Ralf,

Post the output of the commands cdo sinfo and cdo griddes. I am currently trying to convert my grid type "Icc2" to "lonlat" so it can be recognized by CDO and to convert my file finally GRIB1.

I am considering the data for mygrid are:

cat > mygrid << EOF
gridtype = lonlat
gridsize = 29651
xname = lon
xlongname = longitude
xunits = degrees_east
yname = lat
ylongname = latitude
yunits = degrees_north
xsize = 199
ysize = 149
xfirst = 0.121
xinc = 0.24
yfirst = 6.48
yinc = 0.24

toshiba@ubuntu:~/MM5V3/cdo-1.5.6.1$ cdo remapbil,mygrid MMOUT_DOMAIN1.nc out.nc
cdo remapbil (Abort): Unsupported grid type: lcc2

Thanks for your help I will be awaiting your comments.

Gualberto

results_cdo_griddes (486 Bytes) results_cdo_griddes cdo sinfo
results_cdo_info (5.16 KB) results_cdo_info cdo sinfo
mygrid (135 Bytes) mygrid mydgri

RE: help on cdo -f grb setgrid,mygrid cc.nc cc.grb - Added by Ralf Mueller over 12 years ago

hm, these lambert grids are somewhat special in CDO. My suggestions are:

  1. The first + last line of your mygrid file should be removed (cat > mygrid << EOF and (EOF)
  2. the value of xfirst some how has a strange encoding. The minus sign seems to have wrong representation, I used od for this:
    [ram@thingol:~]od -c  mygrid                                                                                     [9:10:28|12-08-07]
    0000000   c   a   t       >       m   y   g   r   i   d       <   <    
    0000020   E   O   F  \n   g   r   i   d   t   y   p   e       =       l
    0000040   o   n   l   a   t  \n   x   s   i   z   e                   =
    0000060       3   6   0  \n   y   s   i   z   e                   =    
    0000100   1   8   0  \n   x   f   i   r   s   t               =     342
    0000120 210 222   1   7   9   .   5  \n   x   i   n   c                
    0000140       =       1  \n   y   f   i   r   s   t               =    
    0000160   -   8   9   .   5  \n   y   i   n   c                       =
    0000200       1  \n   E   O   F  \n
    0000207
    
  3. for a first test, try nearest-neighbor interpolation with remapnn:
     cdo remapnn,r360x180 MMOUT_DOMAIN1.nc NN_out.nc
    This will create a global 1deg grid without a separate grid description file
  4. [offtopic] Use -P if you use a multi-core machine
  5. If is still does not work, try gdal or NCL

RE: help on cdo -f grb setgrid,mygrid cc.nc cc.grb - Added by Ralf Mueller over 12 years ago

I rechecked the source code: Lambert Conformal Conic in netcdf representation is excluded from remapping. As far as I remember, you can convert it to GRIB and then it could work.

RE: help on cdo -f grb setgrid,mygrid cc.nc cc.grb - Added by Gualberto Hernandez over 12 years ago

Rafl,

According to what I indicated above I got:

toshiba@ubuntu:~/MM5V3/cdo-1.5.6.1$ cdo remapnn,r360x180 MMOUT_DOMAIN1.nc NN_out.nc
cdo remapnn (Abort): Unsupported grid type: lcc2

In this link you can download my file:

https://dl.dropbox.com/u/96409134/MMOUT_DOMAIN1.nc

I will appreciate any comments from you.

Thanks
Gualberto

    (1-5/5)