;************************************************ load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" ;************************************************ begin ;************************************************ ; open netCDF file ;************************************************ a = addfile("Aug_35yr.nc","r") ;************************************************ ; Read in variable(s) ;************************************************ var = a->cz(0,:,:) var@lat2d = a->lat var@lon2d = a->lon ;************************************************ ; create plot ;************************************************ wks = gsn_open_wks("png","raster") ; open a ps file gsn_define_colormap(wks, "MPL_RdPu") res = True ; plot mods desired ;=================================== ; you can have the contour lines on in raster mode, but their thickness ; actually make the plot look like is was contoured normally. res@cnFillOn = True ; color Fill res@cnFillMode = "CellFill" ; Raster Mode res@cnLinesOn = False ; Turn off contour lines ;================================ ; these three resources make the continents look nice. The first two ; make them color, and the later adds continental outlines when ; raster mode is used. res@cnLineDrawOrder = "Predraw" ; Draw lines and filled res@cnFillDrawOrder = "Predraw" ; areas before map gets set ;================================= ;res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels ;res@cnMinLevelValF = -2.0 ; set min contour level ;res@cnMaxLevelValF = 0.0 ; set max contour level ;res@cnLevelSpacingF = 0.5 ; set contour spacing res@mpLandFillColor = -1 ; choose color of continents. ; must be in colormap res@cnMissingValFillColor="white" ;;;;;;;;;;;;;;;;;;;;;;;;;; res@gsnAddCyclic = False ;;;;;;;;;;;;;;ZOOM res@mpMinLatF = 0. res@mpMaxLatF = 55. res@mpMinLonF = 80. res@mpMaxLonF = 195. res@mpCenterLonF = 137.5 res@pmTickMarkDisplayMode = "Always" ; 默认是每隔5°出现一次坐标数字 res@gsnLeftString = "" ;=================================== plot = gsn_csm_contour_map(wks,var,res) ; create plot end