1 | load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl" |
---|
2 | load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" |
---|
3 | load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" |
---|
4 | load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" |
---|
5 | |
---|
6 | begin |
---|
7 | |
---|
8 | ; *************************************************** |
---|
9 | ; read parameter_list |
---|
10 | ; *************************************************** |
---|
11 | |
---|
12 | if (isfilepresent("~/.ncl_preferences")) then |
---|
13 | parameter = asciiread("~/.ncl_preferences",75,"string") |
---|
14 | delete(parameter@_FillValue) |
---|
15 | else |
---|
16 | print(" ") |
---|
17 | print("Please copy '.ncl_preferences' into your $home dircetory") |
---|
18 | print(" ") |
---|
19 | exit |
---|
20 | end if |
---|
21 | |
---|
22 | ; *************************************************** |
---|
23 | ; set up default parameter values and strings if not assigned in prompt or parameter list |
---|
24 | ; *************************************************** |
---|
25 | |
---|
26 | if ( .not. isvar("file_in") ) then ; path+name of input file |
---|
27 | if (parameter(7) .EQ. "input file") then |
---|
28 | print(" ") |
---|
29 | print("Please provide input file 'file_in = ' either in prompt or parameter_list") |
---|
30 | print(" ") |
---|
31 | exit |
---|
32 | else |
---|
33 | file_in = parameter(7) |
---|
34 | end if |
---|
35 | end if |
---|
36 | if ( .not. isvar("format_out") ) then ; format of output file |
---|
37 | format_out = "x11" |
---|
38 | if (parameter(9) .NE. "x11") then |
---|
39 | format_out = parameter(9) |
---|
40 | end if |
---|
41 | end if |
---|
42 | if ( .not. isvar("file_out") ) then ; path+name of output file |
---|
43 | file_out = "test" |
---|
44 | if (parameter(11) .NE. "test") then |
---|
45 | file_out = parameter(11) |
---|
46 | end if |
---|
47 | end if |
---|
48 | if ( .not. isvar("no_columns") ) then ; number of plots in one row |
---|
49 | no_columns = 1 |
---|
50 | if (parameter(17) .NE. "1") then |
---|
51 | no_columns = stringtointeger(parameter(17)) |
---|
52 | end if |
---|
53 | end if |
---|
54 | if ( .not. isvar("no_lines") ) then ; number of plot-lines on one sheet |
---|
55 | no_lines = 2 |
---|
56 | if (parameter(19) .NE. "2") then |
---|
57 | no_lines = stringtointeger(parameter(19)) |
---|
58 | end if |
---|
59 | end if |
---|
60 | if ( .not. isvar("var") ) then ; variable name |
---|
61 | check = True |
---|
62 | end if |
---|
63 | if ( .not. isvar("over") ) then ; switches overlaying plots on |
---|
64 | over = 0 |
---|
65 | if (stringtointeger(parameter(37)) .NE. 0) then |
---|
66 | over = stringtointeger(parameter(37)) |
---|
67 | if (stringtointeger(parameter(37)) .NE. 1) then |
---|
68 | print(" ") |
---|
69 | print("Please set 'over' to 0 or 1") |
---|
70 | print(" ") |
---|
71 | exit |
---|
72 | end if |
---|
73 | end if |
---|
74 | end if |
---|
75 | |
---|
76 | ; *************************************************** |
---|
77 | ; open input file |
---|
78 | ; *************************************************** |
---|
79 | |
---|
80 | f = addfile(file_in , "r" ) |
---|
81 | |
---|
82 | vNam = getfilevarnames(f) |
---|
83 | print(" ") |
---|
84 | print("Variable on netCDF file: " + vNam) |
---|
85 | print(" ") |
---|
86 | dim = dimsizes(vNam) |
---|
87 | if (dim .EQ. 0) then |
---|
88 | print(" ") |
---|
89 | print("There are no data on file") |
---|
90 | print(" ") |
---|
91 | end if |
---|
92 | |
---|
93 | t_all = f->time |
---|
94 | nt = dimsizes(t_all) |
---|
95 | delta_t=t_all(nt-1)/nt |
---|
96 | |
---|
97 | ; **************************************************** |
---|
98 | ; start of time step and different types of mistakes that could be done |
---|
99 | ; **************************************************** |
---|
100 | |
---|
101 | if ( .not. isvar("start_time_step") ) then |
---|
102 | start_time_step=t_all(0)/3600 |
---|
103 | if (parameter(13) .NE. "t(0)") then |
---|
104 | if (stringtodouble(parameter(13)) .GE. t_all(nt-1)/3600) |
---|
105 | print(" ") |
---|
106 | print("'start_time_step' = "+ parameter(13) +"h is equal or greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h") |
---|
107 | print(" ") |
---|
108 | print("Please select another 'start_time_step'") |
---|
109 | print(" ") |
---|
110 | exit |
---|
111 | end if |
---|
112 | if (stringtofloat(parameter(13)) .LT. t_all(0)/3600) |
---|
113 | print(" ") |
---|
114 | print("'start_time_step' = "+ parameter(13) +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h") |
---|
115 | print(" ") |
---|
116 | print("Please select another 'start_time_step'") |
---|
117 | print(" ") |
---|
118 | exit |
---|
119 | end if |
---|
120 | start_time_step=stringtodouble(parameter(13)) |
---|
121 | end if |
---|
122 | else |
---|
123 | if (start_time_step .GE. t_all(nt-1)/3600) |
---|
124 | print(" ") |
---|
125 | print("'start_time_step' = "+ start_time_step +"h is equal or greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h") |
---|
126 | print(" ") |
---|
127 | print("Please select another 'start_time_step'") |
---|
128 | print(" ") |
---|
129 | exit |
---|
130 | end if |
---|
131 | if (start_time_step .LT. t_all(0)/3600) |
---|
132 | print(" ") |
---|
133 | print("'start_time_step' = "+ start_time_step +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h") |
---|
134 | print(" ") |
---|
135 | print("Please select another 'start_time_step'") |
---|
136 | print(" ") |
---|
137 | exit |
---|
138 | end if |
---|
139 | end if |
---|
140 | start_time_step = start_time_step*3600 |
---|
141 | do i=0,nt-2 |
---|
142 | if (start_time_step .GE. t_all(i)-delta_t/2 .AND. start_time_step .LT. t_all(i)+delta_t/2)then |
---|
143 | st=i |
---|
144 | break |
---|
145 | end if |
---|
146 | end do |
---|
147 | if (start_time_step .GE. t_all(nt-1)-delta_t/2 .AND. start_time_step .LT. t_all(nt-1)) then |
---|
148 | st=nt-2 |
---|
149 | end if |
---|
150 | |
---|
151 | ; **************************************************** |
---|
152 | ; end of time step and different types of mistakes that could be done |
---|
153 | ; **************************************************** |
---|
154 | |
---|
155 | if ( .not. isvar("end_time_step") ) then |
---|
156 | end_time_step = t_all(nt-1)/3600 |
---|
157 | if (parameter(15) .NE. "t(end)") then |
---|
158 | if (stringtodouble(parameter(15)) .LE. t_all(0)/3600) |
---|
159 | print(" ") |
---|
160 | print("'end_time_step' = "+parameter(15)+ "h is lower or equal than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h") |
---|
161 | print(" ") |
---|
162 | print("Please select another 'end_time_step'") |
---|
163 | print(" ") |
---|
164 | exit |
---|
165 | end if |
---|
166 | if (stringtodouble(parameter(15)) .GT. t_all(nt-1)/3600) |
---|
167 | print(" ") |
---|
168 | print("'end_time_step' = "+ parameter(15) +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h") |
---|
169 | print(" ") |
---|
170 | print("Please select another 'end_time_step'") |
---|
171 | print(" ") |
---|
172 | exit |
---|
173 | end if |
---|
174 | if (stringtodouble(parameter(15)) .LE. start_time_step/3600) |
---|
175 | print(" ") |
---|
176 | print("'end_time_step' = "+ parameter(15) +"h is equal or lower than 'start_time_step' = "+parameter(13)+"h") |
---|
177 | print(" ") |
---|
178 | print("Please select another 'start_time_step' or 'end_time_step'") |
---|
179 | print(" ") |
---|
180 | exit |
---|
181 | end if |
---|
182 | end_time_step = stringtodouble(parameter(15)) |
---|
183 | end if |
---|
184 | else |
---|
185 | if (end_time_step .LE. t_all(0)/3600) |
---|
186 | print(" ") |
---|
187 | print("'end_time_step' = "+end_time_step+ "h is lower or equal than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h") |
---|
188 | print(" ") |
---|
189 | print("Please select another 'end_time_step'") |
---|
190 | print(" ") |
---|
191 | exit |
---|
192 | end if |
---|
193 | if (end_time_step .GT. t_all(nt-1)/3600) |
---|
194 | print(" ") |
---|
195 | print("'end_time_step' = "+ end_time_step +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h") |
---|
196 | print(" ") |
---|
197 | print("Please select another 'end_time_step'") |
---|
198 | print(" ") |
---|
199 | exit |
---|
200 | end if |
---|
201 | if (end_time_step .LE. start_time_step/3600) |
---|
202 | print(" ") |
---|
203 | print("'end_time_step' = "+ end_time_step +"h is equal or lower than 'start_time_step' = "+start_time_step+"h") |
---|
204 | print(" ") |
---|
205 | print("Please select another 'start_time_step' or 'end_time_step'") |
---|
206 | print(" ") |
---|
207 | exit |
---|
208 | end if |
---|
209 | end if |
---|
210 | end_time_step = end_time_step*3600 |
---|
211 | do i=0,nt-1 |
---|
212 | if (end_time_step .GE. t_all(i)-delta_t/2 .AND. end_time_step .LT. t_all(i)+delta_t/2)then |
---|
213 | et=i |
---|
214 | break |
---|
215 | end if |
---|
216 | end do |
---|
217 | |
---|
218 | delete(start_time_step) |
---|
219 | start_time_step=round(st,3) |
---|
220 | delete(end_time_step) |
---|
221 | end_time_step=round(et,3) |
---|
222 | |
---|
223 | t = f->time(start_time_step:end_time_step) |
---|
224 | |
---|
225 | |
---|
226 | ; *************************************************** |
---|
227 | ; set up recourses |
---|
228 | ; *************************************************** |
---|
229 | |
---|
230 | res = True |
---|
231 | res@gsnDraw = False |
---|
232 | res@gsnFrame = False |
---|
233 | res@gsnPaperOrientation = "portrait" |
---|
234 | res@gsnPaperWidth = 8.27 |
---|
235 | res@gsnPaperHeight = 11.69 |
---|
236 | res@gsnPaperMargin = 0.79 |
---|
237 | res@tmXBMode = True |
---|
238 | res@tmYLMode = True |
---|
239 | res@txFont = "helvetica" |
---|
240 | res@tiMainFont = "helvetica" |
---|
241 | res@tiXAxisFont = "helvetica" |
---|
242 | res@tiYAxisFont = "helvetica" |
---|
243 | res@tmXBLabelFont = "helvetica" |
---|
244 | res@tmYLLabelFont = "helvetica" |
---|
245 | res@xyLineColors = (/237/) |
---|
246 | |
---|
247 | res@lgLabelFontHeightF = .02 |
---|
248 | |
---|
249 | resP = True |
---|
250 | resP@txFont = "helvetica" |
---|
251 | resP@txString = f@title+" time series " |
---|
252 | resP@txFuncCode = "~" |
---|
253 | resP@txFontHeightF = 0.015 |
---|
254 | |
---|
255 | res@vpWidthF=4 |
---|
256 | |
---|
257 | txres = True |
---|
258 | |
---|
259 | ; *************************************************** |
---|
260 | ; read data and create plots |
---|
261 | ; *************************************************** |
---|
262 | |
---|
263 | wks_ps = gsn_open_wks(format_out,file_out) |
---|
264 | gsn_define_colormap(wks_ps,"rainbow+white") |
---|
265 | plot_ps=new(dim,graphic) |
---|
266 | |
---|
267 | n=0 |
---|
268 | minE=1.E27 |
---|
269 | maxE=-1.E27 |
---|
270 | minus=1.E27 |
---|
271 | maxus=-1.E27 |
---|
272 | minu=1.E27 |
---|
273 | maxu=-1.E27 |
---|
274 | minz=1.E27 |
---|
275 | maxz=-1.E27 |
---|
276 | minw=1.E27 |
---|
277 | maxw=-1.E27 |
---|
278 | minp=1.E27 |
---|
279 | maxp=-1.E27 |
---|
280 | mins=1.E27 |
---|
281 | maxs=-1.E27 |
---|
282 | |
---|
283 | data = new((/dim,(end_time_step-start_time_step)+1/),float) |
---|
284 | unit = new(dim,string) |
---|
285 | data_0 = new((end_time_step-start_time_step)+1,float) |
---|
286 | data_0 = 0.0 |
---|
287 | mini = new(dim,float) |
---|
288 | maxi = new(dim,float) |
---|
289 | |
---|
290 | if (over .EQ. 1) then |
---|
291 | plot_E = gsn_csm_xy(wks_ps,t,data_0(:),res) |
---|
292 | plot_Es = gsn_csm_xy(wks_ps,t,data_0(:),res) |
---|
293 | plot_us = gsn_csm_xy(wks_ps,t,data_0(:),res) |
---|
294 | plot_ws = gsn_csm_xy(wks_ps,t,data_0(:),res) |
---|
295 | plot_umax = gsn_csm_xy(wks_ps,t,data_0(:),res) |
---|
296 | plot_vmax = gsn_csm_xy(wks_ps,t,data_0(:),res) |
---|
297 | plot_wmax = gsn_csm_xy(wks_ps,t,data_0(:),res) |
---|
298 | plot_z_i_wpt = gsn_csm_xy(wks_ps,t,data_0(:),res) |
---|
299 | plot_z_i_pt = gsn_csm_xy(wks_ps,t,data_0(:),res) |
---|
300 | plot_wpptp0 = gsn_csm_xy(wks_ps,t,data_0(:),res) |
---|
301 | plot_wpptp = gsn_csm_xy(wks_ps,t,data_0(:),res) |
---|
302 | plot_wpt = gsn_csm_xy(wks_ps,t,data_0(:),res) |
---|
303 | plot_pt_0_ = gsn_csm_xy(wks_ps,t,data_0(:),res) |
---|
304 | plot_pt_zp_ = gsn_csm_xy(wks_ps,t,data_0(:),res) |
---|
305 | plot_splptx = gsn_csm_xy(wks_ps,t,data_0(:),res) |
---|
306 | plot_splpty = gsn_csm_xy(wks_ps,t,data_0(:),res) |
---|
307 | plot_splptz = gsn_csm_xy(wks_ps,t,data_0(:),res) |
---|
308 | end if |
---|
309 | |
---|
310 | count_var=0 |
---|
311 | do varn = dim-1,0,1 |
---|
312 | |
---|
313 | if( isStrSubset (vNam(varn), "time") ) |
---|
314 | check = False |
---|
315 | else |
---|
316 | check = True |
---|
317 | end if |
---|
318 | if( isvar("var") ) then |
---|
319 | check = isStrSubset( var,","+vNam(varn)+"," ) |
---|
320 | end if |
---|
321 | if (parameter(21) .NE. "variables") then |
---|
322 | var = parameter(21) |
---|
323 | check = isStrSubset( var,","+vNam(varn)+"," ) |
---|
324 | end if |
---|
325 | |
---|
326 | |
---|
327 | if(check) then |
---|
328 | count_var=count_var+1 |
---|
329 | |
---|
330 | data_all = f ->$vNam(varn)$ |
---|
331 | unit(varn) = data_all@units |
---|
332 | |
---|
333 | data(varn,:)=data_all(start_time_step:end_time_step) |
---|
334 | |
---|
335 | if (over .EQ. 1) then |
---|
336 | |
---|
337 | mini(varn) = min(data(varn,:)) |
---|
338 | maxi(varn) = max(data(varn,:)) |
---|
339 | |
---|
340 | if (vNam(varn) .EQ. "E" .OR. vNam(varn) .EQ. "Es") then |
---|
341 | if (mini(varn) .EQ. maxi(varn)) then |
---|
342 | if (min(data(varn,:)) .EQ. 0)then |
---|
343 | mini(varn)= mini(varn)-1. |
---|
344 | maxi(varn)= maxi(varn)+1. |
---|
345 | end if |
---|
346 | if (min(data(varn,:)) .LT. 0)then |
---|
347 | mini(varn)= mini(varn)-1.+(mini(varn))/2 |
---|
348 | maxi(varn)= maxi(varn)+1.-(maxi(varn))/2 |
---|
349 | end if |
---|
350 | if (min(data(varn,:)) .GT. 0)then |
---|
351 | mini(varn)= mini(varn)-1.-(mini(varn))/2 |
---|
352 | maxi(varn)= maxi(varn)+1.+(maxi(varn))/2 |
---|
353 | end if |
---|
354 | end if |
---|
355 | minE=min((/minE,mini(varn)/)) |
---|
356 | maxE=max((/maxE,maxi(varn)/)) |
---|
357 | end if |
---|
358 | |
---|
359 | if (vNam(varn) .EQ. "us" .OR. vNam(varn) .EQ. "ws") then |
---|
360 | if (mini(varn) .EQ. maxi(varn)) then |
---|
361 | if (min(data(varn,:)) .EQ. 0)then |
---|
362 | mini(varn)= mini(varn)-1. |
---|
363 | maxi(varn)= maxi(varn)+1. |
---|
364 | end if |
---|
365 | if (min(data(varn,:)) .LT. 0)then |
---|
366 | mini(varn)= mini(varn)-1.+(mini(varn))/2 |
---|
367 | maxi(varn)= maxi(varn)+1.-(maxi(varn))/2 |
---|
368 | end if |
---|
369 | if (min(data(varn,:)) .GT. 0)then |
---|
370 | mini(varn)= mini(varn)-1.-(mini(varn))/2 |
---|
371 | maxi(varn)= maxi(varn)+1.+(maxi(varn))/2 |
---|
372 | end if |
---|
373 | end if |
---|
374 | minus=min((/minus,mini(varn)/)) |
---|
375 | maxus=max((/maxus,maxi(varn)/)) |
---|
376 | end if |
---|
377 | |
---|
378 | if (vNam(varn) .EQ. "umax" .OR. vNam(varn) .EQ. "vmax" .OR. vNam(varn) .EQ. "wmax") then |
---|
379 | if (mini(varn) .EQ. maxi(varn)) then |
---|
380 | if (mini(varn) .EQ. 0)then |
---|
381 | mini(varn)= mini(varn)-1. |
---|
382 | maxi(varn)= maxi(varn)+1. |
---|
383 | end if |
---|
384 | if (mini(varn) .LT. 0)then |
---|
385 | mini(varn)= mini(varn)-1.+(mini(varn))/2 |
---|
386 | maxi(varn)= maxi(varn)+1.-(maxi(varn))/2 |
---|
387 | end if |
---|
388 | if (mini(varn) .GT. 0)then |
---|
389 | mini(varn)= mini(varn)-1.-(mini(varn))/2 |
---|
390 | maxi(varn)= maxi(varn)+1.+(maxi(varn))/2 |
---|
391 | end if |
---|
392 | end if |
---|
393 | minu=min((/minu,mini(varn)/)) |
---|
394 | maxu=max((/maxu,maxi(varn)/)) |
---|
395 | end if |
---|
396 | |
---|
397 | if (vNam(varn) .EQ. "z_i_wpt" .OR. vNam(varn) .EQ. "z_i_pt") then |
---|
398 | if (mini(varn) .EQ. maxi(varn)) then |
---|
399 | if (min(data(varn,:)) .EQ. 0)then |
---|
400 | mini(varn)= mini(varn)-1. |
---|
401 | maxi(varn)= maxi(varn)+1. |
---|
402 | end if |
---|
403 | if (min(data(varn,:)) .LT. 0)then |
---|
404 | mini(varn)= mini(varn)-1.+(mini(varn))/2 |
---|
405 | maxi(varn)= maxi(varn)+1.-(maxi(varn))/2 |
---|
406 | end if |
---|
407 | if (min(data(varn,:)) .GT. 0)then |
---|
408 | mini(varn)= mini(varn)-1.-(mini(varn))/2 |
---|
409 | maxi(varn)= maxi(varn)+1.+(maxi(varn))/2 |
---|
410 | end if |
---|
411 | end if |
---|
412 | minz=min((/minz,mini(varn)/)) |
---|
413 | maxz=max((/maxz,maxi(varn)/)) |
---|
414 | end if |
---|
415 | |
---|
416 | if (vNam(varn) .EQ. "wpptp0" .OR. vNam(varn) .EQ. "wpptp" .OR. vNam(varn) .EQ. "wpt") then |
---|
417 | if (mini(varn) .EQ. maxi(varn)) then |
---|
418 | if (min(data(varn,:)) .EQ. 0)then |
---|
419 | mini(varn)= mini(varn)-1. |
---|
420 | maxi(varn)= maxi(varn)+1. |
---|
421 | end if |
---|
422 | if (min(data(varn,:)) .LT. 0)then |
---|
423 | mini(varn)= mini(varn)-1.+(mini(varn))/2 |
---|
424 | maxi(varn)= maxi(varn)+1.-(maxi(varn))/2 |
---|
425 | end if |
---|
426 | if (min(data(varn,:)) .GT. 0)then |
---|
427 | mini(varn)= mini(varn)-1.-(mini(varn))/2 |
---|
428 | maxi(varn)= maxi(varn)+1.+(maxi(varn))/2 |
---|
429 | end if |
---|
430 | end if |
---|
431 | minw=min((/minw,mini(varn)/)) |
---|
432 | maxw=max((/maxw,maxi(varn)/)) |
---|
433 | end if |
---|
434 | |
---|
435 | if (vNam(varn) .EQ. "pt_0_" .OR. vNam(varn) .EQ. "pt_zp_") then |
---|
436 | if (mini(varn) .EQ. maxi(varn)) then |
---|
437 | if (min(data(varn,:)) .EQ. 0)then |
---|
438 | mini(varn)= mini(varn)-1. |
---|
439 | maxi(varn)= maxi(varn)+1. |
---|
440 | end if |
---|
441 | if (min(data(varn,:)) .LT. 0)then |
---|
442 | mini(varn)= mini(varn)-1.+(mini(varn))/2 |
---|
443 | maxi(varn)= maxi(varn)+1.-(maxi(varn))/2 |
---|
444 | end if |
---|
445 | if (min(data(varn,:)) .GT. 0)then |
---|
446 | mini(varn)= mini(varn)-1.-(mini(varn))/2 |
---|
447 | maxi(varn)= maxi(varn)+1.+(maxi(varn))/2 |
---|
448 | end if |
---|
449 | end if |
---|
450 | minp=min((/minp,mini(varn)/)) |
---|
451 | maxp=max((/maxp,maxi(varn)/)) |
---|
452 | end if |
---|
453 | |
---|
454 | if (vNam(varn) .EQ. "splptx" .OR. vNam(varn) .EQ. "splpty" .OR. vNam(varn) .EQ. "splptz") then |
---|
455 | if (mini(varn) .EQ. maxi(varn)) then |
---|
456 | if (min(data(varn,:)) .EQ. 0)then |
---|
457 | mini(varn)= mini(varn)-1. |
---|
458 | maxi(varn)= maxi(varn)+1. |
---|
459 | end if |
---|
460 | if (min(data(varn,:)) .LT. 0)then |
---|
461 | mini(varn)= mini(varn)-1.+(mini(varn))/2 |
---|
462 | maxi(varn)= maxi(varn)+1.-(maxi(varn))/2 |
---|
463 | end if |
---|
464 | if (min(data(varn,:)) .GT. 0)then |
---|
465 | mini(varn)= mini(varn)-1.-(mini(varn))/2 |
---|
466 | maxi(varn)= maxi(varn)+1.+(maxi(varn))/2 |
---|
467 | end if |
---|
468 | end if |
---|
469 | mins=min((/mins,mini(varn)/)) |
---|
470 | maxs=max((/maxs,maxi(varn)/)) |
---|
471 | end if |
---|
472 | |
---|
473 | end if |
---|
474 | end if |
---|
475 | end do |
---|
476 | |
---|
477 | if (count_var .EQ. 0) then |
---|
478 | print(" ") |
---|
479 | print("Please select a variable 'var=' or use the default value") |
---|
480 | print(" ") |
---|
481 | print("Your selection '"+var+"' does not exist on the input file") |
---|
482 | print(" ") |
---|
483 | exit |
---|
484 | end if |
---|
485 | |
---|
486 | do varn = dim-1,0,1 |
---|
487 | |
---|
488 | if( isStrSubset (vNam(varn), "time") ) |
---|
489 | check = False |
---|
490 | else |
---|
491 | check = True |
---|
492 | end if |
---|
493 | if( isvar("var") ) then |
---|
494 | check = isStrSubset( var,","+vNam(varn)+"," ) |
---|
495 | end if |
---|
496 | if (parameter(21) .NE. "variables") then |
---|
497 | var = parameter(21) |
---|
498 | check = isStrSubset( var,","+vNam(varn)+"," ) |
---|
499 | end if |
---|
500 | |
---|
501 | if(check) then |
---|
502 | |
---|
503 | if (over .EQ. 1) then |
---|
504 | |
---|
505 | res@gsnLeftString = "overlayed plot" |
---|
506 | res@gsnRightString = unit(varn) |
---|
507 | res@tiXAxisString = " time [s] " |
---|
508 | res@tiYAxisString = " " |
---|
509 | res@tiXAxisFontHeightF = 0.07 |
---|
510 | res@txFontHeightF = 0.07 |
---|
511 | res@tiYAxisFontHeightF = 0.07 |
---|
512 | |
---|
513 | if (vNam(varn) .EQ. "E") |
---|
514 | E=0 |
---|
515 | res@xyLineColors = (/237/) |
---|
516 | res@xyLineLabelFontHeightF = 0.05 |
---|
517 | res@xyLineLabelFontColor = 237 |
---|
518 | res@trYMaxF = minE |
---|
519 | res@trYMinF = maxE |
---|
520 | plot_E = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
521 | end if |
---|
522 | if (vNam(varn) .EQ. "Es") |
---|
523 | Es=0 |
---|
524 | res@xyLineColors = (/144/) |
---|
525 | res@xyLineLabelFontHeightF = 0.05 |
---|
526 | res@xyLineLabelFontColor = 144 |
---|
527 | plot_Es = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
528 | end if |
---|
529 | |
---|
530 | if (vNam(varn) .EQ. "us") |
---|
531 | us=0 |
---|
532 | res@xyLineColors = (/237/) |
---|
533 | res@xyLineLabelFontHeightF = 0.05 |
---|
534 | res@xyLineLabelFontColor = 237 |
---|
535 | res@trYMaxF = minus |
---|
536 | res@trYMinF = maxus |
---|
537 | plot_us = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
538 | end if |
---|
539 | if (vNam(varn) .EQ. "ws") |
---|
540 | ws=0 |
---|
541 | res@xyLineColors = (/144/) |
---|
542 | res@xyLineLabelFontHeightF = 0.05 |
---|
543 | res@xyLineLabelFontColor = 144 |
---|
544 | plot_ws = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
545 | end if |
---|
546 | |
---|
547 | if (vNam(varn) .EQ. "umax") |
---|
548 | u=0 |
---|
549 | res@xyLineColors = (/237/) |
---|
550 | res@xyLineLabelFontHeightF = 0.05 |
---|
551 | res@xyLineLabelFontColor = 237 |
---|
552 | res@trYMaxF = minu |
---|
553 | res@trYMinF = maxu |
---|
554 | plot_umax = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
555 | end if |
---|
556 | if (vNam(varn) .EQ. "vmax") |
---|
557 | v=0 |
---|
558 | res@xyLineColors = (/144/) |
---|
559 | res@xyLineLabelFontHeightF = 0.05 |
---|
560 | res@xyLineLabelFontColor = 144 |
---|
561 | plot_vmax = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
562 | end if |
---|
563 | if (vNam(varn) .EQ. "wmax") |
---|
564 | w=0 |
---|
565 | res@xyLineColors = (/80/) |
---|
566 | res@xyLineLabelFontHeightF = 0.05 |
---|
567 | res@xyLineLabelFontColor = 80 |
---|
568 | plot_wmax = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
569 | end if |
---|
570 | |
---|
571 | if (vNam(varn) .EQ. "z_i_wpt") |
---|
572 | zw=0 |
---|
573 | res@xyLineColors = (/237/) |
---|
574 | res@xyLineLabelFontHeightF = 0.05 |
---|
575 | res@xyLineLabelFontColor = 237 |
---|
576 | res@trYMaxF = minz |
---|
577 | res@trYMinF = maxz |
---|
578 | plot_z_i_wpt = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
579 | end if |
---|
580 | if (vNam(varn) .EQ. "z_i_pt") |
---|
581 | z=0 |
---|
582 | res@xyLineColors = (/144/) |
---|
583 | res@xyLineLabelFontHeightF = 0.05 |
---|
584 | res@xyLineLabelFontColor = 144 |
---|
585 | plot_z_i_pt = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
586 | end if |
---|
587 | |
---|
588 | if (vNam(varn) .EQ. "wpptp0") |
---|
589 | w0=0 |
---|
590 | res@xyLineColors = (/237/) |
---|
591 | res@xyLineLabelFontHeightF = 0.05 |
---|
592 | res@xyLineLabelFontColor = 237 |
---|
593 | res@trYMaxF = minw |
---|
594 | res@trYMinF = maxw |
---|
595 | plot_wpptp0 = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
596 | end if |
---|
597 | if (vNam(varn) .EQ. "wpptp") |
---|
598 | wp=0 |
---|
599 | res@xyLineColors = (/144/) |
---|
600 | res@xyLineLabelFontHeightF = 0.05 |
---|
601 | res@xyLineLabelFontColor = 144 |
---|
602 | plot_wpptp = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
603 | end if |
---|
604 | if (vNam(varn) .EQ. "wpt") |
---|
605 | wt=0 |
---|
606 | res@xyLineColors = (/80/) |
---|
607 | res@xyLineLabelFontHeightF = 0.05 |
---|
608 | res@xyLineLabelFontColor = 80 |
---|
609 | plot_wpt = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
610 | end if |
---|
611 | |
---|
612 | if (vNam(varn) .EQ. "pt_0_") |
---|
613 | p=0 |
---|
614 | res@xyLineColors = (/237/) |
---|
615 | res@xyLineLabelFontHeightF = 0.05 |
---|
616 | res@xyLineLabelFontColor = 237 |
---|
617 | res@trYMaxF = minp |
---|
618 | res@trYMinF = maxp |
---|
619 | plot_pt_0_ = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
620 | end if |
---|
621 | if (vNam(varn) .EQ. "pt_zp_") |
---|
622 | pz=0 |
---|
623 | res@xyLineColors = (/144/) |
---|
624 | res@xyLineLabelFontHeightF = 0.05 |
---|
625 | res@xyLineLabelFontColor = 144 |
---|
626 | plot_pt_zp_ = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
627 | end if |
---|
628 | |
---|
629 | if (vNam(varn) .EQ. "splptx") |
---|
630 | x=0 |
---|
631 | res@xyLineColors = (/237/) |
---|
632 | res@xyLineLabelFontHeightF = 0.05 |
---|
633 | res@xyLineLabelFontColor = 237 |
---|
634 | res@trYMaxF = mins |
---|
635 | res@trYMinF = maxs |
---|
636 | plot_splptx = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
637 | end if |
---|
638 | if (vNam(varn) .EQ. "splpty") |
---|
639 | y=0 |
---|
640 | res@xyLineColors = (/144/) |
---|
641 | res@xyLineLabelFontHeightF = 0.05 |
---|
642 | res@xyLineLabelFontColor = 144 |
---|
643 | plot_splpty = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
644 | end if |
---|
645 | if (vNam(varn) .EQ. "splptz") |
---|
646 | z=0 |
---|
647 | res@xyLineColors = (/80/) |
---|
648 | res@xyLineLabelFontHeightF = 0.05 |
---|
649 | res@xyLineLabelFontColor = 80 |
---|
650 | plot_splptz = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
651 | end if |
---|
652 | |
---|
653 | end if |
---|
654 | end if |
---|
655 | end do |
---|
656 | |
---|
657 | do varn = dim-1,0,1 |
---|
658 | |
---|
659 | if( isStrSubset (vNam(varn), "time") ) |
---|
660 | check = False |
---|
661 | else |
---|
662 | check = True |
---|
663 | end if |
---|
664 | if( isvar("var") ) then |
---|
665 | check = isStrSubset( var,","+vNam(varn)+"," ) |
---|
666 | end if |
---|
667 | if (parameter(21) .NE. "variables") then |
---|
668 | var = parameter(21) |
---|
669 | check = isStrSubset( var,","+vNam(varn)+"," ) |
---|
670 | end if |
---|
671 | |
---|
672 | if(check) then |
---|
673 | |
---|
674 | if (over .EQ. 1) then |
---|
675 | |
---|
676 | if (vNam(varn) .EQ. "E" .AND. Es .NE. 1) then |
---|
677 | E=1 |
---|
678 | overlay(plot_E,plot_Es) |
---|
679 | n=n+1 |
---|
680 | plot_ps(n) = plot_E |
---|
681 | |
---|
682 | ; *************************************************** |
---|
683 | ; legend for combined plot |
---|
684 | ; *************************************************** |
---|
685 | |
---|
686 | lgres = True |
---|
687 | lgMonoDashIndex = False |
---|
688 | lgres@lgLabelFont = "helvetica" |
---|
689 | lgres@lgLabelFontHeightF = .1 |
---|
690 | lgres@vpWidthF = 0.4 |
---|
691 | lgres@vpHeightF = 0.4 |
---|
692 | lgres@lgDashIndexes = (/0,0,0/) |
---|
693 | lgres@lgLineColors = (/237,144,80/) |
---|
694 | lbid = gsn_create_legend(wks_ps,2,(/"E","Es"/),lgres) |
---|
695 | |
---|
696 | amres = True |
---|
697 | amres@amParallelPosF = 0.6 |
---|
698 | amres@amOrthogonalPosF = -0.2 |
---|
699 | annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) |
---|
700 | end if |
---|
701 | if (vNam(varn) .EQ. "Es" .AND. E .NE. 1) then |
---|
702 | Es=1 |
---|
703 | overlay(plot_E,plot_Es) |
---|
704 | n=n+1 |
---|
705 | plot_ps(n) = plot_E |
---|
706 | |
---|
707 | ; *************************************************** |
---|
708 | ; legend for combined plot |
---|
709 | ; *************************************************** |
---|
710 | |
---|
711 | lgres = True |
---|
712 | lgMonoDashIndex = False |
---|
713 | lgres@lgLabelFont = "helvetica" |
---|
714 | lgres@lgLabelFontHeightF = .1 |
---|
715 | lgres@vpWidthF = 0.4 |
---|
716 | lgres@vpHeightF = 0.4 |
---|
717 | lgres@lgDashIndexes = (/0,0,0/) |
---|
718 | lgres@lgLineColors = (/237,144,80/) |
---|
719 | lbid = gsn_create_legend(wks_ps,2,(/"E","Es"/),lgres) |
---|
720 | |
---|
721 | amres = True |
---|
722 | amres@amParallelPosF = 0.6 |
---|
723 | amres@amOrthogonalPosF = -0.2 |
---|
724 | annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) |
---|
725 | end if |
---|
726 | |
---|
727 | if (vNam(varn) .EQ. "us" .AND. ws .NE. 1) then |
---|
728 | us=1 |
---|
729 | overlay(plot_us,plot_ws) |
---|
730 | n=n+1 |
---|
731 | plot_ps(n) = plot_us |
---|
732 | |
---|
733 | ; *************************************************** |
---|
734 | ; legend for combined plot |
---|
735 | ; *************************************************** |
---|
736 | |
---|
737 | lgres = True |
---|
738 | lgMonoDashIndex = False |
---|
739 | lgres@lgLabelFont = "helvetica" |
---|
740 | lgres@lgLabelFontHeightF = .1 |
---|
741 | lgres@vpWidthF = 0.4 |
---|
742 | lgres@vpHeightF = 0.4 |
---|
743 | lgres@lgDashIndexes = (/0,0,0/) |
---|
744 | lgres@lgLineColors = (/237,144,80/) |
---|
745 | lbid = gsn_create_legend(wks_ps,2,(/"us","ws"/),lgres) |
---|
746 | |
---|
747 | amres = True |
---|
748 | amres@amParallelPosF = 0.6 |
---|
749 | amres@amOrthogonalPosF = -0.2 |
---|
750 | annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) |
---|
751 | end if |
---|
752 | if (vNam(varn) .EQ. "ws" .AND. us .NE. 1) then |
---|
753 | ws=1 |
---|
754 | overlay(plot_us,plot_ws) |
---|
755 | n=n+1 |
---|
756 | plot_ps(n) = plot_us |
---|
757 | |
---|
758 | ; *************************************************** |
---|
759 | ; legend for combined plot |
---|
760 | ; *************************************************** |
---|
761 | |
---|
762 | lgres = True |
---|
763 | lgMonoDashIndex = False |
---|
764 | lgres@lgLabelFont = "helvetica" |
---|
765 | lgres@lgLabelFontHeightF = .1 |
---|
766 | lgres@vpWidthF = 0.4 |
---|
767 | lgres@vpHeightF = 0.4 |
---|
768 | lgres@lgDashIndexes = (/0,0,0/) |
---|
769 | lgres@lgLineColors = (/237,144,80/) |
---|
770 | lbid = gsn_create_legend(wks_ps,2,(/"us","ws"/),lgres) |
---|
771 | |
---|
772 | amres = True |
---|
773 | amres@amParallelPosF = 0.6 |
---|
774 | amres@amOrthogonalPosF = -0.2 |
---|
775 | annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) |
---|
776 | end if |
---|
777 | |
---|
778 | if (vNam(varn) .EQ. "umax" .AND. v .NE. 1) |
---|
779 | if (w .NE. 1) then |
---|
780 | u=1 |
---|
781 | overlay(plot_umax,plot_vmax) |
---|
782 | overlay(plot_umax,plot_wmax) |
---|
783 | n=n+1 |
---|
784 | plot_ps(n) = plot_umax |
---|
785 | |
---|
786 | ; *************************************************** |
---|
787 | ; legend for combined plot |
---|
788 | ; *************************************************** |
---|
789 | |
---|
790 | lgres = True |
---|
791 | lgMonoDashIndex = False |
---|
792 | lgres@lgLabelFont = "helvetica" |
---|
793 | lgres@lgLabelFontHeightF = .1 |
---|
794 | lgres@vpWidthF = 0.4 |
---|
795 | lgres@vpHeightF = 0.4 |
---|
796 | lgres@lgDashIndexes = (/0,0,0/) |
---|
797 | lgres@lgLineColors = (/237,144,80/) |
---|
798 | lbid = gsn_create_legend(wks_ps,3,(/"umax","vmax","wmax"/),lgres) |
---|
799 | |
---|
800 | amres = True |
---|
801 | amres@amParallelPosF = 0.6 |
---|
802 | amres@amOrthogonalPosF = -0.2 |
---|
803 | annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) |
---|
804 | end if |
---|
805 | end if |
---|
806 | if (vNam(varn) .EQ. "vmax" .AND. u .NE. 1) |
---|
807 | if (w .NE. 1) then |
---|
808 | v=1 |
---|
809 | overlay(plot_umax,plot_vmax) |
---|
810 | overlay(plot_umax,plot_wmax) |
---|
811 | n=n+1 |
---|
812 | plot_ps(n) = plot_umax |
---|
813 | |
---|
814 | ; *************************************************** |
---|
815 | ; legend for combined plot |
---|
816 | ; *************************************************** |
---|
817 | |
---|
818 | lgres = True |
---|
819 | lgMonoDashIndex = False |
---|
820 | lgres@lgLabelFont = "helvetica" |
---|
821 | lgres@lgLabelFontHeightF = .1 |
---|
822 | lgres@vpWidthF = 0.4 |
---|
823 | lgres@vpHeightF = 0.4 |
---|
824 | lgres@lgDashIndexes = (/0,0,0/) |
---|
825 | lgres@lgLineColors = (/237,144,80/) |
---|
826 | lbid = gsn_create_legend(wks_ps,3,(/"umax","vmax","wmax"/),lgres) |
---|
827 | |
---|
828 | amres = True |
---|
829 | amres@amParallelPosF = 0.6 |
---|
830 | amres@amOrthogonalPosF = -0.2 |
---|
831 | annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) |
---|
832 | end if |
---|
833 | end if |
---|
834 | if (vNam(varn) .EQ. "wmax" .AND. v .NE. 1) |
---|
835 | if(u .NE. 1) then |
---|
836 | w=1 |
---|
837 | overlay(plot_umax,plot_vmax) |
---|
838 | overlay(plot_umax,plot_wmax) |
---|
839 | n=n+1 |
---|
840 | plot_ps(n) = plot_umax |
---|
841 | |
---|
842 | ; *************************************************** |
---|
843 | ; legend for combined plot |
---|
844 | ; *************************************************** |
---|
845 | |
---|
846 | lgres = True |
---|
847 | lgMonoDashIndex = False |
---|
848 | lgres@lgLabelFont = "helvetica" |
---|
849 | lgres@lgLabelFontHeightF = .1 |
---|
850 | lgres@vpWidthF = 0.4 |
---|
851 | lgres@vpHeightF = 0.4 |
---|
852 | lgres@lgDashIndexes = (/0,0,0/) |
---|
853 | lgres@lgLineColors = (/237,144,80/) |
---|
854 | lbid = gsn_create_legend(wks_ps,3,(/"umax","vmax","wmax"/),lgres) |
---|
855 | |
---|
856 | amres = True |
---|
857 | amres@amParallelPosF = 0.6 |
---|
858 | amres@amOrthogonalPosF = -0.2 |
---|
859 | annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) |
---|
860 | end if |
---|
861 | end if |
---|
862 | |
---|
863 | if (vNam(varn) .EQ. "z_i_wpt" .AND. z .NE. 1) then |
---|
864 | zw=1 |
---|
865 | overlay(plot_z_i_wpt,plot_z_i_pt) |
---|
866 | n=n+1 |
---|
867 | plot_ps(n) = plot_z_i_wpt |
---|
868 | |
---|
869 | ; *************************************************** |
---|
870 | ; legend for combined plot |
---|
871 | ; *************************************************** |
---|
872 | |
---|
873 | lgres = True |
---|
874 | lgMonoDashIndex = False |
---|
875 | lgres@lgLabelFont = "helvetica" |
---|
876 | lgres@lgLabelFontHeightF = .1 |
---|
877 | lgres@vpWidthF = 0.4 |
---|
878 | lgres@vpHeightF = 0.4 |
---|
879 | lgres@lgDashIndexes = (/0,0,0/) |
---|
880 | lgres@lgLineColors = (/237,144,80/) |
---|
881 | lbid = gsn_create_legend(wks_ps,2,(/"z_i_wpt","z_i_pt"/),lgres) |
---|
882 | |
---|
883 | amres = True |
---|
884 | amres@amParallelPosF = 0.6 |
---|
885 | amres@amOrthogonalPosF = -0.2 |
---|
886 | annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) |
---|
887 | end if |
---|
888 | if (vNam(varn) .EQ. "z_i_pt" .AND. zw .NE. 1) then |
---|
889 | z=1 |
---|
890 | overlay(plot_z_i_wpt,plot_z_i_pt) |
---|
891 | n=n+1 |
---|
892 | plot_ps(n) = plot_z_i_wpt |
---|
893 | |
---|
894 | ; *************************************************** |
---|
895 | ; legend for combined plot |
---|
896 | ; *************************************************** |
---|
897 | |
---|
898 | lgres = True |
---|
899 | lgMonoDashIndex = False |
---|
900 | lgres@lgLabelFont = "helvetica" |
---|
901 | lgres@lgLabelFontHeightF = .1 |
---|
902 | lgres@vpWidthF = 0.4 |
---|
903 | lgres@vpHeightF = 0.4 |
---|
904 | lgres@lgDashIndexes = (/0,0,0/) |
---|
905 | lgres@lgLineColors = (/237,144,80/) |
---|
906 | lbid = gsn_create_legend(wks_ps,2,(/"z_i_wpt","z_i_pt"/),lgres) |
---|
907 | |
---|
908 | amres = True |
---|
909 | amres@amParallelPosF = 0.6 |
---|
910 | amres@amOrthogonalPosF = -0.2 |
---|
911 | annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) |
---|
912 | end if |
---|
913 | |
---|
914 | if (vNam(varn) .EQ. "wpptp0" .AND. wp .NE. 1) |
---|
915 | if (wt .NE. 1) then |
---|
916 | w0=1 |
---|
917 | overlay(plot_wpptp0,plot_wpptp) |
---|
918 | overlay(plot_wpptp0,plot_wpt) |
---|
919 | n=n+1 |
---|
920 | plot_ps(n) = plot_wpptp0 |
---|
921 | |
---|
922 | ; *************************************************** |
---|
923 | ; legend for combined plot |
---|
924 | ; *************************************************** |
---|
925 | |
---|
926 | lgres = True |
---|
927 | lgMonoDashIndex = False |
---|
928 | lgres@lgLabelFont = "helvetica" |
---|
929 | lgres@lgLabelFontHeightF = .1 |
---|
930 | lgres@vpWidthF = 0.4 |
---|
931 | lgres@vpHeightF = 0.4 |
---|
932 | lgres@lgDashIndexes = (/0,0,0/) |
---|
933 | lgres@lgLineColors = (/237,144,80/) |
---|
934 | lbid = gsn_create_legend(wks_ps,3,(/"wpptp0","wpptp","wpt"/),lgres) |
---|
935 | |
---|
936 | amres = True |
---|
937 | amres@amParallelPosF = 0.6 |
---|
938 | amres@amOrthogonalPosF = -0.2 |
---|
939 | annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) |
---|
940 | end if |
---|
941 | end if |
---|
942 | if (vNam(varn) .EQ. "wpptp" .AND. w0 .NE. 1) |
---|
943 | if (wt .NE. 1) then |
---|
944 | wp=1 |
---|
945 | overlay(plot_wpptp0,plot_wpptp) |
---|
946 | overlay(plot_wpptp0,plot_wpt) |
---|
947 | n=n+1 |
---|
948 | plot_ps(n) = plot_wpptp0 |
---|
949 | |
---|
950 | ; *************************************************** |
---|
951 | ; legend for combined plot |
---|
952 | ; *************************************************** |
---|
953 | |
---|
954 | lgres = True |
---|
955 | lgMonoDashIndex = False |
---|
956 | lgres@lgLabelFont = "helvetica" |
---|
957 | lgres@lgLabelFontHeightF = .1 |
---|
958 | lgres@vpWidthF = 0.4 |
---|
959 | lgres@vpHeightF = 0.4 |
---|
960 | lgres@lgDashIndexes = (/0,0,0/) |
---|
961 | lgres@lgLineColors = (/237,144,80/) |
---|
962 | lbid = gsn_create_legend(wks_ps,3,(/"wpptp0","wpptp","wpt"/),lgres) |
---|
963 | |
---|
964 | amres = True |
---|
965 | amres@amParallelPosF = 0.6 |
---|
966 | amres@amOrthogonalPosF = -0.2 |
---|
967 | annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) |
---|
968 | end if |
---|
969 | end if |
---|
970 | if (vNam(varn) .EQ. "wpt" .AND. wp .NE. 1) |
---|
971 | if (w0 .NE. 1) then |
---|
972 | wt=1 |
---|
973 | overlay(plot_wpptp0,plot_wpptp) |
---|
974 | overlay(plot_wpptp0,plot_wpt) |
---|
975 | n=n+1 |
---|
976 | plot_ps(n) = plot_wpptp0 |
---|
977 | |
---|
978 | ; *************************************************** |
---|
979 | ; legend for combined plot |
---|
980 | ; *************************************************** |
---|
981 | |
---|
982 | lgres = True |
---|
983 | lgMonoDashIndex = False |
---|
984 | lgres@lgLabelFont = "helvetica" |
---|
985 | lgres@lgLabelFontHeightF = .1 |
---|
986 | lgres@vpWidthF = 0.4 |
---|
987 | lgres@vpHeightF = 0.4 |
---|
988 | lgres@lgDashIndexes = (/0,0,0/) |
---|
989 | lgres@lgLineColors = (/237,144,80/) |
---|
990 | lbid = gsn_create_legend(wks_ps,3,(/"wpptp0","wpptp","wpt"/),lgres) |
---|
991 | |
---|
992 | amres = True |
---|
993 | amres@amParallelPosF = 0.6 |
---|
994 | amres@amOrthogonalPosF = -0.2 |
---|
995 | annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) |
---|
996 | end if |
---|
997 | end if |
---|
998 | |
---|
999 | if (vNam(varn) .EQ. "pt_0_" .AND. pz .NE. 1) then |
---|
1000 | p=1 |
---|
1001 | overlay(plot_pt_0_,plot_pt_zp_) |
---|
1002 | n=n+1 |
---|
1003 | plot_ps(n) = plot_pt_0_ |
---|
1004 | |
---|
1005 | ; *************************************************** |
---|
1006 | ; legend for combined plot |
---|
1007 | ; *************************************************** |
---|
1008 | |
---|
1009 | lgres = True |
---|
1010 | lgMonoDashIndex = False |
---|
1011 | lgres@lgLabelFont = "helvetica" |
---|
1012 | lgres@lgLabelFontHeightF = .1 |
---|
1013 | lgres@vpWidthF = 0.4 |
---|
1014 | lgres@vpHeightF = 0.4 |
---|
1015 | lgres@lgDashIndexes = (/0,0,0/) |
---|
1016 | lgres@lgLineColors = (/237,144,80/) |
---|
1017 | lbid = gsn_create_legend(wks_ps,2,(/"pt_0_","pt_zp_"/),lgres) |
---|
1018 | |
---|
1019 | amres = True |
---|
1020 | amres@amParallelPosF = 0.6 |
---|
1021 | amres@amOrthogonalPosF = -0.2 |
---|
1022 | annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) |
---|
1023 | end if |
---|
1024 | if (vNam(varn) .EQ. "pt_zp_" .AND. p .NE. 1) then |
---|
1025 | pz=1 |
---|
1026 | overlay(plot_pt_0_,plot_pt_zp_) |
---|
1027 | n=n+1 |
---|
1028 | plot_ps(n) = plot_pt_0_ |
---|
1029 | |
---|
1030 | ; *************************************************** |
---|
1031 | ; legend for combined plot |
---|
1032 | ; *************************************************** |
---|
1033 | |
---|
1034 | lgres = True |
---|
1035 | lgMonoDashIndex = False |
---|
1036 | lgres@lgLabelFont = "helvetica" |
---|
1037 | lgres@lgLabelFontHeightF = .1 |
---|
1038 | lgres@vpWidthF = 0.4 |
---|
1039 | lgres@vpHeightF = 0.4 |
---|
1040 | lgres@lgDashIndexes = (/0,0,0/) |
---|
1041 | lgres@lgLineColors = (/237,144,80/) |
---|
1042 | lbid = gsn_create_legend(wks_ps,2,(/"pt_0_","pt_zp_"/),lgres) |
---|
1043 | |
---|
1044 | amres = True |
---|
1045 | amres@amParallelPosF = 0.6 |
---|
1046 | amres@amOrthogonalPosF = -0.2 |
---|
1047 | annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) |
---|
1048 | end if |
---|
1049 | |
---|
1050 | if (vNam(varn) .EQ. "splptx" .AND. y .NE. 1) |
---|
1051 | if (z .NE.1 ) then |
---|
1052 | x=1 |
---|
1053 | overlay(plot_splptx,plot_splpty) |
---|
1054 | overlay(plot_splptx,plot_splptz) |
---|
1055 | n=n+1 |
---|
1056 | plot_ps(n) = plot_splptx |
---|
1057 | |
---|
1058 | ; *************************************************** |
---|
1059 | ; legend for combined plot |
---|
1060 | ; *************************************************** |
---|
1061 | |
---|
1062 | lgres = True |
---|
1063 | lgMonoDashIndex = False |
---|
1064 | lgres@lgLabelFont = "helvetica" |
---|
1065 | lgres@lgLabelFontHeightF = .1 |
---|
1066 | lgres@vpWidthF = 0.4 |
---|
1067 | lgres@vpHeightF = 0.4 |
---|
1068 | lgres@lgDashIndexes = (/0,0,0/) |
---|
1069 | lgres@lgLineColors = (/237,144,80/) |
---|
1070 | lbid = gsn_create_legend(wks_ps,3,(/"splptx","splpty","splptz"/),lgres) |
---|
1071 | |
---|
1072 | amres = True |
---|
1073 | amres@amParallelPosF = 0.6 |
---|
1074 | amres@amOrthogonalPosF = -0.2 |
---|
1075 | annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) |
---|
1076 | end if |
---|
1077 | end if |
---|
1078 | if (vNam(varn) .EQ. "splpty" .AND. x .NE. 1) |
---|
1079 | if(z .NE.1 ) then |
---|
1080 | y=1 |
---|
1081 | overlay(plot_splptx,plot_splpty) |
---|
1082 | overlay(plot_splptx,plot_splptz) |
---|
1083 | n=n+1 |
---|
1084 | plot_ps(n) = plot_splptx |
---|
1085 | |
---|
1086 | ; *************************************************** |
---|
1087 | ; legend for combined plot |
---|
1088 | ; *************************************************** |
---|
1089 | |
---|
1090 | lgres = True |
---|
1091 | lgMonoDashIndex = False |
---|
1092 | lgres@lgLabelFont = "helvetica" |
---|
1093 | lgres@lgLabelFontHeightF = .1 |
---|
1094 | lgres@vpWidthF = 0.4 |
---|
1095 | lgres@vpHeightF = 0.4 |
---|
1096 | lgres@lgDashIndexes = (/0,0,0/) |
---|
1097 | lgres@lgLineColors = (/237,144,80/) |
---|
1098 | lbid = gsn_create_legend(wks_ps,3,(/"splptx","splpty","splptz"/),lgres) |
---|
1099 | |
---|
1100 | amres = True |
---|
1101 | amres@amParallelPosF = 0.6 |
---|
1102 | amres@amOrthogonalPosF = -0.2 |
---|
1103 | annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) |
---|
1104 | end if |
---|
1105 | end if |
---|
1106 | if (vNam(varn) .EQ. "splptz" .AND. y .NE. 1) |
---|
1107 | if(x .NE.1 ) then |
---|
1108 | z=1 |
---|
1109 | overlay(plot_splptx,plot_splpty) |
---|
1110 | overlay(plot_splptx,plot_splptz) |
---|
1111 | n=n+1 |
---|
1112 | plot_ps(n) = plot_splptx |
---|
1113 | |
---|
1114 | ; *************************************************** |
---|
1115 | ; legend for combined plot |
---|
1116 | ; *************************************************** |
---|
1117 | |
---|
1118 | lgres = True |
---|
1119 | lgMonoDashIndex = False |
---|
1120 | lgres@lgLabelFont = "helvetica" |
---|
1121 | lgres@lgLabelFontHeightF = .1 |
---|
1122 | lgres@vpWidthF = 0.4 |
---|
1123 | lgres@vpHeightF = 0.4 |
---|
1124 | lgres@lgDashIndexes = (/0,0,0/) |
---|
1125 | lgres@lgLineColors = (/237,144,80/) |
---|
1126 | lbid = gsn_create_legend(wks_ps,3,(/"splptx","splpty","splptz"/),lgres) |
---|
1127 | |
---|
1128 | amres = True |
---|
1129 | amres@amParallelPosF = 0.6 |
---|
1130 | amres@amOrthogonalPosF = -0.2 |
---|
1131 | annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) |
---|
1132 | end if |
---|
1133 | end if |
---|
1134 | |
---|
1135 | if(vNam(varn) .NE. "splptz" .AND. vNam(varn) .NE. "splpty" .AND. vNam(varn) .NE. "splptx" .AND. vNam(varn) .NE. "pt_zp_" .AND. vNam(varn) .NE. "pt_0_" .AND. vNam(varn) .NE. "wpt" .AND. vNam(varn) .NE. "wpptp" .AND. vNam(varn) .NE. "wpptp0" .AND. vNam(varn) .NE. "z_i_pt" .AND. vNam(varn) .NE. "z_i_wpt" .AND. vNam(varn) .NE. "wmax" .AND. vNam(varn) .NE. "vmax" .AND. vNam(varn) .NE. "umax" .AND. vNam(varn) .NE. "ws" .AND. vNam(varn) .NE. "us" .AND. vNam(varn) .NE. "Es" .AND. vNam(varn) .NE. "E") then |
---|
1136 | n=n+1 |
---|
1137 | res@xyLineColors = (/237/) |
---|
1138 | res@xyLabelMode = False |
---|
1139 | res@gsnLeftString = vNam(varn) |
---|
1140 | res@gsnRightString = unit(varn) |
---|
1141 | res@trYMaxF = min(data(varn,:)) |
---|
1142 | res@trYMinF = max(data(varn,:)) |
---|
1143 | if (min(data(varn,:)) .EQ. max(data(varn,:))) then |
---|
1144 | if (min(data(varn,:)) .EQ. 0)then |
---|
1145 | res@trYMaxF = min(data(varn,:))-1. |
---|
1146 | res@trYMinF = max(data(varn,:))+1. |
---|
1147 | end if |
---|
1148 | if (min(data(varn,:)) .LT. 0)then |
---|
1149 | res@trYMaxF = min(data(varn,:))+(min(data(varn,:)))/2 |
---|
1150 | res@trYMinF = max(data(varn,:))-(max(data(varn,:)))/2 |
---|
1151 | end if |
---|
1152 | if (min(data(varn,:)) .GT. 0)then |
---|
1153 | res@trYMaxF = min(data(varn,:))-(min(data(varn,:)))/2 |
---|
1154 | res@trYMinF = max(data(varn,:))+(max(data(varn,:)))/2 |
---|
1155 | end if |
---|
1156 | end if |
---|
1157 | plot_ps(n) = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
1158 | end if |
---|
1159 | |
---|
1160 | else |
---|
1161 | |
---|
1162 | print("plot of " + vNam(varn)) |
---|
1163 | |
---|
1164 | n=n+1 |
---|
1165 | res@xyLineColors = (/237/) |
---|
1166 | res@gsnLeftString = vNam(varn) |
---|
1167 | res@gsnRightString = unit(varn) |
---|
1168 | res@tiXAxisString = " time [s] " |
---|
1169 | res@tiYAxisString = " " |
---|
1170 | res@tiXAxisFontHeightF = 0.07 |
---|
1171 | res@txFontHeightF = 0.07 |
---|
1172 | res@tiYAxisFontHeightF = 0.07 |
---|
1173 | res@trYMaxF = min(data(varn,:)) |
---|
1174 | res@trYMinF = max(data(varn,:)) |
---|
1175 | if (min(data(varn,:)) .EQ. max(data(varn,:))) then |
---|
1176 | if (min(data(varn,:)) .EQ. 0)then |
---|
1177 | res@trYMaxF = min(data(varn,:))-1. |
---|
1178 | res@trYMinF = max(data(varn,:))+1. |
---|
1179 | end if |
---|
1180 | if (min(data(varn,:)) .LT. 0)then |
---|
1181 | res@trYMaxF = min(data(varn,:))+(min(data(varn,:)))/2 |
---|
1182 | res@trYMinF = max(data(varn,:))-(max(data(varn,:)))/2 |
---|
1183 | end if |
---|
1184 | if (min(data(varn,:)) .GT. 0)then |
---|
1185 | res@trYMaxF = min(data(varn,:))-(min(data(varn,:)))/2 |
---|
1186 | res@trYMinF = max(data(varn,:))+(max(data(varn,:)))/2 |
---|
1187 | end if |
---|
1188 | end if |
---|
1189 | plot_ps(n) = gsn_csm_xy(wks_ps,t,data(varn,:),res) |
---|
1190 | |
---|
1191 | end if |
---|
1192 | end if |
---|
1193 | end do |
---|
1194 | |
---|
1195 | ; *************************************************** |
---|
1196 | ; merge plots onto one page |
---|
1197 | ; *************************************************** |
---|
1198 | |
---|
1199 | if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then |
---|
1200 | gsn_panel(wks_ps,plot_ps(1:n),(/n,1/),resP) |
---|
1201 | else |
---|
1202 | do np = 1,n,no_lines*no_columns |
---|
1203 | if ( np + no_lines*no_columns .gt. n) then |
---|
1204 | gsn_panel(wks_ps, plot_ps(np:n),(/no_lines,no_columns/),resP) |
---|
1205 | else |
---|
1206 | gsn_panel(wks_ps, plot_ps(np:np+no_lines*no_columns-1),(/no_lines,no_columns/),resP) |
---|
1207 | end if |
---|
1208 | end do |
---|
1209 | end if |
---|
1210 | |
---|
1211 | print(" ") |
---|
1212 | print("Output to: " + file_out +"."+ format_out) |
---|
1213 | print(" ") |
---|
1214 | |
---|
1215 | end |
---|