<aname="l00048"></a>00048 <spanclass="comment">/* create new handle from a message in a file*/</span>
<aname="l00049"></a>00049 h = <aname="a1"></a><aclass="code"href="group__grib__handle.html#g5e24f8499aa7e4178ccc25a5de3145c5"title="Create a handle from a file resource.">grib_handle_new_from_file</a>(0,in,&err);
<aname="l00051"></a>00051 printf(<spanclass="stringliteral">"Error: unable to create handle from file %s\n"</span>,filename);
<aname="l00052"></a>00052 }
<aname="l00053"></a>00053
<aname="l00054"></a>00054
<aname="l00055"></a>00055 <spanclass="comment">/* get the size of the values array*/</span>
<aname="l00056"></a>00056 GRIB_CHECK(<aname="a2"></a><aclass="code"href="group__get__set.html#g18b622ed86b24d5e5fcab70c309fc245"title="Get the number of coded value from a key, if several keys of the same name are present...">grib_get_size</a>(h,<spanclass="stringliteral">"values"</span>,&values_len),0);
<aname="l00060"></a>00060 <spanclass="comment">/* get data values*/</span>
<aname="l00061"></a>00061 GRIB_CHECK(<aname="a3"></a><aclass="code"href="group__get__set.html#g61f1029d7f37d51f33835e218d58378a"title="Get double array values from a key.">grib_get_double_array</a>(h,<spanclass="stringliteral">"values"</span>,values,&values_len),0);
<aname="l00062"></a>00062
<aname="l00063"></a>00063 <spanclass="keywordflow">for</span>(i = 0; i < values_len; i++)
<aname="l00069"></a>00069 GRIB_CHECK(<aname="a4"></a><aclass="code"href="group__get__set.html#g5d9eeda38bf59ee3fa9ce3f92e65009e"title="Get a double value from a key, if several keys of the same name are present, the...">grib_get_double</a>(h,<spanclass="stringliteral">"max"</span>,&max),0);
<aname="l00070"></a>00070 GRIB_CHECK(<aclass="code"href="group__get__set.html#g5d9eeda38bf59ee3fa9ce3f92e65009e"title="Get a double value from a key, if several keys of the same name are present, the...">grib_get_double</a>(h,<spanclass="stringliteral">"min"</span>,&min),0);
<aname="l00071"></a>00071 GRIB_CHECK(<aclass="code"href="group__get__set.html#g5d9eeda38bf59ee3fa9ce3f92e65009e"title="Get a double value from a key, if several keys of the same name are present, the...">grib_get_double</a>(h,<spanclass="stringliteral">"average"</span>,&average),0);
<aname="l00072"></a>00072
<aname="l00073"></a>00073 printf(<spanclass="stringliteral">"%d values found in %s\n"</span>,(<spanclass="keywordtype">int</span>)values_len,filename);
<aname="l00076"></a>00076 <aname="a5"></a><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);