Changeset 161 for palm/trunk/SCRIPTS/NCL


Ignore:
Timestamp:
Apr 11, 2008 10:54:53 AM (16 years ago)
Author:
letzel
Message:
  • NCL scripts in trunk/SCRIPTS/NCL updated for vector plots
Location:
palm/trunk/SCRIPTS/NCL
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/NCL/.ncl_preferences

    r157 r161  
    1919___no_lines__________[1;2;...]__________________________________default = 2_______________[ALL]
    20202
    21 ___'var'_____________[E,dt,umax,;...]___________________________default = variables_______[ALL]
     21___'var'_____________[,E,dt,umax,;...]__________________________default = variables_______[ALL]
    2222variables
    2323___combine___________[0] or [1]_________________________________default = 0_______________[PR]
    24240
    25 ___number_comb_______[0] or [1]_________________________________default = 0_______________[PR]
     25___number_comb_______[2] or [3]_________________________________default = 0_______________[PR]
    26260
    27 ___'c_var'___________[umax,vmax,wmax,;...]______________________default = c_variables_____[PR]
     27___'c_var'___________[,us2,vs2,ws2,;...]________________________default = c_variables_____[PR]
    2828c_variables
    2929___dash______________[0] or [1]_________________________________default = 0_______________[PR]
     
    3333___min_z_____________[0;10;...]_________________________________default = 0_______________[PR]
    34340
    35 ___max_z_____________[100;1000;...]_____________________________default = max(z_pr)_______[PR]
    36 max(z_pr)
     35___max_z_____________[100;1000;...]_____________________________default = max(z_u)________[PR]
     36max(z_u)
    3737___'sort'____________[time] or [layer]__________________________default = time____________[CS]
    3838time
     
    6363___vector____________[0] or [1]_________________________________default = 0_______________[CS]
    64640
    65 ___'vec1'____________[u,;v,;...]________________________________default = vec1____________[CS]
     65___'vec1'____________[,u,;,v,;...]______________________________default = vec1____________[CS]
    6666vec1
    67 ___'vec2'____________[u,;v,;...]________________________________default = vec2____________[CS]
     67___'vec2'____________[,u,;,v,;...]______________________________default = vec2____________[CS]
    6868vec2
    69 __'plotvec'__________[u,;v,;...]________________________________default = plotvec_________[CS]
     69__'plotvec'__________[,u,;,v,;...]______________________________default = plotvec_________[CS]
    7070plotvec
    7171___ref_mag___________[0.1;0.02;...]_____________________________default = 0.05____________[CS]
    72720.05
     73___over______________[0] or [1]_________________________________default = 0_______________[TS+PR]
     740
    7375___end of file ".ncl_preferences"_____________________________________________________________
  • palm/trunk/SCRIPTS/NCL/cross_sections.ncl

    r157 r161  
    1212
    1313   if (isfilepresent("~/.ncl_preferences")) then
    14       parameter = asciiread("~/.ncl_preferences",73,"string")
     14      parameter = asciiread("~/.ncl_preferences",75,"string")
    1515      delete(parameter@_FillValue)
    1616   else
     
    208208   print(" ")
    209209   dim   = dimsizes(vNam)
    210  
     210   if (dim .EQ. 0) then
     211      print(" ")
     212      print("There are no data on file")
     213      print(" ")
     214   end if
     215
    211216   ; ***************************************************
    212217   ; set up recourses
     
    259264   end if
    260265
    261    ; ***************************************************
    262    ; open workstation(s)
    263    ; ***************************************************
    264 
    265    wks_ps  = gsn_open_wks(format_out,file_out)
    266    gsn_define_colormap(wks_ps,"rainbow+white")
    267 
    268    plot=new((/no_columns*no_lines/),graphic)
    269 
    270    page = 0
    271 
    272    nc1 = no_columns
    273    nl1 = no_lines
    274 
    275    print("plots sorted by '"+sort+"'")
    276    print(" ")
    277 
    278266   ; *********************************************
    279267   ; set up of start_time_step and end_time_step
    280268   ; *********************************************
    281269
    282    t = f->time
     270   t    = f->time
    283271   nt = dimsizes(t)
    284272     
     
    288276
    289277   if ( .not. isvar("start_time_step") ) then           
    290       start_time_step = 1
     278      start_time_step = 0
    291279      if (parameter(13) .NE. "1") then
    292          if (parameter(13) .LE. "0")
     280         if (parameter(13) .LT. "1")
    293281            print(" ")
    294282            print("Begin with time step 1")
     
    302290            exit
    303291         end if
    304          start_time_step = stringtointeger(parameter(13)) 
     292         start_time_step = stringtointeger(parameter(13))-1 
    305293      end if
    306294   else
     
    317305         exit
    318306      end if
     307      start_time_step = start_time_step - 1
    319308   end if
    320309
     
    324313
    325314   if ( .not. isvar("end_time_step") ) then             
    326       end_time_step = nt
     315      end_time_step = nt-1
    327316      if (parameter(15) .NE. "nt") then
    328317         if (parameter(15) .LE. "0")
     
    344333            exit
    345334         end if
    346          end_time_step = stringtointeger(parameter(15)) 
     335         end_time_step = stringtointeger(parameter(15))-1 
    347336      end if   
    348337   else
     
    365354         exit
    366355      end if
    367    end if
     356      end_time_step = end_time_step-1
     357   end if
     358
     359   no_time=(end_time_step-start_time_step)+1
    368360
    369361   ; ****************************************************
     
    374366      if ( .not. isvar("plotvec") ) then
    375367         plotvec = parameter(69)
    376          if (parameter(69) .EQ. "plotvec") then
    377             print(" ")
    378             print("Please indicate the variable where the vector plot shall overlay ('plotvec')")
    379             print(" ")
    380             exit
    381          end if
    382368      end if
    383369      if ( .not. isvar("vec1") ) then
     
    409395   ; ****************************************************
    410396
    411    do varn=0,dim-
    412 
    413       if ( vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "xu" ) then
     397   do varn=dim-1,0,
     398
     399      if ( vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "xu" .or. vNam(varn) .eq. "zu" .or. vNam(varn) .eq. "zwwi" .or. vNam(varn) .eq. "zusi" .or. vNam(varn) .eq. "time" .or. vNam(varn) .eq. "zu_3d" .or. vNam(varn) .eq. "zw_3d" .or. vNam(varn) .eq. "x" .or. vNam(varn) .eq. "y" .or. vNam(varn) .eq. "zu_xy" .or. vNam(varn) .eq. "zw_xy" .or. vNam(varn) .eq. "zu1_xy" .or. vNam(varn) .eq. "ind_z_xy" .or. vNam(varn) .eq. "y_xz" .or. vNam(varn) .eq. "yv_xz" .or. vNam(varn) .eq. "ind_y_xz" .or. vNam(varn) .eq. "x_yz" .or. vNam(varn) .eq. "xu_yz" .or. vNam(varn) .eq. "ind_x_yz") then
    414400         check = False
    415       end if
    416       if ( vNam(varn) .eq. "zwwi" .or. vNam(varn) .eq. "zusi") then
    417          check = False
    418       end if     
     401      else
     402         check = True
     403      end if   
    419404      if (  isvar("var") ) then 
    420          check = isStrSubset( var,vNam(varn)+",")
     405         check = isStrSubset( var,","+vNam(varn)+",")
    421406      end if
    422407      if (parameter(21) .NE. "variables") then
    423408         var = parameter(21)
    424          check = isStrSubset( var,vNam(varn)+"," )
     409         check = isStrSubset( var,","+vNam(varn)+"," )
    425410      end if   
    426411
    427412      if(check) then
    428        
     413         print(vNam(varn))
    429414         data_all = f->$vNam(varn)$
    430415
     
    536521   end do
    537522
     523   if (xyc .EQ. 1) then
     524      no_layer = (ze-zs)+1
     525   end if
     526   if (xzc .EQ. 1) then
     527      no_layer = (ye-ys)+1
     528   end if
     529   if (yzc .EQ. 1) then
     530      no_layer = (xe-xs)+1
     531   end if
     532
    538533   data  = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float)
    539534
     
    570565   v1=0
    571566   v2=0
    572 
    573    do varn=0,dim-1 
     567   no_var=0
     568   n=0
     569
     570   do varn=dim-1,0,1 
    574571     
    575572      data_all = f->$vNam(varn)$
    576573
    577574      if (vector .EQ. 1) then   
    578          check_vec1 = isStrSubset( vec1,vNam(varn)+",")
    579          check_vec2 = isStrSubset( vec2,vNam(varn)+",")
     575         check_vec1 = isStrSubset( vec1,","+vNam(varn)+",")
     576         check_vec2 = isStrSubset( vec2,","+vNam(varn)+",")
    580577      end if
    581578           
    582       if ( vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "xu" ) then
     579      if ( vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "xu" .or. vNam(varn) .eq. "zu" .or. vNam(varn) .eq. "zwwi" .or. vNam(varn) .eq. "zusi" .or. vNam(varn) .eq. "time" .or. vNam(varn) .eq. "zu_3d" .or. vNam(varn) .eq. "zw_3d" .or. vNam(varn) .eq. "x".or. vNam(varn) .eq. "y" .or. vNam(varn) .eq. "zu_xy" .or. vNam(varn) .eq. "zw_xy" .or. vNam(varn) .eq. "zu1_xy" .or. vNam(varn) .eq. "ind_z_xy" .or. vNam(varn) .eq. "y_xz" .or. vNam(varn) .eq. "yv_xz" .or. vNam(varn) .eq. "ind_y_xz" .or. vNam(varn) .eq. "x_yz" .or. vNam(varn) .eq. "xu_yz" .or. vNam(varn) .eq. "ind_x_yz") then
    583580         check = False
    584       end if
    585       if ( vNam(varn) .eq. "zwwi" .or. vNam(varn) .eq. "zusi") then
    586          check = False
    587       end if     
     581      else
     582         check = True
     583      end if 
    588584      if (  isvar("var") ) then 
    589          check = isStrSubset( var,vNam(varn)+",")
    590       end if
    591  
     585         check = isStrSubset( var,","+vNam(varn)+",")
     586      end if 
    592587      if (parameter(21) .NE. "variables") then
    593588         var = parameter(21)
    594          check = isStrSubset( var,vNam(varn)+"," )
     589         check = isStrSubset( var,","+vNam(varn)+"," )
    595590      end if 
    596591
    597592      if(check) then
    598593
     594         no_var=no_var+1
     595
    599596         if (vector .EQ. 1) then
    600             if (vNam(varn)+"," .EQ. vec1) then
     597            if (","+vNam(varn)+"," .EQ. vec1) then
    601598               v1=v1+1
    602599            end if
    603             if (vNam(varn)+"," .EQ. vec2) then
     600            if (","+vNam(varn)+"," .EQ. vec2) then
    604601               v2=v2+1
    605602            end if
     
    608605         data(varn,:,:,:,:)=data_all(0:nt-1,zs:ze,ys:ye,xs:xe)
    609606         if (check_vec1) then
    610             print("in vec1")
    611607            vect1=data_all
    612608         end if
    613609         if (check_vec2) then
    614              print("in vec2")
    615610            vect2=data_all
    616611         end if
     
    626621      delete(data_all)
    627622
    628    end do 
     623   end do
     624 
     625   plot_panel=new((/no_time*no_layer*no_var/),graphic)
    629626
    630627   if (vector .EQ. 1) then
     
    645642
    646643   ; ***************************************************
     644   ; open workstation(s)
     645   ; ***************************************************
     646
     647   wks_ps  = gsn_open_wks(format_out,file_out)
     648   gsn_define_colormap(wks_ps,"rainbow+white")
     649
     650   plot=new((/no_time*no_layer*no_var/),graphic)
     651
     652   page = 0
     653   n=0
     654
     655   print("plots sorted by '"+sort+"'")
     656   print(" ")
     657
     658   ; ***************************************************
    647659   ; create plots
    648660   ; ***************************************************
     
    650662   check = True
    651663
    652    do varn=0,dim-1
     664   do varn=dim-1,0,1
    653665
    654666      if (vector .EQ. 1) then   
    655          check_vecp = isStrSubset( plotvec,vNam(varn)+",")
     667         check_vecp = isStrSubset( plotvec,","+vNam(varn)+",")
    656668      end if
    657669
    658       if ( vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "xu" ) then
    659          check = False
    660       end if
    661       if ( vNam(varn) .eq. "zwwi" .or. vNam(varn) .eq. "zusi") then
    662          check = False
    663       end if     
     670      if ( vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "xu" .or. vNam(varn) .eq. "zu" .or. vNam(varn) .eq. "zwwi" .or. vNam(varn) .eq. "zusi" .or. vNam(varn) .eq. "time" .or. vNam(varn) .eq. "zu_3d" .or. vNam(varn) .eq. "zw_3d" .or. vNam(varn) .eq. "x".or. vNam(varn) .eq. "y" .or. vNam(varn) .eq. "zu_xy" .or. vNam(varn) .eq. "zw_xy" .or. vNam(varn) .eq. "zu1_xy" .or. vNam(varn) .eq. "ind_z_xy" .or. vNam(varn) .eq. "y_xz" .or. vNam(varn) .eq. "yv_xz" .or. vNam(varn) .eq. "ind_y_xz" .or. vNam(varn) .eq. "x_yz" .or. vNam(varn) .eq. "xu_yz" .or. vNam(varn) .eq. "ind_x_yz") then
     671         check = False
     672      else
     673         check = True
     674      end if   
    664675      if (  isvar("var") ) then 
    665          check = isStrSubset( var,vNam(varn)+",")
     676         check = isStrSubset( var,","+vNam(varn)+",")
    666677      end if
    667678      if (parameter(21) .NE. "variables") then
    668679         var = parameter(21)
    669          check = isStrSubset( var,vNam(varn)+"," )
     680         check = isStrSubset( var,","+vNam(varn)+"," )
    670681      end if
    671682   
    672683      if(check) then
    673      
     684   
    674685         ; ****************************************************
    675686         ; loops over time and layer
    676687         ; ****************************************************
    677688
    678          do lo = los, loe                                       ; lo: loop outer
    679             do li = lis, lie, no_lines*no_columns               ; li: loop inner
    680                
    681                if ( sort .eq. "time" ) then
    682                   ta = li
    683                   tb = min( (/li + no_lines*no_columns - 1, end_time_step/) )
    684                   if ( xyc .eq. 1 ) then
    685                      xa = xs
    686                      xb = xe
    687                      ya = ys
    688                      yb = ye
    689                      za = lo
    690                      zb = lo
    691                   end if
    692                   if ( xzc .eq. 1 ) then
    693                      xa = xs
    694                      xb = xe
    695                      ya = lo
    696                      yb = lo
    697                      za = zs
    698                      zb = ze
    699                   end if
    700                   if ( yzc .eq. 1 ) then
    701                      xa = lo
    702                      xb = lo
    703                      ya = ys
    704                      yb = ye
    705                      za = zs
    706                      zb = ze
    707                   end if
    708                end if
    709 
    710                if ( sort .eq. "layer" ) then
    711                   ta = lo
    712                   tb = lo
    713                   if ( xyc .eq. 1 ) then
    714                      xa = xs
    715                      xb = xe
    716                      ya = ys
    717                      yb = ye
    718                      za = li
    719                      zb = min( (/li + no_lines*no_columns - 1, ze/) ) 
    720                   end if
    721                   if ( xzc .eq. 1 ) then
    722                      xa = xs
    723                      xb = xe
    724                      ya = li
    725                      yb = min( (/li + no_lines*no_columns - 1, ye/) )
    726                      za = zs
    727                      zb = ze
    728                   end if
    729                   if ( yzc .eq. 1 ) then
    730                      xa = li
    731                      xb = min( (/li + no_lines*no_columns - 1, xe/) )
    732                      ya = ys
    733                      yb = ye
    734                      za = zs
    735                      zb = ze
    736                   end if
    737                end if   
    738 
     689         do lo = los, loe                                       
     690            do li = lis, lie                           
     691                 
    739692               ; ****************************************************
    740693               ; xy cross section
     
    743696               if ( xyc .eq. 1 ) then
    744697               
    745                   cs_res@tiXAxisString   = "x [m]"
    746                   cs_res@tiYAxisString   = "y [m]"
     698                  cs_res@tiXAxisString = "x [m]"
     699                  cs_res@tiYAxisString = "y [m]"
    747700                  cs_res@gsnLeftString = "Plot of "+vNam(varn)
    748                  
     701     
    749702                  if ( sort .eq. "time" ) then
    750703                     if ( data&z(lo) .eq. -1 ) then
     
    753706                        level = "=" + data&z(lo) + "m"
    754707                     end if
    755                      do n = 0,tb-ta
    756                         cs_res@gsnCenterString = "time=" + data&t(li+n-1) +"s  z"+level
    757                         plot1 = gsn_csm_contour(wks_ps,data(varn,li+n-1,lo,:,:),cs_res) 
     708                     cs_res@gsnCenterString = "time=" + data&t(li) +"s  z"+level
     709                     plot(n) = gsn_csm_contour(wks_ps,data(varn,li,lo,:,:),cs_res)
     710                     if (vector .EQ. 1) then
    758711                        if (check_vecp)
    759712                           vecres                  = True            ; vector only resources
    760713                           vecres@gsnDraw          = False           ; don't draw
    761                            vecres@gsnFrame         = False           ; don't advance frame
    762                            vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
    763                            vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
    764                            vecres@vcRefLengthF     = 0.05            ; define length of vec ref
     714                           vecres@gsnFrame         = False           ; don't advance frame
     715                           vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
     716                           vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
     717                           vecres@vcRefLengthF     = 0.05            ; define length of vec ref
    765718                           vecres@gsnRightString   = " "             ; turn off right string
    766719                           vecres@gsnLeftString    = " "             ; turn off left string
    767720                           vecres@tiXAxisString    = " "   
    768                            plot_vec=gsn_csm_vector(wks_ps,vect1(li+n-1,lo,:,:),vect2(li+n-1,lo,:,:),vecres)
    769                            overlay(plot1, plot_vec)
    770                         end if                     
    771                         plot(n) = plot1                         
    772                      end do
     721                           plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
     722                           overlay(plot(n), plot_vec)
     723                        else 
     724                           vecres                  = True            ; vector only resources
     725                           vecres@gsnDraw          = False           ; don't draw
     726                           vecres@gsnFrame         = False           ; don't advance frame
     727                           vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
     728                           vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
     729                           vecres@vcRefLengthF     = 0.05            ; define length of vec ref
     730                           vecres@gsnRightString   = "Vector plot of "+vec1+" and "+vec2
     731                           vecres@gsnLeftString    = " "             ; turn off left string
     732                           vecres@tiXAxisString    = " "   
     733                           plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
     734                           plot(n) = plot_vec
     735                        end if
     736                     end if                         
    773737                  end if
    774738
    775739                  if ( sort .eq. "layer" ) then
    776                      do n = 0, zb-za
    777                         if ( data&z(li+n) .eq. -1 ) then
    778                            level = "-average"
    779                         else
    780                            level = "=" + data&z(li+n) + "m"
     740                     if ( data&z(li) .eq. -1 ) then
     741                        level = "-average"
     742                     else
     743                        level = "=" + data&z(li) + "m"
     744                     end if
     745                     cs_res@gsnCenterString = "t=" + data&t(lo) + "s  z"+ level
     746                     plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,li,:,:),cs_res)
     747                     if (vector .EQ. 1) then
     748                        if (check_vecp)
     749                           vecres                  = True            ; vector only resources
     750                           vecres@gsnDraw          = False           ; don't draw
     751                           vecres@gsnFrame         = False           ; don't advance frame
     752                           vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
     753                           vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
     754                           vecres@vcRefLengthF     = 0.05            ; define length of vec ref
     755                           vecres@gsnRightString   = " "             ; turn off right string
     756                           vecres@gsnLeftString    = " "             ; turn off left string
     757                           vecres@tiXAxisString    = " "   
     758                           plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres)
     759                           overlay(plot(n), plot_vec)
     760                        else 
     761                           vecres                  = True            ; vector only resources
     762                           vecres@gsnDraw          = False           ; don't draw
     763                           vecres@gsnFrame         = False           ; don't advance frame
     764                           vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
     765                           vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
     766                           vecres@vcRefLengthF     = 0.05            ; define length of vec ref
     767                           vecres@gsnRightString   = "Vector plot of "+vec1+" and "+vec2
     768                           vecres@gsnLeftString    = " "             ; turn off left string
     769                           vecres@tiXAxisString    = " "   
     770                           plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres)
     771                           plot(n) = plot_vec
    781772                        end if
    782                         cs_res@gsnCenterString = "t=" + data&t(lo-1) + "s  z"+ level
    783                         plot1 = gsn_csm_contour(wks_ps,data(varn,lo-1,li+n,:,:),cs_res)
    784                         if (check_vecp)
    785                            vecres                  = True            ; vector only resources
    786                            vecres@gsnDraw          = False           ; don't draw
    787                            vecres@gsnFrame         = False           ; don't advance frame
    788                            vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
    789                            vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
    790                            vecres@vcRefLengthF     = 0.05            ; define length of vec ref
    791                            vecres@gsnRightString   = " "             ; turn off right string
    792                            vecres@gsnLeftString    = " "             ; turn off left string
    793                            vecres@tiXAxisString    = " "   
    794                            plot_vec=gsn_csm_vector(wks_ps,vect1(lo-1,li+n,:,:),vect2(lo-1,li+n,:,:),vecres)
    795                            overlay(plot1, plot_vec)
    796                         end if
    797                         plot(n) = plot1
    798                      end do
     773                     end if
    799774                  end if
    800 
    801775               end if
    802776
     
    817791                        level = "=" + data&y(lo) + "m"
    818792                     end if
    819                      do n = 0, tb-ta
    820                         cs_res@gsnCenterString = "t=" + data&t(li+n-1) + "s  y"+ level
    821                         plot1 = gsn_csm_contour(wks_ps,data(varn,li+n-1,:,lo,:),cs_res)
     793                     cs_res@gsnCenterString = "t=" + data&t(li) + "s  y"+ level
     794                     plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,lo,:),cs_res)
     795                     if (vector .EQ. 1) then
    822796                        if (check_vecp)
    823797                           vecres                  = True            ; vector only resources
     
    830804                           vecres@gsnLeftString    = " "             ; turn off left string
    831805                           vecres@tiXAxisString    = " "   
    832                            plot_vec=gsn_csm_vector(wks_ps,vect1(li+n-1,lo,:,:),vect2(li+n-1,lo,:,:),vecres)
    833                            overlay(plot1, plot_vec)
     806                           plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
     807                           overlay(plot(n), plot_vec)
     808                        else 
     809                           vecres                  = True            ; vector only resources
     810                           vecres@gsnDraw          = False           ; don't draw
     811                           vecres@gsnFrame         = False           ; don't advance frame
     812                           vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
     813                           vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
     814                           vecres@vcRefLengthF     = 0.05            ; define length of vec ref
     815                           vecres@gsnRightString   = "Vector plot of "+vec1+" and "+vec2
     816                           vecres@gsnLeftString    = " "             ; turn off left string
     817                           vecres@tiXAxisString    = " "   
     818                           plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
     819                           plot(n) = plot_vec
    834820                        end if
    835                         plot(n) = plot1 
    836                      end do
     821                     end if
    837822                  end if
    838823
    839824                  if ( sort .eq. "layer" ) then
    840                      do n = 0, yb-ya
    841                         if ( data&z(li+n) .eq. -1 ) then
    842                            level = "-average"
    843                         else
    844                            level = "=" + data&y(li+n) + "m"
     825                     if ( data&z(li) .eq. -1 ) then
     826                        level = "-average"
     827                     else
     828                        level = "=" + data&y(li) + "m"
     829                     end if
     830                     cs_res@gsnCenterString = "t=" + data&t(lo) + "s  y"+ level
     831                     plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,li,:),cs_res)
     832                     if (vector .EQ. 1) then
     833                        if (check_vecp)
     834                           vecres                  = True            ; vector only resources
     835                           vecres@gsnDraw          = False           ; don't draw
     836                           vecres@gsnFrame         = False           ; don't advance frame
     837                           vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
     838                           vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
     839                           vecres@vcRefLengthF     = 0.05            ; define length of vec ref
     840                           vecres@gsnRightString   = " "             ; turn off right string
     841                           vecres@gsnLeftString    = " "             ; turn off left string
     842                           vecres@tiXAxisString    = " "   
     843                           plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres)
     844                           overlay(plot(n), plot_vec)
     845                        else 
     846                           vecres                  = True            ; vector only resources
     847                           vecres@gsnDraw          = False           ; don't draw
     848                           vecres@gsnFrame         = False           ; don't advance frame
     849                           vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
     850                           vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
     851                           vecres@vcRefLengthF     = 0.05            ; define length of vec ref
     852                           vecres@gsnRightString   = "Vector plot of "+vec1+" and "+vec2
     853                           vecres@gsnLeftString    = " "             ; turn off left string
     854                           vecres@tiXAxisString    = " "   
     855                           plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres)
     856                           plot(n) = plot_vec
    845857                        end if
    846                         cs_res@gsnCenterString = "t=" + data&t(lo-1) + "s  y"+ level
    847                         plot1 = gsn_csm_contour(wks_ps,data(varn,lo-1,:,li+n,:),cs_res)
    848                         if (check_vecp)
    849                            vecres                  = True            ; vector only resources
    850                            vecres@gsnDraw          = False           ; don't draw
    851                            vecres@gsnFrame         = False           ; don't advance frame
    852                            vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
    853                            vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
    854                            vecres@vcRefLengthF     = 0.05            ; define length of vec ref
    855                            vecres@gsnRightString   = " "             ; turn off right string
    856                            vecres@gsnLeftString    = " "             ; turn off left string
    857                            vecres@tiXAxisString    = " "   
    858                            plot_vec=gsn_csm_vector(wks_ps,vect1(li+n-1,lo,:,:),vect2(li+n-1,lo,:,:),vecres)
    859                            overlay(plot1, plot_vec)
    860                         end if
    861                         plot(n) = plot1
    862                      end do
     858                     end if
    863859                  end if                 
    864                  
    865860               end if
    866861
     
    881876                        level = "=" + data&z(lo) + "m"
    882877                     end if
    883                      do n = 0, tb-ta
    884                         cs_res@gsnCenterString = "t=" + data&t(li+n-1) + "s  x"+ level
    885                         plot1 = gsn_csm_contour(wks_ps,data(varn,li+n-1,:,:,lo),cs_res)
     878                     cs_res@gsnCenterString = "t=" + data&t(li) + "s  x"+ level
     879                     plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,:,lo),cs_res)
     880                     if (vector .EQ. 1) then
    886881                        if (check_vecp)
    887882                           vecres                  = True            ; vector only resources
     
    894889                           vecres@gsnLeftString    = " "             ; turn off left string
    895890                           vecres@tiXAxisString    = " "   
    896                            plot_vec=gsn_csm_vector(wks_ps,vect1(li+n-1,lo,:,:),vect2(li+n-1,lo,:,:),vecres)
    897                            overlay(plot1, plot_vec)
     891                           plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
     892                           overlay(plot(n), plot_vec)
     893                        else 
     894                           vecres                  = True            ; vector only resources
     895                           vecres@gsnDraw          = False           ; don't draw
     896                           vecres@gsnFrame         = False           ; don't advance frame
     897                           vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
     898                           vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
     899                           vecres@vcRefLengthF     = 0.05            ; define length of vec ref
     900                           vecres@gsnRightString   = "Vector plot of "+vec1+" and "+vec2
     901                           vecres@gsnLeftString    = " "             ; turn off left string
     902                           vecres@tiXAxisString    = " "   
     903                           plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
     904                           plot(n) = plot_vec
    898905                        end if
    899                         plot(n) = plot1 
    900                      end do
     906                     end if
    901907                  end if
    902908
    903909                  if ( sort .eq. "layer" ) then
    904                      do n = 0, xb-xa
    905                         if ( data&z(li+n) .eq. -1 ) then
    906                            level = "-average"
    907                         else
    908                            level = "=" + data&z(li+n) + "m"
     910                     if ( data&z(li) .eq. -1 ) then
     911                        level = "-average"
     912                     else
     913                        level = "=" + data&z(li) + "m"
     914                     end if
     915                     cs_res@gsnCenterString = "t=" + data&t(lo) + "s  x"+ level
     916                     plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,:,li),cs_res)
     917                     if (vector .EQ. 1) then
     918                        if (check_vecp)
     919                           vecres                  = True            ; vector only resources
     920                           vecres@gsnDraw          = False           ; don't draw
     921                           vecres@gsnFrame         = False           ; don't advance frame
     922                           vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
     923                           vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
     924                           vecres@vcRefLengthF     = 0.05            ; define length of vec ref
     925                           vecres@gsnRightString   = " "             ; turn off right string
     926                           vecres@gsnLeftString    = " "             ; turn off left string
     927                           vecres@tiXAxisString    = " "   
     928                           plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres)
     929                           overlay(plot(n), plot_vec)
     930                        else 
     931                           vecres                  = True            ; vector only resources
     932                           vecres@gsnDraw          = False           ; don't draw
     933                           vecres@gsnFrame         = False           ; don't advance frame
     934                           vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
     935                           vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
     936                           vecres@vcRefLengthF     = 0.05            ; define length of vec ref
     937                           vecres@gsnRightString   = "Vector plot of "+vec1+" and "+vec2
     938                           vecres@gsnLeftString    = " "             ; turn off left string
     939                           vecres@tiXAxisString    = " "   
     940                           plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres)
     941                           plot(n) = plot_vec
    909942                        end if
    910                         cs_res@gsnCenterString = "t=" + data&t(lo-1) + "s  x"+ level
    911                         plot1 = gsn_csm_contour(wks_ps,data(varn,lo-1,:,:,li+n),cs_res)
    912                         if (check_vecp)
    913                            vecres                  = True            ; vector only resources
    914                            vecres@gsnDraw          = False           ; don't draw
    915                            vecres@gsnFrame         = False           ; don't advance frame
    916                            vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
    917                            vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
    918                            vecres@vcRefLengthF     = 0.05            ; define length of vec ref
    919                            vecres@gsnRightString   = " "             ; turn off right string
    920                            vecres@gsnLeftString    = " "             ; turn off left string
    921                            vecres@tiXAxisString    = " "   
    922                            plot_vec=gsn_csm_vector(wks_ps,vect1(li+n-1,lo,:,:),vect2(li+n-1,lo,:,:),vecres)
    923                            overlay(plot1, plot_vec)
    924                         end if
    925                         plot(n) = plot1
    926                      end do
     943                     end if
    927944                  end if
    928 
    929                end if
    930 
    931                ; ***************************************************
    932                ; merge plots onto one page
    933                ; ***************************************************
    934          
    935                gsn_panel(wks_ps, plot(0:n-1),(/no_lines,no_columns/),cs_resP)
    936 
    937                ; To hold no_lines and no_columns constant, it must be defined again:
    938 
    939                no_lines   = nl1
    940                no_columns = nc1
    941 
     945               end if         
     946               n=n+1   
    942947            end do     
    943948         end do 
    944949      end if
    945    end do   
     950   end do
     951
     952   ; ***************************************************
     953   ; merge plots onto one page
     954   ; ***************************************************
     955             
     956   if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then
     957      gsn_panel(wks_ps,plot(0:(no_time*no_layer*no_var)-1),(/no_var,no_layer*no_time/),cs_resP)
     958      print(" ")
     959      print("Outputs to .eps or .epsi have only one frame")
     960      print(" ")
     961   else
     962      do np = 0,no_layer*no_time*no_var-1,no_lines*no_columns   
     963         if ( np + no_lines*no_columns .gt. (no_layer*no_time*no_var)-1) then
     964            gsn_panel(wks_ps, plot(np:(no_layer*no_time*no_var)-1),(/no_lines,no_columns/),cs_resP)
     965         else
     966            gsn_panel(wks_ps, plot(np:np+no_lines*no_columns-1),(/no_lines,no_columns/),cs_resP)
     967         end if
     968      end do
     969   end if
    946970
    947971   print(" ")
  • palm/trunk/SCRIPTS/NCL/profiles.ncl

    r157 r161  
    1010
    1111   if (isfilepresent("~/.ncl_preferences")) then
    12       parameter = asciiread("~/.ncl_preferences",73,"string")
     12      parameter = asciiread("~/.ncl_preferences",75,"string")
    1313      delete(parameter@_FillValue)
    1414   else
     
    7171   if (combine .EQ. 1) then
    7272      if( .not. isvar("c_var") ) then
    73          c_var=" "
    74          if (parameter(27) .NE. "c_variables") then
     73         if (parameter(27) .EQ. "c_variables") then
     74            print(" ")
     75            print("Please select variables for overlaying ('c_var')")
     76            print(" ")
     77            exit
     78         else
    7579            c_var=parameter(27)
    7680         end if
     
    101105      end if
    102106   end if
    103 
     107   if ( .not. isvar("over") ) then                      ; switches overlaying plots on
     108      over = 0
     109      if (stringtointeger(parameter(73)) .NE. 0) then
     110         over = stringtointeger(parameter(73))
     111         if (stringtointeger(parameter(73)) .NE. 1) then
     112            print(" ")
     113            print("Please set 'over' to 0 or 1")
     114            print(" ")
     115            exit
     116         end if   
     117      end if
     118   end if
     119 
    104120   ; ***************************************************
    105121   ; open input file
     
    108124   f=addfile( file_in,"r")
    109125   
    110    vNam  = getfilevarnames(f)
     126   vNam = getfilevarnames(f)
    111127   print(" ")
    112128   print("Variable on netCDF file: " + vNam)
    113129   print(" ")
    114    dim   = dimsizes(vNam)
    115    z_pr  = f->zpt
    116    dimz  = dimsizes(z_pr)
     130   dim = dimsizes(vNam)
     131   if (dim .EQ. 0) then
     132      print(" ")
     133      print("There are no data on file")
     134      print(" ")
     135   end if
     136
     137   do varn = dim-1,0,1
     138      if ( isStrSubset( vNam(varn), "time") .OR. isStrSubset( vNam(varn), "NORM")) then
     139         varn=varn-1
     140         continue
     141      end if
     142      if (vNam(varn) .EQ. "u")
     143         z_u = f->zu
     144         break
     145      else
     146         if (vNam(varn) .EQ. "v")then
     147            z_u = f->zv
     148            break
     149         else
     150            if(vNam(varn) .EQ. "pt")then
     151               z_u = f->zpt
     152               break
     153            else
     154               if(vNam(varn) .EQ. "vpt")then
     155                  z_u = f->zvpt
     156                  break
     157               else
     158                  if(vNam(varn) .EQ. "lpt")then
     159                     z_u = f->zlpt
     160                     break
     161                  else   
     162                     if(vNam(varn) .EQ. "q")then
     163                        z_u = f->zq
     164                        break
     165                     else
     166                        if(vNam(varn) .EQ. "qv")then
     167                           z_u = f->zqv
     168                           break
     169                        else
     170                           if(vNam(varn) .EQ. "ql")then
     171                              z_u = f->zql
     172                              break
     173                           else
     174                              if(vNam(varn) .EQ. "rho")then
     175                                 z_u = f->zrho
     176                                 break
     177                              else
     178                                 if(vNam(varn) .EQ. "s")then
     179                                    z_u = f->zs
     180                                    break
     181                                 else
     182                                    if(vNam(varn) .EQ. "sa")then
     183                                       z_u = f->zsa
     184                                       break
     185                                    else
     186                                       if(vNam(varn) .EQ. "e")then
     187                                          z_u = f->ze
     188                                          break
     189                                       else
     190                                          if(vNam(varn) .EQ. "es")then
     191                                             z_u = f->zes
     192                                             break
     193                                          else
     194                                             if(vNam(varn) .EQ. "km")then
     195                                                z_u = f->zkm
     196                                                break
     197                                             else
     198                                                if(vNam(varn) .EQ. "kh")then
     199                                                   z_u = f->zkh
     200                                                   break
     201                                                else
     202                                                   if(vNam(varn) .EQ. "l")then
     203                                                      z_u = f->zl
     204                                                      break
     205                                                   else
     206                                                      if(vNam(varn) .EQ. "us2")then
     207                                                         z_u = f->zus2
     208                                                         break
     209                                                      else
     210                                                         if(vNam(varn) .EQ. "vs2")then
     211                                                            z_u = f->zvs2
     212                                                            break
     213                                                         else
     214                                                            if(vNam(varn) .EQ. "pts2")then
     215                                                               z_u = f->zpts2
     216                                                               break
     217                                                            else
     218                                                               if(vNam(varn) .EQ. "wsususodz")then
     219                                                                  z_u = f->zwsususodz
     220                                                                  break
     221                                                               else
     222                                                                  if(vNam(varn) .EQ. "wspsodz")then
     223                                                                     z_u = f->zwspsodz
     224                                                                     break
     225                                                                  else
     226                                                                     if(vNam(varn) .EQ. "wpeodz")then
     227                                                                        z_u = f->zwpeodz
     228                                                                        break                                                                       
     229                                                                     end if
     230                                                                  end if
     231                                                               end if
     232                                                            end if
     233                                                         end if
     234                                                      end if
     235                                                   end if
     236                                                end if
     237                                             end if
     238                                          end if
     239                                       end if
     240                                    end if
     241                                 end if
     242                              end if
     243                           end if
     244                        end if
     245                     end if
     246                  end if
     247               end if
     248            end if
     249         end if
     250      end if
     251      varn=varn-1
     252   end do
     253
     254   do varn=dim-1,0,1
     255      if ( isStrSubset( vNam(varn), "time") .OR. isStrSubset( vNam(varn), "NORM")) then
     256         varn=varn-1
     257         continue
     258      end if
     259      if (vNam(varn) .EQ. "w")
     260         z_w = f->zw
     261         break
     262      else
     263         if (vNam(varn) .EQ. "wpup")then
     264            z_w = f->zwpup
     265            break
     266         else
     267            if(vNam(varn) .EQ. "wsus")then
     268               z_w = f->zwsus
     269               break
     270            else
     271               if(vNam(varn) .EQ. "wu")then
     272                  z_w = f->zwu
     273                  break
     274               else
     275                  if(vNam(varn) .EQ. "wpvp")then
     276                     z_w = f->zwpvp
     277                     break
     278                  else   
     279                     if(vNam(varn) .EQ. "wsvs")then
     280                        z_w = f->zwsvs
     281                        break
     282                     else
     283                        if(vNam(varn) .EQ. "wv")then
     284                           z_w = f->zwv
     285                           break
     286                        else
     287                           if(vNam(varn) .EQ. "wptpp")then
     288                              z_w = f->zwptpp
     289                              break
     290                           else
     291                              if(vNam(varn) .EQ. "wspts")then
     292                                 z_w = f->zwspts
     293                                 break
     294                              else
     295                                 if(vNam(varn) .EQ. "wpt")then
     296                                    z_w = f->zwpt
     297                                    break
     298                                 else
     299                                    if(vNam(varn) .EQ. "wsptsBC")then
     300                                       z_w = f->zwsptsBC
     301                                       break
     302                                    else
     303                                       if(vNam(varn) .EQ. "wptBC")then
     304                                          z_w = f->zwptBC
     305                                          break
     306                                       else
     307                                          if(vNam(varn) .EQ. "wpvptp")then
     308                                             z_w = f->zwpvptp
     309                                             break
     310                                          else
     311                                             if(vNam(varn) .EQ. "wsvpts")then
     312                                                z_w = f->zwsvpts
     313                                                break
     314                                             else
     315                                                if(vNam(varn) .EQ. "wvpt")then
     316                                                   z_w = f->zwvpt
     317                                                   break
     318                                                else
     319                                                   if(vNam(varn) .EQ. "wpqp")then
     320                                                      z_w = f->zwpqp
     321                                                      break
     322                                                   else
     323                                                      if(vNam(varn) .EQ. "wsqs")then
     324                                                         z_w = f->zwsqs
     325                                                         break
     326                                                      else
     327                                                         if(vNam(varn) .EQ. "wq")then
     328                                                            z_w = f->zwq
     329                                                            break
     330                                                         else
     331                                                            if(vNam(varn) .EQ. "wpqvp")then
     332                                                               z_w = f->zwpqvp
     333                                                               break
     334                                                            else
     335                                                               if(vNam(varn) .EQ. "wsqvs")then
     336                                                                  z_w = f->zwsqvs
     337                                                                  break
     338                                                               else
     339                                                                  if(vNam(varn) .EQ. "wqv")then
     340                                                                     z_w = f->zwqv
     341                                                                     break
     342                                                                  else
     343                                                                     if(vNam(varn) .EQ. "wpsp")then
     344                                                                        z_w = f->zwpsp
     345                                                                        break
     346                                                                     else
     347                                                                        if(vNam(varn) .EQ. "wsss")then
     348                                                                           z_w = f->zwsss
     349                                                                           break
     350                                                                        else
     351                                                                           if(vNam(varn) .EQ. "ws")then
     352                                                                              z_w = f->zws
     353                                                                              break
     354                                                                           else
     355                                                                              if(vNam(varn) .EQ. "wpsap")then
     356                                                                                 z_w = f->zwpsap
     357                                                                                 break
     358                                                                              else
     359                                                                                 if(vNam(varn) .EQ. "wssas")then
     360                                                                                    z_w = f->zwssas
     361                                                                                    break
     362                                                                                 else
     363                                                                                    if(vNam(varn) .EQ. "wsa")then
     364                                                                                       z_w = f->zwsa
     365                                                                                       break
     366                                                                                    else
     367                                                                                       if(vNam(varn) .EQ. "wses")then
     368                                                                                          z_w = f->zwses
     369                                                                                          break
     370                                                                                       else
     371                                                                                          if(vNam(varn) .EQ. "ws2")then
     372                                                                                             z_w = f->zws2
     373                                                                                             break
     374                                                                                          else
     375                                                                                             if(vNam(varn) .EQ. "ws3")then
     376                                                                                                z_w = f->zws3
     377                                                                                                break
     378                                                                                             else
     379                                                                                                if(vNam(varn) .EQ. "Sw")then
     380                                                                                                   z_w = f->zSw
     381                                                                                                   break
     382                                                                                                else
     383                                                                                                   if(vNam(varn) .EQ. "ws2pts")then
     384                                                                                                      z_w = f->zws2pts
     385                                                                                                      break
     386                                                                                                   else
     387                                                                                                      if(vNam(varn) .EQ. "wspts2")then
     388                                                                                                         z_w = f->zwspts2
     389                                                                                                         break                                           
     390                                                                                                      end if
     391                                                                                                   end if
     392                                                                                                end if
     393                                                                                             end if
     394                                                                                          end if
     395                                                                                       end if
     396                                                                                    end if
     397                                                                                 end if
     398                                                                              end if
     399                                                                           end if
     400                                                                        end if   
     401                                                                     end if
     402                                                                  end if
     403                                                               end if
     404                                                            end if
     405                                                         end if
     406                                                      end if
     407                                                   end if
     408                                                end if
     409                                             end if
     410                                          end if
     411                                       end if
     412                                    end if
     413                                 end if
     414                              end if
     415                           end if
     416                        end if
     417                     end if
     418                  end if
     419               end if
     420            end if
     421         end if
     422      end if
     423      varn=varn-1
     424   end do
     425   if ( .not. isvar("z_u") ) then
     426      zu = 0
     427   else
     428      zu = 1
     429   end if
     430   if ( .not. isvar("z_w") ) then
     431      zw = 0
     432   else
     433      zw = 1
     434   end if
     435
     436   if (zu .EQ. 0 .AND. zw .EQ. 0) then
     437      do varn=0,dim-1     
     438         if ( isStrSubset( vNam(varn), "time") .OR. isStrSubset( vNam(varn), "NORM")) then
     439            check = False
     440         else
     441            if (.not. isvar("var")) then
     442               check = True
     443               if (parameter(21) .NE. "variables") then
     444                  var=parameter(21)
     445                  check = isStrSubset( var,","+vNam(varn)+"," )
     446               end if
     447            else         
     448               check = isStrSubset( var,","+vNam(varn)+"," )
     449            end if
     450         end if
     451         if (check)
     452            z = f->$vNam(varn+1)$
     453            dimz = dimsizes(z)
     454            break
     455         end if   
     456      end do
     457   end if
     458 
     459   dimz  = dimsizes(z_w)
     460   dimz  = dimsizes(z_u)
    117461   t_all = f->time
    118462   nt    = dimsizes(t_all)
    119 
     463 
    120464   ; ****************************************************       
    121465   ; start of time step and different types of mistakes that could be done
     
    125469      start_time_step = 1
    126470      if (parameter(13) .NE. "1") then
    127          if (parameter(13) .LE. "0")
    128             print(" ")
    129             print("Begin with time step 1")
     471         if (parameter(13) .LE. "1")
     472            print(" ")
     473            print("Begin at least with time step 2")
    130474            print(" ")
    131475            exit
     
    137481            exit
    138482         end if
    139          start_time_step = stringtointeger(parameter(13)) 
     483         start_time_step = stringtointeger(parameter(13))-1 
    140484      end if
    141485   else
    142486      if (start_time_step .LE. 0)
    143487         print(" ")
    144          print("Begin with time step 1")
     488         print("Begin at least with time step 1")
    145489         print(" ")
    146490         exit
     
    152496         exit
    153497      end if
     498      start_time_step = start_time_step - 1
    154499   end if
    155500
     
    200545            exit
    201546      end if
     547      end_time_step = end_time_step - 1
    202548   end if
    203549
     
    206552   ; ****************************************************
    207553   
    208    legend_label=new(nt-1,double)
     554   legend_label=new(nt,double)
    209555   do p=start_time_step,end_time_step
    210556      legend_label(p-start_time_step)=t_all(p)
     
    224570   res@gsnFrame                = False
    225571   res@gsnPaperOrientation     = "portrait"
    226    ;  res@gsnmaximize             = True
    227572   res@gsnPaperWidth           = 8.27
    228573   res@gsnPaperHeight          = 11.69
     
    239584   res@pmLegendSide            = "Top"
    240585   res@xyExplicitLegendLabels  = legend_label
    241    res@pmLegendParallelPosF    = 1.4
    242    res@pmLegendOrthogonalPosF  = -1.085
     586   res@pmLegendParallelPosF    = 1.15
     587   res@pmLegendOrthogonalPosF  = -1.0
    243588   res@pmLegendWidthF          = 0.12
    244589   res@pmLegendHeightF         = 0.3
    245590   res@lgLabelFontHeightF     = .02
    246    ;  res@XBLabelConstantSpacingF = 1.0
    247 
     591   res@txFontHeightF      = 0.02
     592   res@tiXAxisFontHeightF = 0.02
     593   res@tiYAxisFontHeightF = 0.02
     594   res@tiXAxisString      = " "   
     595   res@tiYAxisString      = "Height [z]"
     596   
    248597   if ( dash .eq. 0 ) then
    249598      res@xyMonoDashPattern       = True 
     
    257606
    258607   ; ***************************************************
    259    ; set up colors and recourses for combined plot
    260    ; ***************************************************
    261    
    262    if (combine .EQ. 1) then
    263 
    264       if (.not. isvar("number_comb")) then
    265          m=0
    266          m=stringtointeger(parameter(25))
    267          if(m .EQ. 0) then
    268             print(" ")
    269             print("Please indicate the number of variables you would like to combine ('number_comb')")
    270             print(" ")
    271             exit
    272          end if
    273       end if
    274    
    275       ores=True
    276      
    277       colors=new(m*(nt-1),integer)
    278       do j=0,m-1
    279          colors(j+j*(nt-2):(j+1)*(nt-1)-1) = ispan(2,237,235/np)
    280       end do   
    281       ores@xyLineColors = colors
    282 
    283       dash_oplot=new(m*(nt-1),integer)
    284       do j=0,m-1
    285          dash_oplot(j+j*(nt-2):(j+1)*(nt-1)-1)=j
    286       end do
    287       ores@xyDashPatterns = dash_oplot
    288 
    289       ores                         = True
    290       ores@gsnDraw                 = False
    291       ores@gsnFrame                = False
    292       ores@gsnPaperOrientation     = "portrait"
    293       ;  ores@gsnmaximize             = True
    294       ores@gsnPaperWidth           = 8.27
    295       ores@gsnPaperHeight          = 11.69
    296       ores@gsnPaperMargin          = 0.79
    297       ores@txFont                  = "helvetica"
    298       ores@tiMainFont              = "helvetica"
    299       ores@tiXAxisFont             = "helvetica"
    300       ores@tiYAxisFont             = "helvetica"
    301       ores@tmXBLabelFont           = "helvetica"
    302       ores@tmYLLabelFont           = "helvetica"
    303       ores@lgLabelFont             = "helvetica"
    304       ores@tmLabelAutoStride       = True
    305       ores@pmLegendDisplayMode     = "Always"
    306       ores@pmLegendSide            = "Top"
    307       ores@pmLegendParallelPosF    = 1.4
    308       ores@pmLegendOrthogonalPosF  = -1.085
    309       ores@pmLegendWidthF          = 0.15
    310       ores@pmLegendHeightF         = 0.60
    311       ores@lgLabelFontHeightF     = .02
    312       ;  ores@XBLabelConstantSpacingF = 1.0
    313  
    314    end if
    315 
    316    ; ***************************************************
    317608   ; set up graphics for plot
    318609   ; ***************************************************
    319610
    320    plot  = new(dim,graphic)
     611   plot = new(dim,graphic)
     612   plot_ = new(dim,graphic)
     613
     614   if (combine .EQ. 1) then
     615      if ( .not. isvar("number_comb") ) then           
     616         if (parameter(25) .EQ. "0") then
     617            print(" ")
     618            print("Please set 'number_comb' to 2 or 3 if you would like to overlay 2 or 3 variables in one plot")
     619            print(" ")
     620            exit
     621         else
     622            number_comb=stringtointeger(parameter(25))
     623            plot_o = new(number_comb,graphic)   
     624         end if
     625      else
     626         if(number_comb .EQ. 2 .OR. number_comb .EQ. 3) then
     627            plot_o = new(number_comb,graphic)     
     628         else
     629            print(" ")
     630            print("Please set 'number_comb' to 2 or 3 if you would like to overlay 2 or 3 variables in one plot")
     631            print(" ")
     632            exit
     633         end if   
     634      end if
     635      label=new(number_comb,string)
     636      color_o=new(number_comb,integer)
     637      mini=new(number_comb,float)
     638      maxi=new(number_comb,float)
     639   end if
    321640
    322641   wks=gsn_open_wks(format_out,file_out)
     
    324643 
    325644   ; ***************************************************
    326    ; indicate plot number
     645   ; indicate plot number 
    327646   ; ***************************************************
    328 
     647   
    329648   if (combine .EQ. 1) then
    330       n = 1 
     649      n = 1
    331650   else
    332651      n = 0
    333    end if 
    334  
     652   end if
     653
    335654   ; ***************************************************
    336655   ; set up minimum and maximum height
     
    340659      min_z=0
    341660      if (stringtointeger(parameter(33)) .NE. 0) then
    342          if (stringtointeger(parameter(33)) .GE. max(z_pr) ) then
    343             print(" ")
    344             print("Minimum of height ('min_z'="+stringtointeger(parameter(33))+") is greater than available heights (="+max(z_pr)+")")
     661         if (stringtointeger(parameter(33)) .GE. max(z_u) ) then
     662            print(" ")
     663            print("Minimum of height ('min_z'="+stringtointeger(parameter(33))+") is greater than available heights (="+max(z_u)+")")
    345664            print(" ")
    346665            exit
     
    355674      end if
    356675   else
    357       if (min_z .GE. max(z_pr) ) then
     676      if (min_z .GE. max(z_u) ) then
    358677         print(" ")
    359          print("Minimum of height ('min_z'="+min_z+") is greater than available heights (="+max(z_pr)+")")
     678         print("Minimum of height ('min_z'="+min_z+") is greater than available heights (="+max(z_u)+")")
    360679         print(" ")
    361680         exit
     
    370689
    371690   if (.not. isvar("max_z"))
    372       max_z=max(z_pr)
    373       if ((parameter(35)) .NE. "max(z_pr)") then
    374          if (stringtofloat(parameter(35)) .GE. max(z_pr) ) then
    375             print(" ")
    376             print("Maximum of height ('max_z'="+parameter(35)+") is greater than available heights (="+max(z_pr)+")")
     691      max_z=max(z_u)
     692      if ((parameter(35)) .NE. "max(z_u)") then
     693         if (stringtofloat(parameter(35)) .GE. max(z_u) ) then
     694            print(" ")
     695            print("Maximum of height ('max_z'="+parameter(35)+") is greater than available heights (="+max(z_u)+")")
    377696            print(" ")
    378697            exit
     
    389708      if (max_z .GE. max(z_pr) ) then
    390709         print(" ")
    391          print("Maximum of height ('max_z'="+max_z+") is greater than available heights (="+max(z_pr)+")")
     710         print("Maximum of height ('max_z'="+max_z+") is greater than available heights (="+max(z_u)+")")
    392711         print(" ")
    393712         exit
     
    411730      end if
    412731   end do 
    413    
    414    if (combine .EQ. 1) then
    415       data_o=new((/m,end_time_step,dimz/),float)
    416       data_o!0 = "e"
    417       legend_label_oplot=new(m*(nt-1),string)
    418       mini=new(m,float)
    419       maxi=new(m,float)
    420       e=-1
    421    end if 
    422 
    423    do varn = 0, dim-1   
    424      
    425       if ( isStrSubset( vNam(varn), "NORM") .or. isStrSubset( vNam(varn), "time") )
     732 
     733   data   = new((/dim,(end_time_step-start_time_step)+1,dimz/),float)
     734   data_0 = new((/(end_time_step-start_time_step)+1,dimz/),float)
     735   data_0 = 0.0
     736   t      = new((/(end_time_step-start_time_step)+1,dimz/),float)
     737   t      = 0.0
     738   unit   = new(dim,string)
     739
     740   if (over .EQ. 1) then
     741      plot_u         = gsn_csm_xy(wks,t,data_0(:,:),res)
     742      miniu = 1.E27
     743      maxiu =-1.E27
     744      plot_v         = gsn_csm_xy(wks,t,data_0(:,:),res)
     745      miniv = 1.E27
     746      maxiv =-1.E27
     747      plot_w         = gsn_csm_xy(wks,t,data_0(:,:),res)
     748      miniw = 1.E27
     749      maxiw =-1.E27
     750      plot_pt        = gsn_csm_xy(wks,t,data_0(:,:),res)
     751      minipt = 1.E27
     752      maxipt =-1.E27
     753      plot_vpt       = gsn_csm_xy(wks,t,data_0(:,:),res)
     754      minivpt = 1.E27
     755      maxivpt =-1.E27
     756      plot_lpt       = gsn_csm_xy(wks,t,data_0(:,:),res)
     757      minilpt = 1.E27
     758      maxilpt =-1.E27
     759      plot_q         = gsn_csm_xy(wks,t,data_0(:,:),res)
     760      miniq = 1.E27
     761      maxiq =-1.E27
     762      plot_qv        = gsn_csm_xy(wks,t,data_0(:,:),res)
     763      miniqv = 1.E27
     764      maxiqv =-1.E27
     765      plot_ql        = gsn_csm_xy(wks,t,data_0(:,:),res)
     766      miniql = 1.E27
     767      maxiql =-1.E27
     768      plot_rho       = gsn_csm_xy(wks,t,data_0(:,:),res)
     769      plot_s         = gsn_csm_xy(wks,t,data_0(:,:),res)
     770      plot_sa        = gsn_csm_xy(wks,t,data_0(:,:),res)
     771      plot_e         = gsn_csm_xy(wks,t,data_0(:,:),res)
     772      minie = 1.E27
     773      maxie =-1.E27
     774      plot_es        = gsn_csm_xy(wks,t,data_0(:,:),res)
     775      minie = 1.E27
     776      maxie =-1.E27
     777      plot_km        = gsn_csm_xy(wks,t,data_0(:,:),res)
     778      minie = 1.E27
     779      maxie =-1.E27
     780      plot_kh        = gsn_csm_xy(wks,t,data_0(:,:),res)
     781      minie = 1.E27
     782      maxie =-1.E27
     783      plot_l         = gsn_csm_xy(wks,t,data_0(:,:),res)     
     784      plot_wpup      = gsn_csm_xy(wks,t,data_0(:,:),res)
     785      miniwpup = 1.E27
     786      maxiwpup =-1.E27
     787      plot_wsus      = gsn_csm_xy(wks,t,data_0(:,:),res)
     788      miniwsus = 1.E27
     789      maxiwsus =-1.E27
     790      plot_wu        = gsn_csm_xy(wks,t,data_0(:,:),res)
     791      miniwu = 1.E27
     792      maxiwu =-1.E27
     793      plot_wpvp      = gsn_csm_xy(wks,t,data_0(:,:),res)
     794      miniwpvp = 1.E27
     795      maxiwpvp =-1.E27
     796      plot_wsvs      = gsn_csm_xy(wks,t,data_0(:,:),res)
     797      miniwsvs = 1.E27
     798      maxiwsvs =-1.E27
     799      plot_wv        = gsn_csm_xy(wks,t,data_0(:,:),res)
     800      miniwv = 1.E27
     801      maxiwv =-1.E27
     802      plot_wpptp     = gsn_csm_xy(wks,t,data_0(:,:),res)
     803      miniwpptp = 1.E27
     804      maxiwpptp =-1.E27
     805      plot_wspts     = gsn_csm_xy(wks,t,data_0(:,:),res)
     806      miniwspts = 1.E27
     807      maxiwspts =-1.E27
     808      plot_wpt       = gsn_csm_xy(wks,t,data_0(:,:),res)
     809      miniwpt = 1.E27
     810      maxiwpt =-1.E27
     811      plot_wsptsBC   = gsn_csm_xy(wks,t,data_0(:,:),res)
     812      miniwsptsBC = 1.E27
     813      maxiwsptsBC =-1.E27
     814      plot_wptBC     = gsn_csm_xy(wks,t,data_0(:,:),res)
     815      miniwptBC = 1.E27
     816      maxiwptBC =-1.E27
     817      plot_wpvptp    = gsn_csm_xy(wks,t,data_0(:,:),res)
     818      miniwpvptp = 1.E27
     819      maxiwpvptp =-1.E27
     820      plot_wsvpts    = gsn_csm_xy(wks,t,data_0(:,:),res)
     821      miniwsvpts = 1.E27
     822      maxiewsvpts=-1.E27
     823      plot_wvpt      = gsn_csm_xy(wks,t,data_0(:,:),res)
     824      miniwvpt = 1.E27
     825      maxiwvpt =-1.E27
     826      plot_wpqp      = gsn_csm_xy(wks,t,data_0(:,:),res)
     827      miniwpqp = 1.E27
     828      maxiwpqp =-1.E27
     829      plot_wsqs      = gsn_csm_xy(wks,t,data_0(:,:),res)
     830      miniwsqs = 1.E27
     831      maxiwsqs =-1.E27
     832      plot_wq        = gsn_csm_xy(wks,t,data_0(:,:),res)
     833      miniwq = 1.E27
     834      maxiwq =-1.E27
     835      plot_wpqvp     = gsn_csm_xy(wks,t,data_0(:,:),res)
     836      miniwpqvp = 1.E27
     837      maxiwpqvp =-1.E27
     838      plot_wsqvs     = gsn_csm_xy(wks,t,data_0(:,:),res)
     839      miniwsqvs = 1.E27
     840      maxiwsqvs =-1.E27
     841      plot_wqv       = gsn_csm_xy(wks,t,data_0(:,:),res)
     842      miniwqv = 1.E27
     843      maxiwqv =-1.E27
     844      plot_wpsp      = gsn_csm_xy(wks,t,data_0(:,:),res)
     845      miniwpsp = 1.E27
     846      maxiwpsp =-1.E27
     847      plot_wsss      = gsn_csm_xy(wks,t,data_0(:,:),res)
     848      miniwsss = 1.E27
     849      maxiwsss =-1.E27
     850      plot_ws        = gsn_csm_xy(wks,t,data_0(:,:),res)
     851      miniws = 1.E27
     852      maxiws =-1.E27
     853      plot_wpsap     = gsn_csm_xy(wks,t,data_0(:,:),res)
     854      miniwpsap = 1.E27
     855      maxiwpsap =-1.E27
     856      plot_wssas     = gsn_csm_xy(wks,t,data_0(:,:),res)
     857      miniwssas = 1.E27
     858      maxiwssas =-1.E27
     859      plot_wsa       = gsn_csm_xy(wks,t,data_0(:,:),res)
     860      miniwsa = 1.E27
     861      maxiwsa =-1.E27
     862      plot_wses      = gsn_csm_xy(wks,t,data_0(:,:),res)
     863      plot_us2       = gsn_csm_xy(wks,t,data_0(:,:),res)
     864      minius2 = 1.E27
     865      maxius2 =-1.E27
     866      plot_vs2       = gsn_csm_xy(wks,t,data_0(:,:),res)
     867      minivs2 = 1.E27
     868      maxivs2 =-1.E27
     869      plot_ws2       = gsn_csm_xy(wks,t,data_0(:,:),res)
     870      miniws2 = 1.E27
     871      maxiws2 =-1.E27
     872      plot_pts2      = gsn_csm_xy(wks,t,data_0(:,:),res)
     873      plot_ws3       = gsn_csm_xy(wks,t,data_0(:,:),res)
     874      plot_Sw        = gsn_csm_xy(wks,t,data_0(:,:),res)
     875      plot_ws2pts    = gsn_csm_xy(wks,t,data_0(:,:),res)
     876      plot_wspts2    = gsn_csm_xy(wks,t,data_0(:,:),res)
     877      plot_wsususodz = gsn_csm_xy(wks,t,data_0(:,:),res)
     878      miniwsususodz = 1.E27
     879      maxiwsususodz =-1.E27
     880      plot_wspsodz   = gsn_csm_xy(wks,t,data_0(:,:),res)
     881      miniwspsodz = 1.E27
     882      maxiwspsodz =-1.E27
     883      plot_wpeodz    = gsn_csm_xy(wks,t,data_0(:,:),res)
     884      miniwpeodz = 1.E27
     885      maxiwpeodz =-1.E27
     886   end if
     887 
     888   n_o=0
     889   do varn = 0,dim-1
     890       
     891      temp = f->$vNam(varn)$
     892     
     893      if ( isStrSubset( vNam(varn), "time") .OR. isStrSubset( vNam(varn), "NORM")) then
    426894         check = False
    427895      else
     
    430898            if (parameter(21) .NE. "variables") then
    431899               var=parameter(21)
    432                check = isStrSubset( var,vNam(varn)+"," )
     900               check = isStrSubset( var,","+vNam(varn)+"," )
    433901            end if
    434902         else         
    435             check = isStrSubset( var,vNam(varn)+"," )
     903            check = isStrSubset( var,","+vNam(varn)+"," )
    436904         end if
    437905      end if
     906
     907      if (combine .EQ. 1) then         
     908         com=isStrSubset(c_var,","+vNam(varn)+"," )     
     909         if (com)                       
     910            check = False
     911            data(varn,:,:) = temp(start_time_step:end_time_step,0:dimz-1)
     912            unit(varn) = temp@units
     913            if (n_o .GT. number_comb-1) then
     914               print(" ")
     915               print("Please set 'number_comb' to the right number of overlaying variables ('c_var')")
     916               print(" ")
     917               exit
     918            end if
     919            mini(n_o)=min(data(varn,:,:))
     920            maxi(n_o)=max(data(varn,:,:))
     921            varn=varn+1
     922            n_o=n_o+1
     923         end if
     924      end if
     925
     926      if(check) then
     927               
     928         z = f->$vNam(varn+1)$
     929 
     930         unit(varn) = temp@units
     931         data(varn,:,:) = temp(start_time_step:end_time_step,0:dimz-1)
     932 
     933         if (over .EQ. 0) then 
     934            res@gsnLeftString      = vNam(varn)
     935            res@gsnRightString     = unit(varn)
     936            res@trYMinF            = min_z
     937            res@trYMaxF            = max_z 
     938            res@trXMinF            = min(data(varn,:,:))
     939            res@trXMaxF            = max(data(varn,:,:))       
     940            plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 
     941         end if       
     942         
     943            if (vNam(varn) .EQ. "u") then
     944               miniu=min(data(varn,:,:))
     945               maxiu=max(data(varn,:,:))
     946               if (over .EQ. 1) then
     947                  res@xyDashPattern  = 0
     948                  plot_u = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     949               else
     950                  res@gsnLeftString      = vNam(varn)
     951                  res@gsnRightString     = unit(varn)
     952                  res@trXMinF            = miniu
     953                  res@trXMaxF            = maxiu                 
     954                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res) 
     955               end if
     956            end if
     957            if (vNam(varn) .EQ. "v") then
     958               miniv=min(data(varn,:,:))
     959               maxiv=max(data(varn,:,:))
     960               if (over .EQ. 1) then
     961                  res@xyDashPattern  = 1
     962                  plot_v = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     963               else
     964                  res@gsnLeftString      = vNam(varn)
     965                  res@gsnRightString     = unit(varn)
     966                  res@trXMinF            = miniv
     967                  res@trXMaxF            = maxiv                   
     968                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     969               end if 
     970            end if
     971            if (vNam(varn) .EQ. "w") then
     972               miniw=min(data(varn,:,:))
     973               maxiw=max(data(varn,:,:))
     974               if (over .EQ. 1) then
     975                  res@xyDashPattern  = 2
     976                  plot_w = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     977               else
     978                  res@gsnLeftString      = vNam(varn)
     979                  res@gsnRightString     = unit(varn)
     980                  res@trXMinF            = miniw
     981                  res@trXMaxF            = maxiw                   
     982                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     983               end if   
     984            end if
     985
     986            if (vNam(varn) .EQ. "pt") then
     987               minipt=min(data(varn,:,:))
     988               maxipt=max(data(varn,:,:))
     989               if (over .EQ. 1) then
     990                  res@xyDashPattern  = 0
     991                  plot_pt = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     992               else
     993                  res@gsnLeftString      = vNam(varn)
     994                  res@gsnRightString     = unit(varn)
     995                  res@trXMinF            = minipt
     996                  res@trXMaxF            = maxipt
     997                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     998               end if 
     999            end if
     1000            if (vNam(varn) .EQ. "vpt") then
     1001               minivpt=min(data(varn,:,:))
     1002               maxivpt=max(data(varn,:,:))
     1003               if (over .EQ. 1) then
     1004                  res@xyDashPattern  = 1
     1005                  plot_vpt = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1006               else
     1007                  res@gsnLeftString      = vNam(varn)
     1008                  res@gsnRightString     = unit(varn)
     1009                  res@trXMinF            = minivpt
     1010                  res@trXMaxF            = maxivpt
     1011                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1012               end if
     1013            end if
     1014            if (vNam(varn) .EQ. "lpt") then
     1015               minilpt=min(data(varn,:,:))
     1016               maxilpt=max(data(varn,:,:))
     1017               if (over .EQ. 1) then
     1018                  res@xyDashPattern  = 2
     1019                  plot_lpt = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1020               else
     1021                  res@gsnLeftString      = vNam(varn)
     1022                  res@gsnRightString     = unit(varn)
     1023                  res@trXMinF            = minilpt
     1024                  res@trXMaxF            = maxilpt
     1025                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1026               end if
     1027            end if
     1028
     1029            if (vNam(varn) .EQ. "q") then
     1030               miniq=min(data(varn,:,:))
     1031               maxiq=max(data(varn,:,:))
     1032               if (over .EQ. 1) then
     1033                  res@xyDashPattern  = 0
     1034                  plot_q = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1035               else
     1036                  res@gsnLeftString      = vNam(varn)
     1037                  res@gsnRightString     = unit(varn)
     1038                  res@trXMinF            = miniq
     1039                  res@trXMaxF            = maxiq
     1040                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1041               end if
     1042            end if
     1043            if (vNam(varn) .EQ. "qv") then
     1044               miniqv=min(data(varn,:,:))
     1045               maxiqv=max(data(varn,:,:))
     1046               if (over .EQ. 1) then
     1047                  res@xyDashPattern  = 1
     1048                  plot_qv = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1049               else
     1050                  res@gsnLeftString      = vNam(varn)
     1051                  res@gsnRightString     = unit(varn)
     1052                  res@trXMinF            = miniqv
     1053                  res@trXMaxF            = maxiqv
     1054                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1055               end if
     1056            end if
     1057            if (vNam(varn) .EQ. "ql") then
     1058               miniql=min(data(varn,:,:))
     1059               maxiql=max(data(varn,:,:))
     1060               if (over .EQ. 1) then
     1061                  res@xyDashPattern  = 2
     1062                  plot_ql = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1063               else
     1064                  res@gsnLeftString      = vNam(varn)
     1065                  res@gsnRightString     = unit(varn)
     1066                  res@trXMinF            = miniql
     1067                  res@trXMaxF            = maxiql
     1068                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1069               end if
     1070            end if
     1071
     1072            if (vNam(varn) .EQ. "rho") then               
     1073               if (over .EQ. 1) then
     1074                  res@gsnLeftString      = vNam(varn)
     1075                  res@gsnRightString     = unit(varn)
     1076                  res@trXMinF            = min(data(varn,:,:))
     1077                  res@trXMaxF            = max(data(varn,:,:))
     1078                  plot_q = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1079               else
     1080                  res@gsnLeftString      = vNam(varn)
     1081                  res@gsnRightString     = unit(varn)
     1082                  res@trXMinF            = min(data(varn,:,:))
     1083                  res@trXMaxF            = max(data(varn,:,:))
     1084                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1085               end if
     1086            end if
     1087
     1088            if (vNam(varn) .EQ. "s") then               
     1089               if (over .EQ. 1) then
     1090                  res@gsnLeftString      = vNam(varn)
     1091                  res@gsnRightString     = unit(varn)
     1092                  res@trXMinF            = min(data(varn,:,:))
     1093                  res@trXMaxF            = max(data(varn,:,:))
     1094                  plot_s = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1095               else
     1096                  res@gsnLeftString      = vNam(varn)
     1097                  res@gsnRightString     = unit(varn)
     1098                  res@trXMinF            = min(data(varn,:,:))
     1099                  res@trXMaxF            = max(data(varn,:,:))
     1100                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1101               end if
     1102            end if
     1103
     1104            if (vNam(varn) .EQ. "sa") then                 
     1105               if (over .EQ. 1) then
     1106                  res@gsnLeftString      = vNam(varn)
     1107                  res@gsnRightString     = unit(varn)
     1108                  res@trXMinF            = min(data(varn,:,:))
     1109                  res@trXMaxF            = max(data(varn,:,:))
     1110                  plot_sa = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1111               else
     1112                  res@gsnLeftString      = vNam(varn)
     1113                  res@gsnRightString     = unit(varn)
     1114                  res@trXMinF            = min(data(varn,:,:))
     1115                  res@trXMaxF            = max(data(varn,:,:)) 
     1116                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1117               end if
     1118            end if
     1119
     1120            if (vNam(varn) .EQ. "e") then
     1121               minie=min(data(varn,:,:))
     1122               maxie=max(data(varn,:,:))
     1123               if (over .EQ. 1) then
     1124                  res@xyDashPattern  = 0
     1125                  plot_e = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1126               else
     1127                  res@gsnLeftString      = vNam(varn)
     1128                  res@gsnRightString     = unit(varn)
     1129                  res@trXMinF            = minie
     1130                  res@trXMaxF            = maxie
     1131                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1132               end if
     1133            end if
     1134            if (vNam(varn) .EQ. "es") then
     1135               minies=min(data(varn,:,:))
     1136               maxies=max(data(varn,:,:))
     1137               if (over .EQ. 1) then
     1138                  res@xyDashPattern  = 1
     1139                  plot_es = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1140               else
     1141                  res@gsnLeftString      = vNam(varn)
     1142                  res@gsnRightString     = unit(varn)
     1143                  res@trXMinF            = minies
     1144                  res@trXMaxF            = maxies
     1145                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1146               end if
     1147            end if
     1148
     1149            if (vNam(varn) .EQ. "km") then
     1150               minikm=min(data(varn,:,:))
     1151               maxikm=max(data(varn,:,:))
     1152               if (over .EQ. 1) then
     1153                  res@xyDashPattern  = 0
     1154                  plot_km = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1155               else
     1156                  res@gsnLeftString      = vNam(varn)
     1157                  res@gsnRightString     = unit(varn)
     1158                  res@trXMinF            = minikm
     1159                  res@trXMaxF            = maxikm
     1160                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1161               end if
     1162            end if
     1163            if (vNam(varn) .EQ. "kh") then
     1164               minikh=min(data(varn,:,:))
     1165               maxikh=max(data(varn,:,:))
     1166               if (over .EQ. 1) then
     1167                  res@xyDashPattern  = 1
     1168                  plot_kh = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1169               else
     1170                  res@gsnLeftString      = vNam(varn)
     1171                  res@gsnRightString     = unit(varn)
     1172                  res@trXMinF            = minikh
     1173                  res@trXMaxF            = maxikh
     1174                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1175               end if
     1176            end if
     1177
     1178            if (vNam(varn) .EQ. "l") then                 
     1179               if (over .EQ. 1) then
     1180                  res@gsnLeftString      = vNam(varn)
     1181                  res@gsnRightString     = unit(varn)
     1182                  res@trXMinF            = min(data(varn,:,:))
     1183                  res@trXMaxF            = max(data(varn,:,:))
     1184                  plot_l = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1185               else
     1186                  res@gsnLeftString      = vNam(varn)
     1187                  res@gsnRightString     = unit(varn)
     1188                  res@trXMinF            = min(data(varn,:,:))
     1189                  res@trXMaxF            = max(data(varn,:,:))
     1190                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1191               end if
     1192            end if
     1193
     1194            if (vNam(varn) .EQ. "wpup") then
     1195               miniwpup=min(data(varn,:,:))
     1196               maxiwpup=max(data(varn,:,:))
     1197               if (over .EQ. 1) then
     1198                  res@xyDashPattern  = 0
     1199                  plot_wpup = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1200               else
     1201                  res@gsnLeftString      = vNam(varn)
     1202                  res@gsnRightString     = unit(varn)
     1203                  res@trXMinF            = miniwpup
     1204                  res@trXMaxF            = maxiwpup
     1205                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1206               end if
     1207            end if
     1208            if (vNam(varn) .EQ. "wsus") then
     1209               miniwsus=min(data(varn,:,:))
     1210               maxiwsus=max(data(varn,:,:))
     1211               if (over .EQ. 1) then
     1212                  res@xyDashPattern  = 1
     1213                  plot_wsus = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1214               else
     1215                  res@gsnLeftString      = vNam(varn)
     1216                  res@gsnRightString     = unit(varn)
     1217                  res@trXMinF            = miniwsus
     1218                  res@trXMaxF            = maxiwsus
     1219                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1220               end if
     1221            end if
     1222            if (vNam(varn) .EQ. "wu") then
     1223               miniwu=min(data(varn,:,:))
     1224               maxiwu=max(data(varn,:,:))
     1225               if (over .EQ. 1) then
     1226                  res@xyDashPattern  = 2
     1227                  plot_wu = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1228               else
     1229                  res@gsnLeftString      = vNam(varn)
     1230                  res@gsnRightString     = unit(varn)
     1231                  res@trXMinF            = miniwu
     1232                  res@trXMaxF            = maxiwu
     1233                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1234               end if
     1235            end if
     1236
     1237            if (vNam(varn) .EQ. "wpvp") then
     1238               miniwpvp=min(data(varn,:,:))
     1239               maxiwpvp=max(data(varn,:,:))
     1240               if (over .EQ. 1) then
     1241                  res@xyDashPattern  = 0
     1242                  plot_wpvp = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1243               else
     1244                  res@gsnLeftString      = vNam(varn)
     1245                  res@gsnRightString     = unit(varn)
     1246                  res@trXMinF            = miniwpvp
     1247                  res@trXMaxF            = maxiwpvp
     1248                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1249               end if
     1250            end if
     1251            if (vNam(varn) .EQ. "wsvs") then
     1252               miniwsvs=min(data(varn,:,:))
     1253               maxiwsvs=max(data(varn,:,:))
     1254               if (over .EQ. 1) then
     1255                  res@xyDashPattern  = 1
     1256                  plot_wsvs = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1257               else
     1258                  res@gsnLeftString      = vNam(varn)
     1259                  res@gsnRightString     = unit(varn)
     1260                  res@trXMinF            = miniwsvs
     1261                  res@trXMaxF            = maxiwsvs
     1262                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1263               end if
     1264            end if
     1265            if (vNam(varn) .EQ. "wv") then
     1266               miniwv=min(data(varn,:,:))
     1267               maxiwv=max(data(varn,:,:))
     1268               if (over .EQ. 1) then
     1269                  res@xyDashPattern  = 2
     1270                  plot_wv = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1271               else
     1272                  res@gsnLeftString      = vNam(varn)
     1273                  res@gsnRightString     = unit(varn)
     1274                  res@trXMinF            = miniwv
     1275                  res@trXMaxF            = maxiwv
     1276                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1277               end if
     1278            end if
     1279
     1280            if (vNam(varn) .EQ. "wpptp") then
     1281               miniwpptp=min(data(varn,:,:))
     1282               maxiwpptp=max(data(varn,:,:))
     1283               if (over .EQ. 1) then
     1284                  res@xyDashPattern  = 0
     1285                  plot_wpptp = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1286               else
     1287                  res@gsnLeftString      = vNam(varn)
     1288                  res@gsnRightString     = unit(varn)
     1289                  res@trXMinF            = miniwpptp
     1290                  res@trXMaxF            = maxiwpptp
     1291                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1292               end if
     1293            end if
     1294            if (vNam(varn) .EQ. "wspts") then
     1295               miniwspts=min(data(varn,:,:))
     1296               maxiwspts=max(data(varn,:,:))
     1297               if (over .EQ. 1) then
     1298                  res@xyDashPattern  = 1
     1299                  plot_wspts = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1300               else
     1301                  res@gsnLeftString      = vNam(varn)
     1302                  res@gsnRightString     = unit(varn)
     1303                  res@trXMinF            = miniwspts
     1304                  res@trXMaxF            = maxiwspts
     1305                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1306               end if
     1307            end if
     1308            if (vNam(varn) .EQ. "wpt") then
     1309               miniwpt=min(data(varn,:,:))
     1310               maxiwpt=max(data(varn,:,:))
     1311               if (over .EQ. 1) then
     1312                  res@xyDashPattern  = 2
     1313                  plot_wpt = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1314               else
     1315                  res@gsnLeftString      = vNam(varn)
     1316                  res@gsnRightString     = unit(varn)
     1317                  res@trXMinF            = miniwpt
     1318                  res@trXMaxF            = maxiwpt
     1319                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1320               end if
     1321            end if
     1322
     1323            if (vNam(varn) .EQ. "wsptsBC") then
     1324               miniwsptsBC=min(data(varn,:,:))
     1325               maxiwsptsBC=max(data(varn,:,:))
     1326               if (over .EQ. 1) then
     1327                  res@xyDashPattern  = 0
     1328                  plot_wsptsBC = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1329               else
     1330                  res@gsnLeftString      = vNam(varn)
     1331                  res@gsnRightString     = unit(varn)
     1332                  res@trXMinF            = miniwsptsBC
     1333                  res@trXMaxF            = maxiwsptsBC
     1334                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1335               end if
     1336            end if             
     1337            if (vNam(varn) .EQ. "wptBC") then
     1338               miniwptBC=min(data(varn,:,:))
     1339               maxiwptBC=max(data(varn,:,:))
     1340               if (over .EQ. 1) then
     1341                  res@xyDashPattern  = 1
     1342                  plot_wptBC = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1343               else
     1344                  res@gsnLeftString      = vNam(varn)
     1345                  res@gsnRightString     = unit(varn)
     1346                  res@trXMinF            = miniwptBC
     1347                  res@trXMaxF            = maxiwptBC
     1348                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1349               end if
     1350            end if
     1351
     1352            if (vNam(varn) .EQ. "wpvptp") then
     1353               miniwpvptp=min(data(varn,:,:))
     1354               maxiwpvptp=max(data(varn,:,:))
     1355               if (over .EQ. 1) then
     1356                  res@xyDashPattern  = 0
     1357                  plot_wpvptp = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1358               else
     1359                  res@gsnLeftString      = vNam(varn)
     1360                  res@gsnRightString     = unit(varn)
     1361                  res@trXMinF            = miniwpvptp
     1362                  res@trXMaxF            = maxiwpvptp
     1363                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1364               end if
     1365            end if
     1366            if (vNam(varn) .EQ. "wsvpts") then
     1367               miniwsvpts=min(data(varn,:,:))
     1368               maxiwsvpts=max(data(varn,:,:))
     1369               if (over .EQ. 1) then
     1370                  res@xyDashPattern  = 1
     1371                  plot_wsvpts = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1372               else
     1373                  res@gsnLeftString      = vNam(varn)
     1374                  res@gsnRightString     = unit(varn)
     1375                  res@trXMinF            = miniwsvpts
     1376                  res@trXMaxF            = maxiwsvpts
     1377                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1378               end if
     1379            end if
     1380            if (vNam(varn) .EQ. "wvpt") then
     1381               miniwvpt=min(data(varn,:,:))
     1382               maxiwvpt=max(data(varn,:,:))
     1383               if (over .EQ. 1) then
     1384                  res@xyDashPattern  = 2
     1385                  plot_wvpt = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1386               else
     1387                  res@gsnLeftString      = vNam(varn)
     1388                  res@gsnRightString     = unit(varn)
     1389                  res@trXMinF            = miniwvpt
     1390                  res@trXMaxF            = maxiwvpt
     1391                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1392               end if
     1393            end if
     1394
     1395            if (vNam(varn) .EQ. "wpqp") then
     1396               miniwpqp=min(data(varn,:,:))
     1397               maxiwpqp=max(data(varn,:,:))
     1398               if (over .EQ. 1) then
     1399                  res@xyDashPattern  = 0
     1400                  plot_wpqp = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1401               else
     1402                  res@gsnLeftString      = vNam(varn)
     1403                  res@gsnRightString     = unit(varn)
     1404                  res@trXMinF            = miniwpqp
     1405                  res@trXMaxF            = maxiwpqp
     1406                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1407               end if
     1408            end if
     1409            if (vNam(varn) .EQ. "wsqs") then
     1410               miniwsqs=min(data(varn,:,:))
     1411               maxiwsqs=max(data(varn,:,:))
     1412               if (over .EQ. 1) then
     1413                  res@xyDashPattern  = 1
     1414                  plot_wsqs = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1415               else
     1416                  res@gsnLeftString      = vNam(varn)
     1417                  res@gsnRightString     = unit(varn)
     1418                  res@trXMinF            = miniwsqs
     1419                  res@trXMaxF            = maxiwsqs
     1420                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1421               end if
     1422            end if
     1423            if (vNam(varn) .EQ. "wq") then
     1424               miniwq=min(data(varn,:,:))
     1425               maxiwq=max(data(varn,:,:))
     1426               if (over .EQ. 1) then
     1427                  res@xyDashPattern  = 2
     1428                  plot_wq = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1429               else
     1430                  res@gsnLeftString      = vNam(varn)
     1431                  res@gsnRightString     = unit(varn)
     1432                  res@trXMinF            = miniwq
     1433                  res@trXMaxF            = maxiwq
     1434                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1435               end if
     1436            end if
     1437
     1438            if (vNam(varn) .EQ. "wpqvp") then
     1439               miniwpqvp=min(data(varn,:,:))
     1440               maxiwpqvp=max(data(varn,:,:))
     1441               if (over .EQ. 1) then
     1442                  res@xyDashPattern  = 0
     1443                  plot_wpqvp = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1444               else
     1445                  res@gsnLeftString      = vNam(varn)
     1446                  res@gsnRightString     = unit(varn)
     1447                  res@trXMinF            = miniwpqvp
     1448                  res@trXMaxF            = maxiwpqvp
     1449                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1450               end if
     1451            end if
     1452            if (vNam(varn) .EQ. "wsqvs") then
     1453               miniwsqvs=min(data(varn,:,:))
     1454               maxiwsqvs=max(data(varn,:,:))
     1455               if (over .EQ. 1) then
     1456                  res@xyDashPattern  = 1
     1457                  plot_wsqvs = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1458               else
     1459                  res@gsnLeftString      = vNam(varn)
     1460                  res@gsnRightString     = unit(varn)
     1461                  res@trXMinF            = miniwsqvs
     1462                  res@trXMaxF            = maxiwsqvs
     1463                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1464               end if
     1465            end if
     1466            if (vNam(varn) .EQ. "wqv") then
     1467               miniwqv=min(data(varn,:,:))
     1468               maxiwqv=max(data(varn,:,:))
     1469               if (over .EQ. 1) then
     1470                  res@xyDashPattern  = 2
     1471                  plot_wqv = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1472               else
     1473                  res@gsnLeftString      = vNam(varn)
     1474                  res@gsnRightString     = unit(varn)
     1475                  res@trXMinF            = miniwqv
     1476                  res@trXMaxF            = maxiwqv
     1477                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1478               end if
     1479            end if
     1480
     1481            if (vNam(varn) .EQ. "wpsp") then
     1482               miniwpsp=min(data(varn,:,:))
     1483               maxiwpsp=max(data(varn,:,:))
     1484               if (over .EQ. 1) then
     1485                  res@xyDashPattern  = 0
     1486                  plot_wpsp = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1487               else
     1488                  res@gsnLeftString      = vNam(varn)
     1489                  res@gsnRightString     = unit(varn)
     1490                  res@trXMinF            = miniwpsp
     1491                  res@trXMaxF            = maxiwpsp
     1492                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1493               end if
     1494            end if
     1495            if (vNam(varn) .EQ. "wsss") then
     1496               miniwsss=min(data(varn,:,:))
     1497               maxiwsss=max(data(varn,:,:))
     1498               if (over .EQ. 1) then
     1499                  res@xyDashPattern  = 1
     1500                  plot_wsss = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1501               else
     1502                  res@gsnLeftString      = vNam(varn)
     1503                  res@gsnRightString     = unit(varn)
     1504                  res@trXMinF            = miniwsss
     1505                  res@trXMaxF            = maxiwsss
     1506                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1507               end if
     1508            end if
     1509            if (vNam(varn) .EQ. "ws") then
     1510               miniws=min(data(varn,:,:))
     1511               maxiws=max(data(varn,:,:))
     1512               if (over .EQ. 1) then
     1513                  res@xyDashPattern  = 2
     1514                  plot_ws = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1515               else
     1516                  res@gsnLeftString      = vNam(varn)
     1517                  res@gsnRightString     = unit(varn)
     1518                  res@trXMinF            = miniws
     1519                  res@trXMaxF            = maxiws
     1520                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1521               end if
     1522            end if
     1523
     1524            if (vNam(varn) .EQ. "wpsap") then
     1525               miniwpsap=min(data(varn,:,:))
     1526               maxiwpsap=max(data(varn,:,:))
     1527               if (over .EQ. 1) then
     1528                  res@xyDashPattern  = 0
     1529                  plot_wpsap = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1530               else
     1531                  res@gsnLeftString      = vNam(varn)
     1532                  res@gsnRightString     = unit(varn)
     1533                  res@trXMinF            = miniwpsap
     1534                  res@trXMaxF            = maxiwpsap
     1535                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1536               end if
     1537            end if
     1538            if (vNam(varn) .EQ. "wssas") then
     1539               miniwssas=min(data(varn,:,:))
     1540               maxiwssas=max(data(varn,:,:))
     1541               if (over .EQ. 1) then
     1542                  res@xyDashPattern  = 1
     1543                  plot_wssas = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1544               else
     1545                  res@gsnLeftString      = vNam(varn)
     1546                  res@gsnRightString     = unit(varn)
     1547                  res@trXMinF            = miniwssas
     1548                  res@trXMaxF            = maxiwssas
     1549                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1550               end if
     1551            end if
     1552            if (vNam(varn) .EQ. "wsa") then
     1553               miniwsa=min(data(varn,:,:))
     1554               maxiwsa=max(data(varn,:,:))
     1555               if (over .EQ. 1) then
     1556                  res@xyDashPattern  = 2
     1557                  plot_wsa = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1558               else
     1559                  res@gsnLeftString      = vNam(varn)
     1560                  res@gsnRightString     = unit(varn)
     1561                  res@trXMinF            = miniwsa
     1562                  res@trXMaxF            = maxiwsa
     1563                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1564               end if
     1565            end if
     1566
     1567            if (vNam(varn) .EQ. "wses") then               
     1568               if (over .EQ. 1) then
     1569                  res@gsnLeftString      = vNam(varn)
     1570                  res@gsnRightString     = unit(varn)
     1571                  res@trXMinF            = min(data(varn,:,:))
     1572                  res@trXMaxF            = max(data(varn,:,:))
     1573                  plot_wses = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1574               else
     1575                  res@gsnLeftString      = vNam(varn)
     1576                  res@gsnRightString     = unit(varn)
     1577                  res@trXMinF            = min(data(varn,:,:))
     1578                  res@trXMaxF            = max(data(varn,:,:))
     1579                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1580               end if
     1581            end if
     1582
     1583            if (vNam(varn) .EQ. "us2") then
     1584               minius2=min(data(varn,:,:))
     1585               maxius2=max(data(varn,:,:))
     1586               if (over .EQ. 1) then
     1587                  res@xyDashPattern  = 0
     1588                  plot_us2 = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1589               else
     1590                  res@gsnLeftString      = vNam(varn)
     1591                  res@gsnRightString     = unit(varn)
     1592                  res@trXMinF            = minius2
     1593                  res@trXMaxF            = maxius2
     1594                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1595               end if
     1596            end if
     1597            if (vNam(varn) .EQ. "vs2") then
     1598               minivs2=min(data(varn,:,:))
     1599               maxivs2=max(data(varn,:,:))
     1600               if (over .EQ. 1) then
     1601                  res@xyDashPattern  = 1
     1602                  plot_vs2 = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1603               else
     1604                  res@gsnLeftString      = vNam(varn)
     1605                  res@gsnRightString     = unit(varn)
     1606                  res@trXMinF            = minivs2
     1607                  res@trXMaxF            = maxivs2
     1608                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1609               end if
     1610            end if
     1611            if (vNam(varn) .EQ. "ws2") then
     1612               miniws2=min(data(varn,:,:))
     1613               maxiws2=max(data(varn,:,:))
     1614               if (over .EQ. 1) then
     1615                  res@xyDashPattern  = 2
     1616                  plot_ws2 = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1617               else
     1618                  res@gsnLeftString      = vNam(varn)
     1619                  res@gsnRightString     = unit(varn)
     1620                  res@trXMinF            = miniws2
     1621                  res@trXMaxF            = maxiws2
     1622                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1623               end if
     1624            end if
     1625
     1626            if (vNam(varn) .EQ. "pts2") then
     1627               minipts2=min(data(varn,:,:))
     1628               maxipts2=max(data(varn,:,:))                 
     1629               if (over .EQ. 1) then
     1630                  res@gsnLeftString      = vNam(varn)
     1631                  res@gsnRightString     = unit(varn)
     1632                  res@trXMinF            = minipts2
     1633                  res@trXMaxF            = maxipts2
     1634                  plot_pts2 = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1635               else
     1636                  res@gsnLeftString      = vNam(varn)
     1637                  res@gsnRightString     = unit(varn)
     1638                  res@trXMinF            = minipts2
     1639                  res@trXMaxF            = maxipts2
     1640                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1641               end if
     1642            end if
     1643
     1644            if (vNam(varn) .EQ. "ws3") then
     1645               miniws3=min(data(varn,:,:))
     1646               maxiws3=max(data(varn,:,:))                 
     1647               if (over .EQ. 1) then
     1648                  res@gsnLeftString      = vNam(varn)
     1649                  res@gsnRightString     = unit(varn)
     1650                  res@trXMinF            = miniws3
     1651                  res@trXMaxF            = maxiws3
     1652                  plot_ws3 = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1653               else
     1654                  res@gsnLeftString      = vNam(varn)
     1655                  res@gsnRightString     = unit(varn)
     1656                  res@trXMinF            = miniws3
     1657                  res@trXMaxF            = maxiws3
     1658                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1659               end if
     1660            end if
     1661
     1662            if (vNam(varn) .EQ. "Sw") then
     1663               miniSw=min(data(varn,:,:))
     1664               maxiSw=max(data(varn,:,:))                 
     1665               if (over .EQ. 1) then
     1666                  res@gsnLeftString      = vNam(varn)
     1667                  res@gsnRightString     = unit(varn)
     1668                  res@trXMinF            = miniSw
     1669                  res@trXMaxF            = maxiSw
     1670                  plot_Sw = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1671               else
     1672                  res@gsnLeftString      = vNam(varn)
     1673                  res@gsnRightString     = unit(varn)
     1674                  res@trXMinF            = miniSw
     1675                  res@trXMaxF            = maxiSw
     1676                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1677               end if
     1678            end if
     1679
     1680            if (vNam(varn) .EQ. "ws2pts") then
     1681               miniws2pts=min(data(varn,:,:))
     1682               maxiws2pts=max(data(varn,:,:))                 
     1683               if (over .EQ. 1) then
     1684                  res@gsnLeftString      = vNam(varn)
     1685                  res@gsnRightString     = unit(varn)
     1686                  res@trXMinF            = miniws2pts
     1687                  res@trXMaxF            = maxiws2pts
     1688                  plot_ws2pts = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1689               else
     1690                  res@gsnLeftString      = vNam(varn)
     1691                  res@gsnRightString     = unit(varn)
     1692                  res@trXMinF            = miniws2pts
     1693                  res@trXMaxF            = maxiws2pts
     1694                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1695               end if
     1696            end if
     1697
     1698            if (vNam(varn) .EQ. "wspts2") then
     1699               miniwspts2=min(data(varn,:,:))
     1700               maxiwspts2=max(data(varn,:,:))                 
     1701               if (over .EQ. 1) then
     1702                  res@gsnLeftString      = vNam(varn)
     1703                  res@gsnRightString     = unit(varn)
     1704                  res@trXMinF            = miniwspts2
     1705                  res@trXMaxF            = maxiwspts2
     1706                  plot_wspts2 = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1707               else
     1708                  res@gsnLeftString      = vNam(varn)
     1709                  res@gsnRightString     = unit(varn)
     1710                  res@trXMinF            = miniwspts2
     1711                  res@trXMaxF            = maxiwspts2
     1712                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1713               end if
     1714            end if
     1715
     1716            if (vNam(varn) .EQ. "wsususodz") then
     1717               miniwsususodz=min(data(varn,:,:))
     1718               maxiwsususodz=max(data(varn,:,:))
     1719               if (over .EQ. 1) then
     1720                  res@xyDashPattern  = 0
     1721                  plot_wsususodz = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1722               else
     1723                  res@gsnLeftString      = vNam(varn)
     1724                  res@gsnRightString     = unit(varn)
     1725                  res@trXMinF            = miniwsususodz
     1726                  res@trXMaxF            = maxiwsususodz
     1727                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1728               end if 
     1729            end if
     1730            if (vNam(varn) .EQ. "wspsodz") then
     1731               miniwspsodz=min(data(varn,:,:))
     1732               maxiwspsodz=max(data(varn,:,:))
     1733               if (over .EQ. 1) then
     1734                  res@xyDashPattern  = 1
     1735                  plot_wspsodz = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1736               else
     1737                  res@gsnLeftString      = vNam(varn)
     1738                  res@gsnRightString     = unit(varn)
     1739                  res@trXMinF            = miniwspsodz
     1740                  res@trXMaxF            = maxiwspsodz
     1741                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1742               end if
     1743            end if
     1744            if (vNam(varn) .EQ. "wpeodz") then
     1745               miniwpeodz=min(data(varn,:,:))
     1746               maxiwpeodz=max(data(varn,:,:))
     1747               if (over .EQ. 1) then
     1748                  res@xyDashPattern  = 2
     1749                  plot_wpeodz = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1750               else
     1751                  res@gsnLeftString      = vNam(varn)
     1752                  res@gsnRightString     = unit(varn)
     1753                  res@trXMinF            = miniwpeodz
     1754                  res@trXMaxF            = maxiwpeodz
     1755                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1756               end if
     1757            end if
     1758         if (over .EQ. 0) then
     1759            n=n+1 
     1760         end if     
     1761         varn=varn+1
     1762      end if     
     1763      delete(temp)
     1764   end do
     1765   
     1766   if (over .EQ. 1 ) then
     1767
     1768      overlay(plot_u,plot_v)
     1769      overlay(plot_u,plot_w)
     1770      u=0
     1771      overlay(plot_pt,plot_vpt)
     1772      overlay(plot_pt,plot_lpt)
     1773      pt=0
     1774      overlay(plot_q,plot_qv)
     1775      overlay(plot_q,plot_ql)
     1776      q=0
     1777      overlay(plot_e,plot_es)
     1778      e=0
     1779      overlay(plot_km,plot_kh)
     1780      km=0
     1781      overlay(plot_wpup,plot_wsus)
     1782      overlay(plot_wpup,plot_wu)
     1783      wpup=0
     1784      overlay(plot_wpvp,plot_wsvs)
     1785      overlay(plot_wpvp,plot_wv)
     1786      wpvp=0
     1787      overlay(plot_wpptp,plot_wspts)
     1788      overlay(plot_wpptp,plot_wpt)
     1789      wpptp=0
     1790      overlay(plot_wsptsBC,plot_wptBC)
     1791      wsptsBC=0
     1792      overlay(plot_wpvptp,plot_wsvpts)
     1793      overlay(plot_wpvptp,plot_wvpt)
     1794      wpvptp=0
     1795      overlay(plot_wpqp,plot_wsqs)
     1796      overlay(plot_wpqp,plot_wq)
     1797      wpqp=0
     1798      overlay(plot_wpqvp,plot_wsqvs)
     1799      overlay(plot_wpqvp,plot_wqv)
     1800      wpqvp=0
     1801      overlay(plot_wpsp,plot_wsss)
     1802      overlay(plot_wpsp,plot_ws)
     1803      wpsp=0
     1804      overlay(plot_wpsap,plot_wssas)
     1805      overlay(plot_wpsap,plot_wsa)
     1806      wpsap=0
     1807      overlay(plot_us2,plot_vs2)
     1808      overlay(plot_us2,plot_ws2)
     1809      us2=0
     1810      overlay(plot_wsususodz,plot_wspsodz)
     1811      overlay(plot_wsususodz,plot_wpeodz)
     1812      wsususodz=0
     1813
     1814   end if
     1815
     1816   if (over .EQ. 1) then
     1817   
     1818      do varn = 0,dim-1   
     1819     
     1820         if ( isStrSubset( vNam(varn), "time") .OR. isStrSubset( vNam(varn), "NORM")) then
     1821            check = False
     1822         else
     1823            if (.not. isvar("var")) then
     1824               check = True
     1825               if (parameter(21) .NE. "variables") then
     1826                  var=parameter(21)
     1827                  check = isStrSubset( var,","+vNam(varn)+"," )
     1828               end if
     1829            else         
     1830               check = isStrSubset( var,","+vNam(varn)+"," )
     1831            end if
     1832         end if 
     1833
     1834         if (check)
     1835           
     1836            z = f->$vNam(varn+1)$
     1837           
     1838            ;res@gsnLeftString      = vNam(varn)
     1839            res@gsnRightString     = unit(varn)
     1840            res@trYMinF            = min_z
     1841            res@trYMaxF            = max_z 
     1842            res@trXMinF            = min(data(varn,:,:))
     1843            res@trXMaxF            = max(data(varn,:,:))
     1844            plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 
     1845           
     1846            if (vNam(varn) .EQ. "u" .OR. vNam(varn) .EQ. "v" .OR. vNam(varn) .EQ. "w") then
     1847               if (u .EQ. 0) then
     1848                  res@gsnLeftString      = "u, v and w"
     1849                  res@gsnRightString     = unit(varn)
     1850                  res@trXMinF            = min((/miniu,miniv,miniw/))
     1851                  res@trXMaxF            = max((/maxiu,maxiv,maxiw/))
     1852                  if (vNam(varn) .EQ. "w") then
     1853                     plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1854                  else
     1855                     plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1856                  end if
     1857
     1858                  ; ***************************************************
     1859                  ; legend for combined plot
     1860                  ; ***************************************************
     1861     
     1862                  lgres                    = True
     1863                  lgMonoDashIndex          = False
     1864                  lgres@lgLabelFont        = "helvetica"   
     1865                  lgres@lgLabelFontHeightF = .1           
     1866                  lgres@vpWidthF           = 0.12           
     1867                  lgres@vpHeightF          = 0.1         
     1868                  lgres@lgDashIndexes      = (/0,1,2/)
     1869                  lbid = gsn_create_legend(wks,3,(/"u","v","w"/),lgres)       
     1870
     1871                  amres = True
     1872                  amres@amParallelPosF   = 0.65             
     1873                  amres@amOrthogonalPosF = -0.2           
     1874                  annoid1 = gsn_add_annotation(plot(n),lbid,amres)                 
     1875                  overlay(plot(n),plot_u)
     1876                  u=1
     1877               else
     1878                  varn=varn+1
     1879                  continue
     1880               end if       
     1881            end if 
    4381882     
    439       if (combine .EQ. 1) then
    440          if (c_var .EQ. " ") then
    441             print(" ")
    442             print("Please indicate the variables you would like to combine ('c_var')")
    443             print(" ")
    444             exit
    445          end if               
    446          com=isStrSubset(c_var,vNam(varn)+",")     
    447          if (com) then
    448             e=e+1
     1883            if (vNam(varn) .EQ. "pt" .OR. vNam(varn) .EQ. "vpt" .OR. vNam(varn) .EQ. "lpt") then
     1884               if (pt .EQ. 0) then
     1885                  res@gsnLeftString      = "pt, vpt and lpt"
     1886                  res@gsnRightString     = unit(varn)
     1887                  res@trXMinF            = min((/minipt,minivpt,minilpt/))
     1888                  res@trXMaxF            = max((/maxipt,maxivpt,maxilpt/))
     1889
     1890                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1891
     1892                  ; ***************************************************
     1893                  ; legend for combined plot
     1894                  ; ***************************************************
     1895     
     1896                  lgres                    = True
     1897                  lgMonoDashIndex          = False
     1898                  lgres@lgLabelFont        = "helvetica"   
     1899                  lgres@lgLabelFontHeightF = .1           
     1900                  lgres@vpWidthF           = 0.12           
     1901                  lgres@vpHeightF          = 0.1         
     1902                  lgres@lgDashIndexes      = (/0,1,2/)
     1903                  lbid = gsn_create_legend(wks,3,(/"pt","vpt","lpt"/),lgres)       
     1904
     1905                  amres = True
     1906                  amres@amParallelPosF   = 0.65             
     1907                  amres@amOrthogonalPosF = -0.2           
     1908                  annoid1 = gsn_add_annotation(plot(n),lbid,amres)                 
     1909                  overlay(plot(n),plot_pt)
     1910                  pt=1
     1911               else
     1912                  varn=varn+1
     1913                  continue       
     1914               end if
     1915            end if           
     1916            if (vNam(varn) .EQ. "q" .OR. vNam(varn) .EQ. "qv" .OR. vNam(varn) .EQ. "ql") then
     1917               if (q .EQ. 0) then
     1918                  res@gsnLeftString      = "q, qv and ql"
     1919                  res@gsnRightString     = unit(varn)
     1920                  res@trXMinF            = min((/miniq,miniqv,miniql/))
     1921                  res@trXMaxF            = max((/maxiq,maxiqv,maxiql/))
     1922
     1923                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1924
     1925                  ; ***************************************************
     1926                  ; legend for combined plot
     1927                  ; ***************************************************
     1928     
     1929                  lgres                    = True
     1930                  lgMonoDashIndex          = False
     1931                  lgres@lgLabelFont        = "helvetica"   
     1932                  lgres@lgLabelFontHeightF = .1           
     1933                  lgres@vpWidthF           = 0.12           
     1934                  lgres@vpHeightF          = 0.1         
     1935                  lgres@lgDashIndexes      = (/0,1,2/)
     1936                  lbid = gsn_create_legend(wks,3,(/"q","qv","ql"/),lgres)       
     1937
     1938                  amres = True
     1939                  amres@amParallelPosF   = 0.65             
     1940                  amres@amOrthogonalPosF = -0.2           
     1941                  annoid1 = gsn_add_annotation(plot(n),lbid,amres)                 
     1942                  overlay(plot(n),plot_q)
     1943                  q=1
     1944               else
     1945                  varn=varn+1
     1946                  continue   
     1947               end if
     1948            end if           
     1949            if (vNam(varn) .EQ. "rho") then
     1950               plot(n) = plot_rho
     1951            end if
     1952            if (vNam(varn) .EQ. "s") then
     1953               plot(n) = plot_s
     1954            end if
     1955            if (vNam(varn) .EQ. "sa") then
     1956               plot(n) = plot_sa
     1957            end if
     1958            if (vNam(varn) .EQ. "e" .OR. vNam(varn) .EQ. "es") then
     1959               if (e .EQ. 0) then
     1960                  res@gsnLeftString      = "e and es"
     1961                  res@gsnRightString     = unit(varn)
     1962                  res@trXMinF            = min((/minie,minies/))
     1963                  res@trXMaxF            = max((/maxie,maxies/))
     1964
     1965                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1966
     1967                  ; ***************************************************
     1968                  ; legend for combined plot
     1969                  ; ***************************************************
     1970     
     1971                  lgres                    = True
     1972                  lgMonoDashIndex          = False
     1973                  lgres@lgLabelFont        = "helvetica"   
     1974                  lgres@lgLabelFontHeightF = .1           
     1975                  lgres@vpWidthF           = 0.12           
     1976                  lgres@vpHeightF          = 0.1         
     1977                  lgres@lgDashIndexes      = (/0,1,2/)
     1978                  lbid = gsn_create_legend(wks,3,(/"e","es"/),lgres)       
     1979
     1980                  amres = True
     1981                  amres@amParallelPosF   = 0.65             
     1982                  amres@amOrthogonalPosF = -0.2           
     1983                  annoid1 = gsn_add_annotation(plot(n),lbid,amres)                 
     1984                  overlay(plot(n),plot_e)
     1985                  e=1
     1986               else
     1987                  varn=varn+1
     1988                  continue   
     1989               end if
     1990            end if           
     1991            if (vNam(varn) .EQ. "km" .OR. vNam(varn) .EQ. "kh") then
     1992               if (km .EQ. 0) then
     1993                  res@gsnLeftString      = "km and kh"
     1994                  res@gsnRightString     = unit(varn)
     1995                  res@trXMinF            = min((/minikm,minikh/))
     1996                  res@trXMaxF            = max((/maxikm,maxikh/))
     1997
     1998                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1999
     2000                  ; ***************************************************
     2001                  ; legend for combined plot
     2002                  ; ***************************************************
     2003     
     2004                  lgres                    = True
     2005                  lgMonoDashIndex          = False
     2006                  lgres@lgLabelFont        = "helvetica"   
     2007                  lgres@lgLabelFontHeightF = .1           
     2008                  lgres@vpWidthF           = 0.12           
     2009                  lgres@vpHeightF          = 0.1         
     2010                  lgres@lgDashIndexes      = (/0,1,2/)
     2011                  lbid = gsn_create_legend(wks,3,(/"km","kh"/),lgres)       
     2012
     2013                  amres = True
     2014                  amres@amParallelPosF   = 0.65             
     2015                  amres@amOrthogonalPosF = -0.2           
     2016                  annoid1 = gsn_add_annotation(plot(n),lbid,amres)                 
     2017                  overlay(plot(n),plot_km)
     2018                  km=1
     2019               else
     2020                  varn=varn+1
     2021                  continue   
     2022               end if
     2023            end if           
     2024            if (vNam(varn) .EQ. "l") then
     2025               plot(n) = plot_l
     2026            end if
     2027            if (vNam(varn) .EQ. "wpup" .OR. vNam(varn) .EQ. "wsus" .OR. vNam(varn) .EQ. "wu") then
     2028               if (wpup .EQ. 0) then
     2029                  res@gsnLeftString      = "wpup, wsus and wu"
     2030                  res@gsnRightString     = unit(varn)
     2031                  res@trXMinF            = min((/miniwpup,miniwsus,miniwu/))
     2032                  res@trXMaxF            = max((/maxiwpup,maxiwsus,maxiwu/))
     2033
     2034                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2035
     2036                  ; ***************************************************
     2037                  ; legend for combined plot
     2038                  ; ***************************************************
     2039     
     2040                  lgres                    = True
     2041                  lgMonoDashIndex          = False
     2042                  lgres@lgLabelFont        = "helvetica"   
     2043                  lgres@lgLabelFontHeightF = .1           
     2044                  lgres@vpWidthF           = 0.12           
     2045                  lgres@vpHeightF          = 0.1         
     2046                  lgres@lgDashIndexes      = (/0,1,2/)
     2047                  lbid = gsn_create_legend(wks,3,(/"wpup","wsus","wu"/),lgres)       
     2048
     2049                  amres = True
     2050                  amres@amParallelPosF   = 0.65             
     2051                  amres@amOrthogonalPosF = -0.2           
     2052                  annoid1 = gsn_add_annotation(plot(n),lbid,amres)                 
     2053                  overlay(plot(n),plot_wpup)
     2054                  wpup=1
     2055               else
     2056                  varn=varn+1
     2057                  continue   
     2058               end if
     2059            end if
     2060            if (vNam(varn) .EQ. "wpvp" .OR. vNam(varn) .EQ. "wsvs" .OR.vNam(varn) .EQ. "wv") then
     2061               if (wpvp .EQ. 0) then
     2062                  res@gsnLeftString      = "wpvp, wsus and wv"
     2063                  res@gsnRightString     = unit(varn)
     2064                  res@trXMinF            = min((/miniwpvp,miniwsvs,miniwv/))
     2065                  res@trXMaxF            = max((/maxiwpvp,maxiwsvs,maxiwv/))
     2066
     2067                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2068
     2069                  ; ***************************************************
     2070                  ; legend for combined plot
     2071                  ; ***************************************************
     2072     
     2073                  lgres                    = True
     2074                  lgMonoDashIndex          = False
     2075                  lgres@lgLabelFont        = "helvetica"   
     2076                  lgres@lgLabelFontHeightF = .1           
     2077                  lgres@vpWidthF           = 0.12           
     2078                  lgres@vpHeightF          = 0.1         
     2079                  lgres@lgDashIndexes      = (/0,1,2/)
     2080                  lbid = gsn_create_legend(wks,3,(/"wpvp","wsvs","wv"/),lgres)       
     2081
     2082                  amres = True
     2083                  amres@amParallelPosF   = 0.65             
     2084                  amres@amOrthogonalPosF = -0.2           
     2085                  annoid1 = gsn_add_annotation(plot(n),lbid,amres)                 
     2086                  overlay(plot(n),plot_wpvp)
     2087                  wpup=0
     2088               else
     2089                  varn=varn+1
     2090                  continue   
     2091               end if
     2092            end if
     2093            if (vNam(varn) .EQ. "wpptp" .OR. vNam(varn) .EQ. "wspts" .OR. vNam(varn) .EQ. "wpt") then
     2094               if (wpptp .EQ. 0) then
     2095                  res@gsnLeftString      = "wpptp, wspts and wv"
     2096                  res@gsnRightString     = unit(varn)
     2097                  res@trXMinF            = min((/miniwpptp,miniwspts,miniwpt/))
     2098                  res@trXMaxF            = max((/maxiwpptp,maxiwspts,maxiwpt/))
     2099
     2100                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2101
     2102                  ; ***************************************************
     2103                  ; legend for combined plot
     2104                  ; ***************************************************
     2105     
     2106                  lgres                    = True
     2107                  lgMonoDashIndex          = False
     2108                  lgres@lgLabelFont        = "helvetica"   
     2109                  lgres@lgLabelFontHeightF = .1           
     2110                  lgres@vpWidthF           = 0.12           
     2111                  lgres@vpHeightF          = 0.1         
     2112                  lgres@lgDashIndexes      = (/0,1,2/)
     2113                  lbid = gsn_create_legend(wks,3,(/"wpptp","wspts","wpt"/),lgres)       
     2114
     2115                  amres = True
     2116                  amres@amParallelPosF   = 0.65             
     2117                  amres@amOrthogonalPosF = -0.2           
     2118                  annoid1 = gsn_add_annotation(plot(n),lbid,amres)                 
     2119                  overlay(plot(n),plot_wpptp)
     2120                  wpptp=1
     2121               else
     2122                  varn=varn+1
     2123                  continue   
     2124               end if
     2125            end if
     2126            if (vNam(varn) .EQ. "wsptsBC" .OR. vNam(varn) .EQ. "wptBC") then
     2127               if (wsptsBC .EQ. 0) then
     2128                  res@gsnLeftString      = "wsptsBC and wptBC"
     2129                  res@gsnRightString     = unit(varn)
     2130                  res@trXMinF            = min((/miniwsptsBC,miniwptBC/))
     2131                  res@trXMaxF            = max((/maxiwsptsBC,maxiwptBC/))
     2132
     2133                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2134
     2135                  ; ***************************************************
     2136                  ; legend for combined plot
     2137                  ; ***************************************************
     2138     
     2139                  lgres                    = True
     2140                  lgMonoDashIndex          = False
     2141                  lgres@lgLabelFont        = "helvetica"   
     2142                  lgres@lgLabelFontHeightF = .1           
     2143                  lgres@vpWidthF           = 0.12           
     2144                  lgres@vpHeightF          = 0.1         
     2145                  lgres@lgDashIndexes      = (/0,1,2/)
     2146                  lbid = gsn_create_legend(wks,3,(/"wsptsBC","wptBC"/),lgres)       
     2147
     2148                  amres = True
     2149                  amres@amParallelPosF   = 0.65             
     2150                  amres@amOrthogonalPosF = -0.2           
     2151                  annoid1 = gsn_add_annotation(plot(n),lbid,amres)                 
     2152                  overlay(plot(n),plot_wsptsBC)
     2153                  wsptsBC=1
     2154               else
     2155                  varn=varn+1
     2156                  continue   
     2157               end if 
     2158            end if             
     2159            if (vNam(varn) .EQ. "wpvptp" .OR. vNam(varn) .EQ. "wsvpts" .OR. vNam(varn) .EQ. "wvpt") then
     2160               if (wpvptp .EQ. 0) then
     2161                  res@gsnLeftString      = "wpvptp, wsvpts and wv"
     2162                  res@gsnRightString     = unit(varn)
     2163                  res@trXMinF            = min((/miniwpvptp,miniwsvpts,miniwvpt/))
     2164                  res@trXMaxF            = max((/maxiwpvptp,maxiwsvpts,maxiwvpt/))
     2165
     2166                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2167
     2168                  ; ***************************************************
     2169                  ; legend for combined plot
     2170                  ; ***************************************************
     2171     
     2172                  lgres                    = True
     2173                  lgMonoDashIndex          = False
     2174                  lgres@lgLabelFont        = "helvetica"   
     2175                  lgres@lgLabelFontHeightF = .1           
     2176                  lgres@vpWidthF           = 0.12           
     2177                  lgres@vpHeightF          = 0.1         
     2178                  lgres@lgDashIndexes      = (/0,1,2/)
     2179                  lbid = gsn_create_legend(wks,3,(/"wpvptp","wsvpts","wvpt"/),lgres)       
     2180
     2181                  amres = True
     2182                  amres@amParallelPosF   = 0.65             
     2183                  amres@amOrthogonalPosF = -0.2           
     2184                  annoid1 = gsn_add_annotation(plot(n),lbid,amres)                 
     2185                  overlay(plot(n),plot_wpvptp)
     2186                  wpvptp=1
     2187               else
     2188                  varn=varn+1
     2189                  continue   
     2190               end if
     2191            end if
     2192            if (vNam(varn) .EQ. "wpqp" .OR. vNam(varn) .EQ. "wsqs" .OR. vNam(varn) .EQ. "wq") then
     2193               if (wpqp .EQ. 0) then
     2194                  res@gsnLeftString      = "wpqp, wsqs and wq"
     2195                  res@gsnRightString     = unit(varn)
     2196                  res@trXMinF            = min((/miniwpqp,miniwsqs,miniwq/))
     2197                  res@trXMaxF            = max((/maxiwpqp,maxiwsqs,maxiwq/))
     2198
     2199                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2200
     2201                  ; ***************************************************
     2202                  ; legend for combined plot
     2203                  ; ***************************************************
     2204     
     2205                  lgres                    = True
     2206                  lgMonoDashIndex          = False
     2207                  lgres@lgLabelFont        = "helvetica"   
     2208                  lgres@lgLabelFontHeightF = .1           
     2209                  lgres@vpWidthF           = 0.12           
     2210                  lgres@vpHeightF          = 0.1         
     2211                  lgres@lgDashIndexes      = (/0,1,2/)
     2212                  lbid = gsn_create_legend(wks,3,(/"wpqp","wsqs","wq"/),lgres)       
     2213
     2214                  amres = True
     2215                  amres@amParallelPosF   = 0.65             
     2216                  amres@amOrthogonalPosF = -0.2           
     2217                  annoid1 = gsn_add_annotation(plot(n),lbid,amres)                 
     2218                  overlay(plot(n),plot_wpqp)
     2219                  wpqp=1
     2220               else
     2221                  varn=varn+1
     2222                  continue   
     2223               end if
     2224            end if
     2225            if (vNam(varn) .EQ. "wpqvp" .OR. vNam(varn) .EQ. "wsqvs" .OR. vNam(varn) .EQ. "wqv") then
     2226               if (wpqvp .EQ. 0) then
     2227                  res@gsnLeftString      = "wpqvp, wsqvs and wqv"
     2228                  res@gsnRightString     = unit(varn)
     2229                  res@trXMinF            = min((/miniwpqp,miniwsqvs,miniwqv/))
     2230                  res@trXMaxF            = max((/maxiwpqp,maxiwsqvs,maxiwqv/))
     2231
     2232                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2233
     2234                  ; ***************************************************
     2235                  ; legend for combined plot
     2236                  ; ***************************************************
     2237     
     2238                  lgres                    = True
     2239                  lgMonoDashIndex          = False
     2240                  lgres@lgLabelFont        = "helvetica"   
     2241                  lgres@lgLabelFontHeightF = .1           
     2242                  lgres@vpWidthF           = 0.12           
     2243                  lgres@vpHeightF          = 0.1         
     2244                  lgres@lgDashIndexes      = (/0,1,2/)
     2245                  lbid = gsn_create_legend(wks,3,(/"wpqvp","wsqvs","wqv"/),lgres)       
     2246
     2247                  amres = True
     2248                  amres@amParallelPosF   = 0.65             
     2249                  amres@amOrthogonalPosF = -0.2           
     2250                  annoid1 = gsn_add_annotation(plot(n),lbid,amres)                 
     2251                  overlay(plot(n),plot_wpqvp)
     2252                  wpqvp=1
     2253               else
     2254                  varn=varn+1
     2255                  continue   
     2256               end if
     2257            end if
     2258            if (vNam(varn) .EQ. "wpsp" .OR. vNam(varn) .EQ. "wsss" .OR. vNam(varn) .EQ. "ws") then
     2259               if (wpsp .EQ. 0) then
     2260                  res@gsnLeftString      = "wpsp, wsss and ws"
     2261                  res@gsnRightString     = unit(varn)
     2262                  res@trXMinF            = min((/miniwpsp,miniwsss,miniws/))
     2263                  res@trXMaxF            = max((/maxiwpsp,maxiwsss,maxiws/))
     2264
     2265                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2266
     2267                  ; ***************************************************
     2268                  ; legend for combined plot
     2269                  ; ***************************************************
     2270     
     2271                  lgres                    = True
     2272                  lgMonoDashIndex          = False
     2273                  lgres@lgLabelFont        = "helvetica"   
     2274                  lgres@lgLabelFontHeightF = .1           
     2275                  lgres@vpWidthF           = 0.12           
     2276                  lgres@vpHeightF          = 0.1         
     2277                  lgres@lgDashIndexes      = (/0,1,2/)
     2278                  lbid = gsn_create_legend(wks,3,(/"wpsp","wsss","ws"/),lgres)       
     2279
     2280                  amres = True
     2281                  amres@amParallelPosF   = 0.65             
     2282                  amres@amOrthogonalPosF = -0.2           
     2283                  annoid1 = gsn_add_annotation(plot(n),lbid,amres)                 
     2284                  overlay(plot(n),plot_wpsp)
     2285                  wpsp=1
     2286               else
     2287                  varn=varn+1
     2288                  continue   
     2289               end if
     2290            end if
     2291            if (vNam(varn) .EQ. "wpsap" .OR.vNam(varn) .EQ. "wssas" .OR. vNam(varn) .EQ. "wsa") then
     2292               if (wpsap .EQ. 0) then
     2293                  res@gsnLeftString      = "wpsap, wssas and wsa"
     2294                  res@gsnRightString     = unit(varn)
     2295                  res@trXMinF            = min((/miniwpsap,miniwssas,miniwsa/))
     2296                  res@trXMaxF            = max((/maxiwpsap,maxiwssas,maxiwsa/))
     2297
     2298                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2299
     2300                  ; ***************************************************
     2301                  ; legend for combined plot
     2302                  ; ***************************************************
     2303     
     2304                  lgres                    = True
     2305                  lgMonoDashIndex          = False
     2306                  lgres@lgLabelFont        = "helvetica"   
     2307                  lgres@lgLabelFontHeightF = .1           
     2308                  lgres@vpWidthF           = 0.12           
     2309                  lgres@vpHeightF          = 0.1         
     2310                  lgres@lgDashIndexes      = (/0,1,2/)
     2311                  lbid = gsn_create_legend(wks,3,(/"wpsap","wssas","wsa"/),lgres)       
     2312
     2313                  amres = True
     2314                  amres@amParallelPosF   = 0.65             
     2315                  amres@amOrthogonalPosF = -0.2           
     2316                  annoid1 = gsn_add_annotation(plot(n),lbid,amres)                 
     2317                  overlay(plot(n),plot_wpsap)
     2318                  wpsap=1
     2319               else
     2320                  varn=varn+1
     2321                  continue   
     2322               end if
     2323            end if
     2324            if (vNam(varn) .EQ. "wses") then
     2325               plot(n) = plot_wses
     2326            end if
     2327            if (vNam(varn) .EQ. "us2" .OR. vNam(varn) .EQ. "vs2" .OR. vNam(varn) .EQ. "ws2") then
     2328               if (us2 .EQ. 0) then
     2329                  res@gsnLeftString      = "us2, vs2 and ws2"
     2330                  res@gsnRightString     = unit(varn)
     2331                  res@trXMinF            = min((/minius2,minivs2,miniws2/))
     2332                  res@trXMaxF            = max((/maxius2,maxivs2,maxiws2/))
     2333
     2334                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2335
     2336                  ; ***************************************************
     2337                  ; legend for combined plot
     2338                  ; ***************************************************
     2339     
     2340                  lgres                    = True
     2341                  lgMonoDashIndex          = False
     2342                  lgres@lgLabelFont        = "helvetica"   
     2343                  lgres@lgLabelFontHeightF = .1           
     2344                  lgres@vpWidthF           = 0.12           
     2345                  lgres@vpHeightF          = 0.1         
     2346                  lgres@lgDashIndexes      = (/0,1,2/)
     2347                  lbid = gsn_create_legend(wks,3,(/"us2","vs2","ws2"/),lgres)       
     2348
     2349                  amres = True
     2350                  amres@amParallelPosF   = 0.65             
     2351                  amres@amOrthogonalPosF = -0.2           
     2352                  annoid1 = gsn_add_annotation(plot(n),lbid,amres)                 
     2353                  overlay(plot(n),plot_us2)
     2354                  us2=1
     2355               else
     2356                  varn=varn+1
     2357                  continue   
     2358               end if
     2359            end if
     2360            if (vNam(varn) .EQ. "pts2") then
     2361               plot(n) = plot_pts2
     2362            end if
     2363            if (vNam(varn) .EQ. "ws3") then
     2364               plot(n) = plot_ws3
     2365            end if
     2366            if (vNam(varn) .EQ. "Sw") then
     2367               plot(n) = plot_Sw
     2368            end if
     2369            if (vNam(varn) .EQ. "ws2pts") then
     2370               plot(n) = plot_ws2pts
     2371            end if
     2372            if (vNam(varn) .EQ. "wspts2") then
     2373               plot(n) = plot_wspts2
     2374            end if
     2375            if (vNam(varn) .EQ. "wsususodz" .OR. vNam(varn) .EQ. "wspsodz" .OR. vNam(varn) .EQ. "wpeodz" ) then
     2376               if (wsususodz .EQ. 0) then
     2377                  res@gsnLeftString      = "wsususodz, wspsodz and ws2"
     2378                  res@gsnRightString     = unit(varn)
     2379                  res@trXMinF            = min((/miniwsususodz,miniwspsodz,miniwpeodz/))
     2380                  res@trXMaxF            = max((/maxiwsususodz,maxiwspsodz,maxiwpeodz/))
     2381
     2382                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2383
     2384                  ; ***************************************************
     2385                  ; legend for combined plot
     2386                  ; ***************************************************
     2387     
     2388                  lgres                    = True
     2389                  lgMonoDashIndex          = False
     2390                  lgres@lgLabelFont        = "helvetica"   
     2391                  lgres@lgLabelFontHeightF = .1           
     2392                  lgres@vpWidthF           = 0.12           
     2393                  lgres@vpHeightF          = 0.1         
     2394                  lgres@lgDashIndexes      = (/0,1,2/)
     2395                  lbid = gsn_create_legend(wks,3,(/"wsususodz","wspsodz","wpeodz"/),lgres)       
     2396
     2397                  amres = True
     2398                  amres@amParallelPosF   = 0.65             
     2399                  amres@amOrthogonalPosF = -0.2           
     2400                  annoid1 = gsn_add_annotation(plot(n),lbid,amres)                 
     2401                  overlay(plot(n),plot_wsususodz)
     2402                  wsususodz=1
     2403               else
     2404                  varn=varn+1
     2405                  continue   
     2406               end if
     2407            end if     
     2408            n=n+1   
     2409            varn=varn+1
     2410         end if
     2411      end do
     2412   end if     
     2413
     2414   if (combine .EQ. 1) then
     2415     
     2416      check=True     
     2417      n_o=0
     2418      do varn = 0,dim-1
     2419 
     2420         if ( isStrSubset( vNam(varn), "NORM") .or. isStrSubset( vNam(varn), "time") )
    4492421            check = False
    450             temp = f->$vNam(varn)$           
    451             data_o!1 = temp!0
    452             data_o!2 = temp!1           
    453             data_o(e,:,:) = temp(start_time_step:end_time_step,:)
    454             mini(e) = min(data_o(e,:,:))
    455             maxi(e) = max(data_o(e,:,:))
    456            
    457             do j=e,e
    458                do p=start_time_step,end_time_step
    459                   legend_label_oplot(e*end_time_step+p-start_time_step)=" "+flt2string(doubletofloat(t_all(p)))+" "+vNam(varn)
    460                end do
    461             end do
    462            
    463             delete(temp)
    464             varn = varn + 1
     2422         else
     2423            if (.not. isvar("var")) then
     2424               check = True
     2425               if (parameter(21) .NE. "variables") then
     2426                  var=parameter(21)
     2427                  check = isStrSubset( var,","+vNam(varn)+"," )
     2428               end if
     2429            else         
     2430               check = isStrSubset( var,","+vNam(varn)+"," )
     2431            end if
     2432         end if
     2433     
     2434         if(check) then
     2435
     2436            z = f->$vNam(varn+1)$
     2437            com=isStrSubset( c_var,","+vNam(varn)+"," )
     2438     
     2439            if (com)
     2440                             
     2441               if (n_o .EQ. 1) then
     2442                  res@xyDashPattern  = 1
     2443                                 
     2444               else           
     2445                  if (n_o .EQ. 2) then
     2446                     res@xyDashPattern  = 2
     2447                  else
     2448                     res@xyDashPattern  = 0
     2449                     res@gsnLeftString  = c_var
     2450                     res@gsnRightString = unit(varn)
     2451                     res@trXMinF        = min(mini)
     2452                     res@trXMaxF        = max(maxi)
     2453                  end if
     2454               end if
     2455               label(n_o)=vNam(varn)
     2456               color_o(n_o)=237
     2457               plot_o(n_o)=gsn_csm_xy(wks,data(varn,:,:),z,res)
     2458               n_o=n_o+1
     2459            end if         
     2460            varn=varn+1   
     2461         end if
     2462      end do
     2463   
     2464      if(number_comb .EQ. 2)then
     2465         overlay(plot_o(0),plot_o(1))
     2466      end if
     2467      if(number_comb .EQ. 3)then
     2468         overlay(plot_o(0),plot_o(1))
     2469         overlay(plot_o(0),plot_o(2))
     2470      end if
     2471
     2472      ; ***************************************************
     2473      ; legend for combined plot
     2474      ; ***************************************************
     2475     
     2476      lgres                    = True
     2477      lgMonoDashIndex          = False
     2478      lgres@lgDashIndexes      = (/0,1,2/)
     2479      lgres@lgLabelFont        = "helvetica"   
     2480      lgres@lgLabelFontHeightF = .1           
     2481      lgres@vpWidthF           = 0.12           
     2482      lgres@vpHeightF          = 0.1           
     2483 
     2484      lbid = gsn_create_legend(wks,number_comb,label,lgres)       
     2485
     2486      amres = True
     2487      amres@amParallelPosF   = 0.65                 
     2488      amres@amOrthogonalPosF = -0.2           
     2489      annoid1 = gsn_add_annotation(plot_o(0),lbid,amres)
    4652490   
    466          end if       
    467       end if 
    468  
    469       if(check) then
    470 
    471          temp = f->$vNam(varn)$     
    472          data = temp(start_time_step:end_time_step,:)   
    473          testx= data*100 
    474          print("         plot of " + vNam(varn))
    475          data!1 = "z"
    476  
    477          res@gsnLeftString      = "PROFILE plot of"
    478          res@gsnRightString     = vNam(varn)
    479          res@txFontHeightF      = 0.02
    480          res@tiXAxisFontHeightF = 0.02
    481          res@tiYAxisFontHeightF = 0.02
    482          res@tiXAxisString      = " "   
    483          res@tiYAxisString      = "Height [z]"
    484          res@trXMinF            = min(data(:,:))
    485          res@trXMaxF            = max(data(:,:))
    486          res@trYMinF            = min_z
    487          res@trYMaxF            = max_z   
    488        
    489          plot(n) = gsn_csm_xy(wks,data,z_pr,res) 
    490    
    491          delete(temp)
    492          delete(data)
    493          n = n + 1
    494          varn = varn + 1
    495        
    496       end if     
    497 
    498    end do
    499 
    500    if (combine .EQ. 1) then
    501       data_all=new((/m*end_time_step,dimz/),float)
    502       do j=0,e
    503          data_all(start_time_step-1+j*end_time_step:(j+1)*end_time_step-1,:) = data_o(j,:,:)
    504       end do 
    505 
    506       ores@gsnLeftString      = "combined PROFILE plot of"
    507       ores@gsnRightString     = c_var
    508       ores@txFontHeightF      = 0.02
    509       ores@tiXAxisFontHeightF = 0.02
    510       ores@tiYAxisFontHeightF = 0.02
    511       ores@tiXAxisString      = " "   
    512       ores@tiYAxisString      = "Height [z]"
    513       ores@trXMinF            = min(mini(:))
    514       ores@trXMaxF            = max(maxi(:))
    515       ores@trYMinF            = min_z
    516       ores@trYMaxF            = max_z   
    517       ores@xyExplicitLegendLabels  = legend_label_oplot
    518 
    519       print(" ")
    520       print("combined plot of " + c_var)
    521  
    522       plot(0) = gsn_csm_xy(wks,data_all,z_pr,ores)
    523      
     2491      plot(0) = plot_o(0)
     2492
    5242493   end if
    5252494
     
    5272496   ; merge plots onto one page
    5282497   ; ***************************************************
    529  
    530    do i = 0, n-1, no_lines*no_columns
    531       if( (i+no_lines*no_columns) .gt. (n-1)) then
    532         gsn_panel(wks,plot(i:n-1),(/no_lines,no_columns/),resP)
    533       else
    534         gsn_panel(wks,plot(i:i+no_lines*no_columns-1),(/no_lines,no_columns/),resP)
    535       end if
     2498 print(n)
     2499   do m=0,n-1
     2500      plot_(m)=plot(n-1-m)
    5362501   end do
     2502
     2503   if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then
     2504      gsn_panel(wks,plot_(0:n-1),(/n,1/),resP)
     2505   else   
     2506      do i = 0,n-1, no_lines*no_columns
     2507         if( (i+no_lines*no_columns) .gt. (n-1)) then
     2508            gsn_panel(wks,plot_(i:n-1),(/no_lines,no_columns/),resP)
     2509         else
     2510           gsn_panel(wks,plot_(i:i+no_lines*no_columns-1),(/no_lines,no_columns/),resP)
     2511         end if
     2512      end do
     2513   end if
    5372514
    5382515   print(" ")
  • palm/trunk/SCRIPTS/NCL/timeseries.ncl

    r157 r161  
    1111   
    1212   if (isfilepresent("~/.ncl_preferences")) then
    13       parameter = asciiread("~/.ncl_preferences",73,"string")
     13      parameter = asciiread("~/.ncl_preferences",75,"string")
    1414      delete(parameter@_FillValue)
    1515   else
     
    2323   ; set up default parameter values and strings if not assigned in prompt or parameter list
    2424   ; ***************************************************
    25    
     25 
    2626   if ( .not. isvar("file_in") ) then                   ; path+name of input file     
    2727      if (parameter(7) .EQ. "input file") then
     
    6060   if ( .not. isvar("var") ) then                       ; variable name
    6161      check = True
     62   end if
     63   if ( .not. isvar("over") ) then                      ; switches overlaying plots on
     64      over = 0
     65      if (stringtointeger(parameter(73)) .NE. 0) then
     66         over = stringtointeger(parameter(73))
     67         if (stringtointeger(parameter(73)) .NE. 1) then
     68            print(" ")
     69            print("Please set 'over' to 0 or 1")
     70            print(" ")
     71            exit
     72         end if   
     73      end if
    6274   end if
    6375 
     
    6880   f  = addfile(file_in , "r" )
    6981
    70    vNam  = getfilevarnames(f) 
     82   vNam  = getfilevarnames(f)
    7183   print(" ")
    7284   print("Variable on netCDF file: " + vNam)
    7385   print(" ")
    74    dim   = dimsizes(vNam)
     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
    7593   t_all = f->time
    76    nt    = dimsizes(t_all)
     94   nt  = dimsizes(t_all)
    7795
    7896   ; ****************************************************       
     
    8199
    82100   if ( .not. isvar("start_time_step") ) then           
    83       start_time_step = 1
    84       if (parameter(13) .LE. "1") then
    85          if (parameter(13) .EQ. "0")
     101      start_time_step = 0
     102      if (parameter(13) .NE. "1") then
     103         if (parameter(13) .LE. "0")
    86104            print(" ")
    87105            print("Begin with time step 1")
     
    95113            exit
    96114         end if
    97          start_time_step = stringtointeger(parameter(13)) 
     115         start_time_step = stringtointeger(parameter(13))-1 
    98116      end if
    99117   else
     
    110128         exit
    111129      end if
     130      start_time_step = start_time_step - 1
    112131   end if
    113132
     
    137156            exit
    138157         end if
    139          end_time_step = stringtointeger(parameter(15)) 
     158         end_time_step = stringtointeger(parameter(15))-1
    140159      end if   
    141160   else
     
    153172      end if
    154173      if (end_time_step .LT. start_time_step)
    155             print(" ")
    156             print("'end_time_step' = "+end_time_step +" is lower than 'start_time_step' = "+start_time_step)
    157             print(" ")
    158             exit
    159       end if
     174         print(" ")
     175         print("'end_time_step' = "+end_time_step +" is lower than 'start_time_step' = "+start_time_step)
     176         print(" ")
     177         exit
     178      end if
     179      end_time_step = end_time_step - 1
    160180   end if 
    161181
     
    181201   res@tiYAxisFont             = "helvetica"
    182202   res@tmXBLabelFont           = "helvetica"
    183    res@tmYLLabelFont           = "helvetica" 
    184    res@xyLineColors            = (/237/)
     203   res@tmYLLabelFont           = "helvetica"
     204   res@xyLineColors            = (/237/)
     205   
     206   res@lgLabelFontHeightF     = .02
     207
    185208   resP                        = True
    186209   resP@txFont                 = "helvetica"
     
    191214   res@vpWidthF=4
    192215
     216   txres = True
    193217
    194218   ; ***************************************************
     
    198222   wks_ps = gsn_open_wks(format_out,file_out)           
    199223   gsn_define_colormap(wks_ps,"rainbow+white")
    200    plot_ps=new(dim,graphic)                             
     224   plot_ps=new(dim,graphic)
     225                                 
    201226   n=0
    202  
    203    do varn = 0, dim-1 
     227   minE=1.E27
     228   maxE=-1.E27
     229   minus=1.E27
     230   maxus=-1.E27
     231   minu=1.E27
     232   maxu=-1.E27
     233   minz=1.E27
     234   maxz=-1.E27
     235   minw=1.E27
     236   maxw=-1.E27
     237   minp=1.E27
     238   maxp=-1.E27
     239   mins=1.E27
     240   maxs=-1.E27
     241
     242   data   = new((/dim,(end_time_step-start_time_step)+1/),float)
     243   unit   = new(dim,string)
     244   data_0 = new((end_time_step-start_time_step)+1,float)
     245   data_0 = 0.0
     246   mini   = new(dim,float)
     247   maxi   = new(dim,float)
     248   
     249   if (over .EQ. 1) then
     250      plot_E       = gsn_csm_xy(wks_ps,t,data_0(:),res)
     251      plot_Es      = gsn_csm_xy(wks_ps,t,data_0(:),res)
     252      plot_us      = gsn_csm_xy(wks_ps,t,data_0(:),res)
     253      plot_ws      = gsn_csm_xy(wks_ps,t,data_0(:),res)
     254      plot_umax    = gsn_csm_xy(wks_ps,t,data_0(:),res)
     255      plot_vmax    = gsn_csm_xy(wks_ps,t,data_0(:),res)
     256      plot_wmax    = gsn_csm_xy(wks_ps,t,data_0(:),res)
     257      plot_z_i_wpt = gsn_csm_xy(wks_ps,t,data_0(:),res)
     258      plot_z_i_pt  = gsn_csm_xy(wks_ps,t,data_0(:),res)
     259      plot_wpptp0  = gsn_csm_xy(wks_ps,t,data_0(:),res)
     260      plot_wpptp   = gsn_csm_xy(wks_ps,t,data_0(:),res)
     261      plot_wpt     = gsn_csm_xy(wks_ps,t,data_0(:),res)
     262      plot_pt_0_   = gsn_csm_xy(wks_ps,t,data_0(:),res)
     263      plot_pt_zp_  = gsn_csm_xy(wks_ps,t,data_0(:),res)
     264      plot_splptx  = gsn_csm_xy(wks_ps,t,data_0(:),res)
     265      plot_splpty  = gsn_csm_xy(wks_ps,t,data_0(:),res)
     266      plot_splptz  = gsn_csm_xy(wks_ps,t,data_0(:),res)
     267   end if
     268 
     269   do varn = dim-1,0,1
     270
     271      if( isStrSubset (vNam(varn), "time") )
     272         check = False
     273      else
     274         check = True
     275      end if
    204276      if( isvar("var") ) then                   
    205          check = isStrSubset( var,vNam(varn)+"," )
     277         check = isStrSubset( var,","+vNam(varn)+"," )
    206278      end if
    207279      if (parameter(21) .NE. "variables") then
    208280         var = parameter(21)
    209          check = isStrSubset( var,vNam(varn)+"," )
     281         check = isStrSubset( var,","+vNam(varn)+"," )
    210282      end if
    211283   
     284     
     285      if(check) then
     286       
     287         data_all = f ->$vNam(varn)$
     288         unit(varn) = data_all@units
     289               
     290         data(varn,:)=data_all(start_time_step:end_time_step)
     291         
     292         if (over .EQ. 1) then
     293
     294            mini(varn) = min(data(varn,:))
     295            maxi(varn) = max(data(varn,:))
     296           
     297            if (vNam(varn) .EQ. "E" .OR. vNam(varn) .EQ. "Es") then
     298               if (mini(varn) .EQ. maxi(varn)) then
     299                  if (min(data(varn,:)) .EQ. 0)then
     300                     mini(varn)= mini(varn)-1.
     301                     maxi(varn)= maxi(varn)+1.
     302                  end if
     303                  if (min(data(varn,:)) .LT. 0)then
     304                     mini(varn)= mini(varn)-1.+(mini(varn))/2
     305                     maxi(varn)= maxi(varn)+1.-(maxi(varn))/2
     306                  end if
     307                  if (min(data(varn,:)) .GT. 0)then
     308                     mini(varn)= mini(varn)-1.-(mini(varn))/2
     309                     maxi(varn)= maxi(varn)+1.+(maxi(varn))/2
     310                  end if
     311               end if
     312               minE=min((/minE,mini(varn)/))
     313               maxE=max((/maxE,maxi(varn)/))
     314            end if
     315
     316            if (vNam(varn) .EQ. "us" .OR. vNam(varn) .EQ. "ws") then
     317               if (mini(varn) .EQ. maxi(varn)) then
     318                  if (min(data(varn,:)) .EQ. 0)then
     319                     mini(varn)= mini(varn)-1.
     320                     maxi(varn)= maxi(varn)+1.
     321                  end if
     322                  if (min(data(varn,:)) .LT. 0)then
     323                     mini(varn)= mini(varn)-1.+(mini(varn))/2
     324                     maxi(varn)= maxi(varn)+1.-(maxi(varn))/2
     325                  end if
     326                  if (min(data(varn,:)) .GT. 0)then
     327                     mini(varn)= mini(varn)-1.-(mini(varn))/2
     328                     maxi(varn)= maxi(varn)+1.+(maxi(varn))/2
     329                  end if
     330               end if
     331               minus=min((/minus,mini(varn)/))
     332               maxus=max((/maxus,maxi(varn)/))
     333            end if
     334
     335            if (vNam(varn) .EQ. "umax" .OR. vNam(varn) .EQ. "vmax" .OR. vNam(varn) .EQ. "wmax") then
     336               if (mini(varn) .EQ. maxi(varn)) then
     337                  if (mini(varn) .EQ. 0)then
     338                     mini(varn)= mini(varn)-1.
     339                     maxi(varn)= maxi(varn)+1.
     340                  end if
     341                  if (mini(varn) .LT. 0)then
     342                     mini(varn)= mini(varn)-1.+(mini(varn))/2
     343                     maxi(varn)= maxi(varn)+1.-(maxi(varn))/2
     344                  end if
     345                  if (mini(varn) .GT. 0)then
     346                     mini(varn)= mini(varn)-1.-(mini(varn))/2
     347                     maxi(varn)= maxi(varn)+1.+(maxi(varn))/2
     348                  end if
     349               end if
     350               minu=min((/minu,mini(varn)/))
     351               maxu=max((/maxu,maxi(varn)/))
     352            end if
     353
     354            if (vNam(varn) .EQ. "z_i_wpt" .OR. vNam(varn) .EQ. "z_i_pt") then
     355               if (mini(varn) .EQ. maxi(varn)) then
     356                  if (min(data(varn,:)) .EQ. 0)then
     357                     mini(varn)= mini(varn)-1.
     358                     maxi(varn)= maxi(varn)+1.
     359                  end if
     360                  if (min(data(varn,:)) .LT. 0)then
     361                     mini(varn)= mini(varn)-1.+(mini(varn))/2
     362                     maxi(varn)= maxi(varn)+1.-(maxi(varn))/2
     363                  end if
     364                  if (min(data(varn,:)) .GT. 0)then
     365                     mini(varn)= mini(varn)-1.-(mini(varn))/2
     366                     maxi(varn)= maxi(varn)+1.+(maxi(varn))/2
     367                  end if
     368               end if
     369               minz=min((/minz,mini(varn)/))
     370               maxz=max((/maxz,maxi(varn)/))
     371            end if
     372
     373            if (vNam(varn) .EQ. "wpptp0" .OR. vNam(varn) .EQ. "wpptp" .OR. vNam(varn) .EQ. "wpt") then
     374               if (mini(varn) .EQ. maxi(varn)) then
     375                  if (min(data(varn,:)) .EQ. 0)then
     376                     mini(varn)= mini(varn)-1.
     377                     maxi(varn)= maxi(varn)+1.
     378                  end if
     379                  if (min(data(varn,:)) .LT. 0)then
     380                     mini(varn)= mini(varn)-1.+(mini(varn))/2
     381                     maxi(varn)= maxi(varn)+1.-(maxi(varn))/2
     382                  end if
     383                  if (min(data(varn,:)) .GT. 0)then
     384                     mini(varn)= mini(varn)-1.-(mini(varn))/2
     385                     maxi(varn)= maxi(varn)+1.+(maxi(varn))/2
     386                  end if
     387               end if
     388               minw=min((/minw,mini(varn)/))
     389               maxw=max((/maxw,maxi(varn)/))
     390            end if
     391
     392            if (vNam(varn) .EQ. "pt_0_" .OR. vNam(varn) .EQ. "pt_zp_") then
     393               if (mini(varn) .EQ. maxi(varn)) then
     394                  if (min(data(varn,:)) .EQ. 0)then
     395                     mini(varn)= mini(varn)-1.
     396                     maxi(varn)= maxi(varn)+1.
     397                  end if
     398                  if (min(data(varn,:)) .LT. 0)then
     399                     mini(varn)= mini(varn)-1.+(mini(varn))/2
     400                     maxi(varn)= maxi(varn)+1.-(maxi(varn))/2
     401                  end if
     402                  if (min(data(varn,:)) .GT. 0)then
     403                     mini(varn)= mini(varn)-1.-(mini(varn))/2
     404                     maxi(varn)= maxi(varn)+1.+(maxi(varn))/2
     405                  end if
     406               end if
     407               minp=min((/minp,mini(varn)/))
     408               maxp=max((/maxp,maxi(varn)/))
     409            end if
     410
     411            if (vNam(varn) .EQ. "splptx" .OR. vNam(varn) .EQ. "splpty" .OR. vNam(varn) .EQ. "splptz") then
     412               if (mini(varn) .EQ. maxi(varn)) then
     413                  if (min(data(varn,:)) .EQ. 0)then
     414                     mini(varn)= mini(varn)-1.
     415                     maxi(varn)= maxi(varn)+1.
     416                  end if
     417                  if (min(data(varn,:)) .LT. 0)then
     418                     mini(varn)= mini(varn)-1.+(mini(varn))/2
     419                     maxi(varn)= maxi(varn)+1.-(maxi(varn))/2
     420                  end if
     421                  if (min(data(varn,:)) .GT. 0)then
     422                     mini(varn)= mini(varn)-1.-(mini(varn))/2
     423                     maxi(varn)= maxi(varn)+1.+(maxi(varn))/2
     424                  end if
     425               end if
     426               mins=min((/mins,mini(varn)/))
     427               maxs=max((/maxs,maxi(varn)/))
     428            end if
     429           
     430         end if
     431      end if
     432   end do
     433
     434   do varn = dim-1,0,1
     435     
    212436      if( isStrSubset (vNam(varn), "time") )
    213437         check = False
    214       end if
     438      else
     439         check = True
     440      end if     
     441      if( isvar("var") ) then                   
     442         check = isStrSubset( var,","+vNam(varn)+"," )
     443      end if
     444      if (parameter(21) .NE. "variables") then
     445         var = parameter(21)
     446         check = isStrSubset( var,","+vNam(varn)+"," )
     447      end if
    215448 
    216449      if(check) then
     450
     451        if (over .EQ. 1) then
    217452 
    218          n=n+1
    219          data = f ->$vNam(varn)$         
    220          print("plot of " + vNam(varn))
    221 
    222          res@gsnRightString       = vNam(varn)
    223          res@tiXAxisString        = " time [s] "
    224          res@tiXAxisFontHeightF   = 0.07
    225          res@txFontHeightF        = 0.07
    226          res@tiYAxisFontHeightF   = 0.07
    227      
    228          plot_ps(n) = gsn_csm_xy(wks_ps,t,data(start_time_step:end_time_step),res)
     453            res@gsnLeftString       = "overlayed plot"
     454            res@gsnRightString      = unit(varn)
     455            res@tiXAxisString        = " time [s] "
     456            res@tiYAxisString        = " "
     457            res@tiXAxisFontHeightF   = 0.07
     458            res@txFontHeightF        = 0.07
     459            res@tiYAxisFontHeightF   = 0.07
     460            res@xyLabelMode          = "Custom"
     461           
     462
     463            if (vNam(varn) .EQ. "E")
     464               E=0
     465               res@xyLineColors     = (/237/)
     466               res@xyExplicitLabels =  "E"
     467               res@xyLineLabelFontHeightF = 0.05
     468               res@xyLineLabelFontColor   = 237
     469               res@trYMaxF           = minE
     470               res@trYMinF           = maxE
     471               plot_E = gsn_csm_xy(wks_ps,t,data(varn,:),res)
     472            end if
     473            if (vNam(varn) .EQ. "Es")
     474               Es=0
     475               res@xyLineColors            = (/144/)
     476               res@xyExplicitLabels =  "Es"
     477               res@xyLineLabelFontHeightF = 0.05
     478               res@xyLineLabelFontColor   = 144
     479               plot_Es = gsn_csm_xy(wks_ps,t,data(varn,:),res)
     480            end if
     481             
     482            if (vNam(varn) .EQ. "us")
     483               us=0
     484               res@xyLineColors            = (/237/)
     485               res@xyExplicitLabels =  "us"
     486               res@xyLineLabelFontHeightF = 0.05
     487               res@xyLineLabelFontColor   = 237
     488               res@trYMaxF           = minus
     489               res@trYMinF           = maxus
     490               plot_us = gsn_csm_xy(wks_ps,t,data(varn,:),res)
     491            end if             
     492            if (vNam(varn) .EQ. "ws")
     493               ws=0
     494               res@xyLineColors            = (/144/)
     495               res@xyExplicitLabels =  "ws"
     496               res@xyLineLabelFontHeightF = 0.05
     497               res@xyLineLabelFontColor   = 144
     498               plot_ws = gsn_csm_xy(wks_ps,t,data(varn,:),res)
     499            end if
     500             
     501            if (vNam(varn) .EQ. "umax")
     502               u=0
     503               res@xyLineColors            = (/237/)
     504               res@xyExplicitLabels =  "umax"
     505               res@xyLineLabelFontHeightF = 0.05
     506               res@xyLineLabelFontColor   = 237
     507               res@trYMaxF           = minu
     508               res@trYMinF           = maxu
     509               plot_umax = gsn_csm_xy(wks_ps,t,data(varn,:),res)
     510            end if
     511            if (vNam(varn) .EQ. "vmax")
     512               v=0
     513               res@xyLineColors            = (/144/)
     514               res@xyExplicitLabels =  "vmax"
     515               res@xyLineLabelFontHeightF = 0.05
     516               res@xyLineLabelFontColor   = 144
     517               plot_vmax = gsn_csm_xy(wks_ps,t,data(varn,:),res)
     518            end if
     519            if (vNam(varn) .EQ. "wmax")
     520               w=0
     521               res@xyLineColors            = (/80/)
     522               res@xyExplicitLabels =  "wmax"
     523               res@xyLineLabelFontHeightF = 0.05
     524               res@xyLineLabelFontColor   = 80
     525               plot_wmax = gsn_csm_xy(wks_ps,t,data(varn,:),res)
     526            end if
    229527   
    230       end if
     528            if (vNam(varn) .EQ. "z_i_wpt")
     529               zw=0
     530               res@xyLineColors            = (/237/)
     531               res@xyExplicitLabels =  "z_i_wpt"
     532               res@xyLineLabelFontHeightF = 0.05
     533               res@xyLineLabelFontColor   = 237
     534               res@trYMaxF           = minz
     535               res@trYMinF           = maxz
     536               plot_z_i_wpt = gsn_csm_xy(wks_ps,t,data(varn,:),res)
     537            end if
     538            if (vNam(varn) .EQ. "z_i_pt")
     539               z=0
     540               res@xyLineColors            = (/144/) 
     541               res@xyExplicitLabels =  "z_i_pt"
     542               res@xyLineLabelFontHeightF = 0.05
     543               res@xyLineLabelFontColor   = 144
     544               plot_z_i_pt = gsn_csm_xy(wks_ps,t,data(varn,:),res)
     545            end if
     546
     547            if (vNam(varn) .EQ. "wpptp0")
     548               w0=0
     549               res@xyLineColors            = (/237/)
     550               res@xyExplicitLabels =  "wpptp0"
     551               res@xyLineLabelFontHeightF = 0.05
     552               res@xyLineLabelFontColor   = 237
     553               res@trYMaxF           = minw
     554               res@trYMinF           = maxw
     555               plot_wpptp0 = gsn_csm_xy(wks_ps,t,data(varn,:),res)
     556            end if
     557            if (vNam(varn) .EQ. "wpptp")
     558               wp=0
     559               res@xyLineColors            = (/144/)
     560               res@xyExplicitLabels =  "wpptp"
     561               res@xyLineLabelFontHeightF = 0.05
     562               res@xyLineLabelFontColor   = 144
     563               plot_wpptp = gsn_csm_xy(wks_ps,t,data(varn,:),res) 
     564            end if
     565            if (vNam(varn) .EQ. "wpt")
     566               wt=0
     567               res@xyLineColors            = (/80/)
     568               res@xyExplicitLabels =  "wpt"
     569               res@xyLineLabelFontHeightF = 0.05
     570               res@xyLineLabelFontColor   = 80
     571               plot_wpt = gsn_csm_xy(wks_ps,t,data(varn,:),res)
     572            end if
     573
     574            if (vNam(varn) .EQ. "pt_0_")
     575               p=0
     576               res@xyLineColors            = (/237/)
     577               res@xyExplicitLabels =  "pt_0_"
     578               res@xyLineLabelFontHeightF = 0.05
     579               res@xyLineLabelFontColor   = 237
     580               res@trYMaxF           = minp
     581               res@trYMinF           = maxp
     582               plot_pt_0_ = gsn_csm_xy(wks_ps,t,data(varn,:),res) 
     583            end if
     584            if (vNam(varn) .EQ. "pt_zp_")
     585               pz=0
     586               res@xyLineColors            = (/144/)
     587               res@xyExplicitLabels =  "pt_zp_"
     588               res@xyLineLabelFontHeightF = 0.05
     589               res@xyLineLabelFontColor   = 144
     590               plot_pt_zp_ = gsn_csm_xy(wks_ps,t,data(varn,:),res)
     591            end if
     592
     593            if (vNam(varn) .EQ. "splptx")
     594               x=0
     595               res@xyLineColors            = (/237/)
     596               res@xyExplicitLabels =  "splptx"
     597               res@xyLineLabelFontHeightF = 0.05
     598               res@xyLineLabelFontColor   = 237
     599               res@trYMaxF           = mins
     600               res@trYMinF           = maxs
     601               plot_splptx = gsn_csm_xy(wks_ps,t,data(varn,:),res)   
     602            end if
     603            if (vNam(varn) .EQ. "splpty")
     604               y=0
     605               res@xyLineColors            = (/144/)
     606               res@xyExplicitLabels =  "splpty"
     607               res@xyLineLabelFontHeightF = 0.05
     608               res@xyLineLabelFontColor   = 144
     609               plot_splpty = gsn_csm_xy(wks_ps,t,data(varn,:),res)
     610            end if
     611            if (vNam(varn) .EQ. "splptz")
     612               z=0
     613               res@xyLineColors            = (/80/)
     614               res@xyExplicitLabels =  "splptz"
     615               res@xyLineLabelFontHeightF = 0.05
     616               res@xyLineLabelFontColor   = 80
     617               plot_splptz = gsn_csm_xy(wks_ps,t,data(varn,:),res)         
     618            end if
     619
     620         end if
     621      end if
     622   end do
     623   
     624   do varn = dim-1,0,1
    231625 
     626      if( isStrSubset (vNam(varn), "time") )
     627         check = False
     628      else
     629         check = True
     630      end if   
     631      if( isvar("var") ) then                   
     632         check = isStrSubset( var,","+vNam(varn)+"," )
     633      end if
     634      if (parameter(21) .NE. "variables") then
     635         var = parameter(21)
     636         check = isStrSubset( var,","+vNam(varn)+"," )
     637      end if
     638   
     639      if(check) then
     640       
     641         if (over .EQ. 1) then       
     642       
     643            if (vNam(varn) .EQ. "E" .AND. Es .NE. 1) then
     644               E=1   
     645               overlay(plot_E,plot_Es)
     646               n=n+1
     647               plot_ps(n) = plot_E               
     648            end if
     649            if (vNam(varn) .EQ. "Es" .AND. E .NE. 1) then
     650               Es=1
     651               overlay(plot_E,plot_Es)
     652               n=n+1
     653               plot_ps(n) = plot_E           
     654            end if
     655
     656            if (vNam(varn) .EQ. "us" .AND. ws .NE. 1) then
     657               us=1
     658               overlay(plot_us,plot_ws)
     659               n=n+1
     660               plot_ps(n) = plot_us
     661            end if
     662            if (vNam(varn) .EQ. "ws" .AND. us .NE. 1) then
     663               ws=1
     664               overlay(plot_us,plot_ws)
     665               n=n+1
     666               plot_ps(n) = plot_us
     667            end if
     668         
     669            if (vNam(varn) .EQ. "umax" .AND. v .NE. 1)
     670               if (w .NE. 1) then
     671                  u=1         
     672                  overlay(plot_umax,plot_vmax)
     673                  overlay(plot_umax,plot_wmax)
     674                  n=n+1
     675                  plot_ps(n) = plot_umax
     676               end if
     677            end if
     678            if (vNam(varn) .EQ. "vmax" .AND. u .NE. 1)
     679               if (w .NE. 1) then
     680                  v=1 
     681                  overlay(plot_umax,plot_vmax)
     682                  overlay(plot_umax,plot_wmax)
     683                  n=n+1
     684                  plot_ps(n) = plot_umax
     685               end if
     686            end if
     687            if (vNam(varn) .EQ. "wmax" .AND. v .NE. 1)
     688               if(u .NE. 1) then 
     689                  w=1       
     690                  overlay(plot_umax,plot_vmax)
     691                  overlay(plot_umax,plot_wmax)
     692                  n=n+1
     693                  plot_ps(n) = plot_umax
     694               end if
     695            end if
     696           
     697            if (vNam(varn) .EQ. "z_i_wpt" .AND. z .NE. 1) then
     698               zw=1       
     699               overlay(plot_z_i_wpt,plot_z_i_pt)
     700               n=n+1
     701               plot_ps(n) = plot_z_i_wpt           
     702            end if
     703            if (vNam(varn) .EQ. "z_i_pt" .AND. zw .NE. 1) then
     704               z=1     
     705               overlay(plot_z_i_wpt,plot_z_i_pt)
     706               n=n+1
     707               plot_ps(n) = plot_z_i_wpt           
     708            end if   
     709         
     710            if (vNam(varn) .EQ. "wpptp0" .AND. wp .NE. 1)
     711               if (wt .NE. 1) then
     712                  w0=1
     713                  overlay(plot_wpptp0,plot_wpptp)
     714                  overlay(plot_wpptp0,plot_wpt)
     715                  n=n+1
     716                  plot_ps(n) = plot_wpptp0
     717               end if           
     718            end if
     719            if (vNam(varn) .EQ. "wpptp" .AND. w0 .NE. 1)
     720               if (wt .NE. 1) then
     721                 wp=1
     722                 overlay(plot_wpptp0,plot_wpptp)
     723                 overlay(plot_wpptp0,plot_wpt)
     724                 n=n+1
     725                 plot_ps(n) = plot_wpptp0 
     726               end if           
     727            end if
     728            if (vNam(varn) .EQ. "wpt" .AND. wp .NE. 1)
     729               if (w0 .NE. 1) then
     730                  wt=1
     731                  overlay(plot_wpptp0,plot_wpptp)
     732                  overlay(plot_wpptp0,plot_wpt)
     733                  n=n+1
     734                  plot_ps(n) = plot_wpptp0             
     735               end if
     736            end if
     737
     738            if (vNam(varn) .EQ. "pt_0_" .AND. pz .NE. 1) then
     739               p=1     
     740               overlay(plot_pt_0_,plot_pt_zp_)
     741               n=n+1
     742               plot_ps(n) = plot_pt_0_           
     743            end if
     744            if (vNam(varn) .EQ. "pt_zp_" .AND. p .NE. 1) then
     745               pz=1       
     746               overlay(plot_pt_0_,plot_pt_zp_)
     747               n=n+1
     748               plot_ps(n) = plot_pt_0_           
     749            end if
     750           
     751            if (vNam(varn) .EQ. "splptx" .AND. y .NE. 1)
     752               if (z .NE.1 ) then
     753                  x=1     
     754                  overlay(plot_splptx,plot_splpty)
     755                  overlay(plot_splptx,plot_splptz)
     756                  n=n+1
     757                  plot_ps(n) = plot_splptx           
     758               end if
     759            end if
     760            if (vNam(varn) .EQ. "splpty" .AND. x .NE. 1)
     761               if(z .NE.1 ) then
     762                  y=1         
     763                  overlay(plot_splptx,plot_splpty)
     764                  overlay(plot_splptx,plot_splptz)
     765                  n=n+1
     766                  plot_ps(n) = plot_splptx
     767               end if           
     768            end if
     769            if (vNam(varn) .EQ. "splptz" .AND. y .NE. 1)
     770               if(x .NE.1 ) then
     771                  z=1         
     772                  overlay(plot_splptx,plot_splpty)
     773                  overlay(plot_splptx,plot_splptz)
     774                  n=n+1
     775                  plot_ps(n) = plot_splptx   
     776               end if       
     777            end if
     778
     779            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
     780               n=n+1
     781               res@xyLineColors   = (/237/)
     782               res@xyLabelMode    = False
     783               res@gsnLeftString  = vNam(varn)
     784               res@gsnRightString = unit(varn)
     785               res@trYMaxF        = min(data(varn,:))
     786               res@trYMinF        = max(data(varn,:))
     787               if (min(data(varn,:)) .EQ. max(data(varn,:))) then
     788                  if (min(data(varn,:)) .EQ. 0)then
     789                     res@trYMaxF = min(data(varn,:))-1.
     790                     res@trYMinF = max(data(varn,:))+1.
     791                  end if
     792                  if (min(data(varn,:)) .LT. 0)then
     793                     res@trYMaxF = min(data(varn,:))+(min(data(varn,:)))/2
     794                     res@trYMinF = max(data(varn,:))-(max(data(varn,:)))/2
     795                  end if
     796                  if (min(data(varn,:)) .GT. 0)then
     797                     res@trYMaxF = min(data(varn,:))-(min(data(varn,:)))/2
     798                     res@trYMinF = max(data(varn,:))+(max(data(varn,:)))/2
     799                  end if
     800               end if
     801               plot_ps(n) = gsn_csm_xy(wks_ps,t,data(varn,:),res) 
     802            end if
     803       
     804         else
     805           
     806            print("plot of " + vNam(varn))
     807           
     808            n=n+1
     809            res@xyLineColors            = (/237/)
     810            res@gsnLeftString       = vNam(varn)
     811            res@gsnRightString      = unit(varn)
     812            res@tiXAxisString        = " time [s] "
     813            res@tiYAxisString        = " "
     814            res@tiXAxisFontHeightF   = 0.07
     815            res@txFontHeightF        = 0.07
     816            res@tiYAxisFontHeightF   = 0.07
     817            res@trYMaxF        = min(data(varn,:))
     818            res@trYMinF        = max(data(varn,:))
     819            if (min(data(varn,:)) .EQ. max(data(varn,:))) then
     820               if (min(data(varn,:)) .EQ. 0)then
     821                     res@trYMaxF = min(data(varn,:))-1.
     822                     res@trYMinF = max(data(varn,:))+1.
     823                  end if
     824                  if (min(data(varn,:)) .LT. 0)then
     825                     res@trYMaxF = min(data(varn,:))+(min(data(varn,:)))/2
     826                     res@trYMinF = max(data(varn,:))-(max(data(varn,:)))/2
     827                  end if
     828                  if (min(data(varn,:)) .GT. 0)then
     829                     res@trYMaxF = min(data(varn,:))-(min(data(varn,:)))/2
     830                     res@trYMinF = max(data(varn,:))+(max(data(varn,:)))/2
     831                  end if
     832            end if
     833            plot_ps(n) = gsn_csm_xy(wks_ps,t,data(varn,:),res)
     834           
     835         end if     
     836      end if
    232837   end do
    233 
     838 
    234839   ; ***************************************************
    235840   ; merge plots onto one page
    236841   ; ***************************************************
    237 
    238    do np = 1,n,no_lines*no_columns
    239    
    240       if ( np + no_lines*no_columns .gt. n) then   
    241          gsn_panel(wks_ps, plot_ps(np:n),(/no_lines,no_columns/),resP)
    242       else
    243          gsn_panel(wks_ps, plot_ps(np:np+no_lines*no_columns-1),(/no_lines,no_columns/),resP)
    244       end if
    245      
    246    end do
     842 
     843   if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then
     844      gsn_panel(wks_ps,plot_ps(1:n),(/n,1/),resP)
     845   else
     846      do np = 1,n,no_lines*no_columns   
     847         if ( np + no_lines*no_columns .gt. n) then   
     848            gsn_panel(wks_ps, plot_ps(np:n),(/no_lines,no_columns/),resP)
     849         else
     850            gsn_panel(wks_ps, plot_ps(np:np+no_lines*no_columns-1),(/no_lines,no_columns/),resP)
     851         end if
     852      end do
     853   end if
    247854
    248855   print(" ")
Note: See TracChangeset for help on using the changeset viewer.