[ncl-talk] Regridding WRF corvilinear grid to gpm rain rectlinear grid

Mary Haley haley at ucar.edu
Mon Dec 4 11:32:45 MST 2017


[I'm reposting this because my original post had an attachment over 2 MB
and I had to reject my own post!]

It always helps to look at things graphically if the regridding is not
working. Also, you really need to look more closely at your data, because
several time steps had all constant data.

I'm not sure what you are saying is wrong about the regridding.

I have a template for creating a panel plot of original data and regridded
data, so I used this on your data.

There are some things to note:

[1] Your regridded data is in a smaller area than the original data, so
obviously you cannot fully regrid the original data.

[2] You probably don't want to use bilinear interpolation to regrid
precipitation data.  "Conserve" might be a better match.

[3] For some of your time steps, the rain data is all constant.

To check if it was constant across all time steps, I created an animation.
I then realized that your precipitation data is very sparse and most of the
"interesting" parts are happening outside the area that you are regridding
to, so this makes for several plots that are all one color. I then decided
to try regridding temperature instead, to make sure things were working.

----

See the attached trial_mod.ncl, which is your regridding script with
plotting added. This script regrids temperature instead of precipitation.
As you can see from one of the PNGs that I attached (the GIF animation was
too large to attach), the regridding appears to be working.

If you try to regrid rain, you will see that the plot is not very
interesting. This is because I haven't made the effort to pick better
levels for precipitation.  You can take this script and modify it for your
own purposes.

--Mary



On Mon, Dec 4, 2017 at 9:58 AM, Mary Haley <haley at ucar.edu> wrote:

