Page tree

GRIB-API support is being discontinued at the end of 2018. Please consider upgrading to ecCodes


Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 19 Next »

<div class="contents">
<h2><a class="anchor" id="new"></a> New</h2>
<ul>
<li><a href="/publications/manuals/grib_api/conversion.html">GRIB edition 1 to 2 conversion</a></li>
<li><a href="/publications/manuals/d/gribapi/param/">Parameters in GRIB API</a></li>
<li><b> GRIB API keys </b>
<ul>
<li><a href="/publications/manuals/d/gribapi/fm92/grib1/">GRIB edition 1 </a></li>
<li><a href="/publications/manuals/d/gribapi/fm92/grib2/">GRIB edition 2 </a></li>
<li><a href="/publications/manuals/d/gribapi/keys/">Edition independent</a></li>
</ul> </li>
</ul>
<h2><a class="anchor" id="overview"></a> Overview</h2>
<p>The <a class="el" href="namespacegrib__api.html" title="Module grib_api.">grib_api</a> is the application program interface developed at ECMWF to provide an easy and realiable way for encoding and decoding WMO FM-92 GRIB <a href="http://www.wmo.ch/pages/prog/www/WMOCodes/Manual/WMO306_vol-I-2-PartB-GRIB1.pdf">edition 1</a> and <a href="http://www.wmo.ch/pages/prog/www/DPS/grib-2.html">edition 2</a> messages.</p>
<p>With the <a class="el" href="namespacegrib_api.html" title="Module grib_api.">grib_api</a> library, that is written entirely in C, some command line <a class="el" href="tools.html">tools</a> are provided to give a quick way to manipulate grib data. Moreover a <a class="el" href="namespacegrib_api.html">Fortran interface 90</a> is available giving access to the main features of the C library.</p>
<p>The library is designed to access and modify messages in both editions with the same <a class="el" href="group_get_set.html">function calls</a> using a set of <a class="el" href="keys.html">Grib API keys</a> to access the coded information ( examples: <a class="el" href="get_8f90-example.html">get.f90</a> <a class="el" href="set_8f90-example.html">set.f90</a>, <a class="el" href="get_8c-example.html">get.c</a>, <a class="el" href="set_8c-example.html">set.c</a>, <a class="el" href="grib_get.html#grib_get_examples">grib_get</a>, <a class="el" href="grib_set.html#grib_set_examples">grib_set</a> ).</p>
<p>The <a class="el" href="keys.html">keys</a> available for a message are different depending not only on the edition but also and mainly on the type of each message and the information it contains. A list of all the available keys in a message can be obtained dynamically using the library as shown in <a class="el" href="keys_iterator_8c-example.html">keys_iterator.c</a> or using the <a class="el" href="tools.html">Grib tools</a> as shown in <a class="el" href="grib_dump.html#grib_dump_examples">grib_dump</a> or grib_keys.</p>
<p>GRIB API will replace the GRIBEX function and a <a href="/publications/manuals/grib_api/gribexkeys/callGribex.html">table of conversion</a> between the numeric encoding of GRIBEX and the alphanumeric keys of GRIB API is provided to help the migration.</p>
<p>To learn how to use the <a class="el" href="namespacegrib__api.html" title="Module grib_api.">grib_api</a> we recommend the user works through the <a class="el" href="grib_examples.html">Grib API examples</a>.</p>
<p>Reference manuals are also provided for the C library (organized in <a class="el" href="modules.html">C interface</a>) and for the <a class="el" href="namespacegrib__api.html">Fortran 90 interface</a>.</p>
<p><a class="el" href="installation.html">Installation</a> instructions are also provided.</p>
<h2><a class="anchor" id="ecwf_users"></a> Compiling and linking on ECMWF platforms</h2>
<p>The grib API is installed on all systems at ECMWF with both its components: the library and the tools.<br /> The latest version of the tools is always available in the system PATH so that users can begin using the tools immediately by typing directly the tool name (<a class="el" href="tools.html">see tools reference</a>).<br /> The latest version of the library is also installed on any platform and it is available for linking through the following two environment variables: $GRIB_API_INCLUDE $GRIB_API_LIB.<br /> <br /> Here is a short summary on how to compile and link on ECMWF systems:<br /> </p>
<ul>
<li>ecgate, hpce, hpcf
<div class="fragment">
<pre class="fragment">
> xlc -o foo foo.c $GRIB_API_INCLUDE $GRIB_API_LIB -lm
</pre>
</div> <br />
<div class="fragment">
<pre class="fragment">
> xlf90 -o foo foo.f90 $GRIB_API_INCLUDE $GRIB_API_LIB
</pre>
</div><br /> </li>
<li>linux cluster (C programs)
<div class="fragment">
<pre class="fragment">
> gcc -m32 -o foo foo.c $GRIB_API_INCLUDE $GRIB_API_LIB
</pre>
</div> <br /> </li>
<li>workstation (C programs)
<div class="fragment">
<pre class="fragment">
> gcc -o foo foo.c $GRIB_API_INCLUDE $GRIB_API_LIB
</pre>
</div> <br /> </li>
<li>linux cluster,workstation (Fortran programs)
<div class="fragment">
<pre class="fragment">
> use pgf90
> pgf90 -o foo foo.f90 $GRIB_API_INCLUDE $GRIB_API_LIB
</pre>
</div><br /> </li>
</ul>
</div>

  • No labels