;*************************************************************** 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" ;**************************************************************** begin ;**************************************************** ; open file and read in monthly data ;**************************************************** ymdStrt=19880601 ymdLast=19880831 yrStrt=ymdStrt/10000 yrLast=ymdLast/10000 nhar=4 latL=30 latR=36 lonL=69 lonR=76 f = addfile ("/Users/nabeela17/Downloads/APHRO_MA_025deg_V1101.1988.nc", "r") ;****first-step TIME2=f->time ymd = cd_calendar(TIME2,-2) iStrt=ind(ymd.eq.ymdStrt) iLast=ind(ymd.eq.ymdLast) delete(TIME2) delete(ymd) time=f->time(iStrt:iLast) ;print(iStrt) TIME = cd_calendar(time, 0) ; type float year = floattoint( TIME(:,0) ) month = floattoint( TIME(:,1) ) day = floattoint( TIME(:,2) ) ddd = day_of_year(year, month, day) ;print(ddd) ;yyyyddd = year*1000 + ddd ;print(yyyyddd) ;**second-step ;***define-timeperiod-event**** smdStrt=19880713 smdLast=19880718 syrStrt=smdStrt/10000 syrLast=smdLast/10000 TIME3=f->time smd = cd_calendar(TIME3,-2) siStrt=ind(smd.eq.smdStrt) siLast=ind(smd.eq.smdLast) delete(TIME3) delete(smd) ;print(siLast) time1=f->time(siStrt:siLast) ;print(time1) TIME1 = cd_calendar(time1, 0) ; type float syear = floattoint( TIME1(:,0) ) smonth = floattoint( TIME1(:,1) ) sday = floattoint( TIME1(:,2) ) sddd = day_of_year(syear, smonth, sday) ;print(sddd) ;***define-second-time-for-anomaly ;syyyyddd = syear*1000 + sddd ;print(syyyyddd) pre = f->precip(ddd,:,:) printVarSummary(pre) xClmDay=clmDayTLL(pre,ddd) printVarSummary(xClmDay) xAnom=calcDayAnomTLL(pre,sddd,xClmDay) printVarSummary(xAnom) exit xClmDay_sm = smthClmDayTLL(xClmDay, nhar) printVarSummary(xClmDay_sm) xAnom_sm = calcDayAnomTLL (pre, yyyyddd, xClmDay_sm) ;printVarSummary(xAnom_sm) printMinMax(xAnom_sm,True) end