Project

General

Profile

Conversion of a rotated lat-lon grid to standard equidistant cylindrical lat-lon in GRIB

Added by Remi Montroty over 12 years ago

Dear all,

This is my first post but after thoroughly searching the forum, I did not quite find the answer to my problem.

I have a COSMO file in a rotated lat-lon (unrotated, ie pole is set correctly but Data Representation Type set to 10 instead of 0 in the grib). I wish to convert it to standard equidistant cylindrical but I see I need to pass a target grid to "setgrid".

My question is : how to I obtain that grid description based on my grib file (attached)?

I hope I can do that with CDO since it seems to be the kind of supported grids.

Thanks for any help

Remi


Replies (6)

RE: Conversion of a rotated lat-lon grid to standard equidistant cylindrical lat-lon in GRIB - Added by Uwe Schulzweida over 12 years ago

  1. Create a CDO grid description file of your dataset:
    cdo griddes lfff01000000p > mygrid
    
    Contents of mygrid:
    gridtype  = lonlat
    gridsize  = 154385
    xname     = rlon
    xlongname = longitude in rotated pole grid
    xunits    = degrees
    yname     = rlat
    ylongname = latitude in rotated pole grid
    yunits    = degrees
    xsize     = 401
    ysize     = 385
    xnpole    = -180
    ynpole    = 90
    xfirst    = 26
    xinc      = 0.0625
    yfirst    = -12
    yinc      = 0.0625
    
  2. Remove the lines xnpole/ynpole (and for netCDF output also xname,xlongname,xunits,yname,ylongname,yunits)
  3. Set the new grid description
    cdo setgrid,mygrid lfff01000000p result
    

RE: Conversion of a rotated lat-lon grid to standard equidistant cylindrical lat-lon in GRIB - Added by Remi Montroty over 12 years ago

Uwe, thanks a lot!

That works a charm!
Would it be similar if the pole was indeed rotated to some value?

I do not see any deltaX deltaY description in the resulting Grib file (when looking with wgrib). Is there a way for it to be added automatically from xinc/yinc?

Thanks again

RE: Conversion of a rotated lat-lon grid to standard equidistant cylindrical lat-lon in GRIB - Added by Uwe Schulzweida over 12 years ago

It wouldn't be similar if the pole is rotated because the resulting geographic grid is not an equidistant lon/lat grid!
The deltaX/deltaY is also missing in your input file. That's because GRIB1 has a very poor accuracy of 1/1000 for all
grid description parameters.

RE: Conversion of a rotated lat-lon grid to standard equidistant cylindrical lat-lon in GRIB - Added by Remi Montroty over 12 years ago

I guess what I meant was : can we interpolate a rotated latlon to a cropped grid (the inscribed square for example) that would be an equidistant latlon...?

I know it was missing in the input file, I just wanted to correct it basically during reprojection.

Thanks for your inputs!

RE: Conversion of a rotated lat-lon grid to standard equidistant cylindrical lat-lon in GRIB - Added by Remi Montroty over 12 years ago

Dear all,

It seems I had overlooked an issue : when using the command above (cdo setgrid,mygrid lfff01000000p result), it converts the forecast time of 24h to .. an analysis valid one day later.

Typically the date 2011112300 becomes 2011112400 (since it is a 24h forecast). Is there a way to prevent the overwriting/conversion of the date??

Thanks

RE: Conversion of a rotated lat-lon grid to standard equidistant cylindrical lat-lon in GRIB - Added by Sohrab Kolsoumi over 4 years ago

If you want to convert this for CORDEX data so you can use a free online converter:
[Rotation of Coordinates Based On CORDEX Domains]1.
But if your database is not CORDEX data so you can use [Open NC File]2 for any netcdf data.
In other hands, maybe this link would be useful:
[Can Open NC File to open a NARCCAP NetCDF files]3

[1]: https://agrimetsoft.com/Cordex%20Coordinate%20Rotation.aspx
[2]: https://agrimetsoft.com/how-to-open-nc-file.aspx
[3]: https://agrimetsoft.com/faq/How%20can%20I%20try%20to%20open%20a%20NARCCAP%20NetCDF%20files.aspx
    (1-6/6)