<div dir="ltr"><div><div>[I wrote this few days ago but forgot to send it   :-( }<br>---<br>A few random comments:<br><br></div><div>[0] netCDF, HDF and GRIB are machine independent.<br></div><div><br>[1] netCDF and HDF are *file* formats. There are rules for creating these files. Further, well constructed nc/hdf files are totally &#39;self-describing.&#39; Further, the capability of including &#39;file attributes&#39; allows for considerable additional information to be included in each file.<br></div></div><div><br>[2] GRIB is a *record* format not a file format. eg: Each GRIB1 record (&#39;message&#39;) corresponds to a single &#39;horizontal&#39; two-dimensional level. (eg: pressure level) at one instance in time. While sometimes called &#39;self-describing&#39;, users must consult an exterior table to find the variable name and units associated with a particular &#39;parameter Id.&#39;<br><br></div><div>[3] There are no rules for for how to collectively structure groups of grib records. Since there are no rules ... anything goes!!!!  Random record ordering is acceptable!<br><br></div><div>[4] GRIB variables are identified by &#39;parameter IDs&#39;. Parameter IDs through 128 are standardized by the WMO. Parameters above 128 are left up to the data centers.<br><br>===<br></div><div>Some comments by Dave Brown who is most knowledgeable on GRIB (actually, *ALL* file formats)<br><br>&quot;I&#39;m sure there&#39;s more -- new types of data that require new<br>
descriptive items that don&#39;t fit into the original scheme. That was<br>
the motivation for GRIB2, but now there are attempts to backport these<br>
concepts into GRIB1. Examples include more complex statistical<br>
variables -- averages of averages, for example. Also types of data<br>
that require new types of dimensions, such as particle size and<br>
wavelength for atmospheric chemical constituents.<br>
<br>
Anyway, it just takes a lot of monitoring and continuous development<br>
to keep up with changes  --- not to mention that we have never<br>
supported the full specification -- it would be very difficult without<br>
having example files that use particular features.<br>
<br>
Of course NCL sorts the records pretty well usually.&quot;<br><br>==============<br><br></div><div>Like, I said, GRIB is a moving target !!!<br><br></div><div>Cheers<br></div><div>D<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 24, 2017 at 1:18 PM, HAVENER, KEVIN F GS-12 USAF ACC 14 WS/WXED <span dir="ltr">&lt;<a target="_blank" href="mailto:kevin.havener@us.af.mil">kevin.havener@us.af.mil</a>&gt;</span> wrote:<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">Well, I may be wrong on this, too.  But couldn&#39;t you read in a netcdf with python-netcdf4 and write it back out with pygrib?  The complexity you mention is still there, but you might be able to make a reasonable grib file with pygrib.  Also CDO should be able to do the trick.  But either way, creating grib correctly files is a tricky business.<br>
<span class="gmail-HOEnZb"><font color="#888888"><br>
Kevin Havener<br>
</font></span><div class="gmail-HOEnZb"><div class="gmail-h5"><br>
-----Original Message-----<br>
From: <a href="mailto:ncl-talk-bounces@ucar.edu">ncl-talk-bounces@ucar.edu</a> [mailto:<a href="mailto:ncl-talk-bounces@ucar.edu">ncl-talk-bounces@ucar.<wbr>edu</a>] On Behalf Of Alan Brammer<br>
Sent: Friday, February 24, 2017 3:04 PM<br>
To: debasish mazumder &lt;<a href="mailto:debasish@ucar.edu">debasish@ucar.edu</a>&gt;<br>
Cc: <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
Subject: Re: [ncl-talk] NETCDF to GRIB<br>
<br>
Grib files are center specific so are not something that the average user can generate from scratch.  They rely on codes and underlying tables, hence the many emails regarding new variables in forecast files that NCL struggles to read until such tables are updated.<br>
<br>
Existing Grib files are fairly easy to manipulate yourself, using grib_tools from ecmwf among other options and you can concatenate the files together to make large single files. But you can’t, with any tool I believe, create a grib file a netcdf however due to the basic nature of the files.<br>
<br>
I may be wrong on this and maybe something is out there that can force a way around.<br>
<br>
<br>
&gt; On 24 Feb 2017, at 12:25, debasish mazumder &lt;<a href="mailto:debasish@ucar.edu">debasish@ucar.edu</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi All,<br>
&gt;<br>
&gt; Is there any way in NCL to convert netcdf (.nc) file to grib (.grb)<br>
&gt; file or can I write a grib file in NCL<br>
&gt;<br>
&gt; with regards<br>
&gt;<br>
&gt; -Deb<br>
&gt;<br>
&gt; ______________________________<wbr>_________________<br>
&gt; ncl-talk mailing list<br>
&gt; <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
&gt; List instructions, subscriber options, unsubscribe:<br>
&gt; <a target="_blank" rel="noreferrer" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br>
______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a target="_blank" rel="noreferrer" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a target="_blank" rel="noreferrer" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
</div></div></blockquote></div><br></div></div>