<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Lyndz,<div class=""><br class=""></div><div class="">The command you provided below <i class="">will</i> work to simply convert the file. However, in order to assign “forecast time” as a dimension instead of an attribute, it is necessary to use ncl_convert2nc’s “-ftime” flag:</div><div class=""><font face="Menlo" class="">ncl_convert2nc fcst_phy2m125.1979010100.grb -ftime -u -U time</font></div><div class=""><br class=""></div><div class="">The “-itime” flag also exists for performing the same operation on “initial time” attributes, but given that the file in question is a forecast (“fcst_*.grb”) that might not be necessary or desired in this case:</div><div class=""><font face="Menlo" class="">ncl_convert2nc fcst_phy2m125.1979010100.grb -ftime -itime -u -U time</font></div><div class=""><br class=""></div><div class="">Since you said that you want your forecast time dimension to be unlimited, you would also want to include “-u forecast_time0” in the ncl_convert2nc command:</div><div class=""><font face="Menlo" class="">ncl_convert2nc fcst_phy2m125.1979010100.grb -ftime -u forecast_time0 -U time</font></div><div class=""><br class=""></div><div class="">Note: Running “ncl_convert2nc --help” (with both NCL 6.3.0 and 6.4.0) indicates that “-u” implicitly makes “initial_time” dimensions unlimited for GRIB input files; “forecast time” requires the dimension name to be specified. (The <a href="https://www.ncl.ucar.edu/Document/Tools/ncl_convert2nc.shtml" class="">web documentation</a> for “-u” is not as verbose, but I will make sure that this information is added.)</div><div class=""><br class=""></div><div class="">Also, you could theoretically choose to output the file as a NetCDF 4 classic format file by adding the “-nc4c” flag:</div><div class=""><font face="Menlo" class="">ncl_convert2nc fcst_phy2m125.1979010100.grb -ftime -u forecast_time0 -U time -nc4c</font></div><div class=""><br class=""></div><div class="">I hope this helps,</div><div class="">Kevin</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 8, 2017, at 4:27 AM, Lyndon Mark Olaguera <<a href="mailto:olagueralyndonmark429@gmail.com" class="">olagueralyndonmark429@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class="gmail_signature"><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class=""><div style="font-size:12.8px" class="">Dear NCL experts,</div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">I am trying to convert a grb file to netcdf using ncl_convert2nc. </div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">Attached are the output of ncl_filedump and ncdump -h. The raw file can be accessed </div><div style="font-size:12.8px" class="">here:</div><div style="font-size:12.8px" class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div style="font-size:12.8px" class=""><span style="font-size:12.8px" class=""><a href="https://www.dropbox.com/s/zcsik2tl8qpgjwi/fcst_phy2m125.1979010100?dl=0" class="">https://www.dropbox.com/s/zcsik2tl8qpgjwi/fcst_phy2m125.1979010100?dl=0</a></span><br class=""></div><div style="font-size:12.8px" class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">I am converting the file using the following command:</div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class=""><b class="">ncl_convert2nc fcst_phy2m125.1979010100.grb -u -U time</b><br class=""></div><div style="font-size:12.8px" class=""><b class=""><br class=""></b></div><div style="font-size:12.8px" class="">This is weird because the ncl_filedump has the "initial_time" attibute. Example:</div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class=""><div class="">      float ULWRF_GDS0_SFC_ave3h ( g0_lat_0, g0_lon_1 )</div><div class="">         sub_center :<span class="gmail-m_-3584914191868895001gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>241</div><div class="">         center :<span class="gmail-m_-3584914191868895001gmail-Apple-tab-span" style="white-space:pre-wrap">      </span>Japanese Meteorological Agency - Tokyo (RSMC)</div><div class="">         long_name :<span class="gmail-m_-3584914191868895001gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>Upward long wave radiation flux</div><div class="">         units :<span class="gmail-m_-3584914191868895001gmail-Apple-tab-span" style="white-space:pre-wrap">   </span>W/m^2</div><div class="">         _FillValue :<span class="gmail-m_-3584914191868895001gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>1e+20</div><div class="">         level_indicator :<span class="gmail-m_-3584914191868895001gmail-Apple-tab-span" style="white-space:pre-wrap">   </span>1</div><div class="">         gds_grid_type :<span class="gmail-m_-3584914191868895001gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>0</div><div class="">         parameter_table_version :<span class="gmail-m_-3584914191868895001gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>200</div><div class="">         parameter_number :<span class="gmail-m_-3584914191868895001gmail-Apple-tab-span" style="white-space:pre-wrap">    </span>212</div><div class="">         forecast_time :<span class="gmail-m_-3584914191868895001gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>3</div><div class="">         forecast_time_units :<span class="gmail-m_-3584914191868895001gmail-Apple-tab-span" style="white-space:pre-wrap">   </span>hours</div><div class="">         initial_time :<span class="gmail-m_-3584914191868895001gmail-Apple-tab-span" style="white-space:pre-wrap">      </span>01/01/1979 (00:00)</div></div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">It does not give an error but no "unlimited time" dimension is created:</div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class=""><div class="">determining unlimited dimension dynamically</div><div class="">if   of</div><div class="">Processing file: fcst_phy2m125.1979010100.grb..<wbr class="">.</div><div class=""> Copyright (C) 1995-2017 - All Rights Reserved</div><div class=""> University Corporation for Atmospheric Research</div><div class=""> NCAR Command Language Version 6.4.0</div><div class=""> The use of this software is governed by a License Agreement.</div><div class=""> See <a href="http://www.ncl.ucar.edu/" target="_blank" class="">http://www.ncl.ucar.edu/</a> for more details.</div></div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">Any suggestion on how to do this correctly?</div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">I'll appreciate any help.</div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">Sincerely,</div></div><div class=""><br class=""></div><div class="">Lyndz<br class=""></div></div></div></div></div></div></div></div></div></div></div>
</div>
<span id="cid:CA2B2856-A093-4939-B675-A01895733EA1@planex.in"><file_dump.out></span><span id="cid:776BA5CC-6A57-410B-9D68-F0457195B4FA@planex.in"><ncdump.out></span>_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""></div></blockquote></div><br class=""></div></body></html>