Skip Navigation Links 
NOAA logo - Click to go to the NOAA home page National Weather Service   NWS logo - Click to go to the NWS home page
Climate Prediction Center

About Us
   Our Mission
   Who We Are

Contact Us
   CPC Information
   CPC Web Team

HOME > Monitoring_and_Data > Oceanic and Atmospheric Data > Reanalysis: Atmospheric Data > grb2grid (gis)

WARNING: alpha code - testing version - comments wanted


Grb2grid takes (NCEP) GRIB-1 files and makes ascii grid files for GIS.

The program should not be confused with the the GRIB2GRID package found in the ERSI Support Center. was born because a River Forecast Center (RFC) user wanted to use some NARR (North America Regional Reanalysis) data. That's good news because they were a target user of NARR. However the user lacked experience with GRIB files and really wanted the data in a GIS format. Real bad news when people who could benefit from NARR can't read the files. So either half your potential users will have to learn to read grib or a conversion utility would have to be written.

Warning: I don't have access to a GIS and I had to bother a coworker down the hall to test out the program. Don't expect answers to any GIS question. Odds are in your favor that you know more about GIS that I (WNE) do.

Warning: This program may never be formally released. The of program is attractive and perhaps this program uses a better approach.


  2. copygb on your path
  3. wgrib on your path
  4. Perl
  5. linux (i86)

Linux is listed as a requirement because copygb is distributed as a linux only program. Sure copygb will run on other platforms but porting large fortran packages by non-fortran users was ruled "cruel and unusual punishment" in a recent Supreme Court (US) ruling and may violate Article Five of the Universal Declaration of Human Rights (rest of the world).

How the program works

On the command line, you invoke the program with the name of the input grib file and the parameters for a "raster file" (lat-lon grid). The script then runs copygb to create a new grib file for the specified lat-lon grid. The program then runs wgrib to write the grid point values to the ascii grid file.


From the command prompt, type

You should see a help page with a list of the required parameters.


  1. Want to port code to another machine? See requirements.
  2. Want to run under windows? See requirements.
  3. GIS question? Not here.

Sounds harsh but porting code is time comsuming and requires some one who knows the local machine and is experienced (someone once asked me about the various compiler options for a machine that I've never seen) and I'm a GIS novice (I saw my coworker read in a grid file, and make a pretty plot).


The GRIB-2 format is going to replace GRIB-1. So what happens to the GIS users? Good news is that the guts of the program (copygb, wgrib) have GRIB-2 counterparts. So writing a grib-2 version shouldn't be that difficult.

Comparison of grb2grid and GRIB2GRID

The GRIB2GRID package is a AML and GrADS script. The guts of the conversion is done by GrADS. The input file has to be readable by GrADS and must use an xdef and ydef which are linear. The program is not restricted to GRIB which is nice. As the comments suggest "many improvements possible".

Grb2grid only works with grib files but will accept grids that are not supported by grib2grid such as Mercator, Gaussian and some model grids. In addition, grb2grid will make subregions at the user-specified resolution. The script will convert an entire grib file but requires copygb which is only supported in linux.

Comments:, updated 5/1/2006

NOAA/ National Weather Service
National Centers for Environmental Prediction
Climate Prediction Center
5830 University Research Court
College Park, Maryland 20740
Climate Prediction Center Web Team
Page last modified: May 15, 2005
Disclaimer Privacy Policy