; Set new lat/lon for creating a 0.1x0.1 grid nlat = 1801 mlon = 3601 diro = "./" filo = "NewBaseMap.nc" 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/contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" begin ; Use the nlat and mlon to create the lat/lon for the globe lat = latGlobeFo(nlat, "lat", "latitude", "degrees_north") lon = lonGlobeFo(mlon, "lon", "longitude", "degrees_east") b = addfile("CERES.HiResLandSeaMask.nc","r") landsea = b->LandSea lsm = landsea_mask(b->LandSea,lat,lon) ;========================================================== ; Create netCDF ;========================================================== system("/bin/rm -f "+diro+filo) ncdf = addfile (diro+filo , "c") ncdf@title = "Land-Sea Mask" ncdf@creation_date = systemfunc("date") ncdf->LSMASK = lsm wks = gsn_open_wks("pdf","lsmask") gsn_define_colormap(wks,"wh-bl-gr-ye-re") res = True ; res@gsnAddCyclic = False 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@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 ; res@mpMinLatF = 0 ; res@mpMaxLatF = 60 ; res@mpMinLonF = -100 ; res@mpMaxLonF = -50 ; res@mpCenterLonF = -70 plot = gsn_csm_contour_map_ce(wks,lsm,res) plot = gsn_csm_contour_map_ce(wks,landsea,res) end