[ncl-talk] panels empty

Elisabetta Fiori elisabetta.fiori at cimafoundation.org
Tue Aug 2 09:59:50 MDT 2016


Hello everybody
I am trying to do a figure with different panels inside.
at the end I got only one panel in the figure. In attachment my .ncl
These are my first steps in ncl, please, could someone help me?
Thanks!
Elisabetta
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160802/1350bdce/attachment.html 
-------------- next part --------------
; Equivalent potential temperature


; loading the basic libaries 

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


;starting the script 

begin 

; loading the file 
a = addfile("./wrfout_d03_2014-10-09_03:30:00.nc","r")

; which format we want as output

type = "pdf" 

wks = gsn_open_wks(type,"prova")
gsn_define_colormap(wks,"WhViBlGrYeOrReWh")
  plot = new(2,graphic) 
; set basic resources 
; ---------------------------

res=True
res at MainTitle = "REAL-TIME WRF"
res at Footer = False
pltres = True
mpres = True
mpres at mpNationalLineColor = "Black" 
res at gsnDraw =False

; collecting time intervals from the output file 
; --------------------------------------------

times = wrf_user_getvar(a,"times",-1) 
ntimes = dimsizes(times)

;it = 1
do it = 0,ntimes-1 
res at TimeLabel = times(it)


; Loading the varialbles needed to calculate the equivalent potential
;temperature
; --------------------------------

slp = wrf_user_getvar(a,"slp",it)
wrf_smooth_2d( slp, 3) 
P = wrf_user_getvar(a,"P",it)
PB = wrf_user_getvar(a,"PB",it)
;qv = wrf_user_getvar(a,"QVAPOR",it)
eth = wrf_user_getvar(a,"eth",it)


;T = T + 300 
pf = P + PB 
;k = wrf_tk( P , T )

;eth = wrf_eth( qv , tk , P )
eth at description = "Equivalent Potential Temperature"
eth at units = "K" 

pf = pf*0.01; Convert into hPa 

var2d = wrf_interp_3d_z(eth,pf,650.)

; plotting commands 
; -----------------------------

opts = res
opts at cnFillOn = True 
opts at cnLinelabelsOn = False


opts at FieldTitle= "Equivalent Potential Temperature"
opts at ContourParameters = (/250.,350,5./)
contour_eth = wrf_contour(a,wks,var2d,opts)
; doing the vertical plots 
delete(opts)

;ploting options for SLP
opts = res 
opts at cnLineColor = "Blue"
opts at cnHighLabelsOn = True
opts at cnLowLabelson = True 
opts at ContourParameters = (/900.,1100.,4./)
contour_psl = wrf_contour(a,wks,slp,opts)
delete(opts)


plot(0)= wrf_map_overlays(a,wks,(/contour_eth/),pltres,mpres)
plot(1)= wrf_map_overlays(a,wks,(/contour_eth/),pltres,mpres)

 pres                    = True              ; mod panel plot
  pres at gsnPanelBottom     = 0.05              ; add some space at bottom 
; pres at txString           = "Example of shaded contours"
  pres at gsnPanelMainString = "Example of shaded contours"
  gsn_panel(wks,plot,(/2,1/),pres)        ; create panel plot




; Make Plots 
; ---------------------

;times_sav = times(it) 
;FirstTime = False

end do 
end 


More information about the ncl-talk mailing list