Preliminary documentation:
GRIBW library:
GRIBW is library for writing GRIB. The library has
GRIB reading routines but I decided I didn't like the name GRIBrw,
so the name stays. The library is written in C and currently
is in beta test and will remain in beta as long as the
documentation is so lacking. (The documentation is sufficient
if you can read C and know GRIB.)
For now, if you want the code, you will be getting a
snapshot of my current working directory. Since the
library is in "beta", I would appreciate all comments.
The location of the code and sample programs/scripts is at
ftp://ftp.cpc.ncep.noaa.gov/wd51we/gribw.
A
real program shows how easy it is to write a grib file.
GRIBW utility:
An version of gribw exists and it functions as the inverse of
wgrib. It expects one argument, a binary file with the gridded data,
and the PDS/GDS data in stdin. For example one could execute,
wgrib gribfile | wgrib gribfile -i -PDS -GDS -o bindump | \
gribw bindump -o gribfile2
and recreate the original gribfile. The format of the PDS/GDS
data is compatible the -PDS, -GDS, -PDS10 and -GDS10 output from
wgrib. The previous example doesn't do any useful work but
illustrates how easy it is to write a GRIB file. All you need is
a binary file (formatted, sequential in UNIX Fortran)
and a text file with the PDS and GDS information.
Uses
Encoding a sequential formatted file in GRIB
Reducing file size by reducing the domain size
Changing the Precision of a GRIB File
Sometimes a GRIB file is stored with more precision than is necessary.
The only disadvantage of too much precision is that the files take
up more space than is necessary. The precision can be changed to
n binary bits by,
wgrib gribfile | wgrib gribfile -i -PDS -GDS -o bindump | \
gribw bindump -o gribfile2 -prec n
comments: Wesley.Ebisuzaki@noaa.gov