fils = systemfunc ("ls precip.*.nc") ; file paths a = addfiles (fils, "r") printVarSummary (a) ;************************************************ ; Read the file ;************************************************ ymdStrt = 19790101 ; climatology start year/month/day ymdLast = 20151231 ; " last year/month/day time = a[:]->time yyyymmdd= cd_calendar(time, -2) ; note -2 print(yyyymmdd) ntStrt = ind(yyyymmdd.eq.ymdStrt) ; start time index ntLast = ind(yyyymmdd.eq.ymdLast) ; last time index print("ntStrt="+ntStrt+" ntLast="+ntLast) prc = a[:]->precip(ntStrt:ntLast,:,:) ; read precip from all files printVarSummary (prc) printMinMax (prc,0) print("=====") prcMonth = calculate_monthly_values(prc, "avg", 0, False) ; monthly mean printVarSummary (prcMonth) prcClm = clmMonTLL(prcMonth) ; Compute monthly climatology printVarSummary (prcClm) printMinMax (prcClm,0) months = (/"January", "February", "March", "April" \ ,"May", "June", "July", "August" \ ,"September", "October", "November" \ ,"December" /) ;************************************************ ; create colors ;************************************************* wks = gsn_open_wks("png","climo_ghcn") ; send graphics to PNG file ;************************************************ ; create panel plots ;************************************************* plot = new (12, graphic) ; create graphical array res = True ; plot options desired res@gsnDraw = False res@gsnFrame = False res@cnFillOn = True ; turn on color fill ;res@cnFillPalette = "amwg256" ; set color map res@cnInfoLabelOn = False ; turn off contour info label res@cnLinesOn = False ; turn off contour lines res@cnLineLabelsOn = False ; turn off line labels ;res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels ;res@cnMinLevelValF = 0 ; set min contour level ;res@cnMaxLevelValF = 328 ; set max contour level ;res@cnLevelSpacingF = 10 ; set contour spacing res@cnFillColors = (/"white","cyan", "green","yellow",\ "darkorange","red","magenta","purple",\ "black"/) res@mpFillOn = False ; turn off gray continents res@mpCenterLonF = 0 ; Centers the plot at 0 res@lbLabelBarOn = False ; No single label bar resP = True ; panel options resP@gsnPanelMainString = " Montly precipitation: "+(ymdStrt/100)+"-"+(ymdLast/100) resP@gsnMaximize = True ; maximize image resP@gsnPanelLabelBar = True ; Add common label bar do nmo=0,11 ; loop over the months res@gsnLeftString = months(nmo) plot(nmo) = gsn_csm_contour_map(wks,prcClm(nmo,:,:), res) ; create plot end do gsn_panel(wks,plot,(/4,3/),resP)