-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathplot.ncl
88 lines (79 loc) · 1.99 KB
/
plot.ncl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
lsymmetric = True
;lsymmetric = False
lboth = False
;lboth = True
load "gill.ncl"
begin
x = lon()
y = lat()
p = new((/ny, nx/), "float")
p!0 = "y"
p&y = y
p!1 = "x"
p&x = x
u = p
v = p
w = p
if (lsymmetric.or.lboth) then
symmetric(p, u, v, w, x, y)
else
antisymmetric(p, u, v, w, x, y)
end if
if (lboth) then
pa = p
ua = p
va = p
wa = p
antisymmetric(pa, ua, va, wa, x, y)
p = p + pa
u = u + ua
v = v + va
w = w + wa
end if
wks = gsn_open_wks("x11", "gill")
; gsn_define_colormap(wks, "BlAqGrWh2YeOrReVi22")
gsn_define_colormap(wks, "gs16")
resp = True
resp@vpWidthF = 0.8
resp@vpHeightF = 0.4
resp@vpXF = 0.1
resp@vpYF = 0.7
resp@gsnDraw = False
resp@gsnFrame = False
resv = resp
resp@cnLevelSelectionMode = "ExplicitLevels"
resp@cnInfoLabelOn = False
resw = resp
; resw@cnLevels = (/ -0.3, -0.1, 0.1, 0.3, 0.6, 0.9/)
; resw@cnFillColors = (/ 6, 4, -1, 8, 9, 10, 11/)
resw@cnLevels = (/ -0.3, -0.1, 0.1, 0.3, 0.6, 0.9/)
resw@cnFillColors = (/ 4, 4, -1, 9, 9, 9, 9/)
resw@cnFillOn = True
; resw@cnLinesOn = False
resw@lbLabelFontHeightF = 0.02
plotw = gsn_csm_contour(wks, w, resw)
resp@cnLevels = (/-1.5, -1.2, -0.9, -0.6, -0.3, 0.3, 0.6, 0.9, 1.2, 1.5/)
resp@cnFillOn = False
resp@cnLineThicknessF = 3
resp@cnLineLabelBackgroundColor = -1
plotp = gsn_csm_contour(wks, p, resp)
resv@vcRefAnnoOrthogonalPosF = -1.45
resv@vcRefMagnitudeF = 1.0
resv@vcRefLengthF = 0.02
; Causes Segmentation Fault
; resv@vcGlyphStyle = "CurlyVector"
resv@vcGlyphStyle = "FillArrow"
resv@vcMinDistanceF = 0.02
resv@vcRefAnnoString2On = False
; resv@vcLineArrowThicknessF = 2.0
; res@cnLevelSelectionMode = "AutomaticLevels"
; res@gsnContourNegLineDashPattern = 2
; plot = gsn_csm_contour(wks, u, res)
; plot = gsn_csm_contour(wks, v, res)
plot = gsn_csm_vector(wks, u, v, resv)
overlay(plotw, plotp)
overlay(plotw, plot)
resp = True
draw(plotw)
frame(wks)
end