Project

General

Profile

Number of bits per data value = 0!

Added by Yasmin Kaore 2 months ago

Hi all,
I've downloaded reanalysis temperature data from "ERA5 hourly data on single levels from 1940 to present" dataset". Data format is available in GRIB and NetCDF4 (Experimental).
Using the command with the NetCDF4 file, I get some warnings, but it seems to be working fine.
cdo -outputtab,lat,lon,value t2_ERA5.nc > grid_ERA5.csv
cdi warning (cdfInqContents): Coordinates variable number can't be assigned!
cdi warning (cdfInqContents): Coordinates variable expver can't be assigned!

However, if I use the GRIB file. The following errors appeared. Despite the file is created with the latitude and longitude values, the temperature data is set to zero for all grid points.
cdo -outputtab,lat,lon,value t2_ERA5_2.grib > grid2_ERA5.csv
Wrong GRIB indicator section: found ><
GRIB message error
decodeIS : Input data is not GRIB or pseudo-grib.
decodeIS : Return code = 305
decodeBDS_double : Number of bits per data value = 0!
decodeBDS_double : Return code = 2001
cdo copy: Processed 14641 values from 1 variable over 1 timestep [0.02s 42MB]

cdo sinfon t2_ERA5_2.grib
File format : GRIB
-1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter name
1 : ECMWF unknown v instant 1 1 12221 1 P16 : var167
Grid coordinates :
1 : lonlat : points=12221 (101x121)
lon : -60 to -35 by 0.25 degrees_east
lat : 0 to -30 by -0.25 degrees_north
Vertical coordinates :
1 : surface : levels=1
Time coordinate :
time : 1 step
RefTime = 2023-01-01 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
2023-01-01 00:00:00
cdo sinfon: Processed 1 variable over 1 timestep [0.01s 35MB]

