;***************************************************** ;xy_18.ncl ;***************************************************** load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" ;***************************************************** begin ;***************************************************** ; open files and read in monthly data ;***************************************************** d10 = ("/ccsm/data/PCM1/B06.61/atm/tSeries/") d11 = ("/ccsm/data/PCM1/B06.59/atm/tSeries/") d12 = ("/ccsm/data/PCM1/B06.60/atm/tSeries/") d13 = ("/ccsm/data/PCM1/B06.57/atm/tSeries/") d14 = ("/ccsm/data/PCM1/B06.66/atm/tSeries/") d15 = ("/ccsm/data/PCM1/B06.67/atm/tSeries/") d16 = ("/ccsm/data/PCM1/B06.68/atm/tSeries/") d17 = ("/ccsm/data/PCM1/B06.69/atm/tSeries/") v1 = addfile (d10+"TREFHT.B06.61.atm.1890-1999ANN.nc", "r") v2 = addfile (d11+"TREFHT.B06.59.atm.1890-1999ANN.nc", "r") v3 = addfile (d12+"TREFHT.B06.60.atm.1890-1999ANN.nc", "r") v4 = addfile (d13+"TREFHT.B06.57.atm.1890-1999ANN.nc", "r") n1 = addfile (d14+"TREFHT.B06.66.atm.1890-1999ANN.nc", "r") n2 = addfile (d15+"TREFHT.B06.67.atm.1890-1999ANN.nc", "r") n3 = addfile (d16+"TREFHT.B06.68.atm.1890-1999ANN.nc", "r") n4 = addfile (d17+"TREFHT.B06.69.atm.1890-1999ANN.nc", "r") g = addfile ("/cgd/ccr/jma/gw.nc","r") ;***************************************************** ; some parameters ;***************************************************** nyrs = 110 nlon = 128 nlat = 64 time = ispan(1890,1999,1) ;***************************************************** ; OBS ;***************************************************** obs = asciiread("/cgd/ccr/jma/jones_glob_ann_2002.asc",(/146/),"float") ;***************************************************** ; NATURAL ;***************************************************** nat = new ((/4,nyrs,nlat,nlon/), float) nat(0,:,:,:) = n1->TREFHT nat(1,:,:,:) = n2->TREFHT nat(2,:,:,:) = n3->TREFHT nat(3,:,:,:) = n4->TREFHT ncase = 4 gavn = wgt_areaave(nat,g->gw,1.0,0) gavan = new((/ncase,nyrs/),float) do c = 0, ncase-1 gavan(c,:) = gavn(c,:)-dim_avg(gavn(c,0:29)) end do gavan!0 = "ensembles" gavan!1 = "time" gavan&time = v1->time delete(nat) ;***************************************************** ; ALL ;***************************************************** volc = new ((/4,nyrs,nlat,nlon/), float) volc(0,:,:,:) = v1->TREFHT volc(1,:,:,:) = v2->TREFHT volc(2,:,:,:) = v3->TREFHT volc(3,:,:,:) = v4->TREFHT ncase = 4 gavv = wgt_areaave(volc,g->gw,1.0,0) gavav = new((/ncase,nyrs/),float) do c = 0, ncase-1 gavav(c,:) = gavv(c,:)-dim_avg(gavv(c,0:29)) end do gavav!0 = "ensembles" gavav!1 = "time" gavav&time = v1->time delete(volc) ;***************************************************** ; CALCULATE MIN & MAX ;***************************************************** mnmx = new ((/7,nyrs/), float) mnmx(0,:) = dim_min( gavav(time|:,ensembles|:) ) mnmx(1,:) = dim_max( gavav(time|:,ensembles|:) ) mnmx(2,:) = dim_min( gavan(time|:,ensembles|:) ) mnmx(3,:) = dim_max( gavan(time|:,ensembles|:) ) mnmx(4,:) = dim_avg( gavav(time|:,ensembles|:) ) mnmx(5,:) = dim_avg( gavan(time|:,ensembles|:) ) mnmx(6,0:109) = obs(34:143)-dim_avg(obs(34:63)) ;***************************************************** ; create plot ;***************************************************** wks = gsn_open_wks("ps","xy") ; create plot i = NhlNewColor(wks,1.0,0.71,0.76) ; add color to colormap j = NhlNewColor(wks,0.64,0.71,0.8) ; ditto res = True ; plot mods desired res@gsnDraw = False ; don't draw yet res@gsnFrame = False ; don't advance frame yet res@vpHeightF = 0.4 ; change aspect ratio of plot res@vpWidthF = 0.7 res@trXMinF = 1890 ; set x-axis minimum res@xyMonoLineColor = "False" ; want colored lines res@xyLineColors = (/"Red","Blue","Black"/) ; colors chosen res@xyLineThicknesses = (/3.,3.,4./) ; line thicknesses res@xyDashPatterns = (/0.,0.,0./) ; make all lines solid res@tiYAxisString = "~F35~J~F~C" ; add a axis title res@txFontHeightF = 0.0195 ; change title font heights plot = gsn_csm_xy (wks,time,mnmx(4:6,:),res) ; create plot plot = fill_xy2(wks,plot(0),time,mnmx(2,:),mnmx(3,:),(/0.64,0.71,0.8/),\ (/0.64,0.71,0.8/)) plot = fill_xy2(wks,plot(0),time,mnmx(0,:),mnmx(1,:),(/1.0,0.71,0.76/),\ (/1.0,0.71,0.76/)) ;***************************************************** ; Manually create legend ;***************************************************** res_text = True ; text mods desired res_text@txFontHeightF = 0.015 ; change text size res_text@txJust = "CenterLeft" ; text justification res_lines = True ; polyline mods desired res_lines@gsLineDashPattern = 0. ; solid line res_lines@gsLineThicknessF = 5. ; line thicker res_lines@gsLineColor = "red" ; line color xx = (/1893,1907/) yy = (/0.705,0.705/) gsn_polyline(wks,plot,xx,yy,res_lines) ; add polyline gsn_text(wks,plot,"Anthropogenic + Natural",1910,0.705,res_text); add text yy = (/0.79,0.79/) res_lines@gsLineColor = "blue" ; change to blue gsn_polyline(wks,plot,xx,yy,res_lines) ; add polyline gsn_text(wks,plot,"Natural",1910,0.79,res_text) ; add text yy = (/0.875,0.875/) res_lines@gsLineColor = "black" ; change to black gsn_polyline(wks,plot,xx,yy,res_lines) ; add poly line gsn_text(wks,plot,"Observations",1910,0.875,res_text) ; add text ;***************************************************** ; Manually create titles ;***************************************************** res_text@txJust = "CenterCenter" ; change justification res_text@txFontHeightF = 0.03 ; change font size gsn_text_ndc(wks,"Parallel Climate Model Ensembles",0.55,0.90,res_text) res_text@txFontHeightF = 0.02 ; change font size gsn_text_ndc(wks,"Global Temperature Anomalies",0.55,0.86,res_text) res_text@txFontHeightF = 0.015 ; change font size gsn_text_ndc(wks,"from 1890-1919 average",0.55,0.83,res_text) draw(plot) frame(wks) ; advance frame end