; Example script to produce plots for a WRF real-data run, ; with the ARW coordinate dynamics option. load "/usr/share/ncarg/nclscripts/csm/gsn_code.ncl" load "/usr/share/ncarg/nclscripts/wrf/WRFUserARW.ncl" ; Add special wrf functions begin ; ; The WRF ARW input file. ; This needs to have a ".nc" appended, so just do it. a = addfile("/dvl/atm/szintai/WRF/Play/DPRK_201304_ECMWF_new/WRFRun/wrfout_d01_2013-04-06_18:00:00.nc","r") ; Open a file ; We generate plots, but what kind do we prefer? ; type = "x11" ; type = "pdf" type = "png" ; type = "ncgm" wks = gsn_open_wks(type,"plt_Surface1") gsn_define_colormap(wks,"rainbow") ; Set some basic resources res = True res@MainTitle = "REAL-TIME WRF" pltres = True mpres = True ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; What times and how many time steps are in the data set? times = wrf_user_getvar(a,"times",-1) ; get all times in the file ntimes = dimsizes(times) ; number of times in the file ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; do it = 0,ntimes-1,2 ; TIME LOOP print("Working on time: " + times(it) ) res@TimeLabel = times(it) ; Set Valid time to use on plots ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; First get the variables we will need slp = wrf_user_getvar(a,"slp",it) ; slp wrf_smooth_2d( slp, 3 ) ; smooth slp tc = wrf_user_getvar(a,"tc",it) ; 3D tc td = wrf_user_getvar(a,"td",it) ; 3D td u = wrf_user_getvar(a,"ua",it) ; 3D U at mass points v = wrf_user_getvar(a,"va",it) ; 3D V at mass points td2 = wrf_user_getvar(a,"td2",it) ; Td2 in C tc2 = wrf_user_getvar(a,"T2",it) ; T2 in Kelvin tc2 = tc2-273.16 ; T2 in C u10 = wrf_user_getvar(a,"U10",it) ; u at 10 m, mass point v10 = wrf_user_getvar(a,"V10",it) ; v at 10 m, mass point ; tf2 = 1.8*tc2+32. ; Turn temperature into Fahrenheit ; tf2@description = "Surface Temperature" ; tf2@units = "F" ; td_f = 1.8*td2+32. ; Turn temperature into Fahrenheit ; td_f@description = "Surface Dew Point Temp" ; td_f@units = "F" ; u10 = u10*1.94386 ; Turn wind into knots ; v10 = v10*1.94386 ; u10@units = "kts" ; v10@units = "kts" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; mpres@mpGeophysicalLineColor = "Black" mpres@mpGridLineColor = "Black" mpres@mpLimbLineColor = "Black" mpres@mpNationalLineColor = "Black" mpres@mpPerimLineColor = "Black" mpres@mpUSStateLineColor = "Black" ; Plotting options for T opts = res opts@cnFillOn = True opts@ContourParameters = (/ -20., 40., 5./) opts@gsnSpreadColorEnd = -3 ; End third from the last color in color map contour_tc = wrf_contour(a,wks,tc2,opts) delete(opts) ; Plotting options for Td opts = res opts@cnFillOn = True opts@cnLinesOn = True opts@cnLineLabelsOn = True opts@ContourParameters = (/ -20., 90., 5./) opts@cnLineLabelBackgroundColor = -1 opts@gsnSpreadColorEnd = -3 ; End third from the last color in color map contour_td = wrf_contour(a,wks,td2,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,v10,opts) delete(opts) ; MAKE PLOTS plot = wrf_map_overlays(a,wks,(/contour_tc/),pltres,mpres) ; plot = wrf_map_overlays(a,wks,(/contour_td,vector/),pltres,mpres) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; end do ; END OF TIME LOOP end