;;;; Plots begin type = "png" ; type = "x11" ;;;;;;;;;;;;;;; ;;;; modelNames = (/"eccc","ecmwf","metfr","cmcc","cfs"/) imodel = ispan(0,4,1) ; orders as above yrslct = 2007 ; year to plot observed onset analdir = "./analdat/" startday = 15 currentyear = 2024 STATE = True startmon = 6 ; start month for model data SEASON = "JAS" latS = -14.5 latN = -13.0 lonW = -172. lonE = -171.0 onsetLabelStart = "Jul-15" onsetLabelEnd = "Aug-25" cessnLabelStart = "Sep-25" cessnLabelEnd = "Nov-30" Res = 0.5 ZoomIn = False sMonOnset = 7 COUNTRY = "WSM" ;one of the countries below as displayed. ; The order is the same as maskNameNCL StateNames = (/ "FJI", "FSM", "PLW", "PNG", \ "SLB", "VUT", "WSM", "TUV", \ "COK", "KIR" /) maskNameNCL := (/"Fiji", "Federated States of Micronesia", "Palau", "Papua New Guinea",\ "Solomon Islands" , "Vanuatu", "American Samoa","Tuvalu", \ "Cook Islands","Kiribati" /) onsetInt = 5 cessnInt = 5 regInd := (/0,1,2,3,4,5,6,7,8,9 /) maskCPm = maskNameNCL(regInd) ; FJI FSM PLW PNG SLB VUT WSM TUV COK KIR/-17.8 sLatMin = (/-19.5, 1.0, 3.0, -11., -11.0, -20., -14., -10., -22., -3.5 /) sLatMax = (/-16.0, 10., 8.0, -1., -5.5, -13., -13., -5., -8., 2.5/) sLonMin = (/177.0, 137., 131., 141., 156.0, 166., -172., 176., -165., -174.5/) sLonMax = (/180.5, 163., 134., 157., 163.0, 170., -171., 179., -157., 177.0 /) thisyr = currentyear + sprinti("%0.2i",sMonOnset) + sprinti("%0.2i",startday)+ "00" thisyr = toint(thisyr) ;;;;;;;;;;;;;;;;; useObs = False ; for anomaly purposes. If true cmorph observed ; clim are used to calculate anom and clim. if False ; hindcast clim are used to calc anomalies. ; Plots are hindcast climatology doOnsetClim = True ; True if anomaly,climatology needed otype = 0 ; (0 CMORPH, 1 for CPCunified if available) PlotEnsAnomaly = True PlotEnsMean = True PlotStdDev = True PlotClimatology = True ; ; plot climatology PlotAnomaly = True ; plot anomalies forensemble mebers OnsetPlotEnsMember = False ; plot individual members if (lonW .lt. 0.) then lonW = lonW + 360. end if if (lonE .lt. 0.) then lonE = lonE + 360. end if ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;; dirSHP = "../../shpfiles/" dircolor = "../../colors/" dirSHPafr = dirSHP direps = "./epsfiles/Onset/raw/cmorph/" dateTxtObs = "ObsOnsetCessnDatesClim" dateTxt = dateTxtObs fcstFile = "AllModels_ForecastOnsetCessnDryWetGrowLen" hindFile = "AllModels_HindcastOnsetCessnDryWetGrowLen" obsFile = "Obs_OnsetCessnDryWetGrowLen" timelabels = asciiread(analdir+dateTxt+SEASON+".txt",-1,"string") system("if ! test -d " + direps +" ; then mkdir -p " + direps + " ; fi") figSeason = ""+currentyear LabTitle = SEASON+ " " + currentyear onsetTitle = LabTitle +": Onset dates " cessnTitle = LabTitle +": Cessation dates " growlTitle = LabTitle +": Growing Length " dryspTitle = LabTitle +": Max dryspells " wetspTitle = LabTitle +": Max wetspells " dryTimeTitle = LabTitle +": Time of max dryspell " wetTimeTitle = LabTitle +": Time of max wetspell " useNCLmask = False ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PlotObs = True ;yrslctT = yrslct + sprinti("%0.2i",startmon) + sprinti("%0.2i",startday)+ "00" yrslctT = yrslct + sprinti("%0.2i",sMonOnset) + sprinti("%0.2i",startday)+ "00" yrslctT := toint(yrslctT) ;;;;;;;;;;;;;;;;;;;;; if (PlotObs) then fname = obsFile +SEASON+".nc" a = addfile(analdir + fname,"r") time := a->time iyr := ind(time .eq. yrslctT ) avgOverOnset = False oonset = a->onset(iyr,otype,:,:) ocessation1 = a->cessation(iyr,otype,:,:) ogrowinglen1 = a->growlength(iyr,otype,:,:) owetspLen = a->wetspLengAct(iyr,otype,:,:) ; Maximum wetspell owetspLoc = a->wetspLoc0Act(iyr,otype,:,:) ; wetspLoc1 = a->wetspLoc1Act(iyr,otype,:,:) odryspLen = a->dryspLengAct(iyr,otype,:,:) ; Maximum dryspell odryspLoc = a->dryspLoc0Act(iyr,otype,:,:) ; dryspLoc1 = a->dryspLoc0Act(iyr,otype,:,:) delete(a) fname = "Obs_MonthlyDryWetSpells"+SEASON + ".nc" a = addfile(analdir + fname,"r") omonDryLen = a->dryspell(iyr,:,otype,:,:) omonWetLen = a->wetspell(iyr,:,otype,:,:) omonthT = a->month delete(a) end if fname = fcstFile +SEASON+".nc" a = addfile(analdir + fname,"r") nmodels = a@nmodels time := a->time iyr = ind(time .eq. thisyr) avgOverOnset = True ;print(iyr + " " + nmodels + " " + imodel) onset = a->onset(iyr,imodel,:,:,:) cessation = a->cessation(iyr,imodel,:,:,:) growinglen = a->growlength(iyr,imodel,:,:,:) wetspLen = a->wetspLengAct(iyr,imodel,:,:,:) ; Maximum wetspell wetspLoc = a->wetspLoc0Act(iyr,imodel,:,:,:) wetspLenF = a->wetspLengFix(iyr,imodel,:,:,:) ; Maximum fixed wetspell wetspLocF = a->wetspLoc0Fix(iyr,imodel,:,:,:) dryspLen = a->dryspLengAct(iyr,imodel,:,:,:) ; Maximum dryspell dryspLoc = a->dryspLoc0Act(iyr,imodel,:,:,:) ; dryspLoc1 = a->dryspLoc0Act(iyr,imodel,:,:,:) dryspLenF = a->dryspLengFix(iyr,imodel,:,:,:) ; Maximum fixed wet spell dryspLocF = a->dryspLoc0Fix(iyr,imodel,:,:,:) delete(a) fname = "AllModels_ForecastMonthlyDryWetSpells" +SEASON+".nc" a = addfile(analdir + fname,"r") fmonDryLen = a->dryspell(iyr,:,imodel,:,:,:) fmonWetLen = a->wetspell(iyr,:,imodel,:,:,:) fmonthT = a->month xmodim = dimsizes(imodel) if (xmodim .gt. 1) then onset := dim_avg_n_Wrap(onset, 0) cessation := dim_avg_n_Wrap(cessation, 0) growinglen := dim_avg_n_Wrap(growinglen, 0) wetspLen := dim_avg_n_Wrap(wetspLen, 0) wetspLoc := dim_avg_n_Wrap(wetspLoc, 0) dryspLen := dim_avg_n_Wrap(dryspLen, 0) dryspLoc := dim_avg_n_Wrap(dryspLoc, 0) wetspLenF := dim_avg_n_Wrap(wetspLenF, 0) wetspLocF := dim_avg_n_Wrap(wetspLocF, 0) dryspLenF := dim_avg_n_Wrap(dryspLenF, 0) dryspLocF := dim_avg_n_Wrap(dryspLocF, 0) fmonDryLen := dim_avg_n_Wrap(fmonDryLen,1) fmonWetLen := dim_avg_n_Wrap(fmonWetLen,1) end if delete(a) dimsonset = dimsizes(onset) dimx = dimsonset lab1 = get1Dindex(timelabels, onsetLabelStart) ; print("lab1 "+ lab1) lab2 = get1Dindex(timelabels, onsetLabelEnd ) if (.not.ismissing(lab1) .and. .not. ismissing(lab2)) then onsetlevels = ispan(lab1,lab2,onsetInt) onsetlabelstrings = timelabels(onsetlevels) drywetspLoc = ispan(lab1+10,dimsizes(timelabels)-10,onsetInt) onsetlabelstrings = timelabels(onsetlevels) drywetspLocStrings = timelabels(drywetspLoc) ; print("wetLoc "+ drywetspLoc + drywetspLocStrings) delete([/lab1,lab2/]) else onsetlevels = ispan(0,100,10) onsetlabelstrings = timelabels(onsetlevels) end if lab1 = get1Dindex(timelabels,cessnLabelStart) lab2 = get1Dindex(timelabels, cessnLabelEnd ) if (.not.ismissing(lab1) .and. .not. ismissing(lab2)) then cessnlevels = ispan( lab1 ,lab2 , cessnInt) cessnlabelstrings = timelabels(cessnlevels) else cessnlevels = ispan( 100 ,dimsizes(timelabels)-1 , 10) cessnlabelstrings = timelabels(cessnlevels) end if maxdrywetrun = True ; True = within season, False = climatological mlat = toint((latN-latS)/Res + 1) mlon = toint((lonE-lonW)/Res + 1) REGlat = fspan(latS, latN, mlat) REGlon = fspan(lonW, lonE, mlon) REGlat@units = "degrees_north" REGlon@units = "degrees_east" landocean = (/"ocean", "land"/) if (STATE) then StateInd = ind(StateNames .eq. COUNTRY) StName = StateNames(StateInd) f = addfile(dirSHP + "gadm41_"+StName+"_shp/" + "gadm41_"+StName+"_0.shp" ,"r") state_lon = f->x state_lon = where(state_lon .lt. 0., state_lon+360.0,state_lon) state_lat = f->y delete(f) printMinMax(state_lon,0) end if ;;;;;;;; res = True res@gsnFrame = False res@gsnDraw = False res@gsnLeftString = "" res@gsnRightString = "" res@tfDoNDCOverlay = False res@gsnMaximize = True res@gsnAddCyclic = False res@mpDataBaseVersion = "MediumRes" res@mpDataSetName = "Earth..4" res@mpGeophysicalLineThicknessF = 4 res@mpNationalLineThicknessF = 4 res@mpOutlineBoundarySets = "Allboundaries" res@pmTickMarkDisplayMode = "Always" res@mpLimitMode = "LatLon" res@mpFillOn = False res@mpOutlineOn = True res@cnInfoLabelOn = False res@cnConstFLabelOn = False res@cnFillOn = True res@cnLinesOn = False res@cnConstFEnableFill = False res@cnNoDataLabelOn = False res@mpOceanFillColor = "white" res@mpInlandWaterFillColor = "lightblue" res@cnFillDrawOrder = "PreDraw" ; draw filled contours first res@mpFillDrawOrder = "Draw" ; draw filled map areas second res@tfPolyDrawOrder = "PostDraw" ; draw filled shapefile last res@mpCenterLonF = 190. if (STATE) then ; f = addfile(dirSHP + "gadm41_"+StName+"_shp/" + "gadm41_"+StName+"_0.shp" ,"r") ; state_lon = f->x ; state_lon = where(state_lon .lt. 0., state_lon+360.0,state_lon) ; state_lat = f->y ; delete(f) if (ZoomIn) then min_lat = sLatMin(StateInd) max_lat = sLatMax(StateInd) min_lon = sLonMin(StateInd) max_lon = sLonMax(StateInd) if (min_lon .lt. 0.) then min_lon = min_lon + 360. end if if (max_lon .lt. 0.) then max_lon = max_lon + 360. end if res@mpMinLatF = min_lat ; range to zoom in on res@mpMaxLatF = max_lat res@mpMinLonF = min_lon res@mpMaxLonF = max_lon else ; state_lon = f->x ; state_lon = where(state_lon .lt. 0., state_lon+360.0,state_lon) ; state_lat = f->y min_lat = min(state_lat) max_lat = max(state_lat) min_lon = min(state_lon) max_lon = max(state_lon) res@mpMinLatF = min_lat ; range to zoom in on res@mpMaxLatF = max_lat res@mpMinLonF = min_lon res@mpMaxLonF = max_lon end if f1shp = dirSHP + "gadm41_"+StName+"_shp/" + "gadm41_"+StName+"_0.shp" ;f1shp = dirSHP + "WSM.shp" if (useNCLmask) then res@mpFillOn = True res@mpOutlineOn = False res@mpFillBoundarySets = "NoBoundaries" res@mpOutlineBoundarySets = "National" res@mpFillAreaSpecifiers = landocean res@mpSpecifiedFillColors = (/"white","white"/) res@mpAreaMaskingOn = 1 res@mpMaskAreaSpecifiers = (/maskNameNCL(StateInd)/) res@cnFillDrawOrder = "Predraw" res@cnLineDrawOrder = "Predraw" end if else res@mpMinLatF = latS ; range to zoom in on res@mpMaxLatF = latN res@mpMinLonF = lonW res@mpMaxLonF = lonE f1shp = dirSHP + "fji_polbnda_adm0_country.shp" f1shp = dirSHP + "ppacific.shp" if (useNCLmask) then res@mpFillOn = True res@mpOutlineOn = False res@mpFillBoundarySets = "NoBoundaries" res@mpOutlineBoundarySets = "National" res@mpFillAreaSpecifiers = landocean res@mpSpecifiedFillColors = (/"white","white"/) res@mpAreaMaskingOn = 1 res@mpMaskAreaSpecifiers = maskCPm res@cnFillDrawOrder = "Predraw" res@cnLineDrawOrder = "Predraw" end if end if ;;;;;;;; monthdef = (/"","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep", \ "Oct","Nov","Dec"/) res@cnLevelSelectionMode = "ExplicitLevels" onsetcolors = (/"gray","greenyellow","lawngreen",\ "palegreen", "DarkSeaGreen", \ "ForestGreen","darkgreen", "darkolivegreen", \ "OliveDrab","Orange","slateblue",\ "MediumTurquoise", "Tomato", \ "Peru","violet","magenta","magenta4","maroon"/) wetlevels = (/ 1, 4, 6, 10, 15, 20, 25, 30/) growlevels = (/30, 40, 50, 60, 70, 80, 90, 120/) wetcolors = (/"gray","Orange","Yellow",\ "DarkOliveGreen1", "DarkOliveGreen3", \ "Chartreuse3","ForestGreen","darkgreen","darkolivegreen"/) drycolors = (/"gray" ,"yellowgreen","palegreen",\ "greenyellow", "yellow","goldenrod","orange",\ "slateblue","violet", "magenta","maroon"/) anomlevels = (/-40,-30,-20,-10, -5, \ 0, 5, 10, 20, 30, 40 /) LevAnomGrowl = (/-35,-30,-20,-10,-5,-3 , \ 0, 3, 5, 10, 20, 30 /) LevAnomDrysp = (/-15,-10,-6 ,-4,-2 , -1,\ 0, 1, 2, 4, 6,10/) LevAnomOnset = (/-28,-21,-14,-7, -3, \ 0, 3, 7, 14, 21, 28/) LevAnomWetsp = (/-15,-10,-6 ,-4,-2 ,-1, \ 0,1, 2, 4, 6 , 10 /) LevAnomCessn = (/-40,-35,-28,-21,-14,-7, \ 0, 7, 14, 21, 28, 35 /) drylevels = (/2, 4, 6, 8, 10, 12 ,15, 20, 25, 30/) ronset = res ronset@cnLevelSelectionMode = "ExplicitLevels" ronset@cnLevels = onsetlevels ronset@lbLabelStrings = onsetlabelstrings ;ronset@cnFillColors = onsetcolors ronset@cnFillOn = True ronset@cnFillPallette = "ncl_default" ronset@lbOrientation = "Vertical" ronset@tiMainString = onsetTitle ;cmap := read_colormap_file("gui_default") ;xcmap := cmap ;xcmap(0:1,0:2) = 0.7 ;xcmap(0:1,3) = 1. ;ronset@cnFillPalette := xcmap ;cmap(2:,:) rcessn = res rcessn@cnLevelSelectionMode = "ExplicitLevels" rcessn@cnLevels = cessnlevels rcessn@lbLabelStrings = cessnlabelstrings rcessn@cnFillColors = onsetcolors rcessn@lbOrientation = "Vertical" rcessn@tiMainString = cessnTitle rdrysp = res rdrysp@cnLevelSelectionMode = "ExplicitLevels" rdrysp@cnLevels = drylevels rdrysp@cnFillColors = drycolors rdrysp@lbOrientation = "Vertical" rdrysp@tiMainString = dryspTitle rwetsp = res rwetsp@cnLevelSelectionMode = "ExplicitLevels" rwetsp@cnLevels = wetlevels rwetsp@cnFillColors = wetcolors rwetsp@lbOrientation = "Vertical" rwetsp@tiMainString = wetspTitle rgrowl = res rgrowl@cnLevelSelectionMode = "ExplicitLevels" rgrowl@cnLevels = growlevels rgrowl@cnFillColors = wetcolors rgrowl@lbOrientation = "Vertical" rgrowl@tiMainString = growlTitle rdryspLoc = res rdryspLoc@cnLevelSelectionMode = "ExplicitLevels" rdryspLoc@cnLevels = drywetspLoc rdryspLoc@lbLabelStrings = drywetspLocStrings rdryspLoc@cnFillColors = onsetcolors rdryspLoc@lbOrientation = "Vertical" rdryspLoc@tiMainString = dryTimeTitle rwetspLoc = rdryspLoc rwetspLoc@tiMainString = wetTimeTitle coloranomaly = asciiread(dircolor+ \ "colAnomalyOnsetWRF.txt",(/12,3/),"float") coloranomaly1 = asciiread(dircolor+ \ "colAnomalyOnsetWRF.txt",(/12,3/),"float") res_anom = res res_anom@lbOrientation = "Vertical" res_anom@cnLevelSelectionMode = "ExplicitLevels" res_anom@cnLevels = anomlevels ;res_anom@cnFillColors = coloranomaly res_anom@cnFillColors = coloranomaly(::-1,:) lnres = True lnres@gsLineColor = "black" lnres@gsLineThicknessF = 2.0 ;;;; ;;;;;;;;;;;;; ;;; Get Climatology if (doOnsetClim) then if (useObs) then fname = obsFile + SEASON + ".nc" ;"Obs_OnsetCessnDryWetGrowLenMAM.nc" ; (time,otype, lat, lon fclim = addfile(analdir + fname,"r") x := fclim->onset(:,otype,:,:) climonset = dim_avg_n_Wrap(x, 0) x := fclim->cessation(:,otype,:,:) climcessn = dim_avg_n_Wrap(x, 0) x := fclim->growlength(:,otype,:,:) climgrowl = dim_avg_n_Wrap(x, 0) x := fclim->dryspLengAct(:,otype,:,:) climdryLen = dim_avg_n_Wrap(x, 0) x := fclim->dryspLoc0Act(:,otype,:,:) climdryLoc = dim_avg_n_Wrap(x, 0) x := fclim->wetspLengAct(:,otype,:,:) climwetLen = dim_avg_n_Wrap(x, 0) x := fclim->wetspLoc0Act(:,otype,:,:) climwetLoc = dim_avg_n_Wrap(x, 0) x := fclim->dryspLengFix(:,otype,:,:) climdryLenF = dim_avg_n_Wrap(x, 0) x := fclim->dryspLoc0Fix(:,otype,:,:) climdryLocF = dim_avg_n_Wrap(x, 0) x := fclim->wetspLengFix(:,otype,:,:) climwetLenF = dim_avg_n_Wrap(x, 0) x := fclim->wetspLoc0Fix(:,otype,:,:) climwetLocF = dim_avg_n_Wrap(x, 0) fname = "Obs_MonthlyDryWetSpells" + SEASON + ".nc" ; (time,month, otype, lat, lon) fclim = addfile(analdir + fname,"r") x := fclim->dryspell(:,:,otype,:,:) climDryMon = dim_avg_n_Wrap(x, 0) x := fclim->wetspell(:,:,otype,:,:) climWetMon = dim_avg_n_Wrap(x, 0) else fname = hindFile + SEASON + ".nc" ;"AllModels_...OnsetCessnDryWetGrowLenMAM.nc" ; (time,nmodel,ens, lat,lon ) fclim = addfile(analdir + fname,"r") x := fclim->onset climonset = dim_avg_n_Wrap(x, (/0,1,2/) ) x := fclim->cessation climcessn = dim_avg_n_Wrap(x, (/0,1,2/) ) x := fclim->growlength climgrowl = dim_avg_n_Wrap(x, (/0,1,2/) ) x := fclim->dryspLengAct climdryLen = dim_avg_n_Wrap(x, (/0,1,2/) ) x := fclim->dryspLoc0Act climdryLoc = dim_avg_n_Wrap(x, (/0,1,2/) ) x := fclim->wetspLengAct climwetLen = dim_avg_n_Wrap(x, (/0,1,2/) ) x := fclim->wetspLoc0Act climwetLoc = dim_avg_n_Wrap(x, (/0,1,2/) ) x := fclim->dryspLengFix climdryLenF = dim_avg_n_Wrap(x, (/0,1,2/) ) x := fclim->dryspLoc0Fix climdryLocF = dim_avg_n_Wrap(x, (/0,1,2/) ) x := fclim->wetspLengFix climwetLenF = dim_avg_n_Wrap(x, (/0,1,2/) ) x := fclim->wetspLoc0Fix climwetLocF = dim_avg_n_Wrap(x, (/0,1,2/) ) fname = "AllModels_HindcastMonthlyDryWetSpells" + SEASON + ".nc" ; (time,month, model, ens, lat, lon) fclim = addfile(analdir + fname,"r") y := fclim->dryspell x := dim_avg_n_Wrap(y,0) climDryMon = dim_avg_n_Wrap(x, (/1,2/) ) ;printVarSummary(climDryMon) y := fclim->wetspell x := dim_avg_n_Wrap(y,0) climWetMon = dim_avg_n_Wrap(x, (/1,2/)) end if if (PlotObs) then x := oonset wks = gsn_open_wks(type,direps+"Obs_OnsetDate"+ yrslct) ronset@tiMainString = "Observed onset for " + yrslct cntr = gsn_csm_contour_map(wks,x,ronset) ;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr, wks/]) end if end if ;;;;;; Onset ;ploting starts here do ens=0,dimsonset(0) - 1 if (OnsetPlotEnsMember) then x := onset wks = gsn_open_wks(type,direps+"GCM_OnsetDateE"+ ens) ronset@tiMainString = onsetTitle + "(Ens "+ens +")" cntr = gsn_csm_contour_map(wks,x(ens,:,:),ronset) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr, wks/]) ;;;;;;; Cessation x := cessation wks = gsn_open_wks(type,direps+"GCM_CessationDateE"+ens) rcessn@tiMainString = cessnTitle + "(Ens "+ens +")" cntr = gsn_csm_contour_map(wks,x(ens,:,:),rcessn) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr, wks/]) ;;;;;;;;;;;;;;;;;; ;;;;;; glowlen x := growinglen wks = gsn_open_wks(type,direps+"GCM_GrowingSeasonLengthE"+ens) rgrowl@tiMainString = growlTitle + "(Ens "+ens +")" cntr = gsn_csm_contour_map(wks,x(ens,:,:),rgrowl) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr, wks/]) ;;;;;;;;;;;;;;;;;;;; ;;;; max Drysp length and location x := dryspLen wks = gsn_open_wks(type,direps+"GCM_DrySpLengthE"+ens) rdrysp@tiMainString = dryspTitle + "(Ens "+ens +")" cntr = gsn_csm_contour_map(wks,x(ens,:,:),rdrysp) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr, wks/]) x := dryspLoc wks = gsn_open_wks(type,direps+"GCM_DrySpTimingE"+ ens) rdryspLoc@tiMainString = dryTimeTitle + "(Ens "+ens +")" cntr = gsn_csm_contour_map(wks,x(ens,:,:),rdryspLoc) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr, wks/]) ;;;;;;;;;;;;;;;;;;; ;;;; max Drysp length and location x := dryspLenF wks = gsn_open_wks(type,direps+"GCM_DrySpLenFixE"+ens) rdrysp@tiMainString = dryspTitle + "Fixed (Ens "+ens +")" cntr = gsn_csm_contour_map(wks,x(ens,:,:),rdrysp) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr, wks/]) x := dryspLocF wks = gsn_open_wks(type,direps+"GCM_DrySpTimingFixE"+ ens) rdryspLoc@tiMainString = dryTimeTitle + "Fixed (Ens "+ens +")" cntr = gsn_csm_contour_map(wks,x(ens,:,:),rdryspLoc) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr, wks/]) ;;;;;;;;;;;;;;;;;;;; ;;;; max wetsp length and location after onset x := wetspLen wks = gsn_open_wks(type,direps+"GCM_WetSpLengthE"+ens) rdrysp@tiMainString = wetspTitle + "(Ens "+ens +")" cntr = gsn_csm_contour_map(wks,x(ens,:,:),rwetsp) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr, wks/]) x := wetspLoc wks = gsn_open_wks(type,direps+"GCM_WetSpTimingE"+ ens) rdryspLoc@tiMainString = wetTimeTitle + "(Ens "+ens +")" cntr = gsn_csm_contour_map(wks,x(ens,:,:),rwetspLoc) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr, wks/]) x := wetspLenF wks = gsn_open_wks(type,direps+"GCM_WetSpLenFixE"+ens) rdrysp@tiMainString = wetspTitle + "Fixed (Ens "+ens +")" cntr = gsn_csm_contour_map(wks,x(ens,:,:),rwetsp) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr, wks/]) x := wetspLocF wks = gsn_open_wks(type,direps+"GCM_WetSpTimingFixE"+ ens) rdryspLoc@tiMainString = wetTimeTitle + "Fixed (Ens "+ens +")" cntr = gsn_csm_contour_map(wks,x(ens,:,:),rwetspLoc) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr, wks/]) if (doOnsetClim .and. PlotAnomaly) then ;;;;;;;;;;;;;;;;;;;; ;;;; onset anomaly x := dim_avg_n_Wrap(onset,0) x := onset delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomOnset res_anom@cnFillColors := coloranomaly(::-1,:) xanom := x(ens,:,:) xanom = (/x(ens,:,:) - climonset/) wks = gsn_open_wks(type,direps+"GCM_AnomOnsetE"+ens ) res_anom@tiMainString = SEASON+" Onset Anomaly (Ens "+ens +")" cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) ;;;;;;;;;;;;;;;;;;;; ;;;; cessn anomaly x := cessation delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomCessn res_anom@cnFillColors := coloranomaly1 xanom = x(ens,:,:) xanom = (/x(ens,:,:) - climcessn/) wks = gsn_open_wks(type,direps+"GCM_AnomCessnE" +ens) res_anom@tiMainString = SEASON+" Cessn Anomaly (Ens "+ens +")" cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) ;;;;;;;;;;;;;;;;;;;; ;;;; GrowLen anomaly x := growinglen ;delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomGrowl xanom = x(ens,:,:) xanom = (/x(ens,:,:) - climgrowl/) wks = gsn_open_wks(type,direps+"GCM_AnomGrowlE"+ens ) res_anom@tiMainString=SEASON+" Growing Length Anomaly (Ens "+ens +")" cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) ;;;;;;;;;;;;;;;;;;;; ;;;; max Drysp length and location x := dryspLen delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomDrysp res_anom@cnFillColors := coloranomaly(::-1,:) xanom = x(ens,:,:) xanom = (/x(ens,:,:) - climdryLen/) wks = gsn_open_wks(type,direps+"GCM_AnomDryLenE"+ens) res_anom@tiMainString = SEASON+" Dryspell Anomaly (Ens "+ens +")" cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) x := dryspLoc delete(res_anom@cnLevels) res_anom@cnFillColors := coloranomaly xanom = x(ens,:,:) xanom = (/x(ens,:,:) - climdryLoc/) wks = gsn_open_wks(type,direps+"GCM_AnomDryTimingEns"+ens) res_anom@tiMainString = SEASON+" Dry Timing Anomaly (Ens "+ens +")" cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) ;;;; max Drysp length and location for Fixed x := dryspLenF delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomDrysp res_anom@cnFillColors := coloranomaly(::-1,:) xanom = x(ens,:,:) xanom = (/x(ens,:,:) - climdryLenF/) wks = gsn_open_wks(type,direps+"GCM_AnomDryLenFixE"+ens) res_anom@tiMainString = SEASON+" Dryspell Anomaly Fixed (Ens "+ens +")" cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) x := dryspLocF delete(res_anom@cnLevels) res_anom@cnFillColors := coloranomaly xanom = x(ens,:,:) xanom = (/x(ens,:,:) - climdryLocF/) wks = gsn_open_wks(type,direps+"GCM_AnomDryTimingFixEns"+ens) res_anom@tiMainString = SEASON+" Dry Timing Anomaly Fixed(Ens "+ens +")" cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) ;;;;;;;;;;;;;;;;;;;; ;;;; max Wetsp length and location x := wetspLen delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomDrysp res_anom@cnFillColors := coloranomaly1 xanom = x(ens,:,:) xanom = (/x(ens,:,:) - climwetLen/) wks = gsn_open_wks(type,direps+"GCM_AnomWetspEns"+ens) res_anom@tiMainString =SEASON+" Max Wetspell Anomaly (Ens "+ens +")" cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) x := wetspLoc delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomWetsp res_anom@cnFillColors := coloranomaly1 xanom = x(ens,:,:) xanom = (/x(ens,:,:) - climwetLoc/) wks = gsn_open_wks(type,direps+"GCM_AnomWetStartEns"+ ens) res_anom@tiMainString = SEASON+" Wet Start Anomaly (Ens "+ens +")" cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) ;;;; max Wetsp length and location for fixed x := wetspLenF delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomDrysp res_anom@cnFillColors := coloranomaly1 xanom = x(ens,:,:) xanom = (/x(ens,:,:) - climwetLenF/) wks = gsn_open_wks(type,direps+"GCM_AnomWetLenFixEns"+ens) res_anom@tiMainString =SEASON+" Max Wetspell Anomaly Fixed (Ens "+ens +")" cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) x := wetspLocF delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomWetsp res_anom@cnFillColors := coloranomaly1 xanom = x(ens,:,:) xanom = (/x(ens,:,:) - climwetLocF/) wks = gsn_open_wks(type,direps+"GCM_AnomWetTimingFixEns"+ ens) res_anom@tiMainString = SEASON+" Wet Timin Anomaly Fixed(Ens "+ens +")" cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) end if ; plot Anomaly end if ; OnsetPlotEnsMember end do if (doOnsetClim .and. PlotClimatology) then ;;climOnset wks = gsn_open_wks(type,direps+"GCM_OnsetDateClim") ronset@tiMainString = SEASON+" Onset Climatology " cntr = gsn_csm_contour_map(wks,climonset,ronset) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) ;;Climcessn wks = gsn_open_wks(type,direps+"GCM_CessnDateClim") rcessn@tiMainString = SEASON+" Cessation Climatology " cntr = gsn_csm_contour_map(wks,climcessn,rcessn) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) ;GrowLen wks = gsn_open_wks(type,direps+"GCM_GrowlClim") rgrowl@tiMainString = SEASON+" Length Climatology " cntr = gsn_csm_contour_map(wks,climgrowl,rgrowl) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) ;Dryspell Timing wks = gsn_open_wks(type,direps+"GCM_DrySpTimingClim") rdryspLoc@tiMainString = SEASON+" Climatology drysp timing " cntr = gsn_csm_contour_map(wks,climdryLoc,rdryspLoc) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) ;Dry length wks = gsn_open_wks(type,direps+"GCM_DrySpLengthClim") rdrysp@tiMainString = SEASON+" Climatology max dryspell length " cntr = gsn_csm_contour_map(wks,climdryLen,rdrysp) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) ;Dryspell Timing for fixed season wks = gsn_open_wks(type,direps+"GCM_DrySpTimingFixClim") rdryspLoc@tiMainString = SEASON+" Clim max drysp timing (fixed season)" cntr = gsn_csm_contour_map(wks,climdryLocF,rdryspLoc) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) ;Dry length for fixed season wks = gsn_open_wks(type,direps+"GCM_DrySpLenFixClim") rdrysp@tiMainString = SEASON+" Clim. max drysp length (fixed season) " cntr = gsn_csm_contour_map(wks,climdryLenF,rdrysp) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) ;Max Wetspell Timing wks = gsn_open_wks(type,direps+"GCM_WetSpTimingClim") rdryspLoc@tiMainString = SEASON+" Clim max wetsp timing " cntr = gsn_csm_contour_map(wks,climwetLoc,rwetspLoc) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) ;Wetspell Length wks = gsn_open_wks(type,direps+"GCM_WetSpLenthClim") rdrysp@tiMainString = SEASON+" Clim max Wetsp length " cntr = gsn_csm_contour_map(wks,climwetLen,rwetsp) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) ;Max Wetspell Timing for fixed season wks = gsn_open_wks(type,direps+"GCM_WetSpTimingFixClim") rdryspLoc@tiMainString = SEASON+" Clim max wetsp timing (fixed season) " cntr = gsn_csm_contour_map(wks,climwetLocF,rwetspLoc) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) ;Wetspell Length wks = gsn_open_wks(type,direps+"GCM_WetSpLenFixClim") rdrysp@tiMainString = SEASON+" Clim max wetsp length (fixed season) " cntr = gsn_csm_contour_map(wks,climwetLenF,rwetsp) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) mdim = dimsizes(fmonthT) icount = 0 do imond = startmon, startmon + mdim - 1 x := climDryMon(icount,:,:) xnam := direps+"GCM_DrySpLenClimMonth"+icount xtit := "Climatology max dryspell for " + monthdef(imond) wks = gsn_open_wks(type,xnam) rdrysp@tiMainString = xtit cntr = gsn_csm_contour_map(wks,x,rdrysp) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) x := climWetMon(icount,:,:) xnam := direps+"GCM_WetSpLenClimMonth"+icount xtit := "Climatology max wetspell for " + monthdef(imond) wks = gsn_open_wks(type,xnam) rdrysp@tiMainString = xtit cntr = gsn_csm_contour_map(wks,x,rwetsp) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) icount = icount + 1 end do end if ; doOnsetClim .and. PlotClimatology delete(dimsonset) ;############################################################################## ; Do the ensemble forecasts here ;############################################################################# lnres = True lnres@gsLineColor = "black" lnres@gsLineThicknessF = 2.0 plres = lnres plres@gsLineColor = "blue" plres@gsLineThicknessF = 6.0 xlres = lnres xlres@gsLineColor = "black" xlres@gsLineThicknessF = 1.0 xlres@gsLineDashPattern = 4 dims = dimsizes(onset) nens = dims(0) if (avgOverOnset) then onsetavg = ispan(1,nens - 1,1) onsetens = dim_avg_n_Wrap(onset(onsetavg,:,:),0) cessationens = dim_avg_n_Wrap(cessation(onsetavg,:,:),0) growinglenens = dim_avg_n_Wrap(growinglen(onsetavg,:,:),0) dryspLenens = dim_avg_n_Wrap(dryspLen(onsetavg,:,:),0) dryspLocens = dim_avg_n_Wrap(dryspLoc(onsetavg,:,:),0) wetspLenens = dim_avg_n_Wrap(wetspLen(onsetavg,:,:),0) wetspLocens = dim_avg_n_Wrap(wetspLoc(onsetavg,:,:),0) dryspLenensF = dim_avg_n_Wrap(dryspLenF(onsetavg,:,:),0) dryspLocensF = dim_avg_n_Wrap(dryspLocF(onsetavg,:,:),0) wetspLenensF = dim_avg_n_Wrap(wetspLenF(onsetavg,:,:),0) wetspLocensF = dim_avg_n_Wrap(wetspLocF(onsetavg,:,:),0) dryspLenensM = dim_avg_n_Wrap(fmonDryLen(:,onsetavg,:,:),1) wetspLenensM = dim_avg_n_Wrap(fmonWetLen(:,onsetavg,:,:),1) else onsetens = onset(iavg,:,:) cessationens = cessation(iavg,:,:) growinglenens = growinglen(iavg,:,:) dryspLenens = dryspLen(iavg,:,:) dryspLocens = dryspLoc(iavg,:,:) wetspLenens = wetspLen(iavg,:,:) wetspLocens = wetspLoc(iavg,:,:) dryspLenensF = dryspLenF(iavg,:,:) dryspLocensF = dryspLocF(iavg,:,:) wetspLenensF = wetspLenF(iavg,:,:) wetspLocensF = wetspLocF(iavg,:,:) dryspLenensM = fmonDryLen(:,iavg,:,:) wetspLenensM = fmonWetLen(:,iavg,:,:) end if print(" range: onsetens ") printMinMax(onsetens,0) print(" range: cessation ") printMinMax(cessationens,0) print("Range: growlen ") printMinMax(growinglenens,0) print("Range: wetspell len ") printMinMax(wetspLenens,0) print("Range: dryspell len ") printMinMax(dryspLenens,0) print("Range: wetspell loc ") printMinMax(wetspLocens,0) print("Range: dryspell loc ") printMinMax(dryspLocens,0) if (PlotStdDev) then fname = "./analdat/AverageOnset.nc" system("/bin/rm -f " + fname) fout = addfile(fname,"c") fout->onset = onsetens fname = "./analdat/AverageCessn.nc" system("/bin/rm -f " + fname) fout = addfile(fname,"c") fout->cessn = cessationens onsetStdev = dim_stddev_n_Wrap(onset,0) onsetLowBound95 = onsetens onsetHighBound95 = onsetLowBound95 dims := dimsizes(onsetStdev) dimy := dims(0) dimx := dims(1) if(dimsizes(dims) .ge. 2) then do j=0, dimy-1 do i = 0, dimx - 1 tmp := sqrt(num(.not. ismissing(onset(:,j,i)))) if ( .not. ismissing(tmp) .and. tmp .gt. 0.0 ) then onsetLowBound95(j,i) = (/onsetens(j,i) - 1.96*onsetStdev(j,i) /tmp /) onsetHighBound95(j,i) = (/ onsetens(j,i) + 1.96*onsetStdev(j,i) /tmp /) else onsetLowBound95(j,i) = onsetLowBound95@_FillValue onsetHighBound95(j,i) = onsetHighBound95@_FillValue end if end do end do end if ;;;;;;;;;;;; Lowbound of 95% level confidence int (earliest onset)a wks = gsn_open_wks(type,direps+"GCM_EarliestDate"+ "ENS95Low") ronset@tiMainString = onsetTitle + " (Earliest onset) " cntr = gsn_csm_contour_map(wks,onsetLowBound95,ronset) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete(cntr) delete(wks) ;;;;;;;;;;;; High bound of 95% level confidence int (latest/delayed onset) wks = gsn_open_wks(type,direps+"GCM_LatestDate"+ "ENS95High") ronset@tiMainString = onsetTitle + " (Latest onset) " cntr = gsn_csm_contour_map(wks,onsetHighBound95,ronset) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete(cntr) delete(wks) ;;;;;;;; STD Dev ;;;;;;;; ; Standard deviation wks = gsn_open_wks(type,direps+"GCM_OnsetDate"+ "Sdev") xvar := onsetStdev resstd = res resstd@tiMainString = onsetTitle + " (Std. dev) " ;resstd@cnMaxLevelCount = 8 ;resstd@cnLevelSelectionMode = "EqualSpacedLevels" ; equally spaced resstd@cnLevelSelectionMode = "ExplicitLevels" ; ;sdcolors = (/"yellowgreen","palegreen",\ sdcolors = (/"yellowgreen","greenyellow","yellow","orange","gray",\ "goldenrod",\ "slateblue","violet", "magenta","maroon"/) sdlevels = (/5, 10,20,30 /) resstd@cnLevels = sdlevels resstd@cnFillColors = sdcolors resstd@cnFillOn = True ;resstd@cnLineThicknessF = 2 ; line thickness ;resstd@cnLinesOn = False ;True cntr = gsn_csm_contour_map(wks,xvar,resstd) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete(cntr) delete(wks) end if if (doOnsetClim .and. PlotEnsMean) then ;;;;;;;;;;; ;;;; Plot Onset ;;;; wks = gsn_open_wks(type,direps+"GCM_OnsetDate"+ "ENSmean") ronset@tiMainString = onsetTitle + " (Ens Mean) " cntr = gsn_csm_contour_map(wks,onsetens,ronset) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) ;;;;;;; Cessation wks = gsn_open_wks(type,direps+"GCM_CessationDate"+"ENSmean") rcessn@tiMainString = cessnTitle + " (Ens Mean) " cntr = gsn_csm_contour_map(wks,cessationens,rcessn) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) ;;;;;;;;;;;;;;;;;; ; Growing length ;;;;;;;;;;;;;;;;;; wks = gsn_open_wks(type,direps+"GCM_GrowingSeasonLength"+"ENSmean") rgrowl@tiMainString = growlTitle + " (Ens Mean) " cntr = gsn_csm_contour_map(wks,growinglenens,rgrowl) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) ;;;;;;;;;;;;;;; ;;;; Max Dryspell Length and Timing wks = gsn_open_wks(type,direps+"GCM_DrySpTiming"+ "ENSmean") rdryspLoc@tiMainString = dryTimeTitle + " (Ens Mean) " cntr = gsn_csm_contour_map(wks,dryspLocens,rdryspLoc) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) wks = gsn_open_wks(type,direps+"GCM_DrySpLength"+ "ENSmean") rdrysp@tiMainString = dryspTitle + " (Ens Mean) " cntr = gsn_csm_contour_map(wks,dryspLenens,rdrysp) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) ;;;; Max Dryspell Length and Timing for fixed season wks = gsn_open_wks(type,direps+"GCM_DrySpTimingFix"+ "ENSmean") rdryspLoc@tiMainString = dryTimeTitle + " (fixed season; Ens Mean) " cntr = gsn_csm_contour_map(wks,dryspLocensF,rdryspLoc) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) wks = gsn_open_wks(type,direps+"GCM_DrySpLenFix"+ "ENSmean") rdrysp@tiMainString = dryspTitle + " (fixed season; Ens Mean) " cntr = gsn_csm_contour_map(wks,dryspLenensF,rdrysp) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) ;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Maximum Wetspell length and its location after onset wks = gsn_open_wks(type,direps+"GCM_WetSpTiming"+"ENSmean") rdrysp@tiMainString = wetspTitle + " (Ens Mean) " cntr = gsn_csm_contour_map(wks,wetspLocens,rwetspLoc) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) wks = gsn_open_wks(type,direps+"GCM_WetSpLength"+"ENSmean") rwetsp@tiMainString = wetspTitle + " (Ens Mean) " cntr = gsn_csm_contour_map(wks,wetspLenens,rwetsp) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) ;;; Maximum Wetspell length and location for fixed season wks = gsn_open_wks(type,direps+"GCM_WetSpTimingFix"+"ENSmean") rdrysp@tiMainString = wetspTitle + " (fixed season; Ens Mean) " cntr = gsn_csm_contour_map(wks,wetspLocensF,rwetspLoc) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) wks = gsn_open_wks(type,direps+"GCM_WetSpLenFix"+"ENSmean") rwetsp@tiMainString = wetspTitle + " (fixed season; Ens Mean) " cntr = gsn_csm_contour_map(wks,wetspLenensF,rwetsp) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) mdim = dimsizes(fmonthT) icount = 0 do imond = startmon, startmon + mdim - 1 x := dryspLenensM(icount,:,:) xnam := direps+"GCM_DrySpLenENSmeanMonth"+icount xtit := "Ens mean max dryspell for " + monthdef(imond) wks = gsn_open_wks(type,xnam) rdrysp@tiMainString = xtit cntr = gsn_csm_contour_map(wks,x,rdrysp) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) x := wetspLenensM(icount,:,:) xnam := direps+"GCM_WetSpLenENSmeanMonth"+icount xtit := "Ens mean max wetspell for " + monthdef(imond) wks = gsn_open_wks(type,xnam) rwetsp@tiMainString = xtit cntr = gsn_csm_contour_map(wks,x,rwetsp) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks/]) icount = icount + 1 end do end if ; plot ensemble mean if (doOnsetClim .and. PlotEnsAnomaly) then ;;;;;;;;;; Ensemble Anomaly ;;;;; Plot onset anomaly delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomOnset res_anom@cnFillColors := coloranomaly(::-1,:) xanom = onsetens xanom = (/xanom - climonset/) wks = gsn_open_wks(type,direps+"GCM_AnomOnset_ENS") res_anom@tiMainString = SEASON+" Onset Ens. Mean Anomaly " cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) ;;;; Plot Cessn anomaly delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomCessn res_anom@cnFillColors := coloranomaly1 xanom = cessationens xanom = (/xanom - climcessn/) wks = gsn_open_wks(type,direps+"GCM_AnomCessn_ENS") res_anom@tiMainString = SEASON+" Cessation Ens. Mean Anomaly " cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) ;;;; Plot GrowLen anomaly delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomGrowl xanom = growinglenens xanom = (/xanom - climgrowl/) wks = gsn_open_wks(type,direps+"GCM_AnomGrowl_ENS") res_anom@tiMainString = SEASON+" Length Ens. Mean Anomaly " cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) ;;;; Plot Max Dry spell timing/location (Start Time) and Length delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomOnset res_anom@cnFillColors := coloranomaly xanom = dryspLocens xanom = (/xanom - climdryLoc/) wks = gsn_open_wks(type,direps+"GCM_AnomDryTiming_ENS") res_anom@tiMainString = SEASON+" Drysp timing Ens Mean Anomaly " cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) ;; anom length delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomDrysp res_anom@cnFillColors := coloranomaly(::-1,:) xanom = dryspLenens xanom = (/xanom - climdryLen/) wks = gsn_open_wks(type,direps+"GCM_AnomDryLen_ENS") res_anom@tiMainString = SEASON+" Dry Max Len Ens Mean Anomaly " cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) ; Drysp Timing for fixed season delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomOnset res_anom@cnFillColors := coloranomaly xanom = dryspLocensF xanom = (/xanom - climdryLocF/) wks = gsn_open_wks(type,direps+"GCM_AnomDryTimingFix_ENS") res_anom@tiMainString = SEASON+" Drysp timing Ens Mean Anomaly (fixed season) " cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) ;; anom length delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomDrysp res_anom@cnFillColors := coloranomaly(::-1,:) xanom = dryspLenensF xanom = (/xanom - climdryLenF/) wks = gsn_open_wks(type,direps+"GCM_AnomDryLenFix_ENS") res_anom@tiMainString = SEASON+" Dry Max Len Ens Mean Anomaly (Fixed season)" cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) ;;;; Plot Max Wet spell Location (Start Time) and Length delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomWetsp res_anom@cnFillColors := coloranomaly1 xanom = wetspLocens xanom = (/xanom - climwetLoc/) wks = gsn_open_wks(type,direps+"GCM_AnomWetTiming_ENS") res_anom@tiMainString = SEASON+" Max Wetsp timing (Ens Mean Anomaly)" cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) ;; anom length delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomWetsp res_anom@cnFillColors := coloranomaly1 xanom = wetspLenens xanom = (/xanom - climwetLen/) wks = gsn_open_wks(type,direps+"GCM_AnomWetLen_ENS") res_anom@tiMainString = SEASON+" Max Wetsp Length Ens Mean Anomaly " cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) ;;; Plot Max Wet spell Location (Start Time) and Length for fixed season delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomWetsp res_anom@cnFillColors := coloranomaly1 xanom = wetspLocensF xanom = (/xanom - climwetLocF/) wks = gsn_open_wks(type,direps+"GCM_AnomWetTimingFix_ENS") res_anom@tiMainString = SEASON+" Max Wetsp timing (Fixed Szn; Ens Mean Anomaly)" cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) ;; anom length delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomWetsp res_anom@cnFillColors := coloranomaly1 xanom = wetspLenensF xanom = (/xanom - climwetLenF/) wks = gsn_open_wks(type,direps+"GCM_AnomWetLenFix_ENS") res_anom@tiMainString = SEASON+" Max Wetsp Length Ens Mean Anomaly (Fixed Szn) " cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) ;;;;;; mdim = dimsizes(fmonthT) icount = 0 do imond = startmon, startmon + mdim - 1 delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomDrysp res_anom@cnFillColors := coloranomaly(::-1,:) xanom := dryspLenensM(icount,:,:) xanom = (/ xanom - climDryMon(icount,:,:) /) xnam := direps+"GCM_AnomDrySpLenENSmeanMonth"+icount xtit := "Ens mean max dryspell anomaly for " + monthdef(imond) res_anom@tiMainString = xtit wks = gsn_open_wks(type,xnam) cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) delete(res_anom@cnLevels) res_anom@cnLevels = LevAnomWetsp res_anom@cnFillColors := coloranomaly1 xanom = wetspLenensM(icount,:,:) xanom = (/xanom - climWetMon(icount,:,:) /) xnam := direps+"GCM_AnomWetSpLenENSmeanMonth"+icount xtit := "Ens mean max wetspell anomaly for " + monthdef(imond) res_anom@tiMainString = xtit wks = gsn_open_wks(type,xnam) cntr = gsn_csm_contour_map(wks,xanom,res_anom) ;;poly1 = gsn_add_shapefile_polylines(wks,cntr,f1shp,lnres) ;poly1 = gsn_add_polyline(wks,cntr,state_lon,state_lat,lnres) draw(cntr) frame(wks) delete([/cntr,wks,xanom/]) icount = icount + 1 end do end if ; plotEnsAnomaly end