Project

General

Profile

Error "NetCDF: Numeric conversion not representable" for variable of type unsigned int

Added by Ralf Quast almost 3 years ago

Hi! I type

cdo infon S3B_OL_1_EFR____20190526T093331_20190526T093631_20190527T125903_0179_025_364_2160_LN1_O_NT_002_Germany_000.nc

and obtain the error message

cdf_get_att_int   : ncid = 65536 varid = 34 att = flag_masks val = -2147483648
Error (cdf_get_att_int): NetCDF: Numeric conversion not representable
Error (cdf_close): NetCDF: HDF error

The file is in netCDF-4 format. And there is only one variable, which has a flag_masks attribute:

        uint quality_flags(y, x) ;
                string quality_flags:long_name = "Classification and quality flags" ;
                string quality_flags:coordinates = "lat lon" ;
                string quality_flags:flag_meanings = "land coastline fresh_inland_water tidal_region bright straylight_risk invalid cosmetic duplicated sun_glint_risk dubious saturated_Oa01 saturated_Oa02 saturated_Oa03 saturated_Oa04 saturated_Oa05 saturated_Oa06 saturated_Oa07 saturated_Oa08 saturated_Oa09 saturated_Oa10 saturated_Oa11 saturated_Oa12 saturated_Oa13 saturated_Oa14 saturated_Oa15 saturated_Oa16 saturated_Oa17 saturated_Oa18 saturated_Oa19 saturated_Oa20 saturated_Oa21" ;
                quality_flags:flag_masks = 2147483648U, 1073741824U, 536870912U, 268435456U, 134217728U, 67108864U, 33554432U, 16777216U, 8388608U, 4194304U, 2097152U, 1048576U, 524288U, 262144U, 131072U, 65536U, 32768U, 16384U, 8192U, 4096U, 2048U, 1024U, 512U, 256U, 128U, 64U, 32U, 16U, 8U, 4U, 2U, 1U ;
                string quality_flags:flag_coding_name = "quality_flags" ;
                string quality_flags:flag_descriptions = "" ;

The file is attached. My CDO version is

Climate Data Operators version 1.9.3 (http://mpimet.mpg.de/cdo)
CXX Compiler: g++ -g -O2 -fdebug-prefix-map=/build/cdo-g3Qjnd/cdo-1.9.3+dfsg.1=. -fstack-protector-strong -Wformat -Werror=format-security -fopenmp 
CXX version : g++ (Ubuntu 7.3.0-1ubuntu1) 7.3.0
C Compiler: gcc -g -O2 -fdebug-prefix-map=/build/cdo-g3Qjnd/cdo-1.9.3+dfsg.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -fPIC -fopenmp 
C version : gcc (Ubuntu 7.3.0-1ubuntu1) 7.3.0
F77 Compiler: f77 -g -O2 -fdebug-prefix-map=/build/cdo-g3Qjnd/cdo-1.9.3+dfsg.1=. -fstack-protector-strong
F77 version : unknown
Features: 67GB C++14 Fortran 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.58.0
Filetypes: srv ext ieg grb1 grb2 nc1 nc2 nc4 nc4c nc5 
     CDI library version : 1.9.3
GRIB_API library version : 2.6.0
  NetCDF library version : 4.6.0 of Feb  9 2018 19:21:24 $
    HDF5 library version : library undefined
    EXSE library version : 1.4.0
    FILE library version : 1.8.3

but the error occurrs with newer CDO versions (1.9.9) I tried as well. Could you explain what this error means and why it happens?

Best wishes, Ralf


Replies (2)

RE: Error "NetCDF: Numeric conversion not representable" for variable of type unsigned int - Added by Uwe Schulzweida almost 3 years ago

Hi Ralf,

CDO reads all types of integer less equal 32 bits as a signed 32-bit integer. The present attribute is unsigned 32 bit and the value 2147483648U is out of range of a 32-bit signed integer.
Thanks for the report, we will fix this bug in the next CDO version!

Best wishes,
Uwe

    (1-2/2)