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/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/run_cor.ncl"
begin
f=addfile("/cygdrive/G/cntl/b.e11.B1850C5CN.f19_g16.0850cntl.001.cam.h0.TS.185001-200512.nc","r")
f2=addfile("/cygdrive/G/cntl/cntl.001.cam.h0.V.185001-200512.nc","r")
sst =f->TS(:,{-5:5},{190:240})
vv =f2->V(:,{850},{20:40},{100:140})
year =ispan(1850,2005,1)
year@units ="yr"
year1 =ispan(1850,1985,1)
year1@units ="yr"
vv =-1*vv
siw =month_to_season(sst,"DJF")
v =month_to_season(vv,"DJF")
sss =wgt_areaave(siw,1.0,1.0,1)
vvvv =wgt_areaave(v,1.0,1.0,1)
cor11 =run_cor(sss,vvvv,year,21)
;**************************************
labels =(/"cor11"/)
wks = gsn_open_wks("png","/cygdrive/G/cntl/gsn_xy")
res = True
res@gsnYRefLine =0.433
res@gsnYRefLine =-0.433
res@gsnYRefLineColor ="red"
res@xyLineColor = "black" ; use xyLineColors if multiple lines
res@gsnMaximize = True
res@tiMainString = "EAWWMI(v850) AND NINO3.4"
res@tiYAxisString = "cor"
res@tiXAxisString = "Time"
plot1= gsn_csm_xy(wks,year1,cor11,res)
end