[ncl-talk] WRF Domain plot: Overlay next domain box over a parent domain topography plot

Mary Haley haley at ucar.edu
Fri Apr 22 12:09:26 MDT 2016


Tabish,

Thanks for providing your files offline.

There are a number of ways adding the domain boxes to your WRF map plot
could be done.

Since I don't have a lot of time to clean this up, I decided to combine the
code from plotgrids.ncl and the wrf_wps_dom function to create a new
function called "wrf_add_wps_dom".  This function takes a map created from
"wrf_map_overlays" and adds the domain boxes to it, based on a namelist.wps
file.

I've attached the script for the new function, and a modified version of
wrf_wps_ter4.ncl that uses it. Basically, you want to call wrf_map_overlays
as usual, but you need to set:

pltres at PanelPlot = True

which tells wrf_map_overlays not to remove the contour plot after it's
done.  This allows you to then call wrf_add_wps_dom to add the lines and
text to the existing map.

Here's a code snippet of what it looks like:

load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load "./wrf_add_dom.ncl"

  . . .
  contour = wrf_contour(a,wks,ter,res)

  pltres = True                              ; Set plot options
  mpres = True                               ; Set map options
  pltres at PanelPlot = True                    ; Don't remove contour plot
after the overlay
  plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)  ; Plot the data
over a map background

  plot = wrf_add_wps_dom(wks,plot)    ;  Add domain boxes to map

  draw(plot)     ; This will draw contours, map, domain lines, and text
  frame(wks)

--Mary



On Tue, Apr 19, 2016 at 4:27 PM, Mary Haley <haley at ucar.edu> wrote:

> Tabish,
>
> This is an excellent question. I will try to come up with an example for
> you tonight or tomorrow. I want to do a "good" example so I can include it
> on our examples website.
>
> --Mary
>
>
> On Tue, Apr 19, 2016 at 3:22 PM, Tabish Ansari <tabishumaransari at gmail.com
> > wrote:
>
>> Hi
>>
>> I've been using the standard example scripts plotgrids.ncl to preview
>> domain and wrf_wps_ter4.ncl
>> <http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/BASIC/wrf_wps_ter4.ncl>
>> to plot terrain. The first script reads in the namelist.wps while the
>> second one reads in the geo_em.d0x.nc file.
>>
>> I need to plot the topography using the wrf_map_overlays() function just
>> the same way as in wrf_wps_ter4.ncl but I also need to overlay a box
>> depicting the next nest(s) like in plotgrids.ncl. How can I achieve that?
>>
>> Thanks in advance!
>>
>> Tabish
>>
>> Tabish U Ansari
>> PhD student, Lancaster Environment Center
>> Lancaster Univeristy
>> Bailrigg, Lancaster,
>> LA1 4YW, United Kingdom
>>
>> _______________________________________________
>> 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/20160422/7c6cb567/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plt_geo_4.png
Type: image/png
Size: 362146 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160422/7c6cb567/attachment-0001.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrf_add_wps_dom.ncl
Type: application/octet-stream
Size: 14639 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160422/7c6cb567/attachment-0002.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrf_wps_ter4_mod.ncl
Type: application/octet-stream
Size: 1377 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160422/7c6cb567/attachment-0003.obj 


More information about the ncl-talk mailing list