|Local forecast by
Degrib and GrADS
Some people are confused here by their old habits of using "gribmap", which
created a control file (.ctl) for GRIB1 files, that they could then load in
GrADS. The problem is that (as far as I know) GrADS doesn't have a gribmap
for GRIB2. To solve this, I could have converted the GRIB2 message to GRIB1, and
then used "gribmap", but that was impractical, since the meta data in GRIB2 has
changed too much for a 1 to 1 mapping to GRIB1. Instead, I convert a message
from GRIB2 to a NxM real * 4 (.flt) file, which GrADS can read, and then I
create the .ctl file myself.
Step 1 Convert a message.
To convert a given message from GRIB2 (or GRIB1) to a ".flt" file, and a
GrADS control file (.ctl):
- In the GUI tkdegrib:
Click on the "GIS" tab, and browse for your file. Double click on it in the
top half, and it should fill out the inventory part in the bottom half.
Select the message that you want in the bottom half, and choose the output
name (or press "Recommend" to have tkdegrib "recommend" one. Next choose
"FLT" for "File Type". Now click on "Create GrADS .ctl file", and decide on
whether you want a coverage grid, by scrolling through the "Grid:" options.
Then press the "Generate .flt file" button at the bottom.
- From the command line:
/degrib/bin/degrib "GRIB file" -C -msg 1 -Flt -Interp -GrADS
/degrib/bin/degrib "GRIB file" -C -msg 1 -Flt -GrADS
where "GRIB file" is replaced with the name of your GRIB file.
This should read the file, and extract the requested messages. The -Flt
option tells it to create the .flt file. The "-GrADS" option
says to create the ".ctl" file. The "-Interp" allows GrADS to work better
since it tells degrib to interpolate the grid to a lat/lon coverage grid,
which saves GrADS from having to do so. See the
"degrib Man Page"
(particularly the "CONVERT OPTIONS" section and the "FLT SPECIFIC OPTIONS")
for more details.
Step 2 Start GrADS
- Click here to go to the
GrADS home page.
- Go to the download page, and get a copy. (I used xwin32 with Cygwin)
- Install the program choosing a directory. (I used d:/cygwin/PCGrADS)
- Start the X Server
- Start Grads (using the PC version)
Step 3 Load data into GrADS
- choose landscape
- open c:/ndfd/degrib16/output/maxt.ctl
- set gxout shaded
- display maxt
Hopefully, in the future, I will convert the entire GRIB2 file to a .flt
like file (probably have to change file extensions to avoid confusion) instead
of just one message at a time. That way GrADS will have all the fields (as it
currently does in GRIB1), the projection will have been done already and
things will be a simple 1 step process.