;******************************************************** ; climo_0.ncl ; ; Concepts illustrated: ; - Read netCDF containing monthly means of SLP ; Data can be downloaded from: ; https://www.esrl.noaa.gov/psd/data/gridded/data.ncep.reanalysis.html ; - Use 'cd_calendar' to derive 'yyyymm' values ; - Specfy temporal period of interest ; - Use 'ind' function to select full years ; - Calculate monthly climatological means and interannual variability ; using 'clmMonTLL' and 'stdMonTLL' ; - plot ;******************************************************** ; MAIN ;******************************************************** diri = "./" fili = "slp.mon.mean.nc" pthi = diri+fili ; open the netCDF file f = addfile (pthi, "r") slp = f->slp ; (time,lat,lon) printVarSummary(slp) printMinMax(slp,0) print("=========") ;******************************** ; the clmMonTLL and stdMonTLL require full years only ;******************************** ymStrt = 195001 ymLast = 201712 yyyymm = cd_calendar(slp&time, -1) tStrt = ind(yyyymm.eq.ymStrt) tLast = ind(yyyymm.eq.ymLast) slpAve = clmMonTLL(slp(tStrt:tLast,:,:)) slpStd = stdMonTLL(slp(tStrt:tLast,:,:)) ;******************************** ; create plot ;******************************** mon = (/"January", "February", "March", "April" \ ,"May", "June", "July", "August" \ ,"September", "October", "November" \ ,"December" /) nmo = dimsizes(mon) plot = new(2,"graphic") wks = gsn_open_wks ("png", "climo" ) ; send graphics to PNG file res = True ; plot mods desired res@cnInfoLabelOrthogonalPosF = -0.07 ; move the label inside the plot res@gsnDraw = False ; Do not draw plot res@gsnFrame = False ; Do not advance frome resP = True ; panel resources do nmo=0,6,6 ; 0,nmos-1 res@cnLevelSpacingF = 2.0 ; set contour spacing res@gsnCenterString = "Climatology" plot(0) = gsn_csm_contour_map(wks,slpAve(nmo,:,:), res) res@cnLevelSpacingF = 0.5 ; set contour spacing res@gsnCenterString = "Interannual Variability" plot(1) = gsn_csm_contour_map(wks,slpStd(nmo,:,:), res) resP@gsnPanelMainString = mon(nmo)+": "+(ymStrt/100)+"-"+(ymLast/100) gsn_panel(wks,plot,(/2,1/),resP) ; create panel plot end do