Guest User

Untitled

a guest
Feb 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 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->air(0,:,:) ; (nlat, nlon)
  14. t@lon2d = f->lon ; associate 2D arrays containing
  15. t@lat2d = f->lat ; coordinates with variable
  16. lon2d = e->lon
  17. lat2d = e->lat
  18. slp = e->slp(0,:,:)
  19.  
  20.  
  21.  
  22. ;=================================================;
  23. ; Create plot
  24. ;=================================================;
  25. wks = gsn_open_wks("X11","test") ; open a ps file
  26. gsn_define_colormap(wks,"BlAqGrYeOrRe") ; choose colormap
  27.  
  28. res = True ; plot mods desired
  29. res@cnFillOn = True ; turn on color fill
  30. res@cnLinesOn = False ; turn off contour lines
  31. res@gsnSpreadColors = True ; use full colormap
  32. res@gsnDraw = False ; don't draw yet
  33. res@gsnSpreadColorStart = 10 ; start at color 10
  34. res@gsnSpreadColorEnd = 96 ; end at color 96
  35. res@gsnFrame = False ; don't advance frame yet
  36. res@gsnAddCyclic = True ; add cyclic point
  37.  
  38. pltBase = gsn_csm_contour_map_ce(wks,t,res)
  39. ;=================================================;
  40. ; Create second plot
  41. ;=================================================;
  42. cnres = True
  43. cnres@gsnDraw = False ; don't draw yet
  44. cnres@gsnFrame = False ; don't advance frame yet
  45. cnres@sfXArray = lon2d ; set x coordinates
  46. cnres@sfYArray = lat2d ; set y coordinates
  47. cnres@cnInfoLabelOn = False ; turn off info label
  48.  
  49. plot = gsn_csm_contour(wks,slp,cnres)
  50. ; =================================================;
  51. ; now overlay vector plot on top of scalar plot
  52. ; =================================================;
  53. overlay(pltBase,plot)
  54. draw(pltBase)
  55. frame(wks)
  56. end
Add Comment
Please, Sign In to add comment