Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
HTML
<style type="text/css">
 .paramname {
color: #602020;
	white-space: nowrap;
}
 a.el {
font-weight: bold;
}
 .paramtype {
white-space: nowrap;
}
 .paramkey {
text-align: right;
}
 .memItemLeft {
border-top: 1px solid #C4CFE5;
}
 .memItemRight {
border-top: 1px solid #C4CFE5;
}
 span.comment {
color: #800000
}
 .mdescLeft {
padding: 0px 8px 4px 8px;
	color: #555;
}
 .mdescRight {
padding: 0px 8px 4px 8px;
	color: #555;
}
 span.stringliteral {
color: #002080
}
 .memname {
white-space: nowrap;
        font-weight: bold;
        margin-left: 6px;
}
 .memdoc {
border-bottom: 1px solid #A8B8D9;      
        border-left: 1px solid #A8B8D9;      
        border-right: 1px solid #A8B8D9; 
        padding: 2px 5px;
        background-color: #FBFCFD;
        border-top-width: 0;
        /* opera specific markup */
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
        box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
        /* firefox specific markup */
        -moz-border-radius-bottomleft: 8px;
        -moz-border-radius-bottomright: 8px;
        -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
        background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7);
        /* webkit specific markup */
        -webkit-border-bottom-left-radius: 8px;
        -webkit-border-bottom-right-radius: 8px;
        -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
        background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7));
}
 .memname {
white-space: nowrap;
        font-weight: bold;
        margin-left: 6px;
}
 .memitem {
padding: 0;
	margin-bottom: 10px;
}
 .memproto {
border-top: 1px solid #A8B8D9;
        border-left: 1px solid #A8B8D9;
        border-right: 1px solid #A8B8D9;
        padding: 6px 0px 6px 0px;
        color: #253555;
        font-weight: bold;
        text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
        /* opera specific markup */
        box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
        border-top-right-radius: 8px;
        border-top-left-radius: 8px;
        /* firefox specific markup */
        -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
        -moz-border-radius-topright: 8px;
        -moz-border-radius-topleft: 8px;
        /* webkit specific markup */
        -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
        -webkit-border-top-right-radius: 8px;
        -webkit-border-top-left-radius: 8px;
        background-image:url('nav_f.png');
        background-repeat:repeat-x;
        background-color: #E2E8F2;
}
 .params {
border-spacing: 6px 2px;
}
 span.keywordtype {
color: #604020
}
 span.keywordflow {
color: #e08000
}
 a.code {
color: #4665A2;
}
 pre.fragment {
border: 1px solid #C4CFE5;
	background-color: #FBFCFD;
	padding: 4px 6px;
	margin: 4px 8px 4px 2px;
	overflow: auto;
	word-wrap: break-word;
	font-size:  9pt;
	line-height: 125%;
}
 .fragment {
font-family: monospace, fixed;
	font-size: 105%;
}
 address.footer {
text-align: right;
	padding-right: 12px;
}
 hr.footer {
height: 1px;
}
 div.contents {
margin-top: 10px;
	margin-left: 10px;
	margin-right: 10px;
}
 div.headertitle {
padding: 5px 5px 5px 10px;
}
 div.header {
background-image:url('nav_h.png');
        background-repeat:repeat-x;
	background-color: #F9FAFC;
	margin:  0px;
	border-bottom: 1px solid #C4CFE5;
}
 img.footer {
border: 0px;
	vertical-align: middle;
}
 .exception {
border-spacing: 6px 2px;
}
 span.preprocessor {
color: #806020
}
 div.summary {
float: right;
	font-size: 8pt;
	padding-right: 5px;
	width: 50%;
	text-align: right;
}
 div.navpath {
width: 100%;
	line-height: 140%;
}

</style>
<div class="contents"> 
 <style type="text/css">
