<div dir="ltr"><div class="gmail_default" style="font-size:small">Raja,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I took the ESMF_regrid_32.ncl script, and modified it so it would regrid every variable on the file that has a "coordinates" attribute that contains one of "XLAT XLONG", "XLAT_U XLONG_U" and "XLAT_V XLONG_V". Since these three grids are of different sizes, you have to create three separate weights files, in order to properly regrid each variable.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You should look at "create_weights_file". This is the code that creates each weights file. I used an interpolation method of "bilinear" and regridded to a "0.10deg" grid. You can change this code if you want to use a different interpolation method or different lat/lon grid to regrid to.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Once you have each weights file, then the regridding happens pretty quickly, using</div><div class="gmail_default" style="font-size:small">the "ESMF_regrid_with_weights" function.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Note that because this was only one time step, I didn't make the script to handle the case where you might have multiple timesteps, and hence would need a different weights file for each time step *if* the lat/lon grids changed for each time step.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif">This script does *not* write the variables to a NetCDF. I just didn't have time to do this. You can look at the "<a href="http://www.ncl.ucar.edu/Applications/Scripts/se2fv_esmf.regrid2file.ncl">se2fv_esmf.regrid2file.ncl</a>" and "<a href="http://www.ncl.ucar.edu/Applications/Scripts/se2fv_esmf.regrid2file.ncl_predefine">se2fv_esmf.regrid2file.ncl_predefine</a>" scripts on the same page, which show how to write results to a NetCDF file.</font></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif">For debugging purposes, this script creates a plot of each regridded variable, if it is 2D, 3D, or 4D. It only creates a plot of the first timestep (if applicable) and first level (if applicable).</font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif">The PDF file can get quite large, so you may want to change this to "x11" just to see what it looks like. Also, some of the variables are constant, so the plot may fail.</font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif">See the attached.</font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif">--Mary</font></div><div class="gmail_default" style="font-size:small"><b><br></b></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 7, 2015 at 8:59 AM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Raja,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I've started an example script for you and will send it later. It's based on ESMF_regrid_32.ncl on this page:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/ESMF.shtml#ex32" target="_blank">http://www.ncl.ucar.edu/Applications/ESMF.shtml#ex32</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Apr 7, 2015 at 1:08 AM, Raja Sivaranjan <span dir="ltr"><<a href="mailto:rajasivaranjan92@gmail.com" target="_blank">rajasivaranjan92@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><br><div class="gmail_chip gmail_drive_chip" style="width:396px;min-height:18px;max-height:18px;background-color:#f5f5f5;padding:5px;color:#222;font-family:arial;font-style:normal;font-weight:bold;font-size:13px;border:1px solid #ddd;line-height:1"><a href="https://docs.google.com/file/d/0B8hsoIO1rKMLTF96UDVObVV2aTg/edit?usp=drive_web" style="display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;padding:1px 0px;border:none;width:100%" target="_blank"><img style="vertical-align:bottom;border:none" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png"> <span dir="ltr" style="color:#15c;text-decoration:none;vertical-align:bottom">wrfout_d03_2014-10-30_00_00_00</span></a></div>Hi everyone,<div><br></div><div>I need re-sample the wrf orutput which is in 9*8 km resolution to 10*10 km resolution. How to re-sample all the wrf ouput variables with NCL? Need your help.</div><div><br></div><div>Thanks in advance</div><div>Rajasivaranjan</div><div><br></div></div>
<br></div></div>_______________________________________________<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>
</blockquote></div><br></div>