source: palm/trunk/SCRIPTS/NCL/timeseries.ncl @ 220

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