<div dir="ltr"><div><div>If you want a time dimension<br><br>%&gt; ncl_convert2nc  aod.2014100400.grb -itime<br><br></div><div>or, more elaborate, change NCL&#39;s dimension name<br><br>%&gt; ncl_convert2nc aod.2014100400.grb -itime -u initial_time0_hours -U time<br></div><div><br></div><div>Ignore any warning message .. not important<br></div><div><br></div>%&gt; ncdump -h <a href="http://aod.2014100400.nc">aod.2014100400.nc</a><br><br><br>etcdf aod.2014100400 {<br>dimensions:<br>        time = UNLIMITED ; // (1 currently)<br>        lat_0 = 181 ;<br>        lon_0 = 360 ;<br>        ncl_strlen_0 = 18 ;<br>variables:<br>        float AOTK_P48_GLL0(time, lat_0, lon_0) ;<br>                AOTK_P48_GLL0:forecast_time_units = &quot;hours&quot; ;<br>                AOTK_P48_GLL0:forecast_time = 0 ;<br>                AOTK_P48_GLL0:parameter_template_discipline_category_number = 48, 0, 20, 102 ;<br>                AOTK_P48_GLL0:parameter_discipline_and_category = &quot;Meteorological products, Atmospheric chemical constituents&quot; ;<br>                AOTK_P48_GLL0:grid_type = &quot;Latitude/longitude&quot; ;<br>                AOTK_P48_GLL0:_FillValue = 1.e+20f ;<br>                AOTK_P48_GLL0:units = &quot;Numeric&quot; ;<br>                AOTK_P48_GLL0:long_name = &quot;Aerosol optical thickness&quot; ;<br>                AOTK_P48_GLL0:production_status = &quot;Operational products&quot; ;<br>                AOTK_P48_GLL0:center = &quot;US National Weather Service - NCEP (WMC)&quot; ;<br>        double time(time) ;<br>                time:units = &quot;hours since 1800-01-01 00:00&quot; ;<br>                time:long_name = &quot;initial time&quot; ;<br>        double initial_time0_encoded(time) ;<br>                initial_time0_encoded:units = &quot;yyyymmddhh.hh_frac&quot; ;<br>                initial_time0_encoded:long_name = &quot;initial time encoded as double&quot; ;<br>        float lat_0(lat_0) ;<br>                lat_0:La1 = 90.f ;<br>                lat_0:Lo1 = 0.f ;<br>                lat_0:La2 = -90.f ;<br>                lat_0:Lo2 = 359.f ;<br>                lat_0:Di = 1.f ;<br>                lat_0:Dj = 1.f ;<br>                lat_0:units = &quot;degrees_north&quot; ;<br>                lat_0:grid_type = &quot;Latitude/Longitude&quot; ;<br>                lat_0:long_name = &quot;latitude&quot; ;<br>        float lon_0(lon_0) ;<br>                lon_0:La1 = 90.f ;<br>                lon_0:Lo1 = 0.f ;<br>                lon_0:La2 = -90.f ;<br>                lon_0:Lo2 = 359.f ;<br>                lon_0:Di = 1.f ;<br>                lon_0:Dj = 1.f ;<br>                lon_0:units = &quot;degrees_east&quot; ;<br>                lon_0:grid_type = &quot;Latitude/Longitude&quot; ;<br>                lon_0:long_name = &quot;longitude&quot; ;<br>        char initial_time0(time, ncl_strlen_0) ;<br>                initial_time0:NCL_converted_from_type = &quot;string&quot; ;<br>                initial_time0:units = &quot;mm/dd/yyyy (hh:mm)&quot; ;<br>                initial_time0:long_name = &quot;Initial time of first record&quot; ;<br><br>// global attributes:<br>                :creation_date = &quot;Wed Oct  8 13:35:24 MDT 2014&quot; ;<br>                :NCL_Version = &quot;6.2.0&quot; ;<br>                :system = &quot;Darwin <a href="http://sheamac.cgd.ucar.edu">sheamac.cgd.ucar.edu</a> 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64&quot; ;<br>                :Conventions = &quot;None&quot; ;<br>                :grib_source = &quot;aod.2014100400.grb&quot; ;<br>                :title = &quot;NCL: convert-GRIB-to-netCDF&quot; ;<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 8, 2014 at 12:41 PM, Partha Bhattacharjee <span dir="ltr">&lt;<a href="mailto:pbhatta2@jhu.edu" target="_blank">pbhatta2@jhu.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>​Thanks Dave. It worked. <br>
</p>
<p><br>
</p>
<p>Partha<br>
</p>
<div style="color:rgb(33,33,33)">
<hr style="display:inline-block;width:98%">
<div dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>From:</b> David Brown &lt;<a href="mailto:dbrown@ucar.edu" target="_blank">dbrown@ucar.edu</a>&gt;<br>
<b>Sent:</b> Wednesday, October 8, 2014 2:29 PM<br>
<b>To:</b> Partha Bhattacharjee<br>
<b>Cc:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
<b>Subject:</b> Re: [ncl-talk] Write grib2 to netcdf</font>
<div> </div>
</div><div><div class="h5">
<div>
<div dir="ltr">If you use ncl_filedump on your GRIB2 file you will see that it has no time dimension. There is only a lat and a lon dimension. The script you are using is trying to read a time dimension that does not exist -- therefore the error. The simplest
 and most general way to convert any GRIB file to NetCDF is to use the script ncl_convert2nc, which is supplied with every NCL installation. If the &#39;ncl&#39; binary is in your PATH then ncl_convert2nc will be as well, assuming you have a standard installation.
<div> -dave<br>
<div>
<div>
<p><br>
</p>
</div>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Oct 8, 2014 at 10:41 AM, Partha Bhattacharjee <span dir="ltr">
&lt;<a href="mailto:pbhatta2@jhu.edu" target="_blank">pbhatta2@jhu.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>​Forgot to add information about my earlier question. I am using NCL 6.2.1. <br>
</p>
<p><br>
</p>
<p>Partha<br>
</p>
<div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<hr style="display:inline-block;width:98%">
<div dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>From:</b>
<a href="mailto:ncl-talk-bounces@ucar.edu" target="_blank">ncl-talk-bounces@ucar.edu</a> &lt;<a href="mailto:ncl-talk-bounces@ucar.edu" target="_blank">ncl-talk-bounces@ucar.edu</a>&gt; on behalf of Partha Bhattacharjee &lt;<a href="mailto:pbhatta2@jhu.edu" target="_blank">pbhatta2@jhu.edu</a>&gt;<br>
<b>Sent:</b> Wednesday, October 8, 2014 11:39 AM<br>
<b>To:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
<b>Subject:</b> [ncl-talk] Write grib2 to netcdf</font>
<div> </div>
</div>
<span>
<div>
<p>I was using slightly modified form of an example in NCL page <a href="https://www.ncl.ucar.edu/Applications/gribeff.shtml" title="https://www.ncl.ucar.edu/Applications/gribeff.shtml
Ctrl+click or tap to follow link" target="_blank">https://www.ncl.ucar.edu/Applications/gribeff.shtml</a>
 to convert grib2 file to netcdf. However, ncl cannot read the time information from input grib2 file and stops where &quot;initial_time​&quot; is mentioned. Grib2 file and ncl code are attached. Any help is appreciated. <br>
</p>
<p><br>
</p>
<p> Thanks.<br>
</p>
<p> Partha<br>
</p>
</div>
</span></div>
</div>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div></div></div>
</div>

<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>