<div dir="ltr"><div class="gmail_default" style="font-size:small">I don&#39;t know anything about the DSSAT format, but to see how to read WRF variables, visit the NCL/WRF pages:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style><a href="http://www.ncl.ucar.edu/Applications/wrf.shtml">http://www.ncl.ucar.edu/Applications/wrf.shtml</a><br></div><div class="gmail_default" style><br></div><div class="gmail_default" style>Any one of these links shows various ways for reading data from a WRF file. </div><div class="gmail_default" style><br></div><div class="gmail_default" style>As a quick example, you can either read a variable directly:</div><div class="gmail_default" style><br></div><div class="gmail_default" style><font face="monospace, monospace">a     = addfile(&quot;<a href="http://wrfout_xxxxx.nc">wrfout_xxxxx.nc</a>&quot;,&quot;r&quot;)</font></div><div class="gmail_default" style><font face="monospace, monospace">rainc = a-&gt;RAINC</font></div>







<div class="gmail_default" style><br></div><div class="gmail_default" style>&quot;rainc&quot; will contain all the data and the metadata.</div><div class="gmail_default" style><br></div><div class="gmail_default" style>or you can use the &quot;wrf_user_getvar&quot; function, which calculates specific diagnostics by reading required WRF variables and doing the specified calculation.</div><div class="gmail_default" style><br></div><div class="gmail_default" style><a href="http://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_getvar.shtml">http://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_getvar.shtml</a></div>







<div class="gmail_default" style><br></div><div class="gmail_default" style>If you want to stay in the Python world, then you can use PyNIO to read a WRF output variable.  The syntax is different than NCL:</div><div class="gmail_default" style><br></div><div class="gmail_default" style><font face="monospace, monospace">import Nio as nio</font></div><div class="gmail_default" style><font face="monospace, monospace">a     = nio.open_file(&quot;<a href="http://wrfout_xxxx.nc">wrfout_xxxx.nc</a>&quot;)</font></div><div class="gmail_default" style><font face="monospace, monospace">rainc = a.variables[&#39;</font><span style="font-family:monospace,monospace">RAINC</span><font face="monospace, monospace">&#39;]      # this is a NioVariable with metadataT[:] to access values</font></div><div class="gmail_default" style><div class="gmail_default"><font face="monospace, monospace"># rainc = a.variables[&#39;</font><span style="font-family:monospace,monospace">RAINC</span><font face="monospace, monospace">&#39;][:]  # this is a numpy array with the actual values. </font></div><div><font face="monospace, monospace"><br></font></div></div><div class="gmail_default" style>You can learn more about PyNIO at <a href="http://www.pyngl.ucar.edu/Nio.shtml">http://www.pyngl.ucar.edu/Nio.shtml</a></div><div class="gmail_default" style><br></div><div class="gmail_default" style>There may be some WRF PyNIO/PyNGL examples at: <a href="http://www.pyngl.ucar.edu/Nio.shtml">http://www.pyngl.ucar.edu/gallery.shtml</a></div><div class="gmail_default" style>I can&#39;t check at the moment because the NCAR websites are down due to semi-annual maintenance.</div><div class="gmail_default" style><br></div><div class="gmail_default" style>--Mary</div><div class="gmail_default" style><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 13, 2015 at 5:15 AM, Raja Sivaranjan <span dir="ltr">&lt;<a href="mailto:rajasivaranjan92@gmail.com" target="_blank">rajasivaranjan92@gmail.com</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">Dear all,<div><br></div><div>I need to prepare weather file for DSSAT model from wrf output. Rainfall, Min and Max temperature, solar radiation and weed speed are variable i need to extract. I&#39;m using python for handling netcdf file which very difficult to work with big file. I did some coding to convert wrf output to DSSAT weather file format. Now i want to learn NCL, since it is more powerful to work with nc files.</div><div><br></div><div>Below are the things i need to do in NCL:</div><div><br></div><div>1. Extract variables such as  Rainfall, Min and Max Temperature, solar radiation and weed speed for required time</div><div>2. Write the extracted variable in DSSAT format.</div><div><br></div><div>Things i have done in python:</div><div><br></div><div>1. convert wrfnc to excel</div><div>2. excel to Dssat format.<br></div><div><br></div><div>Can anyone help me out in this.</div><div><br></div><div><br></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>