File size: 6,964 Bytes
03a6065
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185

data = yyyymmdd_time(2023, 2023, "integer")
pa1 = "H:/shum2022-2023/shum.daily.era5.2023.nc"
f1 = addfile(pa1, "r")
do a = 0,364
pa = "H:/ERA511/"+data(a)+".nc"
f = addfile(pa, "r")
z1 = short2flt(f->z(:,{500},30:90:-1,250:320))
u = short2flt(f->u(:,{850},30:90:-1,250:320))
v = short2flt(f->v(:,{850},30:90:-1,250:320))
t1 = short2flt(f->t(:,{500},30:90:-1,250:320))
z = z1/9.8
copy_VarCoords(z1, z)
t = t1-273.15
copy_VarCoords(t1, t)
printVarSummary(z)
z_avg = dim_avg_n_Wrap(z, 0)
u_avg = dim_avg_n_Wrap(u, 0)
v_avg = dim_avg_n_Wrap(v, 0)
t_avg = dim_avg_n_Wrap(t, 0)
; print(f1)
q=f1->shum(a,{500},30:90:-1,70:140)
printVarSummary(q)

qu700summ1 = new((/61,71/),float)
qv700summ1 = new((/61,71/),float)
sqdt700summ1 = new((/61,71/),float)
do i=0,60
do j=0,70
    qv700summ1(i,j) = q(i,j)*v_avg(i,j)/9.8
    qu700summ1(i,j) = q(i,j)*u_avg(i,j)/9.8    
    sqdt700summ1(i,j) = sqrt(qv700summ1(i,j)*qv700summ1(i,j)+qu700summ1(i,j)*qu700summ1(i,j))*1e3
end do 
end do

copy_VarCoords(q, sqdt700summ1)
printVarSummary(sqdt700summ1)

name = "f:/xiao/HXM/shum/hgt&shum"+data(a)
; ; name = "f:/xiao/SAH/tu/uvhgt100q1979"
wks = gsn_open_wks("png", name)
gsn_define_colormap(wks,"precip_11lev") 

FontHeightF         = 0.013
; ;------------------------------------------------
resmp               = True 
resmp@gsnDraw       = False
resmp@gsnFrame      = False 
resmp@tmXBMajorOutwardLengthF = 0
resmp@tmXBMinorOutwardLengthF = 0
resmp@tmYLMajorOutwardLengthF = 0
resmp@tmYLMinorOutwardLengthF = 0

resmp@tmXTOn        = False
resmp@tmYROn        = False  
resmp@pmTickMarkDisplayMode = "Always"
resmp@mpFillOn               = True
resmp@mpDataSetName          = "Earth..4"
resmp@mpDataBaseVersion      = "MediumRes"
;resmp@mpDataSetName          = "Earth..4"
resmp@mpAreaMaskingOn        = True
resmp@mpMaskAreaSpecifiers   = (/"China","Taiwan"/)
resmp@mpOutlineSpecifiers        = (/"China","China:Provinces"/)
; resmp@mpOutlineSpecifiers        = (/"China"/)
resmp@mpLandFillColor        = "white"
resmp@mpInlandWaterFillColor = "white"
;resmp@mpLandFillColor        = "navajowhite1"
resmp@mpOceanFillColor       = "white"
;resmp@mpOutlineBoundarySets  = "NoBoundaries"
resmp@mpNationalLineThicknessF = 3
resmp@mpOutlineOn            = True ;
resmp@mpGeophysicalLineColor = "black"
resmp@mpGeophysicalLineThicknessF = 0.5
resmp@tmYLLabelFontHeightF = 0.013
resmp@tmYRLabelFontHeightF = 0.013
           
resmp@mpMinLonF            = 70.              
resmp@mpMaxLonF            = 140.
resmp@mpMinLatF            = 0.
resmp@mpMaxLatF            = 60.
  resmp@tmXBLabelFontHeightF      = 0.04
  resmp@tmYLLabelFontHeightF      = 0.04
resmp@tiXAxisFontHeightF = 0.03
resmp@tiYAxisFontHeightF = 0.03

resss1           = True
; ress1           = resmp
  resss1@gsnDraw   = False
  resss1@gsnFrame  = False 
  resss1@gsnAddCyclic = False  ;数据没有覆盖全球,设为False
  resss1@vcRefAnnoOn = True
  resss1@gsnRightString     = ""
resss1@gsnLeftString        = "" 
  resss1@gsnLeftStringFontHeightF   = 0.05
  resss1@gsnRightStringFontHeightF  = 0.05 
  resss1@vcGlyphStyle = "FillArrow"    ;LineArrow箭头CurlyVector长箭头
  ;res4@vcMinMagnitudeF = 5.0 ;不绘制小10的箭头
  resss1@vcWindBarbLineThicknessF = 3
  resss1@vcLineArrowThicknessF = 3
  resss1@vcMinDistanceF = 0.03 ;箭头之间的最小距离,防止高纬度地区绘制过多箭头
