Project

General

Profile

CDO conversion from netcdf to grib2

Added by Giorgio Ghiggini about 3 years ago

Hi,

I am new of the cygwin64 as well as of the cdo tool.

I am trying to convert a netcdf file into grib2 with the following command

cdo -f grb2 copy test.nc test.grib2

But I am getting the following error.

ECCODES ERROR : Unable to load sample file GRIB2.tmpl
in /usr/local/share/eccodes/samples

Error (gribHandleNew): grib_handle_new_from_samples failed!

I tried installing several cygwin dependences but getting the same error.
Any help is appreciated.
Giorgio


Replies (4)

RE: CDO conversion from netcdf to grib2 - Added by Giorgio Ghiggini about 3 years ago

I have solved following these instruction found in the wiki
"Unfortunately the GRIB1/2 library eccodes does not work with only the dll file - You need the download and extract the source-tarball from here and set the environment variable ECCODES_DEFINITION_PATH to the definitions subdirectory of the extracted source code with its full absolute path. Don't forget to make that persistent by adding to your favourite shell config file (.bashrc, .zshrc, .cshrc or so). This is a detailed description how to do this."

RE: CDO conversion from netcdf to grib2 - Added by Ralf Mueller about 3 years ago

hi!

CDO can now be installed with the setup.exe from cygwin directly. for grib2, make sure you install libeccodes-devel for full grib2 support

cheers
ralf

RE: CDO conversion from netcdf to grib2 - Added by Kyle Lesinger about 3 years ago

Also I would check out gdal. There appears to be documentation for this conversion https://stackoverflow.com/questions/17403928/convert-grib-to-netcdf-file.

RE: CDO conversion from netcdf to grib2 - Added by Ralf Mueller almost 3 years ago

cdo is now an official cygwin package. you dont need to do this by hand anymore https://sourceware.org/pipermail/cygwin-announce/2021-May/010059.html

    (1-4/4)