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-mem_final

wgrib2: -mem_final


Wgrib2 supports memory files. Memory files are transient and only exist while wgrib2 is running. Memory files can be loaded prior to grib processing by the -mem_init option and writen to disk after grib processing by the -mem_final option. Memory files are rarely used in interactive wgrib2 use.

HPC and CW2

Memory files was designed to support the reading and writing of grib files using CW2 in a HPC environment. Suppose you want to write a grib file with a 1000 grib messages. You let 1000 CPUS encode one grib message each. The encoding CPU may set the RPN register with the grid values. The calling wgrib2 to encode data and write the grib2 message to a memory file. After the call, the memory file can be read and sent to the cpus that are tasked with writing the 1000 grib messages to disk.


-mem_final N FILE
                   FILE=file to write


$ wgrib2 gep19.t00z.pgrb2af180 -mem_final 1 OUT.grb -grib @mem:1
1:0:d=2009060500:HGT:200 mb:180 hour fcst:ENS=+19
2:46042:d=2009060500:TMP:200 mb:180 hour fcst:ENS=+19
The above line reads the file 'gep19.t00z.pgrb2af180' and and writes it to @mem:1. At the end of the grib processing @mem:1 is written to OUT.grb. This example shows the contents of the memory file at the end of the grib processing.

See also: -mem_init

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: July 29, 2016
Disclaimer Privacy Policy