<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p></p>
<div>
<p style="margin-bottom: 0in; line-height: 100%">Hi,</p>
<p style="margin-bottom: 0in; line-height: 100%"><br>
</p>
<p style="margin-bottom: 0in; line-height: 100%">It hard to see the grid type by ncdump results. Can you apply Climate Data Operator (CDO)? If yes, you can see the grid coordinates with the sinfo or griddes operators:</p>
<p style="margin-bottom: 0in; line-height: 100%"><br>
</p>
<p style="margin-bottom: 0in; line-height: 100%">cdo sinfo file.nc </p>
<p style="margin-bottom: 0in; line-height: 100%"><br>
</p>
<p style="margin-bottom: 0in; line-height: 100%">cdo griddes file.nc</p>
<p style="margin-bottom: 0in; line-height: 100%"><br>
</p>
<p style="margin-bottom: 0in; line-height: 100%">You can create mygrid file by the following way:</p>
<p style="margin-bottom: 0in; line-height: 100%"><br>
</p>
<pre class="western">cat > mygrid << EOF</pre>
<pre class="western">gridtype =
</pre>
<pre class="western">xsize =
</pre>
<pre class="western">ysize =
</pre>
<pre class="western">xfirst =
</pre>
<pre class="western">xinc =
</pre>
<pre class="western">yfirst =
</pre>
<pre class="western">yinc =
</pre>
<pre class="western" style="margin-bottom: 0.2in">EOF</pre>
<p style="margin-bottom: 0in; line-height: 100%">I hope I could help you.</p>
<p style="margin-bottom: 0in; line-height: 100%"><br>
</p>
<p style="margin-bottom: 0in; line-height: 100%">Beata</p>
</div>
<br>
<p></p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Arunima Singh <arunima@vassarlabs.com><br>
<b>Sent:</b> Monday, February 13, 2017 8:32:49 AM<br>
<b>To:</b> Beáta Szábo-Takács<br>
<b>Cc:</b> Barry Lynn; ncl-talk<br>
<b>Subject:</b> Re: [ncl-talk] How to convert netcdf to grib format</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hi,
<div><br>
</div>
<div>Thanks .</div>
<div>Can you please tell me what to have in mygrid ?</div>
<div><br>
</div>
<div>My netcdf file has following variables : </div>
<div>
<div>netcdf DET_10N20N_76E85E_2016111712 {</div>
<div>dimensions:</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>lat = 81 ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>lon = 73 ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>time = 41 ;</div>
<div>variables:</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>float latitude(lat) ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>latitude:units = "degrees_north" ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>float longitude(lon) ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>longitude:units = "degrees_east" ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>float time(time) ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>time:units = "hours since 2016-11-17 12Z" ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>float \2m_temperature(time, lat, lon) ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>\2m_temperature:units = "C" ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>float \2m_relative_humidity(time, lat, lon) ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>\2m_relative_humidity:units = "%" ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>float mean_sea_level_pressure(time, lat, lon) ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>mean_sea_level_pressure:units = "Pa" ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>float \6hr_accumulated_precip(time, lat, lon) ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>\6hr_accumulated_precip:units = "mm" ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>float \10m_U_wind(time, lat, lon) ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>\10m_U_wind:units = "m/s" ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>float \10m_V_wind(time, lat, lon) ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>\10m_V_wind:units = "m/s" ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>float wind_magnitude(time, lat, lon) ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>wind_magnitude:units = "m/s" ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>float wind_direction(time, lat, lon) ;</div>
<div><span class="gmail-Apple-tab-span" style="white-space:pre"></span>wind_direction:units = "degrees" ;</div>
<div>}</div>
</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Feb 13, 2017 at 12:56 PM, Beáta Szábo-Takács <span dir="ltr">
<<a href="mailto:szabo.b@czechglobe.cz" target="_blank">szabo.b@czechglobe.cz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="HU" link="blue" vlink="purple">
<div class="m_-5894225414625747602WordSection1">
<p class="MsoNormal">Hi, <u></u><u></u></p>
<p class="MsoNormal">According to CDO support:<u></u><u></u></p>
<p class="MsoNormal">The grid type <i>generic</i> means that the variables have either no grid information or the grid information is not supported in CDO.<br>
In both cases it is not possible to store the data in GRIB format. Here is a list of all supported CDO GRIB grid types:<u></u><u></u></p>
<ul type="disc">
<li class="MsoNormal">Latitude/longitude grid<u></u><u></u></li><li class="MsoNormal">Lambert conformal grid<u></u><u></u></li><li class="MsoNormal">Gaussian latitude/longitude grid<u></u><u></u></li><li class="MsoNormal">Rotated latitude/longitude grid<u></u><u></u></li><li class="MsoNormal">Spherical Harmonic Coefficients<u></u><u></u></li><li class="MsoNormal">Icosahedral-hexagonal GME grid<u></u><u></u></li></ul>
<p class="MsoNormal">You have to add the missing grid information with setgrid if there is no grid information in your file and the variables are stored on one of the above grids:<u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">cdo -f grb setgrid,mygrid
<a href="http://cc.nc" target="_blank">cc.nc</a> cc.grb<u></u><u></u></span></p>
<p class="MsoNormal">You can check the grid information of the variables with the CDO function sinfo or griddes.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I hope I could help you.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Beata<u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Arunima Singh [mailto:<a href="mailto:arunima@vassarlabs.com" target="_blank">arunima@vassarlabs.com</a><wbr>]
<br>
<b>Sent:</b> Monday, February 13, 2017 8:16 AM<br>
<b>To:</b> Beáta Szábo-Takács <<a href="mailto:szabo.b@czechglobe.cz" target="_blank">szabo.b@czechglobe.cz</a>><br>
<b>Cc:</b> Barry Lynn <<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>>; ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>></span></p>
<div>
<div class="h5"><br>
<b>Subject:</b> Re: [ncl-talk] How to convert netcdf to grib format<u></u><u></u></div>
</div>
<p></p>
<div>
<div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">I tried cdo - <u></u><u></u></p>
<div>
<p class="MsoNormal">cdo -f grb copy DET_10N20N_76E85E_2016111712.<wbr>nc DET_10N20N_76E85E_2016111712.<wbr>grib<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">but i am getting following error :<u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<p class="MsoNormal">Warning (cgribexDefGrid) : The CGRIBEX library can not store fields on the used grid!<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Error (cgribexDefGrid) : Unsupported grid type: generic<u></u><u></u></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Mon, Feb 13, 2017 at 12:40 PM, Beáta Szábo-Takács <<a href="mailto:szabo.b@czechglobe.cz" target="_blank">szabo.b@czechglobe.cz</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I think you can convert netcdf to grib by CDO. Try the following operator:<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">cdo -f grb copy <a href="http://file.nc" target="_blank">file.nc</a> file.grb<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I hope it helps.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Beata<u></u><u></u></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span></b><u></u><u></u></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">
<a href="mailto:ncl-talk-bounces@ucar.edu" target="_blank">ncl-talk-bounces@ucar.edu</a> [mailto:<a href="mailto:ncl-talk-bounces@ucar.edu" target="_blank">ncl-talk-bounces@ucar.<wbr>edu</a>]
<b>On Behalf Of </b>Arunima Singh<br>
<b>Sent:</b> Monday, February 13, 2017 8:05 AM<br>
<b>To:</b> Barry Lynn <<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>><br>
<b>Cc:</b> ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>><br>
<b>Subject:</b> Re: [ncl-talk] How to convert netcdf to grib format</span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">What i want is netcdf to grib2 format instead of grib to netcdf.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks and Regards,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Arunima Singh<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">On Mon, Feb 13, 2017 at 12:31 PM, Barry Lynn <<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">Hi:<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">I believe you can find the answer here:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="http://www.ncl.ucar.edu/Applications/griball.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Applications/griball.shtml</a><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<div>
<p class="MsoNormal">On Mon, Feb 13, 2017 at 8:56 AM, Arunima Singh <<a href="mailto:arunima@vassarlabs.com" target="_blank">arunima@vassarlabs.com</a>> wrote:<u></u><u></u></p>
</div>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">I have one netcdf file that i want to convert to grib format.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Can we do this conversion with ncl?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">If yes, how?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks and Regards,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Arunima Singh<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Barry H. Lynn, Ph.D<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Senior Lecturer,<u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="color:#888888">The Institute of the Earth Science, <br>
The Hebrew University of Jerusalem, <br>
Givat Ram, Jerusalem 91904, Israel </span><u></u><u></u></p>
</div>
<p class="MsoNormal"><span style="color:#888888">Tel: 972 547 231 170<br>
Fax: (972)-25662581</span><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">C.E.O, Weather It Is, LTD<br>
Weather and Climate Focus<br>
<a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>
Jerusalem, Israel<br>
Local: 02 930 9525<br>
Cell: 054 7 231 170<br>
Int-IS: x972 2 930 9525<br>
US 914 432 3108<u></u><u></u></p>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</body>
</html>