[ncl-talk] Regridding WRF output

Mary Haley haley at ucar.edu
Wed Apr 8 11:20:57 MDT 2015


Raja,

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.

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.

Once you have each weights file, then the regridding happens pretty
quickly, using
the "ESMF_regrid_with_weights" function.

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.

This script does *not* write the variables to a NetCDF. I just didn't have
time to do this.  You can look at the "se2fv_esmf.regrid2file.ncl
<http://www.ncl.ucar.edu/Applications/Scripts/se2fv_esmf.regrid2file.ncl>"
and "se2fv_esmf.regrid2file.ncl_predefine
<http://www.ncl.ucar.edu/Applications/Scripts/se2fv_esmf.regrid2file.ncl_predefine>"
scripts on the same page, which show how to write results to a NetCDF file.

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).
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.

See the attached.

--Mary


On Tue, Apr 7, 2015 at 8:59 AM, Mary Haley <haley at ucar.edu> wrote:

> Raja,
>
> I've started an example script for you and will send it later.  It's based
> on ESMF_regrid_32.ncl on this page:
>
> http://www.ncl.ucar.edu/Applications/ESMF.shtml#ex32
>
> --Mary
>
>
>
> On Tue, Apr 7, 2015 at 1:08 AM, Raja Sivaranjan <
> rajasivaranjan92 at gmail.com> wrote:
>
>>>>  wrfout_d03_2014-10-30_00_00_00
>> <https://docs.google.com/file/d/0B8hsoIO1rKMLTF96UDVObVV2aTg/edit?usp=drive_web>
>> ​​​Hi everyone,
>>
>> 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.
>>
>> Thanks in advance
>> Rajasivaranjan
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150408/c030354a/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: regrid_all_wrfout.ncl
Type: application/octet-stream
Size: 8796 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150408/c030354a/attachment.obj 


More information about the ncl-talk mailing list