ParNCLDeveloperInfo/SimpleParNCLScripts: plot_vort.ncl

File plot_vort.ncl, 1.3 KB (added by jayesh, 5 years ago)

Computing vorticity from the wind components and plotting it

Line 
1load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
2load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
3load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
4
5begin
6fili = systemfunc("ls eul26x48x96.t.3.nc")  ; 1 file with 3 timesteps     
7
8setfileoption("nc","SuppressClose",False)   ; alter default mode
9
10f = addfiles(fili, "r") ; add the files
11
12u = f[:]->U ; read U
13v = f[:]->V ; read V
14
15vrt = uv2vrA(u,v) ; calc vort
16
17scale = 1.e05
18vrt = vrt * scale
19
20vrt@long_name = "vorticity"
21vrt@units     = "scaled"
22
23wks  = gsn_open_wks("ps","vort")               ; specifies a ps plot
24gsn_define_colormap(wks,"BlWhRe")              ; choose colormap
25
26res                   = True                   ; plot mods desired
27res@cnFillOn          = True                   ; turn on color
28res@gsnSpreadColors   = True                   ; use full range of color map
29res@lbLabelAutoStride = True                   ; nice label bar labels
30res@cnLinesOn         = False                  ; no contour lines
31
32res@cnLevelSelectionMode = "ManualLevels"       ; set manual contour levels
33res@cnMinLevelValF       = -4                   ; set min contour level
34res@cnMaxLevelValF       =  4                   ; set max contour level
35res@cnLevelSpacingF      =  0.5                 ; set contour spacing
36
37
38plot = gsn_csm_contour_map_ce(wks,vrt(0,0,:,:),res) ; create plot
39
40end
41