Where clause. Grib messages are processed only if they match all the key/value constraints. A valid constraint is of type key=value or key!=value. For each key a string (key:s) or a double (key:d) or a long (key:l) type can be specified. Default type is string. <br>
<br>
-M <br>
Multi-grib support off. Turn off support for multiple fields in single grib message <br>
<br>
-7 <br>
Does not fail when the message has wrong length <br>
<br>
-V <br>
Version. <br>
<br>
-G <br>
GRIBEX compatibility mode. <br>
<br>
<h2><aclass="anchor"name="grib_dump_examples">
grib_dump examples</a></h2>
<oltype=1>
<li>To dump in a WMO documentation style with hexadecimal octet values (-H)<br>
h = <aclass="code"href="group__grib__handle.html#gadefac64c19fb5ff06cf805ad4af06ff"title="Create a handle from a message contained in a samples directory.">grib_handle_new_from_samples</a>(NULL,<spanclass="stringliteral">"GRIB1"</span>);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"editionNumber"</span>,1),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"table2Version"</span>,128),0);
<spanclass="comment">/* 98 = European Center for Medium-Range Weather Forecasts (grib1/0.table) */</span>
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"centre"</span>,98),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"generatingProcessIdentifier"</span>,130),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"gridDefinition"</span>,255),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"section1Flags"</span>,128),0);
<spanclass="comment">/* 167 = 2 metre temperature (K) (grib1/2.98.128.table) */</span>
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"indicatorOfParameter"</span>,167),0);
<spanclass="comment">/* 1 = Surface (of the Earth, which includes sea surface) (grib1/3.table) */</span>
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"indicatorOfTypeOfLevel"</span>,1),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"level"</span>,0),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"yearOfCentury"</span>,8),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"month"</span>,2),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"day"</span>,6),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"hour"</span>,12),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"minute"</span>,0),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"unitOfTimeRange"</span>,1),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"P1"</span>,0),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"P2"</span>,0),0);
<spanclass="comment">/* 0 = Forecast product valid at reference time + P1 (P1>0) (grib1/5.table) */</span>
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"timeRangeIndicator"</span>,0),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"numberIncludedInAverage"</span>,0),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"numberMissingFromAveragesOrAccumulations"</span>,0),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"centuryOfReferenceTimeOfData"</span>,21),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"subCentre"</span>,0),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"decimalScaleFactor"</span>,0),0);
<spanclass="comment">/* 1 = MARS labelling or ensemble forecast data (grib1/localDefinitionNumber.98.table) */</span>
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"localDefinitionNumber"</span>,1),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"marsClass"</span>,1),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"marsType"</span>,2),0);
<spanclass="comment">/* 1025 = Atmospheric model (mars/stream.table) */</span>
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"marsStream"</span>,1025),0);
p = <spanclass="stringliteral">"0001"</span>;
size = strlen(p)+1;
GRIB_CHECK(<aclass="code"href="group__get__set.html#g78143cc64571b454b0aba14246e9a53a"title="Set a string value from a key.">grib_set_string</a>(h,<spanclass="stringliteral">"experimentVersionNumber"</span>,p,&size),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"perturbationNumber"</span>,0),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"numberOfForecastsInEnsemble"</span>,0),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"numberOfVerticalCoordinateValues"</span>,0),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"pvlLocation"</span>,255),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"dataRepresentationType"</span>,0),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"Ni"</span>,16),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"Nj"</span>,31),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"latitudeOfFirstGridPoint"</span>,60000),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"longitudeOfFirstGridPoint"</span>,0),0);
<spanclass="comment">/* 128 = 10000000</span>
<spanclass="comment"> (1=1) Direction increments given</span>
<spanclass="comment"> (2=0) Earth assumed spherical with radius = 6367.47 km</span>
<spanclass="comment"> (5=0) u and v components resolved relative to easterly and northerly directions</span>
<spanclass="comment"> See grib1/7.table */</span>
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"resolutionAndComponentFlags"</span>,128),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"latitudeOfLastGridPoint"</span>,0),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"longitudeOfLastGridPoint"</span>,30000),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"iDirectionIncrement"</span>,2000),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"jDirectionIncrement"</span>,2000),0);
<spanclass="comment">/* 0 = 00000000</span>
<spanclass="comment"> (1=0) Points scan in +i direction</span>
<spanclass="comment"> (2=0) Points scan in -j direction</span>
<spanclass="comment"> (3=0) Adjacent points in i direction are consecutive </span>
<spanclass="comment"> See grib1/8.table */</span>
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"scanningMode"</span>,0),0);
<spanclass="comment">/* ITERATOR */</span>
<spanclass="comment">/* NEAREST */</span>
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"bitsPerValue"</span>,16),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"sphericalHarmonics"</span>,0),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"complexPacking"</span>,0),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"integerPointValues"</span>,0),0);
GRIB_CHECK(<aclass="code"href="group__get__set.html#g94c33cfe90c3aa887fb8e14f0bd87fe2"title="Set a long value from a key.">grib_set_long</a>(h,<spanclass="stringliteral">"additionalFlagPresent"</span>,0),0);
<spanclass="comment">/* gribSection5 */</span>
<spanclass="comment">/* Save the message */</span>
f = fopen(argv[1],<spanclass="stringliteral">"w"</span>);
<spanclass="keywordflow">if</span>(!f) {
perror(argv[1]);
exit(1);
}
GRIB_CHECK(<aclass="code"href="group__handling__coded__messages.html#g9d654bd4fc5f422c161edd0a140ea185"title="getting the message attached to a handle">grib_get_message</a>(h,&buffer,&size),0);
<aclass="code"href="group__grib__handle.html#g0e4b2585f22247c49b930c1579257677"title="Frees a handle, also frees the message if it is not a user message.">grib_handle_delete</a>(h);
<spanclass="keywordflow">return</span> 0;
}
</pre></div><br>
</li></ol>
<hrsize="1"><addressstyle="text-align: right;"><small>Generated on Tue Sep 22 15:18:22 2009 for grib_api by