[ncl-talk] Plotting several WRF plots without refreshing the plot

Ty Buckingham ty.buckingham at manchester.ac.uk
Mon Jan 8 05:20:41 MST 2018


Hi there,

I'm currently plotting absolute vorticity at every 10 minutes from one of my WRF outputs and wish to plot all the outputs in one plot PDF. I've attached an example that has been produced in the past (ignore the added graphics). My current loop plots each output as a separate PDF. I've added my .ncl script and added a version to the end of this email.

Any help?

Thanks in advance,
Ty

NCL version: 6.4.0

Script:



begin


a = addfile("wrfout_d04_2007-09-24_05:00:00.nc","r")


; type = "x11"

  type = "pdf"

; type = "ps"

; type = "ncgm"


wks = gsn_open_wks(type,"vort_loop_0500-0600")

setvalues NhlGetWorkspaceObjectId()

    "wsMaximumSize" : 300000000

end setvalues


  pltres                             = True

  mpres                              = True

  mpres at mpOutlineOn                  = True

  mpres at gsnMaximize                  = True

  mpres at mpFillOn                     = False

  mpres at mpGeophysicalLineThicknessF  = 2.0

  mpres at mpGeophysicalLineColor       = "Black"


;***********************************************

; plot controls

;***********************************************


  res          = True

  res at gsnDraw  = False

  res at gsnFrame = False


; res at cnFillPalette        = "BlueDarkRed18"    ; custom colours. Default is good enough for avo.

  res at cnFillOn             = True               ; turns on the color

  res at cnLinesOn            = False              ; turn off contour lines


  res at cnLevelSelectionMode = "ManualLevels"     ; set manual contour levels

  res at cnMinLevelValF       = -0.018             ; set min contour level

  res at cnMaxLevelValF       = 0.018              ; set max contour level

  res at cnLevelSpacingF      = 0.002              ; set contour spacing


  res at lbTitleOn            =  True                          ; turn on title

  res at lbTitleString        = "Absolute Vorticity (1/s)"     ; title string

  res at pmLabelBarOrthogonalPosF = -0.05                      ; distances label bar


;**********************************************

; Begin loop

;**********************************************


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                 ; loop


print("Working on time: " + times(it) )

res at TimeLabel = times(it) ; Set Valid time to use on plots


avo = wrf_user_getvar(a,"avo",time)

z = wrf_user_getvar(a,"z",time)


height = 500.

avo_plane = wrf_user_intrp3d(avo,z,"h",height,0.,False)    ; Interpolates avo to height

avo_plane1 = avo_plane/100000


contour = wrf_contour(a,wks,avo_plane1,res)

plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)


end do


end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180108/d436dc0a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Plot_Example.png
Type: image/png
Size: 1035169 bytes
Desc: Plot_Example.png
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180108/d436dc0a/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrf_avo_loop.ncl
Type: application/octet-stream
Size: 2387 bytes
Desc: wrf_avo_loop.ncl
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180108/d436dc0a/attachment-0001.obj>


More information about the ncl-talk mailing list