Project

General

Profile

Netcdf to grib1 error

Added by Russell Glazer almost 10 years ago

Hello,
I am trying to convert a Netcdf file to grib1 so I use 'cdo -f grb copy ...' and the command executes fine but when I go to look at the created grib1 file it was not correctly converted.

executing the command:
cdo -f grb copy sstatlantic_addhifreq.nc sstatlantic_addhifreq.grb
cdo copy: Processed 3648004 values from 1 variable over 1 timestep ( 0.08s )

when I look at the grb file I get errors like this:

./g1print.exe ../../../inputdata/OSTIA/sstatlantic_addhifreq.grb
Copen: File = ../../../inputdata/OSTIA/sstatlantic_addhifreq.grb zâÕö
Fortran Unit = 4810080
UNIX File descriptor: 3

----------------------------------------------------
rec GRIB GRIB Lvl Lvl Lvl Time Fcst
Num Code name Code one two hour
----------------------------------------------------
End-of-record mark (7777) not found-479881758
Sec0(1) = 8479809 0
1 11 1 0 0 2010-09-08_00:00 + 00
  • stopping in findgrib in gribcode ***
I could not find the GRIB string in the input file
after testing the first 100,000 bytes.
The file may be corrupt or it is not a GRIB file.
Perhaps a gzipped GRIB file or netcdf?

Warning: ieee_inexact is signaling
findgrib


Replies (7)

RE: Netcdf to grib1 error - Added by Russell Glazer almost 10 years ago

I have successfully done this file conversion for a smaller file. Is it possible I am running into issues when the netcdf file is big? Is there a solution to this?

RE: Netcdf to grib1 error - Added by Russell Glazer almost 10 years ago

I still have this problem when converting a large netcdf file to grib1, is there no one that can help?

RE: Netcdf to grib1 error - Added by Ralf Mueller almost 10 years ago

If you're on windows, there is a 2GB limit, when the pre-built binary cdo.exe is used. You can avoid this by compiling it yourself within the cygwin environment

RE: Netcdf to grib1 error - Added by Ralf Mueller almost 10 years ago

Or you split your large file into smaller chunks e.g. with splitcode and process each of them separately.

RE: Netcdf to grib1 error - Added by Ralf Mueller almost 10 years ago

have you tried the ncl package? http://www.ncl.ucar.edu/Download/list_of_binaries.shtml

There seems to be a version for cygwin, too. NCL has a converter script (ncl_convert2nc), which might work.

RE: Netcdf to grib1 error - Added by Russell Glazer almost 10 years ago

If I was exceeding a 2GB limit shouldn't there be an error message when I do the command? I get no error at that point.

RE: Netcdf to grib1 error - Added by Ralf Mueller almost 10 years ago

Yes, there should be something posix-io related shown here. I didn't say, this has to be your kind of error. I just realised, that you're using windows executable and as long as these are note compiled manually, they have their limitation.

If the only difference between your two (large and small) netcd finput files is the number of timesteps or the gridsize, then this might be an error in CDO. Otherwise, the netcdf file might just not be possible to be fully converted to grib1.

My first try would be to select the first timestep only to get a small file. If this does not get converted correctly, then the file size is not the problem.

    (1-7/7)