load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" begin ;;============================================= ;;=========== beginning of settings =========== ;;============================================= neof = (/0,1/); what pcs to calculate years = (/1984,2013/) months= (/7,9/) diri="."; input directory ; fin="EOF.v.700.nc"; input file ; fin="EOF.v.200.nc"; input file fin="EOF.Tb.nc"; input file ; varname="vwnd" ; variable name of EOF, for the title varname="Tb" ; variable name of EOF, for the title interval=2 ; Tb has 8 times a day and vwnd 4 threshold=0.6; arbitrary, need to discuss inf=addfile(diri+"/"+fin,"r") pc_all=inf->eof_ts time=inf->time cd=cd_calendar(time,0) indjas=ind(cd(:,0) .ge. years(0) .and. cd(:,0) .le. years(1) .and. \ cd(:,1) .ge. months(0).and. cd(:,1) .le. months(1)) pc1=pc_all(0,indjas) pc2=pc_all(1,indjas) pc1:=pc1(::interval) pc2:=pc2(::interval); make the time series having consistent time interval pc_square=sqrt(pc1^2+pc2^2) ; A simple way to identify AEWs, not perfect, need to discuss sd=stddev(pc_square) mean=avg(pc_square) pc_norm=(pc_square-mean)/sd copy_VarCoords(pc1,pc_norm) indaew=ind(pc_norm .ge. threshold) end