Re: wrf_countour does not display

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Oct 02 2013 - 13:29:14 MDT

By default, wrf_contour and wrf_vector don't draw any plots. The assumption is that you are going to overlay them later via wrf_overlays.

If you want them to be drawn, then you need to set the resources gsnDraw and gsnFrame to True:

. . .
opts@gsnDraw = True
opts@gsnFrame = True
vector = wrf_vector(a,wks,u(2,1:100,1:100),v(2,1:100,1:100),opts)

--Mary

On Oct 1, 2013, at 7:19 PM, Hiep Duc <Hiep.Duc@environment.nsw.gov.au> wrote:

> Hi all,
>
> I am using ncl to plot out some contour graphs from the WRF file.
>
> I have problem of plotting out using wrf_contour. If am using gsn_contour, it is fine and the contour graph displays ok. But the contour plot does not display when I use the wrf_contour and the wrf_vector (for plotting wind vector). Does anyone know why wrf_contour and wrf_vector do not show the graphs ?.
>
> Thanks
>
> Dr Hiep Duc Nguyen
> Atmospheric Scientist
> NSW Office of Environment & Heritage
> Australia
> .
>
> My ncl code (below) and the ncdump of the WRF file is attached
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
>
> begin
> ;
> print("Working on WRF NARCLIM")
> ; The WRF ARW input file.
> a = addfile("./wrfout_d02_2060-01-01_00:00:00.nc","r")
>
>
> ; Generating plots
> type = "X11"
> wks = gsn_open_wks(type,"plt_WRF_NARCLIM")
>
>
> ; Set some basic resources
> res = True
> res@MainTitle = " "
>
>
> ; What times and how many time steps are in the data set?
> FirstTime = True
> times = wrf_user_list_times(a) ; get times in the file
> ntimes = dimsizes(times) ; number of times in the file
>
> do it = 0,ntimes-1 ; TIME LOOP
>
> print("Working on time: " + times(it) )
> if (FirstTime) then ; Save some times for tracking tendencies
> times_sav = times(it)
> end if
> res@TimeLabel = times(it) ; Set Valid time to use on plots
>
> ; First get the variables we will need
> u = wrf_user_getvar(a,"U",it) ; 3D U at mass points
> v = wrf_user_getvar(a,"V",it) ; 3D V at mass points
> pblh = wrf_user_getvar(a,"PBLH",it) ; Plane Boundary Layer Height
> lai = wrf_user_getvar(a,"LAI",it) ; Leaf Area Index
>
> p = wrf_user_getvar(a, "P",it) ; pressure
> rh = wrf_user_getvar(a,"QVAPOR",it) ; relative humidity
> vs = wrf_user_getvar(a,"UST",it) ; friction velocity
>
> ; Plotting Time
> opts= True
> pltres = True
> mpres = True
> res@InitTime = False
> res@ValidTime = False
> res@NoHeaderFooter = True
> tt=p(1,:,:)
> tt@description = " Init " + times(0) +" / Valid " + times(it)
> resgsn = True
> title1 = gsn_contour(wks,tt,resgsn)
> title = wrf_contour(a,wks,tt,opts)
> ; plot = wrf_map_overlays (a, wks, (/title/), pltres, mpres)
> delete(opts)
>
>
> ; Plotting options for LAI
> opts = True
> pltres = True
> mpres = True
> opts@MainTitle = "Leaf Area Index"
> resgsn1 = True
> resgsn1@cnFillOn = True
> resgsn1@gsnSpreadColors = True
> ; resgsn1@cnMainTitle = "Leaf Area Index"
> contour_lai1 = gsn_contour(wks,lai,resgsn1)
> contour_lai = wrf_contour(a,wks,lai,opts)
> delete(opts)
>
> ; Plotting options for PBLH
> opts = True
> pltres = True
> mpres = True
> opts@MainTitle = "Planetary Boundary Layer"
> resgsn1 = True
> resgsn1@cnFillOn = True
> resgsn1@gsnSpreadColors = True
> ; resgsn1@cnMainTitle = "Planetary Boundary Layer"
> contour_pblh1 = gsn_contour(wks,pblh,resgsn1)
> contour_pblh = wrf_contour(a,wks,pblh,opts)
> delete(opts)
>
> ; Plotting options for Wind Vectors
> opts = res
> pltres = True
> mpres = True
> opts@FieldTitle = "Winds" ; overwrite Field Title
> opts@NumVectors = 30 ; density of wind barbs
> opts@vcWindBarbTickLengthF = 0.35
> opts@vcRefLengthF = 0.025
> vector = wrf_vector(a,wks,u(2,1:100,1:100),v(2,1:100,1:100),opts)
> delete(opts)
>
>
> end do ; END OF TIME LOOP
>
> delete(wks)
> end
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
> This email is intended for the addressee(s) named and may contain confidential and/or privileged information.
> If you are not the intended recipient, please notify the sender and then delete it immediately.
> Any views expressed in this email are those of the individual sender except where the sender expressly and with authority states them to be the views of the Office of Environment and Heritage, NSW Department of Premier and Cabinet.
>
> PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING THIS EMAIL
>
> <narclim_header.txt>_______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Oct 2 13:29:24 2013

This archive was generated by hypermail 2.1.8 : Fri Oct 04 2013 - 16:45:17 MDT