-
Notifications
You must be signed in to change notification settings - Fork 0
/
cy.cospectrum.panel.ncl
388 lines (362 loc) · 17.1 KB
/
cy.cospectrum.panel.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
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
; latitude-phase speed spectrum
;TODO ncl -Q cy.cospectrum.panel.ncl
load "./gsn_csm.ncl"
begin
wcStrt = systemfunc("date")
; FMS
cidCtrl = "b1ctrl"
; caseid = getenv("CASENAME")
; if (ismissing(caseid)) then
; print(caseid)
; status_exit(1)
; end if
cidArr := (/"b2kidston","b12unifit1","b13resi"/)
cidArr2 = (/"K11","LRF","K11-LRF"/)
pp = 300.
FILES1 = "ensemble-wise/cy.cospectrum."+cidArr+"."+pp+".nc"
fdata = addfiles(FILES1,"r")
ListSetType(fdata,"join") ;cat")
; caseid = fdata@caseid
dt = fdata[0]@dt
; Ly = fdata[0]@Ly
Lx = fdata[0]@Lx
ds = fdata[0]@ds
phasespeed = fdata[0]->phasespeed
lat = fdata[0]->lat
u_y = fdata[:]->u_y ; repmat
uEN_y = fdata[:]->uEN_y
uvClim_yc = fdata[:]->uvClim_yc ; repmat
uvEN_yc = fdata[:]->uvEN_yc
vvClim_yn = fdata[0]->vvClim_yn
vvEN_yn = fdata[:]->vvEN_yn
uuClim_yn = fdata[0]->uuClim_yn
uuEN_yn = fdata[:]->uuEN_yn
delete(fdata)
; wallClockElapseTime(wcStrt, "reload nc",0)
; Lx = 2*get_pi("f")*6371 *1000
Lx := tofloat(Lx)
; uvClim_yc(:,{-0.5:0.5}) = uvClim_yc@_FillValue
; uvEN_yc(:,{-0.5:0.5}) = uvEN_yc@_FillValue
cos2y_yc = conform(uvClim_yc, cos(lat*get_d2r("f"))^2, 1)
uvyClim_yc = -1/cos2y_yc*center_finite_diff_n(uvClim_yc*cos2y_yc,lat*get_d2r("f")*6.371e6,False,0,1)*86400 ; Eq.9 in Kidston2011
uvyEN_yc2 = -1/cos2y_yc*center_finite_diff_n((uvClim_yc+uvEN_yc)*cos2y_yc,lat*get_d2r("f")*6.371e6,False,0,1)*86400
uvyEN_yc2 = linint1_n(conform(uvyClim_yc,phasespeed,2)-conform(uvyClim_yc,uEN_y-u_y,(/0,1/)), uvyEN_yc2,False,phasespeed,0,2) -uvyClim_yc
copy_VarCoords(uvClim_yc,uvyClim_yc)
copy_VarCoords(uvyClim_yc,uvyEN_yc2)
/;
vvClim_yn1 = vvClim_yn(:,1:)
vvClim_yn1 = vvClim_yn1 *conform(vvClim_yn1,ispan(1,ds(3)/2,1),1)^2 /2./get_pi("f")/6371/conform(vvClim_yn1,cos(lat*get_d2r("f")),0)
vvEN_yn1 = vvEN_yn(:,1:) *conform(vvClim_yn1,ispan(1,ds(3)/2,1),1)^2 /2./get_pi("f")/6371/conform(vvClim_yn1,cos(lat*get_d2r("f")),0)
; vvClim_yn1@long_name = "v'v' at "+pp+" hPa (m~S~2~N~ s~S~-2~N~ per 1 km bin)"
copy_VarCoords(vvClim_yn1,vvEN_yn1)
vvEN_yn1@long_name = "v'v' at "+pp+" hPa (m~S~2~N~ s~S~-2~N~ per 1 km bin)"
vvnClim_y = dim_sum_n(vvClim_yn(:,1:)*conform(vvClim_yn1,ispan(1,ds(3)/2,1),1),1)/dim_sum_n(vvClim_yn(:,1:),1)
vvnEN_y = dim_sum_n((vvClim_yn(:,1:)+vvEN_yn(:,1:))*conform(vvClim_yn1,ispan(1,ds(3)/2,1),1),1)/dim_sum_n(vvClim_yn(:,1:)+vvEN_yn(:,1:),1)
vvn_ry = dim_sum_n(vv_ryn(:,:,1:)*conform(vv_ryn(:,:,1:),ispan(1,ds(3)/2,1) ,2),2)/dim_sum_n(vv_ryn(:,:,1:),2)
vvnCI_y = sqrt( (dim_variance_n(vvn_ry(irClim,:),0)*(dimsizes(irClim)-1) + dim_variance_n(vvn_ry(irEN,:),0)*(dimsizes(irEN)-1))/(dimsizes(irClim)+dimsizes(irEN)-2) )*sqrt(1./dimsizes(irClim)+1./dimsizes(irEN)) *cdft_t(0.975,dimsizes(irClim)+dimsizes(irEN)-2)
; vvnCI_y = mask(vvnCI_y,vvnCI_y.ne.0,True)
vvnt_y = (vvnEN_y-vvnClim_y) / vvnCI_y
vvlClim_y = cos(lat*get_d2r("f"))*dim_sum_n(vvClim_yn(:,1:)*conform(vvClim_yn1,2*get_pi("f")*6371/ispan(1,ds(3)/2,1),1),1)/dim_sum_n(vvClim_yn(:,1:),1)
vvlEN_y = cos(lat*get_d2r("f"))*dim_sum_n((vvClim_yn(:,1:)+vvEN_yn(:,1:))*conform(vvClim_yn1,2*get_pi("f")*6371/ispan(1,ds(3)/2,1),1),1)/dim_sum_n(vvClim_yn(:,1:)+vvEN_yn(:,1:),1)
vvl_ry = dim_sum_n(vv_ryn(:,:,1:)*conform(vv_ryn(:,:,1:),2*get_pi("f")*6371/ispan(1,ds(3)/2,1) ,2),2)/dim_sum_n(vv_ryn(:,:,1:),2)
vvl_ry = vvl_ry*conform(vvl_ry,cos(lat*get_d2r("f")),1)
vvlCI_y = sqrt( (dim_variance_n(vvl_ry(irClim,:),0)*(dimsizes(irClim)-1) + dim_variance_n(vvl_ry(irEN,:),0)*(dimsizes(irEN)-1))/(dimsizes(irClim)+dimsizes(irEN)-2) )*sqrt(1./dimsizes(irClim)+1./dimsizes(irEN)) *cdft_t(0.975,dimsizes(irClim)+dimsizes(irEN)-2)
; vvlCI_y = mask(vvlCI_y,vvlCI_y.ne.0,True)
vvlt_y = (vvlEN_y-vvlClim_y) / vvlCI_y
; vvlClim_y = 2*get_pi("f")*6371*cos(lat*get_d2r("f")) *dim_sum_n(vvClim_yn(:,1:),1)/dim_sum_n(vvClim_yn(:,1:)*conform(vvClim_yn1,ispan(1,ds(3)/2,1),1),1)
; vvlEN_y = 2*get_pi("f")*6371*cos(lat*get_d2r("f")) *dim_sum_n(vvClim_yn(:,1:)+vvEN_yn(:,1:),1)/dim_sum_n((vvClim_yn(:,1:)+vvEN_yn(:,1:))*conform(vvClim_yn1,ispan(1,ds(3)/2,1),1),1)
; res@sfXArray = conform(transpose(vvClim_yn1),lat,1)
; res@sfYArray = 2*get_pi("f")*6371*cos(res@sfXArray*get_d2r("f"))/conform(transpose(vvClim_yn1),ispan(1,ds(3)/2,1),0)
uunClim_y = dim_sum_n(uuClim_yn(:,1:)*conform(vvClim_yn1,ispan(1,ds(3)/2,1),1),1)/dim_sum_n(uuClim_yn(:,1:),1)
uunEN_y = dim_sum_n((uuClim_yn(:,1:)+uuEN_yn(:,1:))*conform(vvClim_yn1,ispan(1,ds(3)/2,1),1),1)/dim_sum_n(uuClim_yn(:,1:)+uuEN_yn(:,1:),1)
;/
ekeClim_yn = uuClim_yn
ekeClim_yn = (uuClim_yn+vvClim_yn)/2
; ekeClim_yn = mask(ekeClim_yn,ekeClim_yn.ne.0,True)
ekeEN_yn = uuEN_yn
ekeEN_yn = (uuEN_yn+vvEN_yn)/2
; copy_VarCoords(u_y,ekeClim_yn(:,0))
; copy_VarCoords(ekeClim_yn,ekeEN_yn)
; ekeEN_yn@long_name = "u'u'+v'v' at "+pp+" hPa (m~S~2~N~ s~S~-2~N~)"
ekeEN_yn@long_name = ""
; ekenClim_y = dim_sum_n(ekeClim_yn(:,1:)*conform(vvClim_yn1,ispan(1,ds(3)/2,1),1),1)/dim_sum_n(ekeClim_yn(:,1:),1)
; ekenEN_y = dim_sum_n((ekeClim_yn(:,1:)+ekeEN_yn(:,1:))*conform(vvClim_yn1,ispan(1,ds(3)/2,1),1),1)/dim_sum_n(ekeClim_yn(:,1:)+ekeEN_yn(:,1:),1)
type = "pdf"
; type@wkOrientation = "portrait"
type@wkPaperWidthF = 39*12/72.27 ; 190/25.4
type@wkPaperHeightF = 2.0
; wks = gsn_open_wks(type,get_script_prefix_name+"."+pp) ; TODO
wks = gsn_open_wks(type,"fig3") ; TODO
gsn_define_colormap(wks,"BlWhRe") ;"BlueWhiteOrangeRed"
; Set some basic resources
res = True
res@cnFillOn = True
; res@cnFillMode = "CellFill"
res@cnLinesOn = False
res@cnLineLabelsOn = False
res@cnInfoLabelOn = False
; res@cnLevelSelectionMode = "ManualLevels"
; res@cnMinLevelValF = -0.08
; res@cnMaxLevelValF = 0.1
; res@cnLevelSpacingF = 0.02
; res@cnGridBoundFillColor = "grey50"
; res@cnMissingValFillColor= "grey50"
res@lbOrientation = "Vertical"
; res@lbLabelPosition = "Left"
; res@pmLabelBarOrthogonalPosF = -1.5
; res@pmLabelBarWidthF = 0.35
res@lbBoxSeparatorLinesOn = False
res@lbLabelFontHeightF = 0.04
res@gsnAddCyclic = False
; res@tmXBMode = "Explicit" ; explicit labels
; res@tmYLMode = "Manual"
; res@tmYLMaxTicks = 4
; res@tmYLTickStartF = -100.
; res@tmYLTickEndF = -0.
; res@tmYLTickSpacingF = 20.
; res@mpGridLatSpacingF = 20.
; res@tmXBValues = ispan(0,192,48) ; location of labels
; res@tmXBLabels = lbl ; labels themselves
;res@tmXBLabelStride = 24
; res@tmLabelAutoStride = True ; nice stride on labels
; res@tmXBFormat = "0@!;*^se"
res@tmXBLabelFontHeightF = 0.04
res@tmXBLabelDeltaF = -0.5
res@tmYLLabelFontHeightF = 0.04
res@tmYLLabelDeltaF = -0.5
; res@xyMonoDashPattern = True
;res@xyDashPatterns = 1
; res@xyMarkLineMode = "Marklines"
; res@xyLineColors = (/"Blue","Black"/)
;res@gsnXRefLine = 0.5
;res@gsnXRefLineDashPattern = 1
; res@tiMainFontHeightF = 0.04
res@tiXAxisFontHeightF= 0.04
res@tiYAxisFontHeightF= 0.04
res@tiDeltaF = 0.
; res@tiYAxisOffsetXF = -0.01
; res@vpWidthF = 0.82
; res@vpHeightF = 0.62
res@gsnDraw = False
res@gsnFrame = False
;res@gsnShape = True
; res@gsnMaximize = True ; panel
; res@gsnPaperOrientation = "portrait"
res@gsnXAxisIrregular2Linear = True
res@gsnYAxisIrregular2Linear = True
; res@trYMaxF = 10*round(max(lat)/10,0)
;res@trYMinF = 0
/;
;res@pmLegendDisplayMode = "Always" ; turn on legend
;res@pmLegendZone = 1
;;res@pmLegendSide = "Right" ; Change location of
;res@pmLegendParallelPosF = 0.98 ; move
;;res@pmLegendOrthogonalPosF = -0.2 ; move
;res@lgJustification = "BottomRight"
;res@pmLegendWidthF = 0.12 ; Change width and
;res@pmLegendHeightF = 0.1 ; height of legend.
;;res@lgPerimOn = False ; turn off box around
;;res@lgLabelFontHeightF = .02 ; label font height
;res@xyExplicitLegendLabels = (/"0.1a","a"/) ; create explicit labels
;/
ores = True
; ores@cnFillOn = True
; ores@cnFillMode = "CellFill"
; ores@cnLinesOn = False
ores@cnLineLabelsOn = False
ores@cnInfoLabelOn = False
; ores@cnInfoLabelFontHeightF= 0.025
; ores@cnLevelSelectionMode = "AutomaticLevels" ;"ManualLevels" ;"ExplicitLevels" ;
; ores@cnMaxLevelCount = 9
; ores@cnMinLevelValF = -0.3
; ores@cnMaxLevelValF = 0.3
; ores@cnLevelSpacingF = 0.05
; ores@cnLevels = (/ 0.5 /)
ores@cnLineThicknessF = 4.
ores@cnMonoLineColor = False
ores@cnLinePalette = "BlueWhiteOrangeRed";"BlWhRe"
; ores@cnLineColors = (/"blue","blue","blue","green","red","red","red"/)
; ores@cnConstFEnableFill = True
; ores@cnConstFLabelOn = False
ores@gsnContourZeroLineThicknessF = 0.
ores@gsnDraw = False
ores@gsnFrame = False
; ores@cnLevelSelectionMode = "ManualLevels"
; ores@cnMinLevelValF = -0.08
; ores@cnMaxLevelValF = 0.1
; ores@cnLevelSpacingF = 0.02
ores@lbOrientation = "Vertical"
; ores@lbLabelPosition = "Left"
; ores@pmLabelBarOrthogonalPosF = -1.5
ores@gsnXAxisIrregular2Linear = True
ores@gsnYAxisIrregular2Linear = True
gsres = True
gsres@gsLineThicknessF = 8.
; gsres@tfPolyDrawOrder = "Draw"
resP = True
; resP@txString = ""
; resP@txPosYF = 0.98
resP@gsnMaximize = True
resP@gsnPaperOrientation = "portrait"
resP@gsnPaperMargin = 0.
resP@gsnBoxMargin = 0.3
; resP@gsnPanelDebug = True
; resP@gsnPanelLabelBar = True
; resP@lbLabelFontHeightF = 0.012
resP@gsnPanelFigureStrings = "("+(/"a","b","c"/)+") "+cidArr2
; resP@gsnPanelFigureStringsFontHeightF = 0.03
resP@gsnPanelFigureStringsPerimOn = False
resP@gsnPanelFigureStringsJust = "TopLeft"
; resP@pmLabelBarOrthogonalPosF = -0.02 ; panel
resP@gsnPanelScalePlotIndex = 1 ; panel 24
; resP@gsnPanelYWhiteSpacePercent = 2 ; panel 6
; resP@gsnPanelBottom = 0.04 ; panel 7
; resP@gsnPanelTop = 0.935 ; panel 7
resP@gsnPanelLeft = 0.08
resP@gsnPanelRight = 0.92 ; panel 7
resP@gsnFrame = False
plot = new(6, graphic)
dum = new(6, graphic)
res@trYReverse = True
res@cnFillPalette = "BlWhRe";"BlueWhiteOrangeRed"
ores@cnMonoLineColor = True
; ores@cnLinePalette = "BlueWhiteOrangeRed";"BlWhRe"
ores@cnLineThicknessF = 1.
ores@gsnContourNegLineDashPattern = 2
; ores@cnLevelSelectionMode = "AutomaticLevels"
; ores@cnMaxLevelCount = 11
; ores@cnLevelSpacingF = 0.1
; delete_VarAtts(ores,(/"cnLevelSpacingF"/))
; res@tiYAxisString = "Relative angular phase speed (m s~S~-1~N~)"
res@tiYAxisString = "(c-u~H-16V23~_~V-23~)/cos~F33~f~F~ (m s~S~-1~N~)"
res@tiYAxisOffsetXF = -0.01
res@trYMaxF = 20.
res@sfYArray = transpose(conform(uvClim_yc(0,:,:),phasespeed,1) - conform(uvClim_yc(0,:,:),u_y(0,:),0))
res@sfXArray = transpose(conform(uvClim_yc(0,:,:),lat,0))
; d/dy uv
; uvyEN_yc2@long_name = "~F18~-s~FB~y~N~u'v' at "+pp+" hPa (m s~S~-1~N~day~S~-1~N~ per m s~S~-1~N~ bin)"
symMinMaxPlt(uvyEN_yc2,21,False,res)
res@gsnXAxisIrregular2Linear = False
res@gsnYAxisIrregular2Linear = False
res@trGridType = "TriangularMesh" ;"Curvilinear"
symMinMaxPlt(uvyClim_yc,21,False,ores)
ores@trGridType = res@trGridType
ores@sfXArray = res@sfXArray
ores@sfYArray = res@sfYArray
do ip = 0,dimsizes(cidArr)-1
res@tiYAxisOn = (mod(ip,dimsizes(cidArr)).eq.0)
res@tmYLLabelsOn = (mod(ip,dimsizes(cidArr)).eq.0) ; panel 7
; res@tmYLOn = (mod(ip,dimsizes(cidArr)).eq.0) ; panel 7
res@lbLabelBarOn = (mod(ip+1,dimsizes(cidArr)).eq.0)
plot(ip) = gsn_csm_contour(wks,transpose(uvyEN_yc2(ip,:,:)),res)
ploto = gsn_csm_contour(wks,transpose(uvyClim_yc(ip,:,:)),ores)
overlay(plot(ip),ploto)
end do
resP@gsnPanelFigureStringsJust = "TopLeft"
resP@gsnPanelLeft = 0.08
resP@gsnPanelRight = 0.92 ; panel 7
; gsn_panel(wks,plot(:dimsizes(cidArr)-1),(/1,dimsizes(cidArr)/),resP)
newplots = gsn_panel_return(wks,plot(:dimsizes(cidArr)-1),(/1,dimsizes(cidArr)/),resP)
; drawNDCGrid(wks)
frame(wks)
getvalues ploto@contour
"cnMinLevelValF" : wrkcmn
"cnMaxLevelValF" : wrkcmx
"cnLevelSpacingF" : wrkciu
end getvalues
print("CONTOUR FROM "+wrkcmn+" TO "+wrkcmx+" BY "+wrkciu)
;print("Contour LevelSpacing="+ores@cnLevelSpacingF)
bb_dbg = NhlGetBB(newplots)
print("min/max x position = " + min(bb_dbg(:,2)) + "/" + max(bb_dbg(:,3)))
; print("min/max y position = " + min(bb_dbg(:,1)) + "/" + max(bb_dbg(:,0)))
print("wkPaperHeightF="+type@wkPaperWidthF*(max(bb_dbg(:,0))-min(bb_dbg(:,1))))
delete_VarAtts(ores,(/"trGridType","sfXArray","sfYArray"/))
delete_VarAtts(res,(/"trGridType","sfXArray","sfYArray"/))
delete_VarAtts(res,(/"trYReverse"/))
type@wkPaperHeightF = 2.1
wks = gsn_open_wks(type,"fig2") ; TODO
res@tiXAxisString = ""
res@trYReverse = True
res@trYMaxF = 11.
res@tiYAxisString = "Wavenumber"
res@tiYAxisOffsetXF = -0.
ores@cnMonoLineColor = True
; ores@cnLineThicknessF = 4.
delete_VarAtts(ores,(/"cnLevelSpacingF"/))
; gsres0 = gsres
; gsres0@gsLineColor = "Black"
; gsres0@gsLineDashPattern = 0
; gsres@gsLineColor = "Green4"
; gsres@gsLineDashPattern = 2
symMinMaxPlt(ekeEN_yn,51,False,res)
res@cnFillPalette = "BlWhRe";"BlueWhiteOrangeRed"
ores@cnLevelSelectionMode = "AutomaticLevels"
ores@cnMaxLevelCount = 9
do ip = 0,dimsizes(cidArr)-1
res@tiYAxisOn = (mod(ip,dimsizes(cidArr)).eq.0)
res@tmYLLabelsOn = (mod(ip,dimsizes(cidArr)).eq.0) ; panel 7
; res@tmYLOn = (mod(ip,dimsizes(cidArr)).eq.0) ; panel 7
res@lbLabelBarOn = (mod(ip+1,dimsizes(cidArr)).eq.0)
plot(ip) = gsn_csm_contour(wks,transpose(ekeEN_yn(ip,:,:)),res)
ploto = gsn_csm_contour(wks,transpose(ekeClim_yn),ores)
overlay(plot(ip),ploto)
; dum(0) = gsn_add_polyline(wks,plot(0),lat,2*get_pi("f")*6371*cos(lat*get_d2r("f"))/ekelClim_y,gsres0)
; dum(0) = gsn_add_polyline(wks,plot(0),lat,ekenClim_y,gsres0)
; dum(1) = gsn_add_polyline(wks,plot(0),lat,2*get_pi("f")*6371*cos(lat*get_d2r("f"))/ekelEN_y,gsres)
; dum(1) = gsn_add_polyline(wks,plot(0),lat,ekenEN_y,gsres)
end do
resP@gsnPanelFigureStringsJust = "BottomLeft"
resP@gsnPanelLeft = 0.05
resP@gsnPanelRight = 0.93 ; panel 7
newplots = gsn_panel_return(wks,plot(:dimsizes(cidArr)-1),(/1,dimsizes(cidArr)/),resP)
; drawNDCGrid(wks)
frame(wks)
getvalues ploto@contour
"cnMinLevelValF" : wrkcmn
"cnMaxLevelValF" : wrkcmx
"cnLevelSpacingF" : wrkciu
end getvalues
print("CONTOUR FROM "+wrkcmn+" TO "+wrkcmx+" BY "+wrkciu)
bb_dbg = NhlGetBB(newplots)
print("min/max x position = " + min(bb_dbg(:,2)) + "/" + max(bb_dbg(:,3)))
; print("min/max y position = " + min(bb_dbg(:,1)) + "/" + max(bb_dbg(:,0)))
print("wkPaperHeightF="+type@wkPaperWidthF*(max(bb_dbg(:,0))-min(bb_dbg(:,1))))
delete(type)
type = "png"
; type@wkOrientation = "portrait"
type@wkWidth = 1280
type@wkHeight = 1280;640
wks = gsn_open_wks(type,get_script_prefix_name+"."+pp)
gsn_define_colormap(wks,"BlWhRe") ;"BlueWhiteOrangeRed"
do ip = 0,dimsizes(cidArr)-1
res@tiYAxisOn = (mod(ip,dimsizes(cidArr)).eq.0)
res@tmYLLabelsOn = (mod(ip,dimsizes(cidArr)).eq.0) ; panel 7
; res@tmYLOn = (mod(ip,dimsizes(cidArr)).eq.0) ; panel 7
res@lbLabelBarOn = (mod(ip+1,dimsizes(cidArr)).eq.0)
plot(ip) = gsn_csm_contour(wks,transpose(ekeEN_yn(ip,:,:)),res)
ploto = gsn_csm_contour(wks,transpose(ekeClim_yn),ores)
overlay(plot(ip),ploto)
; dum(0) = gsn_add_polyline(wks,plot(0),lat,2*get_pi("f")*6371*cos(lat*get_d2r("f"))/ekelClim_y,gsres0)
; dum(0) = gsn_add_polyline(wks,plot(0),lat,ekenClim_y,gsres0)
; dum(1) = gsn_add_polyline(wks,plot(0),lat,2*get_pi("f")*6371*cos(lat*get_d2r("f"))/ekelEN_y,gsres)
; dum(1) = gsn_add_polyline(wks,plot(0),lat,ekenEN_y,gsres)
end do
; resP@gsnPanelFigureStringsJust = "BottomLeft"
resP@gsnPanelLeft = 0.11
resP@gsnPanelRight = 0.88 ; panel 7
newplots = gsn_panel_return(wks,plot(:dimsizes(cidArr)-1),(/1,dimsizes(cidArr)/),resP)
; drawNDCGrid(wks)
frame(wks)
bb_dbg = NhlGetBB(newplots)
; 80/1280 = 0.0625--0.9375, 0.3125--0.6875,
print("min/max x position = " + min(bb_dbg(:,2)) + "/" + max(bb_dbg(:,3)))
print("min/max y position = " + min(bb_dbg(:,1)) + "/" + max(bb_dbg(:,0)))
system("convert "+wks@name+".png -shave 0x320 "+wks@name+".png")
end
exit
;:'<,'> s?filevardef(\([^,]*\), "\([^"]*\)",.*$?filevarattdef(\1,"\2", \2)? |noh
;:'<,'> s?filevardef(\([^,]*\), "\([^"]*\)",.*$?\1->\2 = (/\2/)? |noh
;:'<,'> s?filevardef(\([^,]*\), "\([^"]*\)",.*$?\2 = fdata->\2? |noh
;:'<,'> g/^[^;]*contour/s/wks,\([^,]*\)/wks,transpose(\1)/gce |noh
;:'<,'> g/^[^;]*polyline/s/\([^,]*\),\([^,]*\),gsres/\2,\1,gsres/gce |noh
; vim: set fdm=marker foldmarker=/;,;/: