Project

General

Profile

misleading error message and compiling challenges

Added by Brian Højen-Sørensen almost 7 years ago

Hi,

I have a GRIB file which has both GRIB1 and GRIB2 parameters in it. I have attached an extract from it with just two parameters (one of each).
I'm using an Ubuntu 17.04 (testing) and an Ubuntu 14.04 LTS (production server).
The CDO installation on the 14.04 system (which is the one it needs to work on) is old and doesn't support GRIB2 and the reduced gaussian grid at all, so I'm trying to compile a version that can handle the files.

Using the repository version of CDO on my Ubuntu 17.04 system I have no issues with the file so I know it should work.

REPO_VERSION: cdo --version
Climate Data Operators version 1.7.2 (http://mpimet.mpg.de/cdo)
Compiler: gcc -g -O2 -fdebug-prefix-map=/build/cdo-_3ondG/cdo-1.7.2+dfsg.1=. -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -fPIC -fopenmp
version: gcc (Ubuntu 6.2.1-5ubuntu1) 6.2.1 20161124
Features: DATA PTHREADS OpenMP45 HDF5 NC4/HDF5/threadsafe OPeNDAP SZ UDUNITS2 PROJ.4 MAGICS CURL FFTW3 SSE2
Libraries: HDF5/1.10.0 proj/4.93 curl/7.52.1(h7.51.0)
Filetypes: srv ext ieg grb grb2 nc nc2 nc4 nc4c
CDI library version : 1.7.2
GRIB_API library version : 2.0.2
NetCDF library version : 4.4.1.1 of Nov 29 2016 17:35:36 $
HDF5 library version : library undefined
SERVICE library version : 1.4.0
EXTRA library version : 1.4.0
IEG library version : 1.4.0
FILE library version : 1.8.2

So I compiled a version which is up to date and where all packages are at least as new (with patch for eccodes instead of grib_api)

COMPILED_VERSION: cdo --version
Climate Data Operators version 1.8.2 (http://mpimet.mpg.de/cdo)
Compiler: gcc -DPIC -fPIC -fopenmp
version: gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
Features: DATA PTHREADS OpenMP45 HDF5 NC4/HDF5 OPeNDAP SZ UDUNITS2 PROJ.4 CURL SSE2
Libraries: HDF5/1.10.1 proj/4.93 curl/7.54.1
Filetypes: srv ext ieg grb1 grb2 nc1 nc2 nc4 nc4c
CDI library version : 1.8.2 of Jun 29 2017 14:46:03
CGRIBEX library version : 1.7.6 of Dec 20 2016 19:55:24
GRIB_API library version : 2.3.0
NetCDF library version : 4.4.1.1 of Jun 29 2017 14:23:59 $
HDF5 library version : 1.10.1
SERVICE library version : 1.4.0 of Jun 29 2017 14:45:57
EXTRA library version : 1.4.0 of Jun 29 2017 14:45:55
IEG library version : 1.4.0 of Jun 29 2017 14:45:56
FILE library version : 1.8.3 of Jun 29 2017 14:45:55

Buth with this version CDO still fails with the following message (on both systems):

cdo sinfo mixed_grb
Error (decodeIS) : GRIB version 2 unsupported!

but the repository version gives (as expected):

cdo sinfo mixed_grb
File format : GRIB
-1 : Institut Source Steptype Levels Num Points Num Dtype : Parameter ID
1 : ECMWF unknown instant 1 1 6599680 1 P12 : 151.128
2 : ECMWF unknown instant 1 1 6599680 1 P16 : 19.1.0
Grid coordinates :
1 : gaussian reduced : points=6599680 nlat=2560 np=1280
lat : 89.94619 to -89.94619 degrees_north
Vertical coordinates :
1 : surface : levels=1
Time coordinate : 1 step
RefTime = 2017-06-27 00:00:00 Units = hours Calendar = proleptic_gregorian
YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss
2017-06-27 09:00:00
cdo sinfo: Processed 2 variables over 1 timestep ( 0.87s )

Then I tried to test whether GRIB2 is actually working. So I converted all parameters to GRIB2 (with the working CDO) using: cdo -f grb2 copy mixed_grb outfile_grb2
Then I tried with the newly compiled CDO again and to my surprise it works fine if file is only GRIB2:

cdo sinfo outfile_grb2
File format : GRIB2
-1 : Institut Source Steptype Levels Num Points Num Dtype : Parameter ID
1 : ECMWF unknown instant 1 1 6599680 1 P12 : 151.128
2 : ECMWF unknown instant 1 1 6599680 1 P16 : 19.1.0
Grid coordinates :
1 : gaussian reduced : points=6599680 nlat=2560 np=1280
lat : 89.94619 to -89.94619 degrees_north
Vertical coordinates :
1 : surface : levels=1
Time coordinate : 1 step
RefTime = 2017-06-27 00:00:00 Units = hours Calendar = proleptic_gregorian
YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss
2017-06-27 09:00:00
cdo sinfo: Processed 2 variables over 1 timestep ( 0.52s )

So now I'm stuck. I have a compiled version with all packages up to date that support GRIB2 and the gaussian grid as long as the file is GRIB2 only. And I have a repository version (that's a bit older) that works with the mixed file as well. The differences in the build (MAGICS, FFTW3, and threadsafe) should not influence this in any way I can imagine.

Does anyone have an idea on how I can build a working version of CDO (I have tried many combinations of packages with the same result)?

Kind regards
Brian Højen-Sørensen

mixed_grb (22 MB) mixed_grb mixed GRIB1/GRIB2 file
outfile_grb2 (22 MB) outfile_grb2 converted to GRIB2 only

Replies (2)

RE: misleading error message and compiling challenges - Added by Uwe Schulzweida almost 7 years ago

Hi Brian,

To make it short, you have to disable the CDO internal GRIB1 decoder/encoder. In this case the GRIB_API is used to decode/encode also GRIB1 messages:

./configure --disable-cgribex --with-grib_api=....

Cheers,
Uwe

RE: misleading error message and compiling challenges - Added by Brian Højen-Sørensen almost 7 years ago

Hi Uwe,

Thanks a lot, that was exactly what was needed.

Cheers,
Brian

    (1-2/2)