Project

General

Profile

grib to netcdf error

Added by Marston Ward almost 12 years ago

Hi,

I have some model data in grib that I'm trying to convert to netcdf using the commands:

g2nc='cdo -f nc -R -t ecmwf copy and cdo -f nc -R -t ecmwf sp2gpl
and CDO version:
cdo -V
Climate Data Operators version 1.5.4 (http://code.zmaw.de/projects/cdo)
Compiler: icc -std=gnu99 -g -O2 -pthread
version: Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 12.1.0.233 Build 20110811
with: PTHREADS NC4 OPeNDAP Z PROJ.4
Compiled: by kent on gimle (x86_64-unknown-linux-gnu) Feb 15 2012 17:28:39
CDI library version : 1.5.4 of Feb 15 2012 17:28:32
CGRIBEX library version : 1.5.1 of Aug 29 2011 20:30:27
netCDF library version : 4.1.2 of Jun 29 2011 23:15:07 $
HDF5 library version : 1.8.7
SERVICE library version : 1.3.0 of Feb 15 2012 17:28:26
EXTRA library version : 1.3.0 of Feb 15 2012 17:28:22
IEG library version : 1.3.0 of Feb 15 2012 17:28:24
FILE library version : 1.7.1 of Feb 15 2012 17:28:22

Some a subet of the file returns the error:

Error (cdf_put_vara_double) : NetCDF: Numeric conversion not representable
cdf_put_vara_double : ncid = 65536 varid = 51 val0 = 0.000000

While the rest seem to work smoothly. The file sizes doesn't show any indication of corruption.
Can someone explain this error, please?

/M


Replies (4)

RE: grib to netcdf error - Added by Ralf Mueller almost 12 years ago

Try adding -b to the conversion call. It sets the output precision. cdo -h tells you more about the possible values for this option.

RE: grib to netcdf error - Added by Jaison-Thomas Ambadan almost 12 years ago

Can you please upload a sample of your original GRIB file?

Cheers,
J.

RE: grib to netcdf error - Added by Jaison-Thomas Ambadan almost 12 years ago

Yes, I think Ralf's suggestion should work for you: try "-b F64" for 64-bit floating point precision

Cheers,
J.

RE: grib to netcdf error - Added by Marston Ward almost 12 years ago

Hi J and Ralf,

The grib files are several gigs but I found one that is small enough to upload.
I tried the following command:

cdo -b F64 -f nc -R -t ecmwf copy ICMGGECE3+000000 ICMGGECE3+000000.nc
and it works great!

I'm puzzled as to why it fails on some files but not all?
Why is it that F32 fails but F64 works?
Are the other files that got converted without the -b F64 command corrupted in some way or truncated?

Much obliged,
/M

ICMGGECE3_000000 (41.9 MB) ICMGGECE3_000000 Grib file
    (1-4/4)