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

wgrib2: -set_int2


The -set_int2 option sets 2 octets to a signed integer value which is commonly used by grib. The integer must range from -32767 to 32767.

-set_int2 I J K
  I = 1..7
  J = 1..(section length-1)
  K = -(2**15-1) .. (2**15-1)
would set 
  Section I, Octet J+0:  if (K >= 0) (K >> 8) & 255
  Section I, Octet J+0:  if (K < 0) ((abs(K) >> 8 ) && 255) | 128
  Section I, Octet J+3:   abs(K) & 255;
 The above is using C syntax.

Multiple integers can be set by making the third argument a colon seperated list.


SECTION=0 .. 7
I-M = Mth integer


See also: -get_int -set_byte -set_hex -set_ieee -set_int

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