;************************************************ ; These files are loaded by default in NCL V6.2.0 and newer ;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" begin ;---------------------------------------------------------------------- ; Time and Data Call ;---------------------------------------------------------------------- yrStrt = 1951 yrLast = 2016 latS = -12 ; Latitude of interest latN = 1 ; to make the average lonW = 28. lonE = 42. ; ============================================================== ; Open the file: Read only the user specified period ; ============================================================== f = addfile ("cru_ts4.03.1901.2018.pre.dat.nc", "r") TIME = f->time ; Importing the time variable from file f. YYYY = cd_calendar(TIME,-1)/100 ; Time in YYYYMM format (option -1). ; The division by 100 shows only the years in YYYY format. iYYYY = ind(YYYY.ge.yrStrt .and. YYYY.le.yrLast) ; Select indices between 1979 and 2003. precip = f->pre(iYYYY,{latS:latN},{lonW:lonE}) ; Select the SLM variable only in the ; ============================================================== ; Calculates monthly anomalies ; ============================================================== clima=clmMonTLL(precip) ; Average in the longitude dimension (2) between lonW and lonE. ; With this, only the dimensions of [time|66]x[lon|36] remain. sstM = dim_avg_n_Wrap(clima,2) printVarSummary(sstM) printMinMax(sstM,0) ; ================================================================= ; Plot ; ================================================================= wks = gsn_open_wks("pdf","hovmolleraclimo") res = True res@gsnMaximize = True res@cnFillOn = True res@cnLineLabelsOn = False res@cnInfoLabelOn = False res@cnLinesOn = False res@cnLevelSelectionMode = "ExplicitLevels" ;res@cnLevels = (/60,80,100,120/) res@gsnLeftString = "" res@gsnCenterString = "" res@gsnRightString = "" res@tiMainString = "" res@tiYAxisString = "" ;reshape color bars ;res@pmLabelBarWidthF =0.05 ;res@pmLabelBarHeightF =0.4 res@lbLabelBarOn =True ;res@lbOrientation ="vertical" ;res@pmLabelBarOrthogonalPosF=-0.04 ;res@lbOrientation ="horizontal" ;res@pmLabelBarOrthogonalPosF=0.1 res@lbLabelStride =2 res@lbBoxMinorExtentF =0.2 ;resize res@vpWidthF =0.60 res@vpHeightF =0.45 ;adjust X-AXis res@tmXBTickSpacingF =2 ;adjust Y-axis ;res@gsnXAxisIrregular2Linear =True ;res@trYReverse = True ;font size res@tiMainFontHeightF =0.022 res@txFontHeightF =0.02 res@tmXBLabelFontHeightF =0.018 res@tmYLLabelFontHeightF =0.018 ;fontsize of tickmark Labels res@tiXAxisFontHeightF =0.02 res@tiYAxisFontHeightF =0.02 ; Fixes special features for time shaft . resTick = True ;resTick@ttmFormat = "%d%c%Y" ;resTick@ttmAxis = "YL" ;resTick@ttmMajorStride = 5 resTick@tmYLMode = "Explicit" resTick@tmYLValues = (/1,2,3,4,5,6,7,8,9,10,11,12/) resTick@tmYLLabels = (/"J","F","M","A","M","J","J","A","S",\ "O","N","D"/) time_axis_labels(ispan(1,12,1),res,resTick) plot = gsn_csm_hov(wks,sstM(:,{latS:latN}),res) end