Project

General

Profile

an issue related to the longitude dimension when converting GRIB1 to Netcdf

Added by Delei Li almost 10 years ago

Hello, Dear all

I am trying to convert a file with GRIB1 format to netcdf format. However, the converted file has a wrong longitude dimension when using cdo command.
If I use ncl_convert2nc command, no problem with the longitude dimension. Does anyone know what's problem with cdo, how could I get a right longitude dimension using cdo?
The command I used are:
cdo -R -f nc copy -invertlat -sellonlatbox,180.,-180.,-90.,90. tmp.grb tmp_cdo.nc
ncl_convert2nc tmp.grb
The data are attached as tmp.grb tmp_cdo.nc and tmp.nc
Thanks very much in advance for your help.

Regards,
Delei

tmp.grb (790 KB) tmp.grb GRIB data
tmp.nc (3.91 MB) tmp.nc ncl_convert2nc
tmp_cdo.nc (5.48 MB) tmp_cdo.nc cdo

Replies (2)

RE: an issue related to the longitude dimension when converting GRIB1 to Netcdf - Added by Uwe Schulzweida almost 10 years ago

Hello Delei,

Thanks for this report! This is definitely a bug in the GRIB library of CDO. We will fix this problem in the next release.

The last copy in your CDO call is not necessary:

cdo -R -f nc invertlat -sellonlatbox,180.,-180.,-90.,90. tmp.grb tmp_cdo.n
As a workaround you can overwrite the grid information with setgrid,t213grid:
cdo -R -f nc invertlat -sellonlatbox,180.,-180.,-90.,90. -setgrid,t213grid tmp.grb tmp_cdo.nc
Cheers, Uwe

RE: an issue related to the longitude dimension when converting GRIB1 to Netcdf - Added by Delei Li almost 10 years ago

Dear Uwe,

Thanks very much for your help. The result is quite good.
The shift of t213grid from the original grid is little and can be ignored.

Regards,
Delei

    (1-2/2)