;**************************************************** ; native_2.ncl ; ; Concepts illustrated: ; - Drawing filled contours over a mercator map ; - Overlaying contours on a map without having lat,lon coordinates ; - Drawing a map using the medium resolution map outlines ; - Turning on map tickmark labels with degree symbols ; - Selecting a different color map ; - Turning off the addition of a longitude cyclic point ; - Zooming in on a particular area on a mercator map ; - Adding a color to an existing color map ; ;***************************************************** load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" ;***************************************************** begin f1 = addfile("pmer.nc","r") p=f1->p lat = f1->lat lon = f1->lon lat_len = dimsizes(lat) lon_len = dimsizes(lon) ; time = f1-> time ; time_len = dimsizes(time) ;************************************** ; Create plot ;*************************************** wks = gsn_open_wks("x11", "native") gsn_define_colormap(wks,"BlGrYeOrReVi200") ; choose color map i = NhlNewColor(wks,0.7,0.7,0.7) ; add gray to colormap res = True ; plot mods desired res@cnFillOn = True ; turn on color res@cnLinesOn = False ; no contour lines res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels res@cnMinLevelValF = 0 ; set min contour level res@cnMaxLevelValF = 70 ; set max contour level res@cnLevelSpacingF = 5 ; contour spacing res@gsnSpreadColors = True ; use full color map res@gsnSpreadColorEnd = -3 ; don't use added gray res@lbOrientation ="vertical" ; vertical label bar res@mpDataBaseVersion = "Ncarg4_1" ; use finer database res@pmTickMarkDisplayMode = "Always" ; turn on tickmarks res@gsnAddCyclic = False ; regional data, don't add pt res@mpProjection = "mercator" ; projection res@mpLimitMode = "Corners" ; method to zoom res@mpLeftCornerLatF = min(lat) res@mpLeftCornerLonF = min(lon) res@mpRightCornerLatF = max(lat) res@mpRightCornerLonF = max(lon) res@tfDoNDCOverlay = True ; do not transform data res@tiMainString ="Native Mercator Projection" plot = gsn_csm_contour_map (wks,fsd(0,:,:),res) ; create plot end