[ncl-talk] Running example scripts for beginners

Mary Haley haley at ucar.edu
Mon Aug 4 08:52:43 MDT 2014


​Zilore,

WRF data is on a curvilinear grid, which means each data point is
represented by a unique lat/lon value. You said that "wrf_map_overlays"
didn't work for you, but it would help if you explain how it didn't work.
 Did you get an error message? If so, include the error message. Did you
get the wrong plot? If so, indicate this. The wrf_xxxx scripts are tailored
for WRF ARW data, so they should work pretty well.

If you want to use the gsn_csm_xxxx scripts, you have to provide lat/lon
information, because the gsn_csm_xxxx scripts are *not* tailored for WRF
data. Otherwise NCL will have no way of knowing what map projection or
where your data is supposed to be overlaid on the map.

If you are trying to use gsn_csm_contour_map and gsn_csm_contour to contour
WRF data, then I suggest visiting this page:

​http://www.ncl.ucar.edu/Applications/wrfgsn.shtml

The first example, wrf_gsn_1.ncl, is the simplest one, but it only draws
one field on a map.

The last example, wrf_gsn_5.ncl, shows how to overlay multiple fields on
one plot.  It shows how to use both gsn_csm_xxx scripts, or wrf_xxxx
scripts.  It's up to you which one you want.

Please look at these examples and try one of them.  If you continue to have
problems, include your script again, but this time include more information
about what is wrong.

Thanks,

--Mary



On Fri, Aug 1, 2014 at 4:05 PM, zilore mumba <zmumba at yahoo.com> wrote:

> My sincere apologies for posting very basic issues. I have been trying to
> make headway in learning ncl with very little progress. All the examples I
> try do not seem to work. Examples,
>
>
>
>
>
>
> wrfout_d01_2014-07-29_00^%00^%00.nc
> <https://www.dropbox.com/s/aeoqmfgrk6pbd99/wrfout_d01_2014-07-29_00%5E%2500%5E%2500.nc>
> zilore mumba shared from Dropbox
> View on www.dropbox.com
> <https://www.dropbox.com/s/aeoqmfgrk6pbd99/wrfout_d01_2014-07-29_00%5E%2500%5E%2500.nc>
> Preview by Yahoo
>
>
> 1. I have tried the two examples on "wrf_map_overlay" examples found at
> wrf_map_overlays
> <https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_map_overlays.shtml> both
> don't work for me, only modification being the filename (which works in
> grads)
> 2.  I have tried the "Getting_started example 5"found at Getting started
> using NCL - example 5 - contour plots over maps
> <https://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun05n.shtml>,
> it does not work for me.
> 3. I have tried *overlay_*" examples found at
> https://www.ncl.ucar.edu/Applications/Scripts/overlay_1.ncl, they do not
> work for me.
> I would appreciate if someone can make overlay_1.ncl (below) work for me.
> Modifications are a) my filename and longitude and latitude of my domain.
> The wrf output file is attached if allowed since it is too large (through
> dropbox). I moved to Windows which does not allow : in file names.
> The error I get is:
> fatal:Dimension (bottom_top) of file (wrfout_d01_2014-07-29_00:00:00) does
> not have an associated coordinate variable
> fatal:["Execute.c":8128]:Execute: Error occurred at or near line 16 in
> file overlay_1.ncl
>
> ;*************************************************
> ; overlay_1.ncl
> ;
> ; Concepts illustrated:
> ;   - Overlaying line contours on filled contours
> ;   - Explicitly setting contour levels
> ;   - Selecting a different color map
> ;
> ;*************************************************
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
> begin
>   a = addfile("wrfout_d01_2014-07-29_00:00:00.nc","r")
>   temp = a->T(0,{500},:,:)
>   uwnd = a->U(0,{500},:,:)
>
>   wks = gsn_open_wks("ps","overlay")
>   gsn_define_colormap(wks,"BlueDarkRed18")    ; use the BlueDarkRed18
> colormap
>
>   res = True
>   res at mpFillOn = False
>   res at mpMaxLatF =  -4.07                      ; specify the plot domain
>   res at mpMinLatF = -21.9                       ;
>   res at mpMinLonF =  17.25                      ;
>   res at mpMaxLonF =  38.44                      ;
>   sres at gsnFrame = False                       ; do not advance the frame
>   sres at cnLevelSelectionMode = "ExplicitLevels" ; use explicit levels
>   sres at cnLevels = ispan(-5,35,5)              ; set the contour levels
>
>   plot = gsn_csm_contour_map(wks,temp,res)    ; create the temperature plot
>   plot_ov = gsn_csm_contour(wks,uwnd,sres)    ; create the U-wind plot
>   overlay(plot,plot_ov)                       ; overlay the U-wind plot on
> the temperature plot
>   draw(plot)                                  ; draw the temperature plot
> (with the U-wind plot overlaid)
>   frame(wks)                                  ; advance the frame
> end
>
>   res at mpOutlineOn = True                            ; turn the map
> outline on
>   res at gsnDraw      =  False                   ; do not draw the plot
>
>
>
>
> [image: image]
> <https://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun05n.shtml>
>
>
>
>
>
> Getting started using NCL - example 5 - contour plots ov...
> <https://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun05n.shtml>
> NCL Home > Documentation > Manuals > Getting Started GSUN > Examples > 1 |
> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11
> View on www.ncl.ucar.edu
> <https://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun05n.shtml>
> Preview by Yahoo
>
>
>
>
>
>
>
>
> wrf_map_overlays
> <https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_map_overlays.shtml>
> NCL WRFUserARW.ncl functions (graphics routines)
> View on www.ncl.ucar.edu
> <https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_map_overlays.shtml>
> Preview by Yahoo
>
>
>
> _______________________________________________
> 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/20140804/2718eee8/attachment.html 


More information about the ncl-talk mailing list