> Ronald,
>
> It always helps to look at things graphically if the regridding is not
> working. Also, you really need to look more closely at your data, because
> several time steps had all constant data.
>
> I'm not sure what you are saying is wrong about the regridding.
>
> I have a template for creating a panel plot of original data and regridded
> data, so I used this on your data.
>
> There are some things to note:
>
> [1] Your regridded data is in a smaller area than the original data, so
> obviously you cannot fully regrid the original data.
>
> [2] You probably don't want to use bilinear interpolation to regrid
> precipitation data.  "Conserve" might be a better match.
>
> [3] For some of your time steps, the rain data is all constant.
>
> To check if it was constant across all time steps, I created an animation.
> I then realized that your precipitation data is very sparse and most of the
> "interesting" parts are happening outside the area that you are regridding
> to, so this makes for several plots that are all one color. I then decided
> to try regridding temperature instead, to make sure things were working.
>
> See the attached trial_mod.ncl, which is your regridding script with
> plotting added. This script regrids temperature instead of precipitation.
> As you can see from the attached animation, the regridding appears to be
> working.
>
> If you try to regrid rain, you will see that the plot is not very
> interesting. This is because I haven't made the effort to pick better
> levels for precipitation.  You can take this script and modify it for your
> own purposes.
>
> --Mary
>
>
> On Mon, Dec 4, 2017 at 12:55 AM, Ronald Opio <opioronald123 at gmail.com>
> wrote:
>
>> Hello Dennis.
>>
>> I have tried this and am still experiencing the same problem. No change
>> is happening to the file I want to re-grid.
>>
>> Please have a look at it and see. I have attached the wrf file as a
>> google drive link plus the script am using and the GPM rainfall file (
>> precip.nc).
>>
>> My intention is to regrid the wrf file so that it has the same dimensions
>> as the precip file.
>>
>> Please help out.
>>
>> Sincerely,
>>
>> Ronald.​
>>  wrf.nc
>> <https://drive.google.com/file/d/1DEV9Kdp3VRH-7oHtBjNfvqhdyvY-9ABj/view?usp=drive_web>
>>>>
>> On Wed, Nov 29, 2017 at 7:34 PM, Dennis Shea <shea at ucar.edu> wrote:
>>
>>> regridding:   I am not sure what you mean by:
>>>   "It runs well, however, when I check the file after, I find that the
>>> WRF file still remains with its original grid size."
>>>
>>> ===
>>> *The original file is never overwritten*.
>>> ===
>>> Suggestion:
>>>     rain = r1 + r2     ; all meta data is lost
>>>     rain at long_name = "Total Rain"              ; whatever
>>>     rain at units = r1 at units
>>>     copy_VarCoords(r1, rain)
>>>
>>> ---
>>>    raingrid = ESMF_regrid(rain,Opt) ; Regrid "rain" to new grid
>>>    printVarSummary(raingrd)
>>>
>>>
>>>
>>>
>>>
>>> On Wed, Nov 29, 2017 at 8:14 AM, Barry Lynn <barry.h.lynn at gmail.com>
>>> wrote:
>>>
>>>> Hi:
>>>>
>>>> Do you mean how to make single maps, or do you mean how to turn a pdf
>>>> or pngs into a gif?
>>>>
>>>> On Wed, Nov 29, 2017 at 2:52 PM, Ronald Opio <opioronald123 at gmail.com>
>>>> wrote:
>>>>
>>>>> Thank you Barry. Let me give this a try.
>>>>>
>>>>> Could you be having a script for animating total precipitation in this
>>>>> way https://www.youtube.com/watch?v=SW1rA-M6l4s ?
>>>>>
>>>>> If so, please share with me.
>>>>>
>>>>> Sincerely,
>>>>>
>>>>> Ronald.
>>>>>
>>>>> On Wed, Nov 29, 2017 at 2:24 PM, Barry Lynn <barry.h.lynn at gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Dear Ronald:
>>>>>>
>>>>>> I have used regrid to regrid to both the original WRF grid and a more
>>>>>> sparse grid.  However, its main task is to regrid to the original grid in
>>>>>> rectilinear coordinates (unless you tell it otherwise).
>>>>>>
>>>>>> You can interpolate from a fine grid to a coarse grid using the
>>>>>> programs available (e.g., area_hi2lores_Wrap).
>>>>>>
>>>>>> Please see lines 320,386 in the program attached (that calculates
>>>>>> frontogenesis).  In this program, I used a more sparse version of the WRF
>>>>>> grid as the destination grid. If you are going to use a grid from a
>>>>>> different data set, then it would be best if the new grid will be smaller
>>>>>> than the WRF grid (so you don't interpolate zeros).
>>>>>>
>>>>>> Barry
>>>>>>
>>>>>> On Wed, Nov 29, 2017 at 11:16 AM, Ronald Opio <
>>>>>> opioronald123 at gmail.com> wrote:
>>>>>>
>>>>>>> Hello colleagues.
>>>>>>>
>>>>>>> I am trying to regrid my WRF output file so as to match the gpm
>>>>>>> rainfall data set grid, however the script is not working.
>>>>>>>
>>>>>>> I am using ESMF_regrid function. It runs well, however, when I check
>>>>>>> the file after, I find that the WRF file still remains with its original
>>>>>>> grid size.
>>>>>>>
>>>>>>> Please help me out. What could the problem be?
>>>>>>>
>>>>>>> I have attached the script herein.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Ronald.
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> ncl-talk mailing list
>>>>>>> ncl-talk at ucar.edu
>>>>>>> List instructions, subscriber options, unsubscribe:
>>>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Barry H. Lynn, Ph.D
>>>>>> Senior Lecturer,
>>>>>> The Institute of the Earth Science,
>>>>>> The Hebrew University of Jerusalem,
>>>>>> Givat Ram, Jerusalem 91904, Israel
>>>>>> Tel: 972 547 231 170
>>>>>> Fax: (972)-25662581
>>>>>>
>>>>>> C.E.O, Weather It Is, LTD
>>>>>> Weather and Climate Focus
>>>>>> http://weather-it-is.com
>>>>>> Jerusalem, Israel
>>>>>> Local: 02 930 9525
>>>>>> Cell: 054 7 231 170
>>>>>> Int-IS: x972 2 930 9525
>>>>>> US 914 432 3108 <(914)%20432-3108>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Barry H. Lynn, Ph.D
>>>> Senior Lecturer,
>>>> The Institute of the Earth Science,
>>>> The Hebrew University of Jerusalem,
>>>> Givat Ram, Jerusalem 91904, Israel
>>>> Tel: 972 547 231 170
>>>> Fax: (972)-25662581
>>>>
>>>> C.E.O, Weather It Is, LTD
>>>> Weather and Climate Focus
>>>> http://weather-it-is.com
>>>> Jerusalem, Israel
>>>> Local: 02 930 9525
>>>> Cell: 054 7 231 170
>>>> Int-IS: x972 2 930 9525
>>>> US 914 432 3108 <(914)%20432-3108>
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> ncl-talk at ucar.edu
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>>>
>>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> 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/20171204/47932389/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trial_mod.ncl
Type: application/octet-stream
Size: 3899 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171204/47932389/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrf_to_rect_t2m.000036.png
Type: image/png
Size: 74675 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171204/47932389/attachment-0001.png>


More information about the ncl-talk mailing list