; Example script to produce plots for a WRF real-data run, ; with the ARW coordinate dynamics option. load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl" begin ; ; The WRF ARW input file. ; This needs to have a ".nc" appended, so just do it. a = addfile("/public3/jtwiles/Tubbs_Fire_Analysis/OLD_ARWPOST/wrfout_d01_2017-10-08_12:00:00.nc","r") ; We generate plots, but what kind do we prefer? type = "x11" ; type = "pdf" ; type = "png" ; type = "ncgm" wks = gsn_open_wks(type,"d1_Tubbs_Tadvect") gsn_define_colormap(wks,"WhViBlGrYeOrReWh") res=True res@gsnDraw=False ;-- don't draw plot yet res@gsnFrame=False ;-- don't advance frame res@gsnMaximize=False ;-- don't maximized the workstation res@gsnLeftString="" res@gsnRightString="" res@mpOutlineBoundarySets="GeophysicalAndUSStates" res@mpOutlineOn = True ;-- outline land (default: False) res@mpGeophysicalLineThicknessF = 2 ;-- thickness of continental res@mpNationalLineThicknessF = 2 ;-- thickness of national boundary outlines res@mpFillOn = False ;-- no map fill res@mpUSStateLineColor = "gray35" ;-- color of interior provincial or state boundary outlines res@mpNationalLineColor = "gray35" ;-- color of interior national boundary outlines. res@mpGeophysicalLineColor = "gray35" ;-- color of all continents, islands, and inland water bodies res@mpLimitMode="Corners" res@pmTickMarkDisplayMode="Always" ;--always displays TickMark object res@tmXBLabelFontHeightF=0.016 ;-- sets font height of bottom X Axis labels res@tmYLLabelFontHeightF=0.016 ;-- sets font height of Y-Axis left labels res@tmXTOn=False ;-- turns off top tick marks res@tmYROn=False ;-- turns off right tick marks res@gsnAddCyclic = False res@tfDoNDCOverlay = True res@cnInfoLabelOn = False ;-- not draw an informational label res@cnLinesOn = True ;-- draw contour lines res@cnLineLabelsOn = True ;-- draw contour lines labels res@cnLineLabelBackgroundColor = "Transparent" ;-- draw lines background color res@cnLineColor = "black" ;-- color for all contour lines res@cnLineThicknessF = 2 ;-- thickness for all contour lines res@cnLineDashPattern = 0 ;-- dash pattern for all contour lines.0: solid lines ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; 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) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; First get the variables we will need u = a->U ; (time,lev,lat,lon); m/s print(dimsizes(u)) v = a->V print(dimsizes(v)) T = a->T ; degK print(dimsizes(T)) Opt = True Opt@WgtFileName = "" gridType = 0 ; global gaussian grid opt_adv = 0 ; return only the advected variable long_name = "advection of temperature" units = "K/s" print("hello") Tadv = advect_var(u,v,T,gridType,long_name,units,opt_adv) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; plot=gsn_csm_contour_map(wks, Tadv, res) draw(plot) ; Close the frame frame(wks) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FirstTime = False end do ; END OF TIME LOOP end