Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; =================================================;
- ; test.ncl
- ; =================================================;
- 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
- f = addfile("/scratch/scratch96/r/reid2/air.sig995.2009.nc","r")
- e = addfile("/scratch/scratch96/r/reid2/slp.2009.nc","r")
- t = f->t ; (nlat, nlon)
- t@lon2d = f->lon2d ; associate 2D arrays containing
- t@lat2d = f->lat2d ; coordinates with variable
- ;=================================================;
- ; Create plot
- ;=================================================;
- wks = gsn_open_wks("X11","test") ; open a ps file
- gsn_define_colormap(wks,"BlAqGrYeOrRe") ; choose colormap
- res = True ; plot mods desired
- res@cnFillOn = True ; turn on color fill
- res@cnLinesOn = False ; turn off contour lines
- res@gsnSpreadColors = True ; use full colormap
- res@gsnDraw = False ; don't draw yet
- res@gsnSpreadColorStart = 10 ; start at color 10
- res@gsnSpreadColorEnd = 96 ; end at color 96
- res@gsnFrame = False ; don't advance frame yet
- res@gsnAddCyclic = True ; add cyclic point
- pltBase = gsn_csm_contour_map_ce(wks,t(:,:),res)
- ;=================================================;
- ; Create second plot
- ;=================================================;
- cnres = True
- cnres@gsnDraw = False ; don't draw yet
- cnres@gsnFrame = False ; don't advance frame yet
- cnres@sfXArray = lon2d ; set x coordinates
- cnres@sfYArray = lat2d ; set y coordinates
- cnres@cnInfoLabelOn = False ; turn off info label
- plot = gsn_csm_contour(wks,shf(0,:,:),cnres)
- ; =================================================;
- ; now overlay vector plot on top of scalar plot
- ; =================================================;
- overlay(pltBase,plot)
- draw(pltBase)
- frame(wks)
- end
Add Comment
Please, Sign In to add comment