Guest User

Untitled

a guest
Feb 19th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. ; =================================================;
  2. ; test.ncl
  3. ; =================================================;
  4. load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
  5. load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
  6. load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
  7. load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
  8. ; =================================================;
  9. begin
  10. f = addfile("/scratch/scratch96/r/reid2/air.sig995.2009.nc","r")
  11. e = addfile("/scratch/scratch96/r/reid2/slp.2009.nc","r")
  12.  
  13. t = f->t ; (nlat, nlon)
  14. t@lon2d = f->lon2d ; associate 2D arrays containing
  15. t@lat2d = f->lat2d ; coordinates with variable
  16.  
  17.  
  18. ;=================================================;
  19. ; Create plot
  20. ;=================================================;
  21. wks = gsn_open_wks("X11","test") ; open a ps file
  22. gsn_define_colormap(wks,"BlAqGrYeOrRe") ; choose colormap
  23.  
  24. res = True ; plot mods desired
  25. res@cnFillOn = True ; turn on color fill
  26. res@cnLinesOn = False ; turn off contour lines
  27. res@gsnSpreadColors = True ; use full colormap
  28. res@gsnDraw = False ; don't draw yet
  29. res@gsnSpreadColorStart = 10 ; start at color 10
  30. res@gsnSpreadColorEnd = 96 ; end at color 96
  31. res@gsnFrame = False ; don't advance frame yet
  32. res@gsnAddCyclic = True ; add cyclic point
  33.  
  34. pltBase = gsn_csm_contour_map_ce(wks,t(:,:),res)
  35. ;=================================================;
  36. ; Create second plot
  37. ;=================================================;
  38. cnres = True
  39. cnres@gsnDraw = False ; don't draw yet
  40. cnres@gsnFrame = False ; don't advance frame yet
  41. cnres@sfXArray = lon2d ; set x coordinates
  42. cnres@sfYArray = lat2d ; set y coordinates
  43. cnres@cnInfoLabelOn = False ; turn off info label
  44.  
  45. plot = gsn_csm_contour(wks,shf(0,:,:),cnres)
  46. ; =================================================;
  47. ; now overlay vector plot on top of scalar plot
  48. ; =================================================;
  49. overlay(pltBase,plot)
  50. draw(pltBase)
  51. frame(wks)
  52. end
Add Comment
Please, Sign In to add comment