;; This script calculates sea level pressure ;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" ; $NCARG_ROOT does not work on my system. Therefore, I have included direct path to *.ncl scripts. load "/usr/share/ncarg/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "/usr/share/ncarg/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" load "/usr/share/ncarg/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin datadir = "." FILES = systemfunc ("ls -1 wrfout_d02*") numFILES = dimsizes(FILES) res = True res@InitTime = False res@Footer = False res@Footer = False pltres = True pltres@amON = False pltres@NoTitles = True pltres@PanelPlot = True pltres@gsnDraw = False ; don't draw pltres@gsnFrame = False mpres = True sopts = True sopts@cnLineColor = "Blue" sopts@ContourParameters = (/950.,1050.,2./) sopts@cnInfoLabelOn = False sopts@cnLineLabelBackgroundColor = -1 sopts@cnInfoLabelOrthogonalPosF = 0.07 ; offset second label information sopts@gsnContourLineThicknessesScale = 1.0 mpres = True mpres@gsnDraw = False ; don't draw mpres@gsnFrame = False mpres@mpGeophysicalLineColor = "Black" mpres@mpNationalLineColor = "black" mpres@mpOutlineOn = True mpres@mpNationalLineThicknessF = 2.0 mpres@mpGeophysicalLineThicknessF = 2.0 mpres@mpGridAndLimbOn = False mpres@tmYROn = True mpres@tmXBLabelFontHeightF = 0.01 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; do ifil = 0,numFILES-1 a = addfile(FILES(ifil)+".nc","r") times = wrf_user_list_times(a) printVarSummary(times) ;print("echo "+times +"|cut -c9-10") day = systemfunc("echo "+times +"|cut -c9-10") yr = systemfunc("echo "+times +"|cut -c1-4") mon = systemfunc("echo "+times +"|cut -c6-7") hr = systemfunc("echo "+times +"|cut -c12-13") if(mon .eq. "01")then mon="JAN" end if if(mon .eq. "02")then mon="FEB" end if if(mon .eq. "03")then mon="MAR" end if if(mon .eq. "04")then mon="APR" end if if(mon .eq. "05")then mon="MAY" end if if(mon .eq. "06")then mon="JUN" end if if(mon .eq. "07")then mon="JUL" end if if(mon .eq. "08")then mon="AUG" end if if(mon .eq. "09")then mon="SEP" end if if(mon .eq. "10")then mon="OCT" end if if(mon .eq. "11")then mon="NOV" end if if(mon .eq. "12")then mon="DEC" end if wks = gsn_open_wks("ps","slp_surf_"+day+mon+yr+"_"+hr+"Z") slp = wrf_user_getvar(a,"slp",0) wrf_smooth_2d( slp,3 ) slp@description = "" slp@units = "" contour_slp = wrf_contour(a,wks,slp,sopts) plot = wrf_map_overlays(a,wks,contour_slp,pltres,mpres) xp = new((/154,155/),float) ; allocate memory yp = new((/154,155/),float) ;best track yp(0,:) = (/ 23.8, 23.9, 24.2, 24.2, 24.1, 24.1, 24.4, 24.2, 24.4, 25.2, 25.7, 25.8, 26.0, \ 26.6, 26.8, 27.0, 28.0, 27.7, 27.9, 27.9, 28.7, 29.0, 30.0, 30.3, 30.5, 31.0, \ 31.7, 32.2, 32.4, 32.9, 33.2, 34.6, 34.9, 35.2, 35.3, 35.6, 35.6, 35.9, 35.9, \ 36.3, 36.6, 36.8, 36.9, 37.0, 37.0, 37.2, 37.1, 37.2, 36.2, 36.0, 35.8, 35.7, \ 35.6, 36.0, 35.7, 34.7, 34.0, 34.0, 33.4, 33.3, 32.7, 32.4, 32.6, 32.2, 31.5, \ 31.4, 30.3, 30.2, 30.0, 29.9, 29.0, 28.9, 28.1, 27.6, 27.6, 28.0, 27.4, 26.9, \ 27.2, 26.9, 26.8, 27.4, 27.9, 28.1, 27.8, 26.9, 26.8, 27.0, 26.9, 27.5, 27.6, \ 27.8, 27.9, 28.7, 28.7, 29.4, 29.0, 29.5, 29.3, 29.0, 29.0, 28.7, 28.4, 28.4, \ 28.3, 27.9, 27.5, 27.1, 27.3, 27.2, 26.7, 25.3, 24.0, 23.7, 23.8, 23.9, 23.1, \ 22.9, 22.3, 23.7, 23.5, 23.8, 24.1, 24.1, 24.7, 24.9, 25.1, 25.1, 25.3, 26.0, \ 26.1, 26.4, 26.3, 26.4, 26.0, 25.8, 25.3, 25.2, 25.0, 25.0, 25.2, 25.2, 24.9, \ 24.9, 24.5, 24.3, 24.2, 23.8, 23.7, 23.5, 23.4, 23.1, 23.0, 22.1, 21.5 /) xp(0,:) = (/ 68.2, 68.7, 68.8, 69.6, 69.6, 70.0, 70.5, 70.8, 71.1, 71.0, 70.8, 70.3, 70.1, \ 70.2, 69.5, 69.5, 70.4, 70.8, 71.5, 71.8, 72.4, 73.0, 73.5, 74.1, 74.1, 74.6, \ 74.6, 75.4, 75.1, 74.0, 73.7, 73.6, 74.1, 74.1, 73.7, 73.7, 73.4, 73.1, 72.6, \ 72.6, 73.0, 73.1, 73.8, 73.6, 74.3, 74.5, 74.7, 75.3, 76.7, 76.7, 76.9, 77.4, \ 77.5, 79.2, 80.4, 80.0, 79.4, 79.0, 79.0, 79.4, 79.5, 79.1, 78.7, 78.6, 78.8, \ 78.8, 81.1, 81.1, 80.9, 80.5, 80.2, 80.9, 82.4, 82.6, 84.0, 84.7, 85.5, 87.0, \ 87.1, 87.4, 88.2, 88.0, 88.2, 88.7, 88.9, 89.0, 90.1, 90.7, 92.1, 92.0, 91.6, \ 91.7, 92.6, 93.4, 94.0, 94.7, 95.4, 96.1, 96.4, 96.2, 96.5, 96.6, 96.4, 96.7, \ 97.4, 97.4, 97.0, 97.2, 96.8, 96.2, 95.2, 95.0, 94.2, 94.2, 94.0, 93.4, 93.4, \ 93.2, 92.7, 92.2, 91.7, 91.3, 91.7, 91.9, 92.4, 92.1, 92.2, 90.7, 89.9, 89.9, \ 89.4, 89.0, 88.8, 88.5, 88.1, 88.1, 89.0, 89.0, 88.8, 88.6, 88.6, 88.5, 88.4, \ 88.2, 88.1, 88.6, 88.7, 88.7, 88.6, 88.5, 88.7, 88.8, 89.0, 89.0, 88.9 /) pres = True ; polyline resources pres@gsLineThicknessF = 2.0 ; line thickness pres@gsLineColor = "black" dum1 = gsn_add_polyline(wks,plot,xp(0,:),yp(0,:),pres) delete(pres) ; draw(plot) ; frame(wks) ; lets frame the plot - do not delete tres = True ; text mods desired tres@txFontHeightF = 0.011 ; make smaller tres@txFont = "helvetica-bold" tres@txFontColor = "red" tres@txBackgroundFillColor = "LightBlue" lon=53.1 lat=35.56 text = gsn_add_text(wks,plot,"Heading",lon,lat,tres) txres = True lon=50.4 lat=35.56 txres@txFont = "text-symbols" txres@txFontHeightF = 0.011 txres@txFontColor = "red" txres@txBackgroundFillColor = "LightBlue" text = gsn_add_text(wks,plot,"S",lon,lat,txres) delete(tres) draw(plot) frame(wks) end do end