; =========================================== ; panel_10.ncl ; =========================================== load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" begin f = addfile ("chi200_ud_smooth.nc","r") scale = 1.e6 ; scale factor chi = f->CHI ; get chi chi = chi/scale ; scale for convenience ;============================================== ; create color plot ;============================================= wks = gsn_open_wks ("ps", "panel" ) ; open ps file gsn_define_colormap(wks,"BlWhRe") ; choose colormap hres = True ; plot mods desired hres@gsnDraw = False ; don't draw yet hres@gsnFrame = False ; don't advance frame yet hres@cnFillOn = True ; turn on color fill hres@gsnSpreadColors = True ; use full range of colors hres@pmLabelBarOrthogonalPosF = -.05 ; position label bar hres@tiMainString = "Pacific Region" ; title hres@cnLevelSelectionMode = "ManualLevels" ; manual contour levels hres@cnMinLevelValF = -10. ; minimum level hres@cnMaxLevelValF = 10. ; maximum level hres@cnLevelSpacingF = 2. ; contour spacing base_plot = gsn_csm_hov(wks, chi(:,{100:220}), hres) ;============================================== ; create xy plot ;============================================= x = dim_avg(chi) ; average chi x!0 = "chi" ; remove warning message y = ispan(0,dimsizes(chi&time)-1,1) ; create y-axis y!0 = "time" xyres = True ; xy plot mods desired xyres@vpWidthF = .20 ; set width of second plot xyres@tmXBMinorOn = False ; no minor tickmarks xyres@tmXBLabelStride = 2 ; label stride xyres@gsnDraw = False ; don't draw yet xyres@gsnFrame = False ; don't advance frame yet xyres@gsnCenterString = "Zonal Ave" ; add title xyres@txFontHeightF = .015 ; change font height plot = gsn_csm_xy(wks, x,y,xyres) ;============================================== ; attach plots ;============================================= newplot = gsn_attach_plots(base_plot,(/plot/),hres,xyres) draw(base_plot) frame(wks) end