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/csm/shea_util.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/diagnostics_cam.ncl" ; import data f=addfile("GPCP__V1_2dd__PRECIP__1x1__alltimes.nc","r") y=f->precip x=y(:,{-0.50:30.5},{349.5:10.5}) ; Font onset ;perform a 15-day running average x_sm_Font=runave_n_Wrap(x,15,0,0) ;this implies that 7 points will be lost at the leftsmost side and 7 at the rightmost side ; zonal average x_zonal_Font=dim_avg_n_Wrap(x_sm_Font,2) ;Interpolating data to have data at the latitudes 0 and 20N xi_Font=x_zonal_Font&lat ; get the latitude coordinates of xi_Font(input coordinates) xo_Font=x_zonal_Font&lat ; define the new latitude coordinates (output coordinates) k=flt2dble(fspan(1,5,dimsizes(xo_Font)+2)) ; create an array of the same type as xo_Font(type double) but that has 2 elements more k(0:dimsizes(xo_Font)-1)=xo_Font ; k ingests all of the elements of xo_Font k(dimsizes(xo_Font):dimsizes(xo_Font)+1)=(/0,20/); in addition k takes 0 and 20 qsort(k); sort k delete(xo_Font) xo_Font=k x_regrid_Font=linint1_n_Wrap(xi_Font,x_zonal_Font,False,xo_Font,0,1) ;process spatial average over two distinc areas: ; 0-7.5N and 7.5-20N x_S=x_regrid_Font(:,{0:7.5}) x_S_avg=dim_avg_n_Wrap(x_S,1) x_N=x_regrid_Font(:,{7.5:20}) x_N_avg=dim_avg_n_Wrap(x_N,1) ;gather data per pentad ;organise data by yyyyddd time=f->time TIME=cd_calendar(time,0) year=floattointeger(TIME(:,0)); extract year and convert it into integer month=floattointeger(TIME(:,1)); extract month and convert it into integer day=floattointeger(TIME(:,2)); extract day (of month) and convert it into integer ; Process the pentad pp=floattointeger((day_of_year(year,month,day)-1)/5)+1 pp(ind(pp.eq.74))=73 yyyypp=year*1000 + pp x_pp=x_N_avg x_pp&time=yyyypp