begin fils = systemfunc ("ls *.nc") ; file paths a = addfiles (fils, "r") printVarSummary (a) ListSetType (a, "cat") ; concatenate (=default) ;************************************************ ; Read the file ;************************************************ ymStrt = 692496 ; climatology start year/month ymLast = 1016808 ; " last year/month a time = f->time time = a->time yyyymm = cd_calendar(time, -1) ntStrt = ind(yyyymm.eq.ymStrt) ; start time index ntLast = ind(yyyymm.eq.ymLast) ; last time index prc = a[:]->precip(ntStrt:ntLast,:,:) ; read T from all files printVarSummary (prc) ntim = dimsizes(time) months = (/"January", "February", "March", "April" \ ,"May", "June", "July", "August" \ ,"September", "October", "November" \ ,"December" /) ;************************************************ ; Compute the climatology using a function in contributed.ncl ;************************************************ tmpClm = clmMonTLL (prc) ; monthly climatology printVarSummary(tmpClm) ;************************************************ ; 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 = 400 ; set max contour level res@cnLevelSpacingF = 5.0 ; set contour spacing 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 = " Precipitation: "+(ymStrt/100)+"-"+(ymLast/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,tmpClm(nmo,:,:), res) ; create plot end do gsn_panel(wks,plot,(/4,3/),resP) end