load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" begin a = addfile("ts.t85.nc","r") ; read in sample data file (resolution=T85) t85 = a->TS(0,:,:) ; grab the first timestep of the TS field b = addfile("landsea.nc","r") ; read in land sea mask basemap file lsm_t85 = landsea_mask(b->LSMASK,t85&lat,t85&lon) ; read in land sea mask, and pass it and ; the t85 lat/lon arrays into landsea_mask t85 = mask(t85,lsm_t85.eq.0,False) ; mask out all ocean points from t85 ;============================================================================ wks = gsn_open_wks("ps","mask") gsn_define_colormap(wks,"wh-bl-gr-ye-re") res = True res@mpFillOn = False ; do not color-fill the map res@gsnTickMarksOn = False ; turn off all tick marks res@mpPerimOn = True ; turn the map perimeter on res@mpPerimDrawOrder = "PostDraw" ; draw the map perimeter last res@gsnDraw = False ; do not draw the plot res@gsnFrame = False ; do not advance the frame res@cnLinesOn = False ; turn off the contour lines res@cnLineLabelsOn = False ; turn off the contour line labels res@cnLevelSelectionMode = "ExplicitLevels" ; explicitly set the levels via cnLevels res@cnLevels = (/1.,2.,3.,4./) ; set the levels res@cnFillOn = True ; turn on color fill res@cnFillMode = "RasterFill" ; use raster fill res@cnFillColors = (/60,100,20,140,5/) ; set the colors that will be used to color fill res@lbLabelStrings = ispan(0,4,1) ; labels for the labelbar boxes res@lbLabelAlignment = "BoxCenters" ; put the labels in the center of the label bar boxes res@lbTitleString = "0=ocean, 1=land, 2=lake, 3=small island, 4=ice shelf" ; labelbar title res@lbTitleFontHeightF = 0.0125 ; labelbar title font height plot = new(2,graphic) res@gsnCenterString = "land sea mask @T85 resolution" plot(0) = gsn_csm_contour_map_ce(wks,lsm_t85,res) res2 = True res2@mpFillOn = False ; do not color-fill the map res2@gsnTickMarksOn = False ; turn off all tick marks res2@mpPerimOn = True ; turn the map perimeter on res2@mpPerimDrawOrder = "PostDraw" ; draw the map perimeter last res2@gsnDraw = False ; do not draw the plot res2@gsnFrame = False ; do not advance the frame res2@cnLinesOn = False ; turn off the contour lines res2@cnLineLabelsOn = False ; turn off the contour line labels res2@cnFillOn = True ; turn on color fill res2@gsnSpreadColors = True ; calculate colors to be used for color fill across entire colormap res2@cnLinesOn = False ; turn the contour lines off res2@gsnCenterString = "TS Field (ocean-masked)" res2@gsnLeftString = "" plot(1) = gsn_csm_contour_map_ce(wks,t85,res2) panres = True ; create a panel resource list panres@gsnMaximize = True ; maximize the size of the paneled plots panres@gsnPanelYWhiteSpacePercent = 1.0 ; leave space between the 2 plots gsn_panel(wks,plot,(/2,1/),panres) end