;绘制参考箭头
  resss1@vcRefAnnoOn = True
  ; ress1@vcRefMagnitudeF = 20.0  ;500标准箭头所表示的大小
  ; ress1@vcRefAnnoString2 = "20m/s"  ;
  resss1@vcRefMagnitudeF = 10.0  ;700标准箭头所表示的大小
  resss1@vcRefAnnoString2 = "10m/s"  
  resss1@vcRefLengthF = 0.03  ;在图形中的长度
  resss1@vcRefAnnoBackgroundColor = "white"  ;背景颜色
  resss1@vcRefAnnoArrowLineColor = "black"
  resss1@vcRefAnnoPerimOn = True  ;关闭边框
  resss1@vcRefAnnoFontHeightF = 0.01  ;参考箭头标签字体大小
  resss1@vcRefAnnoString1On = False  ;设定参考箭头上、
  resss1@vcRefAnnoString2On = True  ; 下的字符
  resss1@vcRefAnnoParallelPosF = 1   ;水平移动参考箭头的位置
  resss1@vcRefAnnoOrthogonalPosF = -0.5

   res500summ                       = True  
res500summ@gsnDraw               = False
res500summ@gsnFrame              = False 
res500summ@gsnLeftString         = "" 
res500summ@gsnRightString        = "" 
res500summ@cnInfoLabelOn         = False
; res500summ@tiMainString = "(c) 500_preSummer2"       ; add title
res500summ@cnLinesOn             = True
res500summ@cnLineThicknessF      = 4.0 ; 2
; res500summ@cnLineThicknesses      = (/3.0,3.0,3.0.3,0/) ; 2
res500summ@cnLineColor           = "purple"
res500summ@cnLineLabelFontColor  = "purple"
res500summ@cnSmoothingOn         = True
res500summ@cnLineLabelFontHeightF = 0.01;FontHeightF-0.002 
res500summ@cnLineLabelAngleF      = 0
res500summ@cnLineLabelsOn      = True
res500summ@cnLevelSpacingF     = 40.0
res500summ@cnLineLabelsOn = True
; res500summ@cnMonoLineColor     =False            ;等值线颜色是否一致
; res500summ@cnLevelSelectionMode    = "ExplicitLevels"
; res500summ@cnLevels                   = (/16600/)
; res500summ@cnLineColors           = (/"blue","blue","red","gold"/)
; res500summ@cnLevelSpacingF   = 20   
res500summ@cnLineLabelDensityF   = 1 ;increase the line labels/line
res500summ@cnLineLabelInterval   = 1 ; labels for every line (default=2)
res500summ@tiMainFontHeightF = 0.013
res500summ@tiMainOffsetYF = -0.005
res500summ@cnSmoothingOn = True

resz                       = True  
resz@gsnDraw               = False
resz@gsnFrame              = False 
resz@gsnLeftString         = "" 
resz@gsnRightString        = "" 
resz@cnInfoLabelOn         = False
;resz@tiMainString = "(c) 500_preSummer2"       ; add title
;resz@tiMainString = "(a) 700_preSummer2"       ; add title

  resz@lbLabelBarOn = True   ;关闭每幅图的色标
  resz@cnInfoLabelOn = False
  resz@cnLineLabelsOn = False
  ;res1@cnLevelSelectionMode = "AutomaticLevels" 
  resz@cnLevelSelectionMode = "ExplicitLevels" 
  ;resz@cnLevels = (/1.5,2,2.5,3,3.5,4,4.5,5,5.5/)
  resz@cnLevels = (/1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8/)
  resz@lbLabelFontHeightF = 0.013
  ;resz@cnLevels = (/2,3,4,5/)
  ;resz@cnFillColors = (/0,122,82,162,194/)
  ;resz@lbOrientation         = "Vertical"
  resz@cnFillOn = True
  resz@cnLinesOn = False
  resz@lbBoxLinesOn = False
  resz@cnSmoothingOn         = True
  resz@lbBoxMinorExtentF = 0.15
  resz@lbBoxEndCapStyle = "TriangleBothEnds"


map = gsn_csm_map(wks, resmp)

plotz700summ2 = gsn_csm_contour(wks, sqdt700summ1(:,:), resz)
overlay(map, plotz700summ2)
plotw700summ1 = gsn_csm_vector(wks, u_avg(:,:), v_avg(:,:),resss1)
overlay(map, plotw700summ1)
plotz2 = gsn_csm_contour(wks, z_avg(:,:), res500summ)
overlay(map, plotz2)
draw(wks)
frame(wks)

end do