<!--
.style1 {color: #FF0000}
-->

 </style> 
 <h2>GRIB section 4, the binary data section</h2> An INTEGER array of at least 42 elements. 
 <p> </p>
 <table border="3"> 
  <caption> 
   <strong>Contents of KSEC4</strong> 
  </caption> 
  <tbody> 
   <tr> 
    <th> Element </th> 
    <th> Contents </th> 
    <th> GRIB API keys<br /> </th> 
   </tr> 
   <tr> 
    <td> 1 </td> 
    <td> Number of data values in array PSEC4 to be encoded or which have been decoded. When the 'A' coding option is used, the count is the number of image bytes stored four to an integer. When the 'B' coding option is used, the count is the number of integers used to return image bytes, stored four to an integer. <p> When a bitmap is used, this number includes the total of both missing and present data values. </p> <p> If this number is negative: </p> 
     <ul>
      <li> the number of field points is -KSEC4(1), </li> 
      <li> the entire field is missing, </li> 
      <li> all values in PSEC4 are 0, </li> 
      <li> the coded data has all the bits of its scale factor are set to 1 </li> 
      <li> all the bits of the exponent and mantissa of its reference value are set to 1 (This is an ECMWF convention). </li> 
     </ul></td> 
    <th style="vertical-align: top;">
     <div align="left"> 
      <p>numberOfPoints</p> 
      <p>numberOfValues</p> 
      <p>numberOfCodedValues</p> 
      <p>numberOfMissing<br /> </p> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 2 </td> 
    <td> Number of bits used for each encoded value. </td> 
    <th style="vertical-align: top;">
     <div align="left"> 
      <p>decimalPrecision</p> 
      <p>bitsPerValue</p> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 3 </td> 
    <td> <pre>Type of data:<br /> 0      Grid point data.<br /> 128    Spherical harmonic coefficients<br /> (Used only if Section 2 is not included when <br /> coding data.)</pre></td> 
    <th style="vertical-align: top;">
     <div align="left">
      <a href="http://www.ecmwf.int/publications/manuals/d/gribapi/keys/grids/">gridType</a>
      <br /> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 4 </td> 
    <td> <pre>Type of packing:<br /> 0       Simple packing.<br /> 64      Complex or second-order packing.<br /></pre> </td> 
    <th style="vertical-align: top;">
     <div align="left">
      packingType =
      <span class="style1"> grid_simple | grid_ieee | spectral_complex | spectral_simple | <br /> spectral_ieee | grid_simple_matrix | grid_second_order | <br /> grid_second_order_different_width | grid_complex | <br /> grid_complex_spatial_differencing | grid_jpeg | grid_png | <br /> grid_simple_log_preprocessing<br /> </span>
      <br /> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 5 </td> 
    <td> <pre>Data representation:<br /> 0       Floating point data.<br /> 32      Integer data.<br /></pre> </td> 
    <th style="vertical-align: top;">
     <div align="left">
      <br /> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 6 </td> 
    <td> <pre>Additional flags indicator:<br /> 0       No additional flags.<br /> 16     Additional flags.<br /></pre> </td> 
    <th style="vertical-align: top;">
     <div align="left">
      <br /> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 7 </td> 
    <td> Reserved. Set to 0. </td> 
    <th style="vertical-align: top;">
     <div align="left">
      <br /> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 8 </td> 
    <td> <pre>Number of values indicator:<br /> 0      Single datum at each grid point.<br /> 64     Matrix of values at each grid point.<br /></pre> </td> 
    <th style="vertical-align: top;">
     <div align="left">
      <br /> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 9 </td> 
    <td> <pre>Secondary bitmaps indicator:<br /> 0      No secondary bitmaps.<br /> 32     Secondary bitmaps present.<br /></pre> </td> 
    <th style="vertical-align: top;">
     <div align="left">
      <br /> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 10 </td> 
    <td> <pre>Values width indicator:<br /> 0      Second order values have constant width.<br /> 16     Second order values have different widths.<br /></pre> </td> 
    <th style="vertical-align: top;">
     <div align="left">
      <br /> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 11 </td> 
    <td> Number of bits for second order values when these have constant width. </td> 
    <th style="vertical-align: top;">
     <div align="left">
      <br /> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 12-15 </td> 
    <td> Reserved for WMO reserved flag fields. Set to 0. </td> 
    <th style="vertical-align: top;">
     <div align="left">
      <br /> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 16 </td> 
    <td> For complex packing, a pointer to the start of packed data values (ie the octet number). Otherwise set to 0. </td> 
    <th style="vertical-align: top;">
     <div align="left">
      <br /> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 17 </td> 
    <td> For complex packing, the scaling factor P, stored as the INTEGER value P*1000 (in the range -10000 to +10000). Otherwise set to 0. </td> 
    <th style="vertical-align: top;">
     <div align="left">
      <br /> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 18 </td> 
    <td> For complex packing, the pentagonal resolution parameter J specifying the truncation of the subset of the data represented as 32-bit floating point numbers (ie not packed). Otherwise set to 0. </td> 
    <th style="vertical-align: top;">
     <div align="left">
      <br /> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 19 </td> 
    <td> For complex packing, the pentagonal resolution parameter K specifying the truncation of the subset of the data represented as 32-bit floating point numbers (ie not packed). Otherwise set to 0. </td> 
    <th style="vertical-align: top;">
     <div align="left">
      <br /> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 20 </td> 
    <td> For complex packing, the pentagonal resolution parameter M specifying the truncation of the subset of the data represented as 32-bit floating point numbers (ie not packed). Otherwise set to 0. </td> 
    <th style="vertical-align: top;">
     <div align="left">
      <br /> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 21 </td> 
    <td> The number of non-missing values in a field which uses a bitmap. <p>When the 'B' coding option is used, this count is the number of image bytes (versions of GRIBEX after 13.040). </p> </td> 
    <th style="vertical-align: top;">
     <div align="left">
      <br /> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 22-33 </td> 
    <td> Reserved. Set to 0. </td> 
    <th style="vertical-align: top;">
     <div align="left">
      <br /> 
     </div></th> 
   </tr> 
   <tr> 
    <td> 34 </td> 
    <td> An offset bit pointer to coded values in the GRIB record. (This is returned by the 'G', 'I' or 'J' decoding options). </td> 
    <th style="vertical-align: top;">
     <div align="left">
      <br /> 
     </div></th> 
   </tr> 
  </tbody> 
 </table>  
 <h2>X decoding option.</h2> Elements 34 to 42 are used only for the 'X' option, which decodes up to 4 values. (See HOPER above). The scanning mode must be from West to East and from North to South. 
 <table border="3"> 
  <caption>
   <strong> KSEC4 - X decoding option </strong>
  </caption>
  <tbody> 
   <tr> 
    <th> Element </th> 
    <th> Contents </th> 
   </tr> 
   <tr> 
    <td> 34 </td> 
    <td> Number of points to be decoded (maximum 4). </td> 
   </tr> 
   <tr> 
    <td> 35 </td> 
    <td> Number of the latitude row of the first value. </td> 
   </tr> 
   <tr> 
    <td> 36 </td> 
    <td> Number of the longitude point of the first value. </td> 
   </tr> 
   <tr> 
    <td> 37 </td> 
    <td> Number of the latitude row of the second value. </td> 
   </tr> 
   <tr> 
    <td> 38 </td> 
    <td> Number of the longitude point of the second value. </td> 
   </tr> 
   <tr> 
    <td> 39 </td> 
    <td> Number of the latitude row of the third value. </td> 
   </tr> 
   <tr> 
    <td> 40 </td> 
    <td> Number of the longitude point of the third value. </td> 
   </tr> 
   <tr> 
    <td> 41 </td> 
    <td> Number of the latitude row of the fourth value. </td> 
   </tr> 
   <tr> 
    <td> 42 </td> 
    <td> Number of the longitude point of the fourth value. </td> 
   </tr> 
  </tbody> 
 </table> 
 <h2>Grid point matrix packing.</h2> For grid point packing, with a matrix of values at each grid point, elements 50 to (50+NC1+NC2) are used as follows: 
 <table border="3"> 
  <caption>
   <strong> KSEC4 - grid matrix packing </strong>
  </caption>
  <tbody> 
   <tr> 
    <th> Element </th> 
    <th> Contents </th> 
   </tr> 
   <tr> 
    <td> 50 </td> 
    <td> First dimension of each matrix (the number of rows). </td> 
   </tr> 
   <tr> 
    <td> 51 </td> 
    <td> Second dimension of each matrix (the number of columns). </td> 
   </tr> 
   <tr> 
    <td> 52 </td> 
    <td> First dimension coordinate values definition. </td> 
   </tr> 
   <tr> 
    <td> 53 </td> 
    <td> Number of coefficients or values used to specify the first dimension coordinate function, NC1. </td> 
   </tr> 
   <tr> 
    <td> 54 </td> 
    <td> Second dimension coordinate values definition. </td> 
   </tr> 
   <tr> 
    <td> 55 </td> 
    <td> Number of coefficients or values used to specify the second dimension coordinate function, NC2. </td> 
   </tr> 
   <tr> 
    <td> 56 </td> 
    <td> First dimension physical significance. </td> 
   </tr> 
   <tr> 
    <td> 57 </td> 
    <td> Second dimension physical significanc. </td> 
   </tr> 
   <tr> 
    <td> 58 - 59 </td> 
    <td> Reserved. Set to 0. </td> 
   </tr> 
  </tbody> 
 </table> 
 <h2>ECMWF use of REALs.</h2> In the WMO specification, the following fields are INTEGER values. ECMWF uses floating-point values for its wave models, so these fields contain REAL values in both input and output. 
 <table border="3"> 
  <caption>
   <strong> KSEC4 - ECMWF use of REALs </strong>
  </caption>
  <tbody> 
   <tr> 
    <th> Elements </th> 
    <th> Contents </th> 
   </tr> 
   <tr> 
    <td> 60 - (59+NC1) </td> 
    <td> Coefficients to define the first dimension coordinate values in functional form, or the explicit coordinate values. </td> 
   </tr> 
   <tr> 
    <td> (60+NC1)-(59+NC1+NC2) </td> 
    <td> Coefficients to define the second dimension coordinate values in functional form, or the explicit coordinate values </td> 
   </tr> 
  </tbody> 
 </table> 
</div>