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 > wgrib2-grid_def

wgrib2: -grid_def


Sometimes wgrib2 does not know the locations of the grid points. Perhaps the wgrib2 code needs to be updated with routines to calculate the locations of the grid points. Perhaps the grid is unstructured and the locations are given on some web pages. The option, -grid_def, is for these cases. If the field has a the name LAUV, LAPP or NLAT, the field is copied to the lat[] variable within wgrib2. If the field is named LOUV, LOPP or ELON, the field is copied ot the lon[] variable within wgrib2. Once the lat[] and lon[] arrays are defined, wgrib2 then knows the location of the grid points. There are two caveats. First, the lat[] and lon[] arrays are erased on detecting a new grid definition. Second, wgrib2 normally works in double precision for the lat/lon calculations. By obtaining the lat/lon from the grib data, you are working in single precision.


 $ wgrib2 IN.grb -grib_def (rest of command line)

See also:

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: Jan 4, 2017
Disclaimer Privacy Policy