;*********************************************** ;mean rainfall distribution for nonTCs ;*********************************************** ; ; 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" begin ;************************************************ ; Read the file ;************************************************ f = addfile("non_cy.nc", "r") prc = f->pre(:,{-5:30},{40:100}) prc@long_name = "precipitation" prc@units = "mm" prc&longitude@units = "degrees_east" prc&latitude@units = "degrees_north" ;printVarSummary(prc) mean_prc = dim_avg_n_Wrap(prc,0) mean_prc@long_name = "precipitation" mean_prc@units = "mm" mean_prc&longitude@units = "degrees_east" mean_prc&latitude@units = "degrees_north" ;printVarSummary(mean_prc) ;************************************************ ; create colors ;************************************************* wks = gsn_open_wks("png","noncy_mean") ; open a workstation and send data to png colors = (/ (/255,255,255/), (/244,255,244/), \ (/217,255,217/), (/163,255,163/), (/106,255,106/), \ (/43,255,106/), (/0,224,0/), (/0,134,0/),(/255,255,0/),\ (/255,127,0/) /) / 255. ; be sure to make this a float! ;************************************************ ; create panel plots ;************************************************* res = True ; plot options desired res@cnFillOn = True ; turn on color fill res@cnLinesOn = False ; turn off contour lines res@cnFillPalette = colors ;res@cnLevelSelectionMode = "ExplicitLevels" ; set explicit contour levels ;res@cnLevels = (/5,10,15,20,25,30,35,40,45,50,55,60,70/) ;res@cnLevels = (/30,40,50,60,70,80,90,100,150,200,250,300,400,500/) res@mpFillOn = True ; turn on gray continents res@pmTickMarkDisplayMode = "Always" res@mpLimitMode = "LatLon" ; select subregion res@mpMinLatF = -5. res@mpMaxLatF = 30. res@mpMinLonF = 40. res@mpMaxLonF = 100. res@mpProjection = "Mercator" res@gsnAddCyclic = False res@lbOrientation = "horizontal" res@trGridType = "TriangularMesh" res@gsnMaximize = True res@gsnLeftString = "All" res@gsnPaperOrientation = "auto" res@mpShapeMode = "FreeAspect" res@vpWidthF = 0.90 res@vpHeightF = 0.70 res@tmYROn = False ; turn off right and top tickmarks res@tmXTOn = False plot = gsn_csm_contour_map(wks, mean_prc,res) ; create plot end