I'm using CDO through conda on Windows.
Climate Data Operators version 2.4.1 (https://mpimet.mpg.de/cdo)
System: x86_64-conda-linux-gnu
CXX Compiler: /home/conda/feedstock_root/build_artifacts/cdo_1718276819718/_build_env/bin/x86_64-conda-linux-gnu-c++ -std=gnu++20 -fPIC -DPIC -g -O2 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/ykaore/anaconda3/envs/cdo/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/cdo_1718276819718/work=/usr/local/src/conda/cdo-2.4.1 -fdebug-prefix-map=/home/ykaore/anaconda3/envs/cdo=/usr/local/src/conda-prefix -fopenmp -pthread
CXX version : unknown
CXX library : ranges
C Compiler: /home/conda/feedstock_root/build_artifacts/cdo_1718276819718/_build_env/bin/x86_64-conda-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/ykaore/anaconda3/envs/cdo/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/cdo_1718276819718/work=/usr/local/src/conda/cdo-2.4.1 -fdebug-prefix-map=/home/ykaore/anaconda3/envs/cdo=/usr/local/src/conda-prefix -fopenmp -pthread -pthread
C version : unknown
F77 Compiler: /home/conda/feedstock_root/build_artifacts/cdo_1718276819718/_build_env/bin/x86_64-conda-linux-gnu-gfortran -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/ykaore/anaconda3/envs/cdo/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/cdo_1718276819718/work=/usr/local/src/conda/cdo-2.4.1 -fdebug-prefix-map=/home/ykaore/anaconda3/envs/cdo=/usr/local/src/conda-prefix
F77 version : GNU Fortran (conda-forge gcc 12.3.0-8) 12.3.0
Features: 3GB 8threads c++20 OpenMP45 Fortran pthreads HDF5 NC4/HDF5/threadsafe OPeNDAP udunits2 proj xml2 magics curl fftw3 sse3
Libraries: yac/3.1.0 NetCDF/4.9.2 HDF5/1.14.3 proj/9.4.1 xml2/2.12.7 curl/8.10.0(h8.8.0) magics/4.15.4
CDI data types: SizeType=size_t
CDI file types: srv ext ieg grb1 grb2 nc1 nc2 nc4 nc4c nc5 nczarr
CDI library version : 2.4.1
cgribex library version : 2.2.0
ecCodes library version : 2.37.0
NetCDF library version : 4.9.2 of Jun 6 2024 10:57:38 $
exse library version : 1.5.0
FILE library version : 1.9.1

How could I solve these warnings and error messages? Thanks in advance. Yasmin Kaore.


Replies (5)

RE: Number of bits per data value = 0! - Added by Karin Meier-Fleischer 2 months ago

In the ECMWF documentation (https://confluence.ecmwf.int/display/LDAS/Converting+from+grib+to+netCDF+with+cdo) the '-setgridtype,regular' is used.

cdo -f nc -copy -setgridtype,regular infile.grb infile.nc
cdo -outputtab,lat,lon,value -setgridtype,regular infile.grb > outfile.csv

RE: Number of bits per data value = 0! - Added by Yasmin Kaore 2 months ago

Hi Karin,

Thanks for your prompt reply. I tried the commands you posted, but I still got the same error "Input data is not GRIB or pseudo-grib (Return code = 305)"
cdo -f nc -copy -setgridtype,regular t2_era5.grib test_1.nc
cdo(1) setgridtype: Process started
cdo(1) setgridtype (Warning): No reduced Gaussian grid found!
Wrong GRIB indicator section: found ><
GRIB message error
decodeIS : Input data is not GRIB or pseudo-grib.
decodeIS : Return code = 305

cdi error (decodeIS): GRIB version 7 unsupported!

cdo -outputtab,lat,lon,value -setgridtype,regular t2_era5.grib > outfile.csv
cdo(1) setgridtype (Warning): No reduced Gaussian grid found!
Wrong GRIB indicator section: found ><
cdi error (decodeIS): GRIB version 9 unsupported!

I also tried the commands suggested by the ECMWF documentation. Just an example:
_ cdo -R remapcon,r1600x800 -setgridtype,regular t2_era5.grib teste1.grib_
cdo(1) setgridtype: Process started
cdo(1) setgridtype (Warning): No reduced Gaussian grid found!
Wrong GRIB indicator section: found ><
GRIB message error
decodeIS : Input data is not GRIB or pseudo-grib.
decodeIS : Return code = 305

cdi error (decodeIS): GRIB version 7 unsupported!

RE: Number of bits per data value = 0! - Added by Karin Meier-Fleischer 2 months ago

I guess that the error message cdi error (decodeIS): GRIB version 7 unsupported! tells you what the problem is here.

You wrote that the data file format you are using is experimental. CDO can handle GRIB1 and GRIB2 files, the format used by ECMWF for ERA5 data (https://confluence.ecmwf.int/display/CKB/ERA5%3A+data+documentation#heading-Dataformat).

RE: Number of bits per data value = 0! - Added by Yasmin Kaore 2 months ago

Yes, the NetCDF file is experimental, but the problem was exactly in the GRIB file. I didn't convert the files from NetCDF to GRIB and vice-versa. I downloaded the files separately and took a look at both. The NetCDF file seemed ok. The whole problem was with the GRIB file from the beginning, which had the errors that I mentioned before, and I know that the original format of the files is usually GRIB.

RE: Number of bits per data value = 0! - Added by Estanislao Gavilan about 2 months ago

hi Yasmin,

Are you using near-time data? If you are using data with less than 3months ERA5 might have two subsets of data. You need to select the data that you are interesed. "The latest 3 months in this dataset are made available through ERA5T, which might be slightly different to ERA5. In the downloaded file, an extra dimenions ‘expver’ indicates which data is ERA5 (expver = 1) and which is ERA5T (expver = 5). "

Also, you should know that if the data is very recent the data will be ERA5T. You need to check the value of expver

So using you netcdf file you could do something like

cdo -outputtab,lat,lon,value -sellevel,1 t2_ERA5.nc > grid_ERA5.csv

    (1-5/5)