; 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/wrf/WRFUserARW.ncl" begin ; Make a list of all files we are interested in a = addfile("./wrfout_d01_2000-04-01_06:00:00.nc","r") wks = gsn_open_wks("png","wrf_test") gsn_define_colormap(wks,"rainbow") ; Set some basic resources res = True res@MainTitle = "REAL-TIME WRF" res@Footer = False pltres = True mpres = True ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;a = addfiles(FILES+".nc","r") times = wrf_user_list_times(a) ntimes = dimsizes(times) ; number of times in the file printVarSummary(times) nt = -1 ; -1 means all time steps tc2 = wrf_user_getvar(a,"T2",nt) ; T2 in Kelvin tc2 = tc2-273.16 ; T2 in C tc2@description = "Surface Temperature" tc2@units = "degrees" printVarSummary(tc2) u10 = wrf_user_getvar(a,"U10",nt) ; u at 10 m, mass point v10 = wrf_user_getvar(a,"V10",nt) ; v at 10 m, mass point ;u10 = u10*1.94386 ; Turn wind into knots ;v10 = v10*1.94386 u10@units = "m/s" v10@units = "m/s" printVarSummary(u10) printVarSummary(v10) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; do it = 0,ntimes-1,1 ; TIME LOOP print("==================================================") print("Working on time: " + times(it) ) res@TimeLabel = times(it) ; Set Valid time to use on plots slp = wrf_user_getvar(a,"slp",it) ; slp wrf_smooth_2d( slp, 3 ) ; smooth slp printMinMax(slp,0) ; Plotting options for T opts = res opts@cnFillOn = True opts@ContourParameters = (/ -20., 90., 5./) opts@gsnSpreadColorEnd = -3 ; End third from the last color in color map contour_tc = wrf_contour(a,wks,tc2(it,:,:),opts) ; contour_tc = wrf_contour(a,wks,tc2,opts) delete(opts) ; Plotting options for SLP opts = res opts@cnLineColor = "Blue" opts@cnHighLabelsOn = True opts@cnLowLabelsOn = True opts@ContourParameters = (/ 900., 1100., 4. /) opts@cnLineLabelBackgroundColor = -1 opts@gsnContourLineThicknessesScale = 2.0 contour_psl = wrf_contour(a,wks,slp,opts) delete(opts) ; Plotting options for Wind Vectors opts = res opts@FieldTitle = "Wind" ; overwrite Field Title opts@NumVectors = 47 ; density of wind barbs vector = wrf_vector(a,wks,u10(it,:,:),v10(it,:,:),opts) ; vector = wrf_vector(a,wks,u10,v10,opts) delete(opts) ; MAKE PLOTS plot = wrf_map_overlays(a,wks,(/contour_tc,contour_psl,vector/),pltres,mpres) end do ; END OF TIME LOOP end