;******************************************* ; roms_2.ncl ;******************************************* load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin ;******************************************* ; open file and read in data ;******************************************* grid = addfile ("CGOA_grid_3.nc", "r") lat2d = grid->lat_rho lon2d = grid->lon_rho f = addfile ("ocean_his_005.nc", "r") t = f->zeta t@lat2d=lat2d t@lon2d=lon2d ;******************************************** ; get some parameters ;******************************************** nlat = dimsizes(lat2d(:,0)) nlon = dimsizes(lon2d(0,:)) ;******************************************** ; create plot ;******************************************** wks = gsn_open_wks ("ps", "roms") ; open workstation gsn_define_colormap (wks,"testcmap") ; choose color map ; ; This will not be necessary in V6.1.0 and later. Named colors can ; be used without having to first add them to the color map. ; i = NhlNewColor(wks,0.8,0.8,0.8) ; add gray to colormap res = True ; plot mods desired res@cnFillOn = True ; color fill res@cnLinesOn = False ; no contour lines res@cnLineLabelsOn = False ; no contour labels res@cnFillDrawOrder = "PreDraw" ; put continents on top res@gsnSpreadColors = True ; use total colormap res@gsnSpreadColorEnd = -3 ; dont' use added gray res@cnInfoLabelOn = False ; no contour info label res@mpGridAndLimbOn = True ; turn on lat/lon lines res@gsnMaximize = True ; biggest plot possible ; The following resources are REQUIRED to properly display ; data zoomed on a lambert conformal grid. res@mpProjection = "LambertConformal" res@mpLambertParallel1F = grid->PLAT(0) res@mpLambertParallel2F = grid->PLAT(1) res@mpLambertMeridianF = grid->PLONG res@mpLimitMode = "Corners" ; choose range of map res@mpLeftCornerLatF = 45 res@mpLeftCornerLonF = -160 res@mpRightCornerLatF = 60 res@mpRightCornerLonF = -130 res@mpDataBaseVersion = "HighRes" ; use high resolution coast res@pmTickMarkDisplayMode = "Always" ; turn on tickmarks plot = gsn_csm_contour_map(wks,t(0,:,:),res) end