load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" begin a = addfile("wrfout_d01_2016-10-30_00:00:00_32layers","r") type = "ps" wks = gsn_open_wks(type,"WEplt") ; Set some basic resources res = True ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FirstTime = True FirstTimeMap = True times = wrf_user_getvar(a,"times",-1) ; get times in the file ntimes = dimsizes(times) ; number of times in the file mdims = getfilevardimsizes(a,"P") ; get some dimension sizes for the file nd = dimsizes(mdims) ; this ingests latitude, longitude, and altitude data xlat = wrf_user_getvar(a, "XLAT",0) ; xlon = wrf_user_getvar(a, "XLONG",0) ter = wrf_user_getvar(a, "HGT",0) ;--------------------------------------------------------------- do it = 1, 6, 1 ; TIME LOOP print("Working on time: " + times(it) ) ts = a->RAINNC(it,100,:) xlon = a->XLONG(it,38,:) xlat = a->XLAT(it,:,:) ; ; this defines the span on the x-section ; xe = xlon(30:130) ; ; then grab ts=RAINNC in this span ; te = ts(30:130) ; ; Plot te versus xe res = True ; plot mods desired res@tiMainString = "HOURLY RAINFALL" ; add title res@tiYAxisString = "Hourly total rainfall (mm)" res@trYMaxF = 50 ; add title res@trYMinF = 0 ; add title res@trXMaxF = -122 ; add title res@trXMinF = -128 ; add title res@tmXBMode = "Manual" res@tmXBTickStartF = res@trXMinF ; Force tickmark labelling to start at first value res@xyLineColors = (/"blue"/) ; change line color plot = gsn_csm_xy (wks,xe,te,res) ; create plot ; Add time label text ; txres = True txres@txFontHeightF = "0.025" str = (/sprinti("%0.2i",it), " hours"/) news = str_concat(str) text = gsn_add_text(wks,plot,news,xlon(30),45,txres) draw(plot) ;--------------------------------------------------------------- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; end do end