Changeset 162 for palm/trunk


Ignore:
Timestamp:
Apr 30, 2008 1:41:13 PM (16 years ago)
Author:
letzel
Message:
  • NCL scripts in trunk/SCRIPTS/NCL updated
Location:
palm/trunk/SCRIPTS/NCL
Files:
5 edited

Legend:

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

    r161 r162  
    1111___'file_out'________[path/name; i.e. ~/.../test]_______________default = test____________[ALL]
    1212test
    13 ___start_time_step___[0;1;...]__________________________________default = 1_______________[ALL]
    14 1
    15 ___end_time_step_____[1;2;...]__________________________________default = nt______________[ALL]
    16 nt
     13___start_time_step___[0;1;...]__________________________________default = t(0)____________[ALL]
     14t(0)
     15___end_time_step_____[1;2;...]__________________________________default = t(end)__________[ALL]
     16t(end)
    1717___no_columns________[1;2;...]__________________________________default = 1_______________[ALL]
    18181
     
    3535___max_z_____________[100;1000;...]_____________________________default = max(z_u)________[PR]
    3636max(z_u)
     37___over______________[0] or [1]_________________________________default = 0_______________[PR+TS]
     380
     39___vector____________[0] or [1]_________________________________default = 0_______________[CS]
     400
     41___'vec1'____________[,u,;,v,;...]______________________________default = vec1____________[CS]
     42vec1
     43___'vec2'____________[,u,;,v,;...]______________________________default = vec2____________[CS]
     44vec2
     45__'plotvec'__________[,u,;,v,;...]______________________________default = plotvec_________[CS]
     46plotvec
     47___ref_mag___________[0.1;0.02;...]_____________________________default = 0.05____________[CS]
     480.05
     49___'mode'____________[Fill], [Line] or [Both]___________________default = Fill____________[CS]
     50Fill
    3751___'sort'____________[time] or [layer]__________________________default = time____________[CS]
    3852time
    39 ___'mode'____________[Fill], [Line] or [Both]___________________default = Fill____________[CS]
    40 Fill
    4153___'fill_mode'_______[AreaFill], [RasterFill] or [CellFill]_____default = AreaFill________[CS]
    4254AreaFill
     
    4961___yzc_______________[0] or [1]_________________________________default = 0_______________[CS]
    50620
    51 ___xs________________[0,1,...]__________________________________default = 0_______________[CS]
    52 0
    53 ___xe________________[1;2;...]__________________________________default = xdim____________[CS]
     63___xs________________[0,1,...]__________________________________default = x0______________[CS+PR]
     64x0
     65___xe________________[1;2;...]__________________________________default = xdim____________[CS+PR]
    5466xdim
    55 ___ys________________[0;1;...]__________________________________default = 0_______________[CS]
    56 0
     67___ys________________[0;1;...]__________________________________default = y0______________[CS]
     68y0
    5769___ye________________[1;2;...]__________________________________default = ydim____________[CS]
    5870ydim
    59 ___zs________________[0;1;...]__________________________________default = 0_______________[CS]
    60 0
     71___zs________________[0;1;...]__________________________________default = z0______________[CS]
     72z0
    6173___ze________________[1;2;...]__________________________________default = zdim____________[CS]
    6274zdim
    63 ___vector____________[0] or [1]_________________________________default = 0_______________[CS]
    64 0
    65 ___'vec1'____________[,u,;,v,;...]______________________________default = vec1____________[CS]
    66 vec1
    67 ___'vec2'____________[,u,;,v,;...]______________________________default = vec2____________[CS]
    68 vec2
    69 __'plotvec'__________[,u,;,v,;...]______________________________default = plotvec_________[CS]
    70 plotvec
    71 ___ref_mag___________[0.1;0.02;...]_____________________________default = 0.05____________[CS]
    72 0.05
    73 ___over______________[0] or [1]_________________________________default = 0_______________[TS+PR]
    74 0
    7575___end of file ".ncl_preferences"_____________________________________________________________
  • palm/trunk/SCRIPTS/NCL/cross_sections.ncl

    r161 r162  
    6161   if ( .not. isvar("sort") ) then                      ; sort of plots
    6262      sort = "time"
    63       if (parameter(37) .NE. "time") then
    64          sort = parameter(37
     63      if (parameter(51) .NE. "time") then
     64         sort = parameter(51
    6565      end if
    6666   end if
    6767   if ( .not. isvar("mode") ) then                      ; pattern of contour plots
    6868      mode = "Fill"
    69       if (parameter(39) .NE. "Fill") then
    70          mode = parameter(39) 
     69      if (parameter(49) .NE. "Fill") then
     70         mode = parameter(49) 
    7171      end if
    7272   end if
    7373   if ( .not. isvar("fill_mode") ) then                 ; pattern of filling
    7474      fill_mode = "AreaFill"
    75       if (parameter(41) .NE. "AreaFill") then
    76          mode = parameter(41
     75      if (parameter(53) .NE. "AreaFill") then
     76         mode = parameter(53
    7777      end if
    7878   end if
    7979   if ( .not. isvar("shape") ) then                     ; keeping of aspect ratio
    8080      shape = 1
    81       if (parameter(43) .NE. "1") then
    82          shape = stringtointeger(parameter(43))
    83          if (stringtointeger(parameter(43)) .NE. 0) then
     81      if (parameter(55) .NE. "1") then
     82         shape = stringtointeger(parameter(55))
     83         if (stringtointeger(parameter(55)) .NE. 0) then
    8484            print(" ")
    8585            print("Please set 'shape' to 0 or 1")
     
    9595   if ( .not. isvar("xyc") ) then                       ; turn xy cross-section on or off
    9696      xyc = 0
    97       if (parameter(45) .NE. "0") then
    98          xyc = stringtointeger(parameter(45))
    99          if (stringtointeger(parameter(45)) .NE. 1) then
     97      if (parameter(57) .NE. "0") then
     98         xyc = stringtointeger(parameter(57))
     99         if (stringtointeger(parameter(57)) .NE. 1) then
    100100            print(" ")
    101101            print("Please set 'xyc' to 0 or 1")
     
    107107   if ( .not. isvar("xzc") ) then                       ; turn xz cross-section on or off
    108108      xzc = 0
    109       if (parameter(47) .NE. "0") then
    110          xzc = stringtointeger(parameter(47))
    111          if (stringtointeger(parameter(47)) .NE. 1) then
     109      if (parameter(59) .NE. "0") then
     110         xzc = stringtointeger(parameter(59))
     111         if (stringtointeger(parameter(59)) .NE. 1) then
    112112            print(" ")
    113113            print("Please set 'xzc' to 0 or 1")
     
    119119   if ( .not. isvar("yzc") ) then                       ; turn yz cross-section on or off
    120120      yzc = 0
    121       if (parameter(49) .NE. "0") then
    122          yzc = stringtointeger(parameter(49))
    123          if (stringtointeger(parameter(49)) .NE. 1) then
     121      if (parameter(61) .NE. "0") then
     122         yzc = stringtointeger(parameter(61))
     123         if (stringtointeger(parameter(61)) .NE. 1) then
    124124            print(" ")
    125125            print("Please set 'yzc' to 0 or 1")
     
    129129      end if
    130130   end if
    131    if ( .not. isvar("xs") ) then                        ; start of x-coordinate range
    132       xs = 0
    133       if (parameter(51) .NE. "0") then
    134          xs = stringtointeger(parameter(51))
    135       end if
    136    end if
    137    if ( .not. isvar("ys") ) then                        ; start of y-coordinate range
    138       ys = 0
    139       if (parameter(55) .NE. "0") then
    140          ys = stringtointeger(parameter(55))
    141       end if
    142    end if
    143    if ( .not. isvar("zs") ) then                        ; start of z-coordinate range
    144       zs = 0
    145       if (parameter(59) .NE. "0") then
    146          zs = stringtointeger(parameter(59))
    147       end if
    148    end if 
    149131
    150132   if (xyc .EQ. 0 .AND. xzc .EQ. 0 .AND. yzc .EQ. 0) then
     
    180162   if ( .not. isvar("vector") ) then                    ; sort of plots
    181163      vector = 0
    182       if (parameter(63) .NE. "0") then
    183          vector = stringtointeger(parameter(63))
    184          if (stringtointeger(parameter(63)) .NE. 1) then
     164      if (parameter(39) .NE. "0") then
     165         vector = stringtointeger(parameter(39))
     166         if (stringtointeger(parameter(39)) .NE. 1) then
    185167            print(" ")
    186168            print("Please set 'vector' to 0 or 1")
     
    192174   if ( .not. isvar("ref_mag") ) then                           ; sort of plots
    193175      ref_mag = 0.05
    194       if (parameter(71) .NE. "0.05") then
    195          ref_mag = stringtofloat(parameter(71))   
     176      if (parameter(47) .NE. "0.05") then
     177         ref_mag = stringtofloat(parameter(47))   
    196178      end if
    197179   end if
     
    208190   print(" ")
    209191   dim   = dimsizes(vNam)
     192
     193   ; ***************************************************
     194   ; check for kind of input file
     195   ; ***************************************************
     196
     197   check_3d = True
     198   do varn=0,dim-1
     199      checkxy = isStrSubset( vNam(varn),"xy")
     200      checkxz = isStrSubset( vNam(varn),"xz")
     201      checkyz = isStrSubset( vNam(varn),"yz")
     202      if (checkxy .OR. checkxz .OR. checkyz) then
     203         check_3d = False
     204         break
     205      end if
     206   end do
     207   if (.not. check_3d) then
     208      if (xyc .EQ. 1 .AND. .not. checkxy) then
     209         print(" ")
     210         print("Your input file doesn't have values for xy cross-sections")
     211         if (checkxz)then
     212            print("Select another input file or xz cross-sections")
     213         else
     214            print("Select another input file or yz cross-sections")
     215         end if
     216         print(" ")
     217         exit
     218      else
     219         print(" ")
     220         print("Your input file contains xy data")
     221         print(" ")
     222      end if
     223      if (xzc .EQ. 1 .AND. .not. checkxz) then
     224         print(" ")
     225         print("Your input file doesn't have values for xz cross-sections")
     226         if (checkxy)then
     227            print("Select another input file or xy cross-sections")
     228         else
     229            print("Select another input file or yz cross-sections")
     230         end if
     231         print(" ")
     232         exit
     233      else
     234         print(" ")
     235         print("Your input file contains xz data")
     236         print(" ")
     237      end if
     238      if (yzc .EQ. 1 .AND. .not. checkyz) then
     239         print(" ")
     240         print("Your input file doesn't have values for yz cross-sections")
     241         if (checkxy)then
     242            print("Select another input file or xy cross-sections")
     243         else
     244            print("Select another input file or xz cross-sections")
     245         end if
     246         print(" ")
     247         exit
     248      else
     249         print(" ")
     250         print("Your input file contains yz data")
     251         print(" ")
     252      end if
     253   else
     254      print(" ")
     255      print("Your input file: '"+file_in+"'")
     256      print("contains 3d or other data")
     257      print(" ")
     258   end if
     259   
    210260   if (dim .EQ. 0) then
    211261      print(" ")
    212       print("There are no data on file")
     262      print("There is no data on file")
    213263      print(" ")
     264      exit
    214265   end if
    215266
     
    241292   cs_res@lgLabelFontHeightF     = .02
    242293   cs_res@txFontHeightF          = .02
     294   cs_res@cnLevelSelectionMode    = "ManualLevels"
     295
    243296   cs_resP = True
    244297   cs_resP@txString               = f@title
    245298   cs_resP@txFuncCode             = "~"                 ; necessary for title
    246299   cs_resP@txFontHeightF          = .02
     300   
    247301 
    248302   if ( mode .eq. "Fill" ) then
     
    268322   ; *********************************************
    269323
    270    t    = f->time
    271    nt = dimsizes(t)
    272      
    273    ; *********************************************     
     324   t_all = f->time
     325   nt = dimsizes(t_all)
     326   delta_t = t_all(nt-1)/nt
     327
     328   ; ****************************************************       
    274329   ; start of time step and different types of mistakes that could be done
    275    ; *********************************************
     330   ; ****************************************************
    276331
    277332   if ( .not. isvar("start_time_step") ) then           
    278       start_time_step = 0
    279       if (parameter(13) .NE. "1") then
    280          if (parameter(13) .LT. "1")
    281             print(" ")
    282             print("Begin with time step 1")
     333      start_time_step=t_all(0)/3600
     334      if (parameter(13) .NE. "t(0)") then
     335         if (stringtodouble(parameter(13)) .GT. t_all(nt-1)/3600)
     336            print(" ")
     337            print("'start_time_step' = "+ parameter(13) +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h")
     338            print(" ")
     339            print("Please select another 'start_time_step'")
    283340            print(" ")
    284341            exit
    285342         end if
    286          if (stringtointeger(parameter(13)) .GT. nt)
    287             print(" ")
    288             print("'start_time_step' = "+ parameter(13) +" is greater than available time steps = " + (nt))
     343         if (stringtofloat(parameter(13)) .LT. t_all(0)/3600)
     344            print(" ")
     345            print("'start_time_step' = "+ parameter(13) +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
     346            print(" ")
     347            print("Please select another 'start_time_step'")
    289348            print(" ")
    290349            exit
    291350         end if
    292          start_time_step = stringtointeger(parameter(13))-1
     351         start_time_step=stringtodouble(parameter(13))
    293352      end if
    294353   else
    295       if (start_time_step .LE. 0)
    296          print(" ")
    297          print("Begin with time step 1")
     354      if (start_time_step .GT. t_all(nt-1)/3600)
     355         print(" ")
     356         print("'start_time_step' = "+ start_time_step +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h")
     357         print(" ")
     358         print("Please select another 'start_time_step'")
    298359         print(" ")
    299360         exit
    300361      end if
    301       if (start_time_step .GT. nt)
    302          print(" ")
    303          print("'start_time_step' = "+ start_time_step +" is greater than available time steps = " + (nt))
     362      if (start_time_step .LT. t_all(0)/3600)
     363         print(" ")
     364         print("'start_time_step' = "+ start_time_step +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
     365         print(" ")
     366         print("Please select another 'start_time_step'")
    304367         print(" ")
    305368         exit
    306369      end if
    307       start_time_step = start_time_step - 1
    308    end if
    309 
     370   end if
     371   start_time_step = start_time_step*3600
     372   do i=0,nt-1     
     373      if (start_time_step .GE. t_all(i)-delta_t/2 .AND. start_time_step .LT. t_all(i)+delta_t/2)then
     374         st=i
     375         break
     376      end if
     377   end do
     378       
    310379   ; ****************************************************
    311380   ; end of time step and different types of mistakes that could be done
     
    313382
    314383   if ( .not. isvar("end_time_step") ) then             
    315       end_time_step = nt-1
    316       if (parameter(15) .NE. "nt") then
    317          if (parameter(15) .LE. "0")
    318             print(" ")
    319             print("'end_time_step' = "+parameter(15)+ " is too small; 'end_time_step' should be at least 1 ")
     384      end_time_step = t_all(nt-1)/3600
     385      if (parameter(15) .NE. "t(end)") then
     386         if (stringtodouble(parameter(15)) .LT. t_all(0)/3600)
     387            print(" ")
     388            print("'end_time_step' = "+parameter(15)+ "h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
     389            print(" ")
     390            print("Please select another 'end_time_step'")
    320391            print(" ")
    321392            exit
    322393         end if
    323          if (stringtointeger(parameter(15)) .GT. nt)
    324             print(" ")
    325             print("'end_time_step' = "+ parameter(15) +" is greater than available time steps = " + (nt))
     394         if (stringtodouble(parameter(15)) .GT. t_all(nt-1)/3600)
     395            print(" ")
     396            print("'end_time_step' = "+ parameter(15) +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h")
     397            print(" ")
     398            print("Please select another 'end_time_step'") 
    326399            print(" ")
    327400            exit
    328401         end if
    329          if (stringtointeger(parameter(15)) .LT. stringtointeger(parameter(13)) )
    330             print(" ")
    331             print("'end_time_step' = "+ parameter(15) +" is lower than 'start_time_step' = "+parameter(15))
     402         if (stringtodouble(parameter(15)) .LT. start_time_step/3600)
     403            print(" ")
     404            print("'end_time_step' = "+ parameter(15) +"h is lower than 'start_time_step' = "+parameter(13)+"h")
     405            print(" ")
     406            print("Please select another 'start_time_step' or 'end_time_step'")
    332407            print(" ")
    333408            exit
    334409         end if
    335          end_time_step = stringtointeger(parameter(15))-1 
     410         end_time_step = stringtodouble(parameter(15))
    336411      end if   
    337412   else
    338       if (end_time_step .LE. 0)
    339          print(" ")
    340          print("'end_time_step' = "+end_time_step+ " is too small; 'end_time_step' should be at least 1 ")
     413      if (end_time_step .LT. t_all(0)/3600)
     414         print(" ")
     415         print("'end_time_step' = "+end_time_step+ "h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
     416         print(" ")
     417         print("Please select another 'end_time_step'")
    341418         print(" ")
    342419         exit
    343420      end if
    344       if (end_time_step .GT. nt)
    345          print(" ")
    346          print("'end_time_step' = "+ end_time_step +" is greater than available time steps = "+(nt))
    347          print(" ")
     421      if (end_time_step .GT. t_all(nt-1)/3600)
     422         print(" ")
     423         print("'end_time_step' = "+ end_time_step +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h")
     424         print(" ")
     425         print("Please select another 'end_time_step'") 
     426         print(" ")
    348427         exit
    349428      end if
    350       if (end_time_step .LT. start_time_step)
    351          print(" ")
    352          print("'end_time_step' = "+end_time_step +" is lower than 'start_time_step' = "+start_time_step)
     429      if (end_time_step .LT. start_time_step/3600)
     430         print(" ")
     431         print("'end_time_step' = "+ end_time_step +"h is lower than 'start_time_step' = "+start_time_step+"h")
     432         print(" ")
     433         print("Please select another 'start_time_step' or 'end_time_step'")
    353434         print(" ")
    354435         exit
    355436      end if
    356       end_time_step = end_time_step-1
    357    end if
    358 
     437   end if
     438   end_time_step = end_time_step*3600
     439   do i=0,nt-1     
     440      if (end_time_step .GE. t_all(i)-delta_t/2 .AND. end_time_step .LT. t_all(i)+delta_t/2)then
     441         et=i
     442         break
     443      end if
     444   end do
     445 
     446   delete(start_time_step)
     447   start_time_step=round(st,3)
     448   delete(end_time_step)
     449   end_time_step=round(et,3)
     450
     451   print(" ")
     452   print("Output from "+t_all(start_time_step)/3600+"h = "+t_all(start_time_step)+"s => index = "+start_time_step)
     453   print("       till "+t_all(end_time_step)/3600+"h = "+t_all(end_time_step)+"s => index = "+end_time_step)
     454   print(" ")
     455 
    359456   no_time=(end_time_step-start_time_step)+1
    360457
     
    365462   if (vector .EQ. 1) then
    366463      if ( .not. isvar("plotvec") ) then
    367          plotvec = parameter(69)
     464         plotvec = parameter(45)
    368465      end if
    369466      if ( .not. isvar("vec1") ) then
    370          vec1 = parameter(65)
    371          if (parameter(65) .EQ. "vec1") then
     467         vec1 = parameter(41)
     468         if (parameter(41) .EQ. "vec1") then
    372469            print(" ")
    373470            print("Please indicate Vector 1 ('vec1') for Vector-Plot")
     
    377474      end if
    378475      if ( .not. isvar("vec2") ) then
    379          vec2 = parameter(67)
    380          if (parameter(67) .EQ. "vec2") then
     476         vec2 = parameter(43)
     477         if (parameter(43) .EQ. "vec2") then
    381478            print(" ")
    382479            print("Please indicate Vector 2 ('vec2') for Vector-Plot")
     
    395492   ; ****************************************************
    396493
    397    do varn=dim-1,0,1 
    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
    400          check = False
     494   if (xyc .EQ. 1) then
     495      do varn=0,dim-1
     496         if (vNam(varn) .eq. "xu"  .OR. vNam(varn) .eq. "x")then   
     497            x_d     = f->$vNam(varn)$
     498            xdim    = dimsizes(x_d)-1
     499            delta_x = x_d(1)-x_d(0)
     500            break
     501         end if
     502      end do
     503      do varn=0,dim-1
     504         if (vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "y")then   
     505            y_d     = f->$vNam(varn)$
     506            ydim    = dimsizes(y_d)-1
     507            delta_y = y_d(1)-y_d(0)
     508            break
     509         end if
     510      end do
     511      do varn=0,dim-1
     512         if (vNam(varn) .eq. "zu_3d" .OR. vNam(varn) .eq. "zw_3d")then
     513            z_d     = f->$vNam(varn)$
     514            zdim    = dimsizes(z_d)-1
     515            delta_z = 0
     516            break
     517         else
     518            if (vNam(varn) .eq. "zu_xy" .OR. vNam(varn) .eq. "zw_xy") then
     519               z_d     = f->$vNam(varn)$
     520               zdim    = dimsizes(z_d)-1
     521               delta_z = -1.d
     522               break
     523            else
     524               zdim    = 0
     525               delta_z = -1.d
     526            end if
     527         end if
     528      end do
     529   end if
     530   if (xzc .EQ. 1) then
     531      do varn=0,dim-1
     532         if (vNam(varn) .eq. "xu"  .OR. vNam(varn) .eq. "x") then
     533            x_d     = f->$vNam(varn)$
     534            xdim    = dimsizes(x_d)-1
     535            delta_x = x_d(1)-x_d(0)
     536            break
     537         end if
     538      end do
     539      do varn=0,dim-1   
     540         if (vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "zu" .OR. vNam(varn) .eq. "zu_3d" .or. vNam(varn) .eq. "zw_3d") then
     541            z_d     = f->$vNam(varn)$
     542            zdim    = dimsizes(z_d)-1
     543            delta_z = z_d(1)-z_d(0)
     544            break
     545         end if
     546      end do
     547      do varn=0,dim-1
     548         if (vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "y") then
     549            y_d     = f->$vNam(varn)$
     550            ydim    = dimsizes(y_d)-1
     551            delta_y = y_d(1)-y_d(0)
     552            break
     553         else
     554            if (vNam(varn) .eq. "y_xz" .or. vNam(varn) .eq. "yv_xz") then
     555               y_d     = f->$vNam(varn)$
     556               ydim    = dimsizes(y_d)-1
     557               delta_y = -1.d
     558               break
     559            else
     560               ydim    = 0
     561               delta_y = -1.d
     562            end if
     563         end if
     564      end do
     565   end if
     566   if (yzc .EQ. 1) then
     567      do varn=0,dim-1 
     568         if (vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "y") then
     569            y_d     = f->$vNam(varn)$
     570            ydim    = dimsizes(y_d)-1
     571            delta_y = y_d(1)-y_d(0)
     572            break
     573         end if
     574      end do
     575      do varn=0,dim-1
     576         if (vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "zu" .OR. vNam(varn) .eq. "zu_3d" .or. vNam(varn) .eq. "zw_3d") then
     577            z_d     = f->$vNam(varn)$
     578            zdim    = dimsizes(z_d)-1
     579            delta_z = z_d(1)-z_d(0)
     580            break
     581         end if
     582      end do
     583      do varn=0,dim-1
     584         if (vNam(varn) .eq. "xu" .or. vNam(varn) .eq. "x")
     585            x_d     = f->$vNam(varn)$
     586            xdim    = dimsizes(x_d)-1
     587            delta_x = x_d(1)-x_d(0)
     588            break
     589         else
     590            if (vNam(varn) .eq. "xu_yz" .or. vNam(varn) .eq. "x_yz" ) then
     591               x_d     = f->$vNam(varn)$
     592               xdim    = dimsizes(x_d)-1
     593               delta_x = -1.d
     594               break
     595            else
     596               xdim    = 0
     597               delta_x = -1.d
     598            end if
     599         end if
     600      end do
     601   end if
     602   
     603   ; ****************************************************
     604   ; set up ranges of x-, y- and z-coordinates
     605   ; ****************************************************         
     606                   
     607   if ( .not. isvar("xs") ) then               
     608      xs     = 0.0d
     609      xstart = 0
     610      if (parameter(63) .NE. "x0") then
     611         if (delta_x .EQ. -1) then
     612            print(" ")
     613            print("You cannot choose a start value for x, there are preseted layers for x")
     614            print(" ")
     615            xstart=0
     616         else
     617            if (stringtodouble(parameter(63)) .LT. 0-delta_x/2) then
     618               print(" ")
     619               print("range start for x-coordinate = "+parameter(63)+"m is lower than first value x = "+0+"m or xu = "+(0-delta_x/2)+"m")
     620               print(" ")
     621               exit
     622            end if
     623            if (xyc .EQ. 1 .OR. xzc .EQ. 1) then
     624               if (stringtodouble(parameter(63)) .GE. xdim*delta_x) then
     625                  print(" ")
     626                  print("range start for x-coordinate = "+parameter(63)+"m is equal or greater than last value = "+xdim*delta_x+"m")
     627                  print(" ")
     628                  exit
     629               end if
     630            else
     631               if (stringtodouble(parameter(63)) .GT. xdim*delta_x) then
     632                  print(" ")
     633                  print("range start for x-coordinate = "+parameter(63)+"m is greater than last value = "+xdim*delta_x+"m")
     634                  print(" ")
     635                  exit
     636               end if
     637            end if
     638            xs = stringtodouble(parameter(63))
     639         end if
     640      end if
     641   else
     642      if (delta_x .EQ. -1) then
     643         print(" ")
     644         print("You cannot choose a start value for x, there are preseted layers for x")
     645         print(" ")
     646         xstart=0
    401647      else
    402          check = True
    403       end if   
    404       if (  isvar("var") ) then 
    405          check = isStrSubset( var,","+vNam(varn)+",")
    406       end if
    407       if (parameter(21) .NE. "variables") then
    408          var = parameter(21)
    409          check = isStrSubset( var,","+vNam(varn)+"," )
    410       end if   
    411 
    412       if(check) then
    413          print(vNam(varn))
    414          data_all = f->$vNam(varn)$
    415 
    416          ; ****************************************************
    417          ; set up ranges of x-, y- and z-coordinates
    418          ; ****************************************************         
    419                    
    420          xdim = dimsizes(data_all(0,0,0,:)) - 1   
    421          ydim = dimsizes(data_all(0,0,:,0)) - 1       
    422          zdim = dimsizes(data_all(0,:,0,0)) - 1 
    423        
    424          if ( .not. isvar("xe")) then     ; output x-coordinate range end (in index)
    425             xe = xdim
    426             if (parameter(53) .NE. "xdim") then
    427                if (stringtointeger(parameter(53)) .GT. xdim) then
    428                   print(" ")
    429                   print("range end for x-coordinate = "+parameter(53)+" is higher than available dimensions = "+xdim)
    430                   print(" ")
     648         if (xs .LT. 0-delta_x/2) then
     649            print(" ")
     650            print("range start for x-coordinate = "+xs+"m is lower than first value = "+(0-delta_x/2)+"m")
     651            print(" ")
     652            exit
     653         end if
     654         if (xyc .EQ. 1 .OR. xzc .EQ. 1) then
     655            if (xs .GE. xdim*delta_x) then
     656               print(" ")
     657               print("range start for x-coordinate = "+xs+"m is equal or greater than last value = "+xdim*delta_x+"m")
     658               print(" ")
     659               exit
     660            end if
     661         else
     662            if (xs .GT. xdim*delta_x) then
     663               print(" ")
     664               print("range start for x-coordinate = "+xs+"m is greater than last value = "+xdim*delta_x+"m")
     665               print(" ")
     666               exit
     667            end if
     668         end if
     669      end if
     670   end if
     671
     672   if ( .not. isvar("ys") ) then   
     673      ys = 0.0d
     674      ystart = 0
     675      if (parameter(67) .NE. "y0") then
     676         if (delta_y .EQ. -1) then
     677            print(" ")
     678            print("You cannot choose a start value for y, there are preseted layers for y")
     679            print(" ")
     680            ystart=0
     681         else
     682            if (stringtodouble(parameter(67)) .LT. 0-delta_y/2) then
     683               print(" ")
     684               print("range start for y-coordinate = "+parameter(67)+"m is lower than first value = "+0-delta_y/2+"m")
     685               print(" ")
     686               exit
     687            end if
     688            if (xyc .EQ. 1 .OR. yzc .EQ. 1) then
     689               if (stringtodouble(parameter(67)) .GE. ydim*delta_y) then
     690                  print(" ")
     691                  print("range start for y-coordinate = "+parameter(67)+"m is equal or greater than last value = "+ydim*delta_y+"m")
     692                  print(" ")
    431693                  exit
    432694               end if
    433                if (stringtointeger(parameter(53)) .LT. 0 .OR. stringtointeger(parameter(53)) .LT. xs) then
    434                   print(" ")
    435                   print("range end for x-coordinate = "+parameter(53)+" is too small")
     695            else
     696               if (stringtodouble(parameter(67)) .GT. ydim*delta_y) then
     697                  print(" ")
     698                  print("range start for y-coordinate = "+parameter(67)+"m is greater than last value = "+ydim*delta_y+"m")
    436699                  print(" ")
    437700                  exit
    438701               end if
    439                xe = stringtointeger(parameter(53))
    440             end if
    441          else
    442             if (xe .GT. xdim) then
    443                print(" ")
    444                print("range end for x-coordinate = "+xe+" is higher than available dimensions = "+xdim)
    445                print(" ")
    446                exit
    447             end if
    448             if (xe .LT. 0 .OR. xe .LT. xs) then
    449                print(" ")
    450                print("range end for x-coordinate = "+xe+" is too small")
    451                print(" ")
    452                exit
    453             end if                 
    454          end if
    455 
    456          if ( .not. isvar("ye")) then     ; output y-coordinate range end (in index)
    457             ye = ydim
    458             if (parameter(57) .NE. "ydim") then
    459                if (stringtointeger(parameter(57)) .GT. ydim) then
    460                   print(" ")
    461                   print("range end for y-coordinate = "+parameter(57)+" is higher than available dimensions = "+ydim)
     702            end if
     703            ys = stringtodouble(parameter(67))
     704         end if
     705      end if
     706   else
     707      if (delta_y .EQ. -1) then
     708         print(" ")
     709         print("You cannot choose a start value for y, there are preseted layers for y")
     710         print(" ")
     711         ystart=0
     712      else
     713         if (ys .LT. 0-delta_y/2) then
     714            print(" ")
     715            print("range start for y-coordinate = "+ys+"m is lower than first value = "+0-delta_y/2+"m")
     716            print(" ")
     717            exit
     718         end if
     719         if (xyc .EQ. 1 .OR. yzc .EQ. 1) then
     720            if (ys .GE. ydim*delta_y) then
     721               print(" ")
     722               print("range start for y-coordinate = "+ys+"m is equal or greater than last value = "+ydim*delta_y+"m")
     723               print(" ")
     724               exit
     725            end if
     726         else
     727            if (ys .GT. ydim*delta_y) then
     728               print(" ")
     729               print("range start for y-coordinate = "+ys+"m is greater than last value = "+ydim*delta_y+"m")
     730               print(" ")
     731               exit
     732            end if
     733         end if
     734      end if
     735   end if
     736 
     737   if ( .not. isvar("zs") ) then                        ; start of z-coordinate range
     738      zs = 0
     739      if (parameter(71) .NE. "z0") then
     740         if (delta_z .EQ. -1) then
     741            print(" ")
     742            print("You cannot choose a start value for z, there are preseted layers for z")
     743            print(" ")
     744         else
     745            print(" ")
     746            print("Please mind to indicate start and end ranges for the z-coordinate in")
     747            print("indices not in 'meters'. Corresponding index and meter:")
     748            print(" ")
     749            print(" = "+z_d+" m")
     750            print(" ")
     751            if (stringtointeger(parameter(71)) .LT. 0) then
     752               print(" ")
     753               print("range start for z-coordinate = "+parameter(71)+" is lower than first gridpoint = 0")
     754               print(" ")
     755               exit
     756            end if
     757            if (xzc .EQ. 1 .OR. yzc .EQ. 1) then
     758               if (stringtointeger(parameter(71)) .GE. zdim) then
     759                  print(" ")
     760                  print("range start for z-coordinate = "+parameter(71)+" is equal or greater than last gridpoint = "+zdim)
    462761                  print(" ")
    463762                  exit
    464763               end if
    465                if (stringtointeger(parameter(57)) .LT. 0 .OR. stringtointeger(parameter(57)) .LT. ys) then
    466                   print(" ")
    467                   print("range end for y-coordinate = "+parameter(57)+" is too small")
     764            else
     765               if (stringtodouble(parameter(71)) .GT. zdim) then
     766                  print(" ")
     767                  print("range start for z-coordinate = "+parameter(71)+" is greater than last gridpoint = "+zdim)
    468768                  print(" ")
    469769                  exit
    470770               end if
    471                ye = stringtointeger(parameter(57))
     771            end if
     772            zs = stringtointeger(parameter(71))
     773         end if
     774      end if
     775   else
     776      if (delta_z .EQ. -1) then
     777         print(" ")
     778         print("You cannot choose a start value for z, there are preseted layers for z")
     779         print(" ")
     780      else
     781         if (zs .LT. 0) then
     782            print(" ")
     783            print("range start for z-coordinate = "+zs+" is lower than first gridpoint = 0")
     784            print(" ")
     785            exit
     786         end if
     787         if (xzc .EQ. 1 .OR. yzc .EQ. 1) then
     788            if (zs .GE. zdim) then
     789               print(" ")
     790               print("range start for z-coordinate = "+zs+" is equal or greater than last gridpoint = "+zdim)
     791               print(" ")
     792               exit
     793            end if
     794         else
     795            if (zs .GT. zdim) then
     796               print(" ")
     797               print("range start for z-coordinate = "+zs+" is greater than last gridpoint = "+zdim)
     798               print(" ")
     799               exit
     800            end if
     801         end if
     802      end if
     803   end if 
     804
     805   if ( .not. isvar("xe")) then   
     806      xe   = xdim*delta_x
     807      xend = xdim
     808      if (parameter(65) .NE. "xdim") then
     809         if (delta_x .EQ. -1) then
     810            print(" ")
     811            print("You cannot choose an end value for x, there are preseted layers for x")
     812            print(" ")
     813            xend=xdim           
     814         else
     815            if (stringtodouble(parameter(65)) .GT. xdim*delta_x) then
     816               print(" ")
     817               print("range end for x-coordinate = "+parameter(65)+"m is greater than last value = "+xdim*delta_x+"m")
     818               print(" ")
     819               exit
    472820            end if
    473          else
    474             if (ye .GT. ydim) then
    475                print(" ")
    476                print("range end for y-coordinate = "+ye+" is higher than available dimensions = "+ydim)
    477                print(" ")
    478                exit
    479             end if
    480             if (ye .LT. 0 .OR. ye .LT. ys) then
    481                print(" ")
    482                print("range end for y-coordinate = "+ye+" is too small")
    483                print(" ")
    484                exit
    485             end if
    486          end if
    487 
    488          if ( .not. isvar("ze")) then     ; output z-coordinate range end (in index)
    489             ze = zdim
    490             if (parameter(61) .NE. "zdim") then
    491                if (stringtointeger(parameter(61)) .GT. zdim) then
    492                   print(" ")
    493                   print("range end for z-coordinate = "+parameter(61)+" is higher than available dimensions = "+zdim)
     821            if (xyc .EQ. 1 .OR. xzc .EQ. 1) then
     822               if (stringtodouble(parameter(65)) .LE. 0-delta_x/2)
     823                  print(" ")
     824                  print("range end for x-coordinate = "+parameter(65)+"m is equal or lower than first value = "+(0-delta_x/2)+"m")
    494825                  print(" ")
    495826                  exit
    496827               end if
    497                if (stringtointeger(parameter(61)) .LT. 0 .OR. stringtointeger(parameter(61)) .LT. zs) then
    498                   print(" ")
    499                   print("range end for z-coordinate = "+parameter(61)+" is too small")
     828               if (stringtodouble(parameter(65)) .LE. xs) then
     829                  print(" ")
     830                  print("range end for x-coordinate = "+parameter(65)+"m is equal or lower than start range = "+xs+"m")
    500831                  print(" ")
    501832                  exit
    502833               end if
    503                ze = stringtointeger(parameter(61))
     834            else
     835               if (stringtodouble(parameter(65)) .LT. 0-delta_x/2)
     836                  print(" ")
     837                  print("range end for x-coordinate = "+parameter(65)+"m is lower than first value = "+(0-delta_x/2)+"m")
     838                  print(" ")
     839                  exit
     840               end if
     841               if (stringtodouble(parameter(65)) .LT. xs) then
     842                  print(" ")
     843                  print("range end for x-coordinate = "+parameter(65)+"m is lower than start range = "+xs+"m")
     844                  print(" ")
     845                  exit
     846               end if
     847            end if         
     848            xe = stringtodouble(parameter(65))
     849         end if
     850      end if
     851   else
     852      if (delta_x .EQ. -1) then
     853         print(" ")
     854         print("You cannot choose an end value for x, there are preseted layers for x")
     855         print(" ")
     856         xend=xdim
     857      else
     858         if (xe .GT. xdim*delta_x) then
     859            print(" ")
     860            print("range end for x-coordinate = "+xe+"m is greater than last value = "+xdim*delta_x+"m")
     861            print(" ")
     862            exit
     863         end if
     864         if (xyc .EQ. 1 .OR. xzc .EQ. 1) then
     865            if (xe .LE. 0-delta_x/2)
     866               print(" ")
     867               print("range end for x-coordinate = "+xe+"m is equal or lower than first value = "+(0-delta_x/2)+"m")
     868               print(" ")
     869               exit
     870            end if
     871            if (xe .LE. xs) then
     872               print(" ")
     873               print("range end for x-coordinate = "+xe+"m is equal or lower than start range = "+xs+"m")
     874               print(" ")
     875               exit
     876            end if
     877            if (stringtodouble(xe .EQ. xs+1)) then
     878               print(" ")
     879               print("range end for x-coordinate = "+xe+"m must be at least two more gridpoints greater than start range = "+xs+"m")
     880               print(" ")
     881               exit
     882            end if
     883         else
     884            if (xe .LT. 0-delta_x/2)
     885               print(" ")
     886               print("range end for x-coordinate = "+xe+"m is lower than first value = "+(0-delta_x/2)+"m")
     887               print(" ")
     888               exit
     889            end if
     890            if (xe .LT. xs) then
     891               print(" ")
     892               print("range end for x-coordinate = "+xe+"m is lower than start range = "+xs+"m")
     893               print(" ")
     894               exit
     895            end if
     896         end if
     897      end if               
     898   end if
     899
     900   if ( .not. isvar("ye")) then 
     901      ye   = ydim*delta_y
     902      yend = ydim
     903      if (parameter(69) .NE. "ydim") then
     904         if (delta_y .EQ. -1) then
     905            print(" ")
     906            print("You cannot choose an end value for y, there are preseted layers for y")
     907            print(" ")
     908            yend=ydim
     909         else
     910            if (stringtodouble(parameter(69)) .GT. ydim*delta_y) then
     911               print(" ")
     912               print("range end for y-coordinate = "+parameter(69)+"m is greater than last value = "+ydim*delta_y+"m")
     913               print(" ")
     914               exit
    504915            end if
    505          else
    506             if (ze .GT. zdim) then
    507                print(" ")
    508                print("range end for z-coordinate = "+ze+" is higher than available dimensions = "+zdim)
     916            if (xyc .EQ. 1 .OR. yzc .EQ. 1) then
     917               if (stringtodouble(parameter(69)) .LE. 0-delta_y/2)
     918                  print(" ")
     919                  print("range end for y-coordinate = "+parameter(69)+"m is equal or lower than first value = "+(0-delta_y/2)+"m")
     920                  print(" ")
     921                  exit
     922               end if
     923               if (stringtodouble(parameter(69)) .LE. ys) then
     924                  print(" ")
     925                  print("range end for y-coordinate = "+parameter(69)+"m is equal or lower than start range = "+ys+"m")
     926                  print(" ")
     927                  exit
     928               end if
     929               if (stringtodouble(parameter(69)) .EQ. ys+1) then
     930                  print(" ")
     931                  print("range end for y-coordinate = "+parameter(69)+"m must be at least two more gridpoints greater than start range = "+ys+"m")
     932                  print(" ")
     933                  exit
     934               end if
     935            else
     936               if (stringtodouble(parameter(69)) .LT. 0-delta_y/2)
     937                  print(" ")
     938                  print("range end for y-coordinate = "+parameter(69)+"m is lower than first value = "+(0-delta_y/2)+"m")
     939                  print(" ")
     940                  exit
     941               end if
     942               if (stringtodouble(parameter(69)) .LT. ys) then
     943                  print(" ")
     944                  print("range end for y-coordinate = "+parameter(69)+"m is lower than start range = "+ys+"m")
     945                  print(" ")
     946                  exit
     947               end if
     948            end if         
     949            ye = stringtodouble(parameter(69))
     950         end if
     951      end if
     952   else
     953      if (delta_y .EQ. -1) then
     954         print(" ")
     955         print("You cannot choose an end value for y, there are preseted layers for y")
     956         print(" ")
     957         yend=ydim
     958      else
     959         if (ye .GT. ydim*delta_y) then
     960            print(" ")
     961            print("range end for y-coordinate = "+ye+"m is greater than last value = "+ydim*delta_y+"m")
     962            print(" ")
     963            exit
     964         end if
     965         if (xyc .EQ. 1 .OR. yzc .EQ. 1) then
     966            if (ye .LE. 0-delta_y/2)
     967               print(" ")
     968               print("range end for y-coordinate = "+ye+"m is equal or lower than first value = "+(0-delta_y/2)+"m")
     969               print(" ")
     970               exit
     971            end if
     972            if (ye .LE. ys) then
     973               print(" ")
     974               print("range end for y-coordinate = "+ye+"m is equal or lower than start range = "+ys+"m")
     975               print(" ")
     976               exit
     977            end if
     978            if (ye .EQ. ys+1) then
     979               print(" ")
     980               print("range end for y-coordinate = "+ye+"m must be at least two more gridpoints greater than start range = "+ys+"m")
     981               print(" ")
     982               exit
     983            end if
     984         else
     985            if (ye .LT. 0-delta_y/2)
     986               print(" ")
     987               print("range end for y-coordinate = "+ye+"m is lower than first value = "+(0-delta_y/2)+"m")
     988               print(" ")
     989               exit
     990            end if
     991            if (ye .LT. ys) then
     992               print(" ")
     993               print("range end for y-coordinate = "+ye+"m is lower than start range = "+ys+"m")
     994               print(" ")
     995               exit
     996            end if
     997         end if
     998      end if
     999   end if
     1000 
     1001   if ( .not. isvar("ze")) then 
     1002      ze = zdim
     1003      if (parameter(73) .NE. "zdim") then
     1004         if (delta_z .EQ. -1) then
     1005            print(" ")
     1006            print("You cannot choose an end value for z, there are preseted layers for z")
     1007            print(" ")           
     1008         else
     1009            if (stringtointeger(parameter(73)) .GT. zdim) then
     1010               print(" ")
     1011               print("range end for z-coordinate = "+parameter(73)+" is greater than last gridpoint = "+zdim)
    5091012               print(" ")
    510                exit
    511             end if
    512             if (ze .LT. 0 .OR. ze .LT. zs) then
    513                print(" ")
    514                print("range end for z-coordinate = "+ze+" is too small")
    515                print(" ")
    516                exit
    517             end if
    518          end if   
    519          delete(data_all)
    520       end if 
    521    end do
    522 
     1013               exit
     1014            end if
     1015         if (xzc .EQ. 1 .OR. yzc .EQ. 1) then
     1016            if (stringtointeger(parameter(73)) .LE. 0)
     1017               print(" ")
     1018               print("range end for z-coordinate = "+parameter(73)+" is equal or lower than first gridpoint = 0")
     1019               print(" ")
     1020               exit
     1021            end if
     1022            if (stringtointeger(parameter(73)) .LE. zs) then
     1023               print(" ")
     1024               print("range end for z-coordinate = "+parameter(73)+" is equal or lower than start range = "+zs)
     1025               print(" ")
     1026               exit
     1027            end if
     1028            if (stringtodouble(parameter(73)) .EQ. zs+1) then
     1029               print(" ")
     1030               print("range end for z-coordinate = "+parameter(73)+" must be at least two more gridpoints greater than start range = "+zs)
     1031               print(" ")
     1032               exit
     1033            end if
     1034         else
     1035            if (stringtointeger(parameter(73)) .LT. 0)
     1036               print(" ")
     1037               print("range end for z-coordinate = "+parameter(73)+" is lower than first gridpoint = 0")
     1038               print(" ")
     1039               exit
     1040            end if
     1041            if (stringtointeger(parameter(73)) .LT. zs) then
     1042               print(" ")
     1043               print("range end for z-coordinate = "+parameter(73)+" is lower than start range = "+zs)
     1044               print(" ")
     1045               exit
     1046            end if
     1047         end if         
     1048         ze = stringtointeger(parameter(73))
     1049      end if
     1050      end if
     1051   else
     1052      if (delta_z .EQ. -1) then
     1053         print(" ")
     1054         print("You cannot choose an end value for z, there are preseted layers for z")
     1055         print(" ")
     1056         ze = zdim
     1057      else
     1058         if (ze .GT. zdim) then
     1059            print(" ")
     1060            print("range end for z-coordinate = "+ze+" is greater than last gridpoint = "+zdim)
     1061            print(" ")
     1062            exit
     1063         end if
     1064         if (xzc .EQ. 1 .OR. yzc .EQ. 1) then
     1065            if (ze .LE. 0)
     1066               print(" ")
     1067               print("range end for z-coordinate = "+ze+" is equal or lower than first gridpoint = 0")
     1068               print(" ")
     1069               exit
     1070            end if
     1071            if (ze .LE. zs) then
     1072               print(" ")
     1073               print("range end for z-coordinate = "+ze+" is equal or lower than start range = "+zs)
     1074               print(" ")
     1075               exit
     1076            end if
     1077            if (ze .EQ. zs+1) then
     1078               print(" ")
     1079               print("range end for z-coordinate = "+ze+" must be at least two more gridpoints greater than start range = "+zs)
     1080               print(" ")
     1081               exit
     1082            end if
     1083         else
     1084            if (ze .LT. 0)
     1085               print(" ")
     1086               print("range end for z-coordinate = "+ze+" is lower than first gridpoint = 0")
     1087               print(" ")
     1088               exit
     1089            end if
     1090            if (ze .LT. zs) then
     1091               print(" ")
     1092               print("range end for z-coordinate = "+ze+" is lower than start range = "+zs)
     1093               print(" ")
     1094               exit
     1095            end if
     1096         end if
     1097      end if
     1098   end if
     1099
     1100   if (delta_x .NE. -1) then
     1101      do i=0,xdim   
     1102         if (xs .GT. x_d(i)-delta_x/2 .AND. xs .LE. x_d(i)+delta_x/2)then
     1103            xstart=i
     1104            break
     1105         end if
     1106      end do
     1107      do i=0,xdim   
     1108         if (xe .GT. x_d(i)-delta_x/2 .AND. xe .LE. x_d(i)+delta_x/2)then
     1109            xend=i
     1110            break
     1111         end if
     1112      end do
     1113   end if
     1114   if (delta_y .NE. -1) then
     1115      do i=0,xdim   
     1116         if (ys .GT. y_d(i)-delta_y/2 .AND. ys .LE. y_d(i)+delta_y/2)then
     1117            ystart=i
     1118            break
     1119         end if
     1120      end do
     1121      do i=0,xdim   
     1122         if (ye .GT. y_d(i)-delta_y/2 .AND. ye .LE. y_d(i)+delta_y/2)then
     1123            yend=i
     1124            break
     1125         end if
     1126      end do
     1127   end if
     1128   
     1129   delete(xs)
     1130   delete(xe)   
     1131   delete(ys)
     1132   delete(ye)
     1133
     1134   xs=xstart
     1135   xe=xend
     1136   ys=ystart
     1137   ye=yend
     1138
     1139   if (xyc .EQ. 1 .OR. xzc .EQ.1)then
     1140      if (xe .EQ. xs+1) then
     1141         print(" ")
     1142         print("range end for x-coordinate="+parameter(65)+"m(=>value on file="+xe*delta_x+"m) must be at least two")
     1143         print("more gridpoints(="+2*delta_x+"m) greater than start range="+parameter(63)+"m(=>value on file="+xs*delta_x+"m)")
     1144         print(" ")
     1145         exit
     1146      end if
     1147   end if
     1148   if (xyc .EQ. 1 .OR. yzc .EQ.1)then
     1149      if (ye .EQ. ys+1) then
     1150         print(" ")
     1151         print("range end for y-coordinate="+parameter(69)+"m(=>value on file="+ye*delta_y+"m) must be at least two")
     1152         print("more gridpoints(="+2*delta_y+"m) greater than start range="+parameter(67)+"m(=>value on file="+ys*delta_y+"m)")
     1153         print(" ")
     1154         exit
     1155      end if
     1156   end if
     1157   if (xzc .EQ. 1 .OR. yzc .EQ.1)then
     1158      if (ze .EQ. zs+1) then
     1159         print(" ")
     1160         print("range end for x-coordinate="+parameter(73)+"(=> value on file="+ze+") must be at least two")
     1161         print("more gridpoints greater than start range="+parameter(71)+"(=>value on file="+zs+")")
     1162         print(" ")
     1163         exit
     1164      end if
     1165   end if
     1166 
    5231167   if (xyc .EQ. 1) then
    5241168      no_layer = (ze-zs)+1
     1169      data = new((/dim,nt,zdim+1,(ye-ys)+1,(xe-xs)+1/),float)
    5251170   end if
    5261171   if (xzc .EQ. 1) then
    5271172      no_layer = (ye-ys)+1
     1173      data = new((/dim,nt,(ze-zs)+1,ydim+1,(xe-xs)+1/),float)
    5281174   end if
    5291175   if (yzc .EQ. 1) then
    5301176      no_layer = (xe-xs)+1
    531    end if
    532 
    533    data  = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float)
     1177      data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,xdim+1/),float)
     1178   end if
     1179
     1180   MinVal = new(dim,float)
     1181   MaxVal = new(dim,float)
    5341182
    5351183   ; ****************************************************
     
    5711219     
    5721220      data_all = f->$vNam(varn)$
    573 
     1221   
    5741222      if (vector .EQ. 1) then   
    5751223         check_vec1 = isStrSubset( vec1,","+vNam(varn)+",")
     
    5901238      end if 
    5911239
    592       if(check) then 
     1240      if(check) then
    5931241
    5941242         no_var=no_var+1
     
    6031251         end if
    6041252
    605          data(varn,:,:,:,:)=data_all(0:nt-1,zs:ze,ys:ye,xs:xe)
     1253         if (xyc .EQ. 1) then
     1254            data(varn,:,:,:,:)=data_all(:,:,ys:ye,xs:xe)
     1255         end if
     1256         if ( xzc .eq. 1 ) then
     1257            data(varn,:,:,:,:)=data_all(:,zs:ze,:,xs:xe)
     1258         end if
     1259         if ( yzc .eq. 1) then
     1260            data(varn,:,:,:,:)=data_all(:,zs:ze,ys:ye,:)
     1261         end if
     1262
    6061263         if (check_vec1) then
    6071264            vect1=data_all
     
    6151272         data!2 = "z"
    6161273         data!3 = "y"
    617          data!4 = "x"   
     1274         data!4 = "x" 
     1275
     1276         MinVal(varn) = min(data(varn,:,:,:,:))
     1277         MaxVal(varn) = max(data(varn,:,:,:,:))
    6181278
    6191279      end if
     
    6221282
    6231283   end do
    624  
    625    plot_panel=new((/no_time*no_layer*no_var/),graphic)
     1284
     1285   if (no_var .EQ. 0) then
     1286      print(" ")
     1287      print("Please select a variable 'var=' or use the default value")
     1288      print(" ")
     1289      print("Your selection '"+var+"' does not exist on the input file")
     1290      print(" ")
     1291      exit
     1292   end if
    6261293
    6271294   if (vector .EQ. 1) then
     
    6481315   gsn_define_colormap(wks_ps,"rainbow+white")
    6491316
    650    plot=new((/no_time*no_layer*no_var/),graphic)
    651 
     1317   plot=new((/no_time*no_layer*no_var*2/),graphic)
     1318 
    6521319   page = 0
    6531320   n=0
    654 
    655    print("plots sorted by '"+sort+"'")
     1321   print(" ")
     1322   print("Plots sorted by '"+sort+"'")
    6561323   print(" ")
    6571324
     
    6601327   ; ***************************************************
    6611328
     1329   if (vector .EQ. 1 .AND. parameter(45) .EQ. "plotvec") then
     1330      do lo = los, loe                                         
     1331         do li = lis, lie
     1332            level = "=" + data&z(lo) + "m"       
     1333            vecres                  = True            ; vector only resources
     1334            vecres@gsnDraw          = False           ; don't draw
     1335            vecres@gsnFrame         = False           ; don't advance frame
     1336            vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
     1337            vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
     1338            vecres@vcRefLengthF     = 0.05            ; define length of vec ref
     1339            vecres@gsnRightString   = "Vector plot of "+vec1+" and "+vec2
     1340            vecres@gsnLeftString = "t=" + data&t(li) +"s  z"+level
     1341            vecres@tiXAxisString    = " "                                               
     1342            plot(n) = gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
     1343            n=n+1
     1344         end do
     1345      end do
     1346   end if
     1347
    6621348   check = True
    663 
     1349 
    6641350   do varn=dim-1,0,1
    6651351
     
    6821368   
    6831369      if(check) then
    684    
     1370         print(vNam(varn))
     1371         space=(MaxVal(varn)-MinVal(varn))/24
     1372 
     1373         cs_res@cnMinLevelValF = MinVal(varn)
     1374         cs_res@cnMaxLevelValF = MaxVal(varn)
     1375
     1376         cs_res@cnLevelSpacingF = space
     1377     
    6851378         ; ****************************************************
    6861379         ; loops over time and layer
    6871380         ; ****************************************************
    6881381
     1382         
    6891383         do lo = los, loe                                       
    690             do li = lis, lie                           
    691                  
     1384            do li = lis, lie
     1385
    6921386               ; ****************************************************
    6931387               ; xy cross section
     
    6991393                  cs_res@tiYAxisString = "y [m]"
    7001394                  cs_res@gsnLeftString = "Plot of "+vNam(varn)
    701      
     1395                 
    7021396                  if ( sort .eq. "time" ) then
    7031397                     if ( data&z(lo) .eq. -1 ) then
     
    7061400                        level = "=" + data&z(lo) + "m"
    7071401                     end if
    708                      cs_res@gsnCenterString = "time=" + data&t(li) +"s  z"+level
     1402                     cs_res@gsnCenterString = "t=" + data&t(li) +"s  z"+level
    7091403                     plot(n) = gsn_csm_contour(wks_ps,data(varn,li,lo,:,:),cs_res)
    710                      if (vector .EQ. 1) then
    711                         if (check_vecp)
    712                            vecres                  = True            ; vector only resources
    713                            vecres@gsnDraw          = False           ; don't draw
    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
    718                            vecres@gsnRightString   = " "             ; turn off right string
    719                            vecres@gsnLeftString    = " "             ; turn off left string
    720                            vecres@tiXAxisString    = " "   
    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
     1404                     if (vector .EQ. 1 .AND. check_vecp) then
     1405                        vecres                  = True            ; vector only resources
     1406                        vecres@gsnDraw          = False           ; don't draw
     1407                        vecres@gsnFrame         = False           ; don't advance frame
     1408                        vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
     1409                        vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
     1410                        vecres@vcRefLengthF     = 0.05            ; define length of vec ref 
     1411                        vecres@gsnRightString   = " "
     1412                        vecres@gsnLeftString    = " "
     1413                        vecres@tiXAxisString    = " "   
     1414                        plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
     1415                        overlay(plot(n), plot_vec)
    7361416                     end if                         
    7371417                  end if
    738 
     1418                 
    7391419                  if ( sort .eq. "layer" ) then
    7401420                     if ( data&z(li) .eq. -1 ) then
     
    7451425                     cs_res@gsnCenterString = "t=" + data&t(lo) + "s  z"+ level
    7461426                     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
    772                         end if
     1427                     if (vector .EQ. 1 .AND. check_vecp) then
     1428                        vecres                  = True            ; vector only resources
     1429                        vecres@gsnDraw          = False           ; don't draw
     1430                        vecres@gsnFrame         = False           ; don't advance frame
     1431                        vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
     1432                        vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
     1433                        vecres@vcRefLengthF     = 0.05            ; define length of vec ref
     1434                        vecres@gsnRightString   = " "             ; turn off right string
     1435                        vecres@gsnLeftString    = " "             ; turn off left string
     1436                        vecres@tiXAxisString    = " "   
     1437                        plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres)
     1438                        overlay(plot(n), plot_vec)
    7731439                     end if
    7741440                  end if
     
    7841450                  cs_res@tiYAxisString   = "z [m]"
    7851451                  cs_res@gsnLeftString = "Plot of "+vNam(varn)
    786 
     1452               
    7871453                  if ( sort .eq. "time" ) then
    7881454                     if ( data&z(lo) .eq. -1 ) then
     
    7931459                     cs_res@gsnCenterString = "t=" + data&t(li) + "s  y"+ level
    7941460                     plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,lo,:),cs_res)
    795                      if (vector .EQ. 1) then
    796                         if (check_vecp)
    797                            vecres                  = True            ; vector only resources
    798                            vecres@gsnDraw          = False           ; don't draw
    799                            vecres@gsnFrame         = False           ; don't advance frame
    800                            vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
    801                            vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
    802                            vecres@vcRefLengthF     = 0.05            ; define length of vec ref
    803                            vecres@gsnRightString   = " "             ; turn off right string
    804                            vecres@gsnLeftString    = " "             ; turn off left string
    805                            vecres@tiXAxisString    = " "   
    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
    820                         end if
     1461                     if (vector .EQ. 1 .AND. check_vecp) then
     1462                        vecres                  = True            ; vector only resources
     1463                        vecres@gsnDraw          = False           ; don't draw
     1464                        vecres@gsnFrame         = False           ; don't advance frame
     1465                        vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
     1466                        vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
     1467                        vecres@vcRefLengthF     = 0.05            ; define length of vec ref
     1468                        vecres@gsnRightString   = " "             ; turn off right string
     1469                        vecres@gsnLeftString    = " "             ; turn off left string
     1470                        vecres@tiXAxisString    = " "   
     1471                        plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
     1472                        overlay(plot(n), plot_vec)
    8211473                     end if
    8221474                  end if
     
    8301482                     cs_res@gsnCenterString = "t=" + data&t(lo) + "s  y"+ level
    8311483                     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
    857                         end if
     1484                     if (vector .EQ. 1 .AND. check_vecp) then
     1485                        vecres                  = True            ; vector only resources
     1486                        vecres@gsnDraw          = False           ; don't draw
     1487                        vecres@gsnFrame         = False           ; don't advance frame
     1488                        vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
     1489                        vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
     1490                        vecres@vcRefLengthF     = 0.05            ; define length of vec ref
     1491                        vecres@gsnRightString   = " "             ; turn off right string
     1492                        vecres@gsnLeftString    = " "             ; turn off left string
     1493                        vecres@tiXAxisString    = " "   
     1494                        plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres)
     1495                        overlay(plot(n), plot_vec)
    8581496                     end if
    8591497                  end if                 
     
    8781516                     cs_res@gsnCenterString = "t=" + data&t(li) + "s  x"+ level
    8791517                     plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,:,lo),cs_res)
    880                      if (vector .EQ. 1) then
    881                         if (check_vecp)
    882                            vecres                  = True            ; vector only resources
    883                            vecres@gsnDraw          = False           ; don't draw
    884                            vecres@gsnFrame         = False           ; don't advance frame
    885                            vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
    886                            vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
    887                            vecres@vcRefLengthF     = 0.05            ; define length of vec ref
    888                            vecres@gsnRightString   = " "             ; turn off right string
    889                            vecres@gsnLeftString    = " "             ; turn off left string
    890                            vecres@tiXAxisString    = " "   
    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
    905                         end if
     1518                     if (vector .EQ. 1 .AND. check_vecp) then
     1519                        vecres                  = True            ; vector only resources
     1520                        vecres@gsnDraw          = False           ; don't draw
     1521                        vecres@gsnFrame         = False           ; don't advance frame
     1522                        vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
     1523                        vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
     1524                        vecres@vcRefLengthF     = 0.05            ; define length of vec ref
     1525                        vecres@gsnRightString   = " "             ; turn off right string
     1526                        vecres@gsnLeftString    = " "             ; turn off left string
     1527                        vecres@tiXAxisString    = " "   
     1528                        plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
     1529                        overlay(plot(n), plot_vec)
    9061530                     end if
    9071531                  end if
     
    9151539                     cs_res@gsnCenterString = "t=" + data&t(lo) + "s  x"+ level
    9161540                     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
    942                         end if
     1541                     if (vector .EQ. 1 .AND. check_vecp)then
     1542                        vecres                  = True            ; vector only resources
     1543                        vecres@gsnDraw          = False           ; don't draw
     1544                        vecres@gsnFrame         = False           ; don't advance frame
     1545                        vecres@vcGlyphStyle     = "CurlyVector"   ; curly vectors
     1546                        vecres@vcRefMagnitudeF  = ref_mag         ; define vector ref mag
     1547                        vecres@vcRefLengthF     = 0.05            ; define length of vec ref
     1548                        vecres@gsnRightString   = " "             ; turn off right string
     1549                        vecres@gsnLeftString    = " "             ; turn off left string
     1550                        vecres@tiXAxisString    = " "   
     1551                        plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres)
     1552                        overlay(plot(n), plot_vec)
    9431553                     end if
    9441554                  end if
     
    9471557            end do     
    9481558         end do 
    949       end if 
     1559      end if
    9501560   end do
    9511561
     
    9531563   ; merge plots onto one page
    9541564   ; ***************************************************
    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
     1565
     1566   if (vector .EQ. 1 .AND. parameter(45) .EQ. "plotvec")then
     1567      if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then
     1568         gsn_panel(wks_ps,plot(0:(no_time*no_layer*(no_var+1))-1),(/no_var+1,no_layer*no_time/),cs_resP)
     1569         print(" ")
     1570         print("Outputs to .eps or .epsi have only one frame")
     1571         print(" ")
     1572      else
     1573         do np = 0,no_layer*no_time*(no_var+1)-1,no_lines*no_columns   
     1574            if ( np + no_lines*no_columns .gt. (no_layer*no_time*(no_var+1))-1) then
     1575               gsn_panel(wks_ps, plot(np:(no_layer*no_time*(no_var+1))-1),(/no_lines,no_columns/),cs_resP)
     1576            else
     1577               gsn_panel(wks_ps, plot(np:np+no_lines*no_columns-1),(/no_lines,no_columns/),cs_resP)
     1578            end if
     1579         end do
     1580      end if
     1581   else         
     1582      if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then
     1583         gsn_panel(wks_ps,plot(0:(no_time*no_layer*no_var)-1),(/no_var,no_layer*no_time/),cs_resP)
     1584         print(" ")
     1585         print("Outputs to .eps or .epsi have only one frame")
     1586         print(" ")
     1587      else
     1588         do np = 0,no_layer*no_time*no_var-1,no_lines*no_columns   
     1589            if ( np + no_lines*no_columns .gt. (no_layer*no_time*no_var)-1) then
     1590               gsn_panel(wks_ps, plot(np:(no_layer*no_time*no_var)-1),(/no_lines,no_columns/),cs_resP)
     1591            else
     1592               gsn_panel(wks_ps, plot(np:np+no_lines*no_columns-1),(/no_lines,no_columns/),cs_resP)
     1593            end if
     1594         end do
     1595      end if
    9691596   end if
    9701597
  • palm/trunk/SCRIPTS/NCL/profiles.ncl

    r161 r162  
    107107   if ( .not. isvar("over") ) then                      ; switches overlaying plots on
    108108      over = 0
    109       if (stringtointeger(parameter(73)) .NE. 0) then
    110          over = stringtointeger(parameter(73))
    111          if (stringtointeger(parameter(73)) .NE. 1) then
     109      if (stringtointeger(parameter(37)) .NE. 0) then
     110         over = stringtointeger(parameter(37))
     111         if (stringtointeger(parameter(37)) .NE. 1) then
    112112            print(" ")
    113113            print("Please set 'over' to 0 or 1")
     
    456456      end do
    457457   end if
    458  
    459    dimz  = dimsizes(z_w)
    460    dimz  = dimsizes(z_u)
     458   if (isvar("z_u") ) then
     459      dimz  = dimsizes(z_u)
     460   else
     461      if (isvar("z_w"))then
     462         dimz  = dimsizes(z_w)
     463      end if
     464   end if
    461465   t_all = f->time
    462466   nt    = dimsizes(t_all)
     467   delta_t=t_all(nt-1)/nt
    463468 
    464469   ; ****************************************************       
     
    467472
    468473   if ( .not. isvar("start_time_step") ) then           
    469       start_time_step = 1
    470       if (parameter(13) .NE. "1") then
    471          if (parameter(13) .LE. "1")
     474      start_time_step=t_all(1)/3600
     475      if (parameter(13) .NE. "t(0)") then
     476         if (stringtodouble(parameter(13)) .GT. t_all(nt-1)/3600)
    472477            print(" ")
    473             print("Begin at least with time step 2")
     478            print("'start_time_step' = "+ parameter(13) +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h")
     479            print(" ")
     480            print("Please select another 'start_time_step'")
    474481            print(" ")
    475482            exit
    476483         end if
    477          if (stringtointeger(parameter(13)) .GE. nt)
     484         if (stringtofloat(parameter(13)) .LE. t_all(0)/3600)
    478485            print(" ")
    479             print("'start_time_step' = "+ parameter(13) +" is greater than available time steps = " + (nt-1))
     486            print("'start_time_step' = "+ parameter(13) +"h is equal or lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
     487            print(" ")
     488            print("Please start profiles at least with second time step = "+t_all(1)+"s = "+t_all(1)/3600+"h")
    480489            print(" ")
    481490            exit
    482491         end if
    483          start_time_step = stringtointeger(parameter(13))-1
     492         start_time_step=stringtodouble(parameter(13))
    484493      end if
    485494   else
    486       if (start_time_step .LE. 0)
     495      if (start_time_step .GT. t_all(nt-1)/3600)
    487496         print(" ")
    488          print("Begin at least with time step 1")
     497         print("'start_time_step' = "+ start_time_step +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h")
     498         print(" ")
     499         print("Please select another 'start_time_step'")
    489500         print(" ")
    490501         exit
    491502      end if
    492       if (start_time_step .GE. nt)
     503      if (start_time_step .LE. t_all(0)/3600)
    493504         print(" ")
    494          print("'start_time_step' = "+ start_time_step +" is greater than available time steps = " + (nt-1))
     505         print("'start_time_step' = "+ start_time_step +"h is equal or lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
     506         print(" ")
     507         print("Please start profiles at least with second time step = "+t_all(1)+"s = "+t_all(1)/3600+"h")
    495508         print(" ")
    496509         exit
    497510      end if
    498       start_time_step = start_time_step - 1
    499511   end if
    500 
     512   start_time_step = start_time_step*3600
     513   if (start_time_step .GT. t_all(0) .AND. start_time_step .LT. t_all(1)+delta_t/2)then
     514      st=1
     515   end if
     516   do i=2,nt-1     
     517      if (start_time_step .GE. t_all(i)-delta_t/2 .AND. start_time_step .LT. t_all(i)+delta_t/2)then
     518         st=i
     519         break
     520      end if
     521   end do
     522 
    501523   ; ****************************************************
    502524   ; end of time step and different types of mistakes that could be done
     
    504526
    505527   if ( .not. isvar("end_time_step") ) then             
    506       end_time_step = nt-1
    507       if (parameter(15) .NE. "nt") then
    508          if (parameter(15) .LE. "0")
    509             print(" ")
    510             print("'end_time_step' = "+parameter(15)+ " is too small; 'end_time_step' should be at least 1 ")
    511             print(" ")
    512             exit
    513          end if
    514          if (stringtointeger(parameter(15)) .GE. nt)
     528      end_time_step = t_all(nt-1)/3600
     529      if (parameter(15) .NE. "t(end)") then
     530         if (stringtodouble(parameter(15)) .GT. t_all(nt-1)/3600)
    515531            print(" ")
    516             print("'end_time_step' = "+ parameter(15) +" is greater than available time steps = " + (nt-1))
     532            print("'end_time_step' = "+ parameter(15) +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h")
     533            print(" ")
     534            print("Please select another 'end_time_step'") 
    517535            print(" ")
    518536            exit
    519537         end if
    520          if (stringtointeger(parameter(15)) .LT. stringtointeger(parameter(13)) )
     538         if (stringtodouble(parameter(15)) .LT. start_time_step/3600)
    521539            print(" ")
    522             print("'end_time_step' = "+ parameter(15) +" is lower than 'start_time_step' = "+parameter(13))
     540            print("'end_time_step' = "+ parameter(15) +"h is lower than 'start_time_step' = "+parameter(13)+"h")
     541            print(" ")
     542            print("Please select another 'start_time_step' or 'end_time_step'")
    523543            print(" ")
    524544            exit
    525545         end if
    526          end_time_step = stringtointeger(parameter(15)) 
     546         end_time_step = stringtodouble(parameter(15))
    527547      end if   
    528548   else
    529       if (end_time_step .LE. 0)
     549      if (end_time_step .GT. t_all(nt-1)/3600)
    530550         print(" ")
    531          print("'end_time_step' = "+end_time_step+ " is too small; 'end_time_step' should be at least 1 ")
     551         print("'end_time_step' = "+ end_time_step +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h")
     552         print(" ")
     553         print("Please select another 'end_time_step'") 
    532554         print(" ")
    533555         exit
    534556      end if
    535       if (end_time_step .GE. nt)
     557      if (end_time_step .LT. start_time_step/3600)
    536558         print(" ")
    537          print("'end_time_step' = "+ end_time_step +" is greater than available time steps = "+(nt-1))
     559         print("'end_time_step' = "+ end_time_step +"h is lower than 'start_time_step' = "+start_time_step+"h")
     560         print(" ")
     561         print("Please select another 'start_time_step' or 'end_time_step'")
    538562         print(" ")
    539563         exit
    540564      end if
    541       if (end_time_step .LT. start_time_step)
    542             print(" ")
    543             print("'end_time_step' = "+end_time_step +" is lower than 'start_time_step' = "+start_time_step)
    544             print(" ")
    545             exit
     565   end if
     566   end_time_step = end_time_step*3600
     567   if (end_time_step .GT. t_all(0) .AND. end_time_step .LT. t_all(1)+delta_t/2)then
     568      et=1
     569   end if
     570   do i=2,nt-1     
     571      if (end_time_step .GE. t_all(i)-delta_t/2 .AND. end_time_step .LT. t_all(i)+delta_t/2)then
     572         et=i
     573         break
    546574      end if
    547       end_time_step = end_time_step - 1
    548    end if
     575   end do
     576
     577   delete(start_time_step)
     578   start_time_step=round(st,3)
     579   delete(end_time_step)
     580   end_time_step=round(et,3)
    549581
    550582   ; ****************************************************
     
    557589   end do
    558590   
    559    np = end_time_step-start_time_step 
     591   np = end_time_step-start_time_step+1 
    560592   if ( black .eq. 0 ) then
    561593      res=True     
     
    887919 
    888920   n_o=0
     921   count_var=0
    889922   do varn = 0,dim-1
    890923       
     
    908941         com=isStrSubset(c_var,","+vNam(varn)+"," )     
    909942         if (com)                       
    910             check = False
    911943            data(varn,:,:) = temp(start_time_step:end_time_step,0:dimz-1)
    912944            unit(varn) = temp@units
     
    919951            mini(n_o)=min(data(varn,:,:))
    920952            maxi(n_o)=max(data(varn,:,:))
    921             varn=varn+1
    922953            n_o=n_o+1
    923954         end if
     
    925956
    926957      if(check) then
    927                
     958         count_var=count_var+1
     959     
    928960         z = f->$vNam(varn+1)$
    929961 
     
    935967            res@gsnRightString     = unit(varn)
    936968            res@trYMinF            = min_z
    937             res@trYMaxF            = max_z 
    938             res@trXMinF            = min(data(varn,:,:))
    939             res@trXMaxF            = max(data(varn,:,:))       
     969            res@trYMaxF            = max_z
     970            if (.not. isvar("xs")) then
     971               if (parameter(63) .NE. "x0") then
     972                  res@trXMinF = stringtofloat(parameter(63))
     973               else
     974                  res@trXMinF            = min(data(varn,:,:))
     975               end if
     976            else
     977               res@trXMinF            = xs
     978            end if
     979            if (.not. isvar("xe")) then
     980               if (parameter(65) .NE. "xdim") then
     981                  res@trXMaxF = stringtofloat(parameter(65))
     982               else
     983                  res@trXMaxF            = max(data(varn,:,:))
     984               end if
     985            else
     986               res@trXMaxF            = xe 
     987            end if                     
    940988            plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 
    941989         end if       
     
    950998                  res@gsnLeftString      = vNam(varn)
    951999                  res@gsnRightString     = unit(varn)
    952                   res@trXMinF            = miniu
    953                   res@trXMaxF            = maxiu                 
     1000                  if (.not. isvar("xs")) then
     1001                     if (parameter(63) .NE. "x0") then
     1002                        res@trXMinF = stringtofloat(parameter(63))
     1003                     else
     1004                        res@trXMinF            = miniu
     1005                     end if
     1006                  else
     1007                     res@trXMinF            = xs
     1008                  end if
     1009                  if (.not. isvar("xe")) then
     1010                     if (parameter(65) .NE. "xdim") then
     1011                        res@trXMaxF = stringtofloat(parameter(65))
     1012                     else
     1013                        res@trXMaxF            = maxiu
     1014                     end if
     1015                  else
     1016                     res@trXMaxF            = xe 
     1017                  end if               
    9541018                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res) 
    9551019               end if
     
    9641028                  res@gsnLeftString      = vNam(varn)
    9651029                  res@gsnRightString     = unit(varn)
    966                   res@trXMinF            = miniv
    967                   res@trXMaxF            = maxiv                   
     1030                  if (.not. isvar("xs")) then
     1031                     if (parameter(63) .NE. "x0") then
     1032                        res@trXMinF = stringtofloat(parameter(63))
     1033                     else
     1034                        res@trXMinF            = miniv
     1035                     end if
     1036                  else
     1037                     res@trXMinF            = xs
     1038                  end if
     1039                  if (.not. isvar("xe")) then
     1040                     if (parameter(65) .NE. "xdim") then
     1041                        res@trXMaxF = stringtofloat(parameter(65))
     1042                     else
     1043                        res@trXMaxF            = maxiv
     1044                     end if
     1045                  else
     1046                     res@trXMaxF            = xe 
     1047                  end if               
    9681048                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
    9691049               end if 
     
    9781058                  res@gsnLeftString      = vNam(varn)
    9791059                  res@gsnRightString     = unit(varn)
    980                   res@trXMinF            = miniw
    981                   res@trXMaxF            = maxiw                   
     1060                  if (.not. isvar("xs")) then
     1061                     if (parameter(63) .NE. "x0") then
     1062                        res@trXMinF = stringtofloat(parameter(63))
     1063                     else
     1064                        res@trXMinF            = miniw
     1065                     end if
     1066                  else
     1067                     res@trXMinF            = xs
     1068                  end if
     1069                  if (.not. isvar("xe")) then
     1070                     if (parameter(65) .NE. "xdim") then
     1071                        res@trXMaxF = stringtofloat(parameter(65))
     1072                     else
     1073                        res@trXMaxF            = maxiw
     1074                     end if
     1075                  else
     1076                     res@trXMaxF            = xe 
     1077                  end if           
    9821078                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    9831079               end if   
     
    9931089                  res@gsnLeftString      = vNam(varn)
    9941090                  res@gsnRightString     = unit(varn)
    995                   res@trXMinF            = minipt
    996                   res@trXMaxF            = maxipt
     1091                  if (.not. isvar("xs")) then
     1092                     if (parameter(63) .NE. "x0") then
     1093                        res@trXMinF = stringtofloat(parameter(63))
     1094                     else
     1095                        res@trXMinF            = minipt
     1096                     end if
     1097                  else
     1098                     res@trXMinF            = xs
     1099                  end if
     1100                  if (.not. isvar("xe")) then
     1101                     if (parameter(65) .NE. "xdim") then
     1102                        res@trXMaxF = stringtofloat(parameter(65))
     1103                     else
     1104                        res@trXMaxF            = maxipt
     1105                     end if
     1106                  else
     1107                     res@trXMaxF            = xe 
     1108                  end if
    9971109                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
    9981110               end if 
     
    10071119                  res@gsnLeftString      = vNam(varn)
    10081120                  res@gsnRightString     = unit(varn)
    1009                   res@trXMinF            = minivpt
    1010                   res@trXMaxF            = maxivpt
     1121                  if (.not. isvar("xs")) then
     1122                     if (parameter(63) .NE. "x0") then
     1123                        res@trXMinF = stringtofloat(parameter(63))
     1124                     else
     1125                        res@trXMinF            = minivpt
     1126                     end if
     1127                  else
     1128                     res@trXMinF            = xs
     1129                  end if
     1130                  if (.not. isvar("xe")) then
     1131                     if (parameter(65) .NE. "xdim") then
     1132                        res@trXMaxF = stringtofloat(parameter(65))
     1133                     else
     1134                        res@trXMaxF            = maxivpt
     1135                     end if
     1136                  else
     1137                     res@trXMaxF            = xe 
     1138                  end if
    10111139                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
    10121140               end if
     
    10211149                  res@gsnLeftString      = vNam(varn)
    10221150                  res@gsnRightString     = unit(varn)
    1023                   res@trXMinF            = minilpt
    1024                   res@trXMaxF            = maxilpt
     1151                  if (.not. isvar("xs")) then
     1152                     if (parameter(63) .NE. "x0") then
     1153                        res@trXMinF = stringtofloat(parameter(63))
     1154                     else
     1155                        res@trXMinF            = minilpt
     1156                     end if
     1157                  else
     1158                     res@trXMinF            = xs
     1159                  end if
     1160                  if (.not. isvar("xe")) then
     1161                     if (parameter(65) .NE. "xdim") then
     1162                        res@trXMaxF = stringtofloat(parameter(65))
     1163                     else
     1164                        res@trXMaxF            = maxilpt
     1165                     end if
     1166                  else
     1167                     res@trXMaxF            = xe 
     1168                  end if
    10251169                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
    10261170               end if
     
    10361180                  res@gsnLeftString      = vNam(varn)
    10371181                  res@gsnRightString     = unit(varn)
    1038                   res@trXMinF            = miniq
    1039                   res@trXMaxF            = maxiq
     1182                  if (.not. isvar("xs")) then
     1183                     if (parameter(63) .NE. "x0") then
     1184                        res@trXMinF = stringtofloat(parameter(63))
     1185                     else
     1186                        res@trXMinF            = minilq
     1187                     end if
     1188                  else
     1189                     res@trXMinF            = xs
     1190                  end if
     1191                  if (.not. isvar("xe")) then
     1192                     if (parameter(65) .NE. "xdim") then
     1193                        res@trXMaxF = stringtofloat(parameter(65))
     1194                     else
     1195                        res@trXMaxF            = maxilq
     1196                     end if
     1197                  else
     1198                     res@trXMaxF            = xe 
     1199                  end if
    10401200                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
    10411201               end if
     
    10501210                  res@gsnLeftString      = vNam(varn)
    10511211                  res@gsnRightString     = unit(varn)
    1052                   res@trXMinF            = miniqv
    1053                   res@trXMaxF            = maxiqv
     1212                  if (.not. isvar("xs")) then
     1213                     if (parameter(63) .NE. "x0") then
     1214                        res@trXMinF = stringtofloat(parameter(63))
     1215                     else
     1216                        res@trXMinF            = minilqv
     1217                     end if
     1218                  else
     1219                     res@trXMinF            = xs
     1220                  end if
     1221                  if (.not. isvar("xe")) then
     1222                     if (parameter(65) .NE. "xdim") then
     1223                        res@trXMaxF = stringtofloat(parameter(65))
     1224                     else
     1225                        res@trXMaxF            = maxilqv
     1226                     end if
     1227                  else
     1228                     res@trXMaxF            = xe 
     1229                  end if
    10541230                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
    10551231               end if
     
    10641240                  res@gsnLeftString      = vNam(varn)
    10651241                  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,:,:)) 
     1242                  if (.not. isvar("xs")) then
     1243                     if (parameter(63) .NE. "x0") then
     1244                        res@trXMinF = stringtofloat(parameter(63))
     1245                     else
     1246                        res@trXMinF            = miniql
     1247                     end if
     1248                  else
     1249                     res@trXMinF            = xs
     1250                  end if
     1251                  if (.not. isvar("xe")) then
     1252                     if (parameter(65) .NE. "xdim") then
     1253                        res@trXMaxF = stringtofloat(parameter(65))
     1254                     else
     1255                        res@trXMaxF            = maxiql
     1256                     end if
     1257                  else
     1258                     res@trXMaxF            = xe 
     1259                  end if
    11161260                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
    11171261               end if
     
    11271271                  res@gsnLeftString      = vNam(varn)
    11281272                  res@gsnRightString     = unit(varn)
    1129                   res@trXMinF            = minie
    1130                   res@trXMaxF            = maxie
     1273                  if (.not. isvar("xs")) then
     1274                     if (parameter(63) .NE. "x0") then
     1275                        res@trXMinF = stringtofloat(parameter(63))
     1276                     else
     1277                        res@trXMinF            = minie
     1278                     end if
     1279                  else
     1280                     res@trXMinF            = xs
     1281                  end if
     1282                  if (.not. isvar("xe")) then
     1283                     if (parameter(65) .NE. "xdim") then
     1284                        res@trXMaxF = stringtofloat(parameter(65))
     1285                     else
     1286                        res@trXMaxF            = maxie
     1287                     end if
     1288                  else
     1289                     res@trXMaxF            = xe 
     1290                  end if
    11311291                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
    11321292               end if
     
    11411301                  res@gsnLeftString      = vNam(varn)
    11421302                  res@gsnRightString     = unit(varn)
    1143                   res@trXMinF            = minies
    1144                   res@trXMaxF            = maxies
     1303                  if (.not. isvar("xs")) then
     1304                     if (parameter(63) .NE. "x0") then
     1305                        res@trXMinF = stringtofloat(parameter(63))
     1306                     else
     1307                        res@trXMinF            = minies
     1308                     end if
     1309                  else
     1310                     res@trXMinF            = xs
     1311                  end if
     1312                  if (.not. isvar("xe")) then
     1313                     if (parameter(65) .NE. "xdim") then
     1314                        res@trXMaxF = stringtofloat(parameter(65))
     1315                     else
     1316                        res@trXMaxF            = maxies
     1317                     end if
     1318                  else
     1319                     res@trXMaxF            = xe 
     1320                  end if
    11451321                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
    11461322               end if
     
    11561332                  res@gsnLeftString      = vNam(varn)
    11571333                  res@gsnRightString     = unit(varn)
    1158                   res@trXMinF            = minikm
    1159                   res@trXMaxF            = maxikm
     1334                  if (.not. isvar("xs")) then
     1335                     if (parameter(63) .NE. "x0") then
     1336                        res@trXMinF = stringtofloat(parameter(63))
     1337                     else
     1338                        res@trXMinF            = minikm
     1339                     end if
     1340                  else
     1341                     res@trXMinF            = xs
     1342                  end if
     1343                  if (.not. isvar("xe")) then
     1344                     if (parameter(65) .NE. "xdim") then
     1345                        res@trXMaxF = stringtofloat(parameter(65))
     1346                     else
     1347                        res@trXMaxF            = maxikm
     1348                     end if
     1349                  else
     1350                     res@trXMaxF            = xe 
     1351                  end if
    11601352                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
    11611353               end if
     
    11701362                  res@gsnLeftString      = vNam(varn)
    11711363                  res@gsnRightString     = unit(varn)
    1172                   res@trXMinF            = minikh
    1173                   res@trXMaxF            = maxikh
     1364                  if (.not. isvar("xs")) then
     1365                     if (parameter(63) .NE. "x0") then
     1366                        res@trXMinF = stringtofloat(parameter(63))
     1367                     else
     1368                        res@trXMinF            = minikh
     1369                     end if
     1370                  else
     1371                     res@trXMinF            = xs
     1372                  end if
     1373                  if (.not. isvar("xe")) then
     1374                     if (parameter(65) .NE. "xdim") then
     1375                        res@trXMaxF = stringtofloat(parameter(65))
     1376                     else
     1377                        res@trXMaxF            = maxikh
     1378                     end if
     1379                  else
     1380                     res@trXMaxF            = xe 
     1381                  end if
    11741382                  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)
    11911383               end if
    11921384            end if
     
    12011393                  res@gsnLeftString      = vNam(varn)
    12021394                  res@gsnRightString     = unit(varn)
    1203                   res@trXMinF            = miniwpup
    1204                   res@trXMaxF            = maxiwpup
     1395                  if (.not. isvar("xs")) then
     1396                     if (parameter(63) .NE. "x0") then
     1397                        res@trXMinF = stringtofloat(parameter(63))
     1398                     else
     1399                        res@trXMinF            = miniwpup
     1400                     end if
     1401                  else
     1402                     res@trXMinF            = xs
     1403                  end if
     1404                  if (.not. isvar("xe")) then
     1405                     if (parameter(65) .NE. "xdim") then
     1406                        res@trXMaxF = stringtofloat(parameter(65))
     1407                     else
     1408                        res@trXMaxF            = maxiwpup
     1409                     end if
     1410                  else
     1411                     res@trXMaxF            = xe 
     1412                  end if
    12051413                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    12061414               end if
     
    12151423                  res@gsnLeftString      = vNam(varn)
    12161424                  res@gsnRightString     = unit(varn)
    1217                   res@trXMinF            = miniwsus
    1218                   res@trXMaxF            = maxiwsus
     1425                  if (.not. isvar("xs")) then
     1426                     if (parameter(63) .NE. "x0") then
     1427                        res@trXMinF = stringtofloat(parameter(63))
     1428                     else
     1429                        res@trXMinF            = miniwsus
     1430                     end if
     1431                  else
     1432                     res@trXMinF            = xs
     1433                  end if
     1434                  if (.not. isvar("xe")) then
     1435                     if (parameter(65) .NE. "xdim") then
     1436                        res@trXMaxF = stringtofloat(parameter(65))
     1437                     else
     1438                        res@trXMaxF            = maxiwsus
     1439                     end if
     1440                  else
     1441                     res@trXMaxF            = xe 
     1442                  end if
    12191443                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    12201444               end if
     
    12291453                  res@gsnLeftString      = vNam(varn)
    12301454                  res@gsnRightString     = unit(varn)
    1231                   res@trXMinF            = miniwu
    1232                   res@trXMaxF            = maxiwu
     1455                  if (.not. isvar("xs")) then
     1456                     if (parameter(63) .NE. "x0") then
     1457                        res@trXMinF = stringtofloat(parameter(63))
     1458                     else
     1459                        res@trXMinF            = miniwu
     1460                     end if
     1461                  else
     1462                     res@trXMinF            = xs
     1463                  end if
     1464                  if (.not. isvar("xe")) then
     1465                     if (parameter(65) .NE. "xdim") then
     1466                        res@trXMaxF = stringtofloat(parameter(65))
     1467                     else
     1468                        res@trXMaxF            = maxiwu
     1469                     end if
     1470                  else
     1471                     res@trXMaxF            = xe 
     1472                  end if
    12331473                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    12341474               end if
     
    12441484                  res@gsnLeftString      = vNam(varn)
    12451485                  res@gsnRightString     = unit(varn)
    1246                   res@trXMinF            = miniwpvp
    1247                   res@trXMaxF            = maxiwpvp
     1486                  if (.not. isvar("xs")) then
     1487                     if (parameter(63) .NE. "x0") then
     1488                        res@trXMinF = stringtofloat(parameter(63))
     1489                     else
     1490                        res@trXMinF            = miniwpvp
     1491                     end if
     1492                  else
     1493                     res@trXMinF            = xs
     1494                  end if
     1495                  if (.not. isvar("xe")) then
     1496                     if (parameter(65) .NE. "xdim") then
     1497                        res@trXMaxF = stringtofloat(parameter(65))
     1498                     else
     1499                        res@trXMaxF            = maxiwpvp
     1500                     end if
     1501                  else
     1502                     res@trXMaxF            = xe 
     1503                  end if
    12481504                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    12491505               end if
     
    12581514                  res@gsnLeftString      = vNam(varn)
    12591515                  res@gsnRightString     = unit(varn)
    1260                   res@trXMinF            = miniwsvs
    1261                   res@trXMaxF            = maxiwsvs
     1516                  if (.not. isvar("xs")) then
     1517                     if (parameter(63) .NE. "x0") then
     1518                        res@trXMinF = stringtofloat(parameter(63))
     1519                     else
     1520                        res@trXMinF            = miniwsvs
     1521                     end if
     1522                  else
     1523                     res@trXMinF            = xs
     1524                  end if
     1525                  if (.not. isvar("xe")) then
     1526                     if (parameter(65) .NE. "xdim") then
     1527                        res@trXMaxF = stringtofloat(parameter(65))
     1528                     else
     1529                        res@trXMaxF            = maxiwsvs
     1530                     end if
     1531                  else
     1532                     res@trXMaxF            = xe 
     1533                  end if
    12621534                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    12631535               end if
     
    12721544                  res@gsnLeftString      = vNam(varn)
    12731545                  res@gsnRightString     = unit(varn)
    1274                   res@trXMinF            = miniwv
    1275                   res@trXMaxF            = maxiwv
     1546                  if (.not. isvar("xs")) then
     1547                     if (parameter(63) .NE. "x0") then
     1548                        res@trXMinF = stringtofloat(parameter(63))
     1549                     else
     1550                        res@trXMinF            = miniwv
     1551                     end if
     1552                  else
     1553                     res@trXMinF            = xs
     1554                  end if
     1555                  if (.not. isvar("xe")) then
     1556                     if (parameter(65) .NE. "xdim") then
     1557                        res@trXMaxF = stringtofloat(parameter(65))
     1558                     else
     1559                        res@trXMaxF            = maxiwv
     1560                     end if
     1561                  else
     1562                     res@trXMaxF            = xe 
     1563                  end if
    12761564                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    12771565               end if
     
    12871575                  res@gsnLeftString      = vNam(varn)
    12881576                  res@gsnRightString     = unit(varn)
    1289                   res@trXMinF            = miniwpptp
    1290                   res@trXMaxF            = maxiwpptp
     1577                  if (.not. isvar("xs")) then
     1578                     if (parameter(63) .NE. "x0") then
     1579                        res@trXMinF = stringtofloat(parameter(63))
     1580                     else
     1581                        res@trXMinF            = miniwpptp
     1582                     end if
     1583                  else
     1584                     res@trXMinF            = xs
     1585                  end if
     1586                  if (.not. isvar("xe")) then
     1587                     if (parameter(65) .NE. "xdim") then
     1588                        res@trXMaxF = stringtofloat(parameter(65))
     1589                     else
     1590                        res@trXMaxF            = maxiwpptp
     1591                     end if
     1592                  else
     1593                     res@trXMaxF            = xe 
     1594                  end if
    12911595                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    12921596               end if
     
    13011605                  res@gsnLeftString      = vNam(varn)
    13021606                  res@gsnRightString     = unit(varn)
    1303                   res@trXMinF            = miniwspts
    1304                   res@trXMaxF            = maxiwspts
     1607                  if (.not. isvar("xs")) then
     1608                     if (parameter(63) .NE. "x0") then
     1609                        res@trXMinF = stringtofloat(parameter(63))
     1610                     else
     1611                        res@trXMinF            = miniwspts
     1612                     end if
     1613                  else
     1614                     res@trXMinF            = xs
     1615                  end if
     1616                  if (.not. isvar("xe")) then
     1617                     if (parameter(65) .NE. "xdim") then
     1618                        res@trXMaxF = stringtofloat(parameter(65))
     1619                     else
     1620                        res@trXMaxF            = maxiwspts
     1621                     end if
     1622                  else
     1623                     res@trXMaxF            = xe 
     1624                  end if
    13051625                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    13061626               end if
     
    13151635                  res@gsnLeftString      = vNam(varn)
    13161636                  res@gsnRightString     = unit(varn)
    1317                   res@trXMinF            = miniwpt
    1318                   res@trXMaxF            = maxiwpt
     1637                  if (.not. isvar("xs")) then
     1638                     if (parameter(63) .NE. "x0") then
     1639                        res@trXMinF = stringtofloat(parameter(63))
     1640                     else
     1641                        res@trXMinF            = miniwpt
     1642                     end if
     1643                  else
     1644                     res@trXMinF            = xs
     1645                  end if
     1646                  if (.not. isvar("xe")) then
     1647                     if (parameter(65) .NE. "xdim") then
     1648                        res@trXMaxF = stringtofloat(parameter(65))
     1649                     else
     1650                        res@trXMaxF            = maxiwpt
     1651                     end if
     1652                  else
     1653                     res@trXMaxF            = xe 
     1654                  end if
    13191655                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    13201656               end if
     
    13301666                  res@gsnLeftString      = vNam(varn)
    13311667                  res@gsnRightString     = unit(varn)
    1332                   res@trXMinF            = miniwsptsBC
    1333                   res@trXMaxF            = maxiwsptsBC
     1668                  if (.not. isvar("xs")) then
     1669                     if (parameter(63) .NE. "x0") then
     1670                        res@trXMinF = stringtofloat(parameter(63))
     1671                     else
     1672                        res@trXMinF            = miniwsptsBC
     1673                     end if
     1674                  else
     1675                     res@trXMinF            = xs
     1676                  end if
     1677                  if (.not. isvar("xe")) then
     1678                     if (parameter(65) .NE. "xdim") then
     1679                        res@trXMaxF = stringtofloat(parameter(65))
     1680                     else
     1681                        res@trXMaxF            = maxiwsptsBC
     1682                     end if
     1683                  else
     1684                     res@trXMaxF            = xe 
     1685                  end if
    13341686                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    13351687               end if
     
    13441696                  res@gsnLeftString      = vNam(varn)
    13451697                  res@gsnRightString     = unit(varn)
    1346                   res@trXMinF            = miniwptBC
    1347                   res@trXMaxF            = maxiwptBC
     1698                  if (.not. isvar("xs")) then
     1699                     if (parameter(63) .NE. "x0") then
     1700                        res@trXMinF = stringtofloat(parameter(63))
     1701                     else
     1702                        res@trXMinF            = miniwptBC
     1703                     end if
     1704                  else
     1705                     res@trXMinF            = xs
     1706                  end if
     1707                  if (.not. isvar("xe")) then
     1708                     if (parameter(65) .NE. "xdim") then
     1709                        res@trXMaxF = stringtofloat(parameter(65))
     1710                     else
     1711                        res@trXMaxF            = maxiwptBC
     1712                     end if
     1713                  else
     1714                     res@trXMaxF            = xe 
     1715                  end if
    13481716                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    13491717               end if
     
    13591727                  res@gsnLeftString      = vNam(varn)
    13601728                  res@gsnRightString     = unit(varn)
    1361                   res@trXMinF            = miniwpvptp
    1362                   res@trXMaxF            = maxiwpvptp
     1729                  if (.not. isvar("xs")) then
     1730                     if (parameter(63) .NE. "x0") then
     1731                        res@trXMinF = stringtofloat(parameter(63))
     1732                     else
     1733                        res@trXMinF            = miniwpvptp
     1734                     end if
     1735                  else
     1736                     res@trXMinF            = xs
     1737                  end if
     1738                  if (.not. isvar("xe")) then
     1739                     if (parameter(65) .NE. "xdim") then
     1740                        res@trXMaxF = stringtofloat(parameter(65))
     1741                     else
     1742                        res@trXMaxF            = maxiwpvptp
     1743                     end if
     1744                  else
     1745                     res@trXMaxF            = xe 
     1746                  end if
    13631747                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    13641748               end if
     
    13731757                  res@gsnLeftString      = vNam(varn)
    13741758                  res@gsnRightString     = unit(varn)
    1375                   res@trXMinF            = miniwsvpts
    1376                   res@trXMaxF            = maxiwsvpts
     1759                  if (.not. isvar("xs")) then
     1760                     if (parameter(63) .NE. "x0") then
     1761                        res@trXMinF = stringtofloat(parameter(63))
     1762                     else
     1763                        res@trXMinF            = miniwsvpts
     1764                     end if
     1765                  else
     1766                     res@trXMinF            = xs
     1767                  end if
     1768                  if (.not. isvar("xe")) then
     1769                     if (parameter(65) .NE. "xdim") then
     1770                        res@trXMaxF = stringtofloat(parameter(65))
     1771                     else
     1772                        res@trXMaxF            = maxiwsvpts
     1773                     end if
     1774                  else
     1775                     res@trXMaxF            = xe 
     1776                  end if
    13771777                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    13781778               end if
     
    13871787                  res@gsnLeftString      = vNam(varn)
    13881788                  res@gsnRightString     = unit(varn)
    1389                   res@trXMinF            = miniwvpt
    1390                   res@trXMaxF            = maxiwvpt
     1789                  if (.not. isvar("xs")) then
     1790                     if (parameter(63) .NE. "x0") then
     1791                        res@trXMinF = stringtofloat(parameter(63))
     1792                     else
     1793                        res@trXMinF            = miniwvpt
     1794                     end if
     1795                  else
     1796                     res@trXMinF            = xs
     1797                  end if
     1798                  if (.not. isvar("xe")) then
     1799                     if (parameter(65) .NE. "xdim") then
     1800                        res@trXMaxF = stringtofloat(parameter(65))
     1801                     else
     1802                        res@trXMaxF            = maxiwvpt
     1803                     end if
     1804                  else
     1805                     res@trXMaxF            = xe 
     1806                  end if
    13911807                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    13921808               end if
     
    14021818                  res@gsnLeftString      = vNam(varn)
    14031819                  res@gsnRightString     = unit(varn)
    1404                   res@trXMinF            = miniwpqp
    1405                   res@trXMaxF            = maxiwpqp
     1820                  if (.not. isvar("xs")) then
     1821                     if (parameter(63) .NE. "x0") then
     1822                        res@trXMinF = stringtofloat(parameter(63))
     1823                     else
     1824                        res@trXMinF            = miniwpqp
     1825                     end if
     1826                  else
     1827                     res@trXMinF            = xs
     1828                  end if
     1829                  if (.not. isvar("xe")) then
     1830                     if (parameter(65) .NE. "xdim") then
     1831                        res@trXMaxF = stringtofloat(parameter(65))
     1832                     else
     1833                        res@trXMaxF            = maxiwpqp
     1834                     end if
     1835                  else
     1836                     res@trXMaxF            = xe 
     1837                  end if
    14061838                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    14071839               end if
     
    14161848                  res@gsnLeftString      = vNam(varn)
    14171849                  res@gsnRightString     = unit(varn)
    1418                   res@trXMinF            = miniwsqs
    1419                   res@trXMaxF            = maxiwsqs
     1850                  if (.not. isvar("xs")) then
     1851                     if (parameter(63) .NE. "x0") then
     1852                        res@trXMinF = stringtofloat(parameter(63))
     1853                     else
     1854                        res@trXMinF            = miniwsqs
     1855                     end if
     1856                  else
     1857                     res@trXMinF            = xs
     1858                  end if
     1859                  if (.not. isvar("xe")) then
     1860                     if (parameter(65) .NE. "xdim") then
     1861                        res@trXMaxF = stringtofloat(parameter(65))
     1862                     else
     1863                        res@trXMaxF            = maxiwsqs
     1864                     end if
     1865                  else
     1866                     res@trXMaxF            = xe 
     1867                  end if
    14201868                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    14211869               end if
     
    14301878                  res@gsnLeftString      = vNam(varn)
    14311879                  res@gsnRightString     = unit(varn)
    1432                   res@trXMinF            = miniwq
    1433                   res@trXMaxF            = maxiwq
     1880                  if (.not. isvar("xs")) then
     1881                     if (parameter(63) .NE. "x0") then
     1882                        res@trXMinF = stringtofloat(parameter(63))
     1883                     else
     1884                        res@trXMinF            = miniwq
     1885                     end if
     1886                  else
     1887                     res@trXMinF            = xs
     1888                  end if
     1889                  if (.not. isvar("xe")) then
     1890                     if (parameter(65) .NE. "xdim") then
     1891                        res@trXMaxF = stringtofloat(parameter(65))
     1892                     else
     1893                        res@trXMaxF            = maxiwq
     1894                     end if
     1895                  else
     1896                     res@trXMaxF            = xe 
     1897                  end if
    14341898                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    14351899               end if
     
    14451909                  res@gsnLeftString      = vNam(varn)
    14461910                  res@gsnRightString     = unit(varn)
    1447                   res@trXMinF            = miniwpqvp
    1448                   res@trXMaxF            = maxiwpqvp
     1911                  if (.not. isvar("xs")) then
     1912                     if (parameter(63) .NE. "x0") then
     1913                        res@trXMinF = stringtofloat(parameter(63))
     1914                     else
     1915                        res@trXMinF            = miniwpqvp
     1916                     end if
     1917                  else
     1918                     res@trXMinF            = xs
     1919                  end if
     1920                  if (.not. isvar("xe")) then
     1921                     if (parameter(65) .NE. "xdim") then
     1922                        res@trXMaxF = stringtofloat(parameter(65))
     1923                     else
     1924                        res@trXMaxF            = maxiwpqvp
     1925                     end if
     1926                  else
     1927                     res@trXMaxF            = xe 
     1928                  end if
    14491929                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    14501930               end if
     
    14591939                  res@gsnLeftString      = vNam(varn)
    14601940                  res@gsnRightString     = unit(varn)
    1461                   res@trXMinF            = miniwsqvs
    1462                   res@trXMaxF            = maxiwsqvs
     1941                  if (.not. isvar("xs")) then
     1942                     if (parameter(63) .NE. "x0") then
     1943                        res@trXMinF = stringtofloat(parameter(63))
     1944                     else
     1945                        res@trXMinF            = miniwsqvs
     1946                     end if
     1947                  else
     1948                     res@trXMinF            = xs
     1949                  end if
     1950                  if (.not. isvar("xe")) then
     1951                     if (parameter(65) .NE. "xdim") then
     1952                        res@trXMaxF = stringtofloat(parameter(65))
     1953                     else
     1954                        res@trXMaxF            = maxiwsqvs
     1955                     end if
     1956                  else
     1957                     res@trXMaxF            = xe 
     1958                  end if
    14631959                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    14641960               end if
     
    14731969                  res@gsnLeftString      = vNam(varn)
    14741970                  res@gsnRightString     = unit(varn)
    1475                   res@trXMinF            = miniwqv
    1476                   res@trXMaxF            = maxiwqv
     1971                  if (.not. isvar("xs")) then
     1972                     if (parameter(63) .NE. "x0") then
     1973                        res@trXMinF = stringtofloat(parameter(63))
     1974                     else
     1975                        res@trXMinF            = miniwqv
     1976                     end if
     1977                  else
     1978                     res@trXMinF            = xs
     1979                  end if
     1980                  if (.not. isvar("xe")) then
     1981                     if (parameter(65) .NE. "xdim") then
     1982                        res@trXMaxF = stringtofloat(parameter(65))
     1983                     else
     1984                        res@trXMaxF            = maxiwqv
     1985                     end if
     1986                  else
     1987                     res@trXMaxF            = xe 
     1988                  end if
    14771989                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    14781990               end if
     
    14882000                  res@gsnLeftString      = vNam(varn)
    14892001                  res@gsnRightString     = unit(varn)
    1490                   res@trXMinF            = miniwpsp
    1491                   res@trXMaxF            = maxiwpsp
     2002                  if (.not. isvar("xs")) then
     2003                     if (parameter(63) .NE. "x0") then
     2004                        res@trXMinF = stringtofloat(parameter(63))
     2005                     else
     2006                        res@trXMinF            = miniwpsp
     2007                     end if
     2008                  else
     2009                     res@trXMinF            = xs
     2010                  end if
     2011                  if (.not. isvar("xe")) then
     2012                     if (parameter(65) .NE. "xdim") then
     2013                        res@trXMaxF = stringtofloat(parameter(65))
     2014                     else
     2015                        res@trXMaxF            = maxiwpsp
     2016                     end if
     2017                  else
     2018                     res@trXMaxF            = xe 
     2019                  end if
    14922020                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    14932021               end if
     
    15022030                  res@gsnLeftString      = vNam(varn)
    15032031                  res@gsnRightString     = unit(varn)
    1504                   res@trXMinF            = miniwsss
    1505                   res@trXMaxF            = maxiwsss
     2032                  if (.not. isvar("xs")) then
     2033                     if (parameter(63) .NE. "x0") then
     2034                        res@trXMinF = stringtofloat(parameter(63))
     2035                     else
     2036                        res@trXMinF            = miniwsss
     2037                     end if
     2038                  else
     2039                     res@trXMinF            = xs
     2040                  end if
     2041                  if (.not. isvar("xe")) then
     2042                     if (parameter(65) .NE. "xdim") then
     2043                        res@trXMaxF = stringtofloat(parameter(65))
     2044                     else
     2045                        res@trXMaxF            = maxiwsss
     2046                     end if
     2047                  else
     2048                     res@trXMaxF            = xe 
     2049                  end if
    15062050                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    15072051               end if
     
    15162060                  res@gsnLeftString      = vNam(varn)
    15172061                  res@gsnRightString     = unit(varn)
    1518                   res@trXMinF            = miniws
    1519                   res@trXMaxF            = maxiws
     2062                  if (.not. isvar("xs")) then
     2063                     if (parameter(63) .NE. "x0") then
     2064                        res@trXMinF = stringtofloat(parameter(63))
     2065                     else
     2066                        res@trXMinF            = miniws
     2067                     end if
     2068                  else
     2069                     res@trXMinF            = xs
     2070                  end if
     2071                  if (.not. isvar("xe")) then
     2072                     if (parameter(65) .NE. "xdim") then
     2073                        res@trXMaxF = stringtofloat(parameter(65))
     2074                     else
     2075                        res@trXMaxF            = maxiws
     2076                     end if
     2077                  else
     2078                     res@trXMaxF            = xe 
     2079                  end if
    15202080                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    15212081               end if
     
    15312091                  res@gsnLeftString      = vNam(varn)
    15322092                  res@gsnRightString     = unit(varn)
    1533                   res@trXMinF            = miniwpsap
    1534                   res@trXMaxF            = maxiwpsap
     2093                  if (.not. isvar("xs")) then
     2094                     if (parameter(63) .NE. "x0") then
     2095                        res@trXMinF = stringtofloat(parameter(63))
     2096                     else
     2097                        res@trXMinF            = miniwpsap
     2098                     end if
     2099                  else
     2100                     res@trXMinF            = xs
     2101                  end if
     2102                  if (.not. isvar("xe")) then
     2103                     if (parameter(65) .NE. "xdim") then
     2104                        res@trXMaxF = stringtofloat(parameter(65))
     2105                     else
     2106                        res@trXMaxF            = maxiwpsap
     2107                     end if
     2108                  else
     2109                     res@trXMaxF            = xe 
     2110                  end if
    15352111                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    15362112               end if
     
    15452121                  res@gsnLeftString      = vNam(varn)
    15462122                  res@gsnRightString     = unit(varn)
    1547                   res@trXMinF            = miniwssas
    1548                   res@trXMaxF            = maxiwssas
     2123                  if (.not. isvar("xs")) then
     2124                     if (parameter(63) .NE. "x0") then
     2125                        res@trXMinF = stringtofloat(parameter(63))
     2126                     else
     2127                        res@trXMinF            = miniwssas
     2128                     end if
     2129                  else
     2130                     res@trXMinF            = xs
     2131                  end if
     2132                  if (.not. isvar("xe")) then
     2133                     if (parameter(65) .NE. "xdim") then
     2134                        res@trXMaxF = stringtofloat(parameter(65))
     2135                     else
     2136                        res@trXMaxF            = maxiwssas
     2137                     end if
     2138                  else
     2139                     res@trXMaxF            = xe 
     2140                  end if
    15492141                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    15502142               end if
     
    15592151                  res@gsnLeftString      = vNam(varn)
    15602152                  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,:,:))
     2153                  if (.not. isvar("xs")) then
     2154                     if (parameter(63) .NE. "x0") then
     2155                        res@trXMinF = stringtofloat(parameter(63))
     2156                     else
     2157                        res@trXMinF            = miniwsa
     2158                     end if
     2159                  else
     2160                     res@trXMinF            = xs
     2161                  end if
     2162                  if (.not. isvar("xe")) then
     2163                     if (parameter(65) .NE. "xdim") then
     2164                        res@trXMaxF = stringtofloat(parameter(65))
     2165                     else
     2166                        res@trXMaxF            = maxiwsa
     2167                     end if
     2168                  else
     2169                     res@trXMaxF            = xe 
     2170                  end if
    15792171                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    15802172               end if
     
    15902182                  res@gsnLeftString      = vNam(varn)
    15912183                  res@gsnRightString     = unit(varn)
    1592                   res@trXMinF            = minius2
    1593                   res@trXMaxF            = maxius2
     2184                  if (.not. isvar("xs")) then
     2185                     if (parameter(63) .NE. "x0") then
     2186                        res@trXMinF = stringtofloat(parameter(63))
     2187                     else
     2188                        res@trXMinF            = minius2
     2189                     end if
     2190                  else
     2191                     res@trXMinF            = xs
     2192                  end if
     2193                  if (.not. isvar("xe")) then
     2194                     if (parameter(65) .NE. "xdim") then
     2195                        res@trXMaxF = stringtofloat(parameter(65))
     2196                     else
     2197                        res@trXMaxF            = maxius2
     2198                     end if
     2199                  else
     2200                     res@trXMaxF            = xe 
     2201                  end if
    15942202                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
    15952203               end if
     
    16042212                  res@gsnLeftString      = vNam(varn)
    16052213                  res@gsnRightString     = unit(varn)
    1606                   res@trXMinF            = minivs2
    1607                   res@trXMaxF            = maxivs2
     2214                  if (.not. isvar("xs")) then
     2215                     if (parameter(63) .NE. "x0") then
     2216                        res@trXMinF = stringtofloat(parameter(63))
     2217                     else
     2218                        res@trXMinF            = minivs2
     2219                     end if
     2220                  else
     2221                     res@trXMinF            = xs
     2222                  end if
     2223                  if (.not. isvar("xe")) then
     2224                     if (parameter(65) .NE. "xdim") then
     2225                        res@trXMaxF = stringtofloat(parameter(65))
     2226                     else
     2227                        res@trXMaxF            = maxivs2
     2228                     end if
     2229                  else
     2230                     res@trXMaxF            = xe 
     2231                  end if
    16082232                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
    16092233               end if
     
    16182242                  res@gsnLeftString      = vNam(varn)
    16192243                  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
     2244                  if (.not. isvar("xs")) then
     2245                     if (parameter(63) .NE. "x0") then
     2246                        res@trXMinF = stringtofloat(parameter(63))
     2247                     else
     2248                        res@trXMinF            = miniws2
     2249                     end if
     2250                  else
     2251                     res@trXMinF            = xs
     2252                  end if
     2253                  if (.not. isvar("xe")) then
     2254                     if (parameter(65) .NE. "xdim") then
     2255                        res@trXMaxF = stringtofloat(parameter(65))
     2256                     else
     2257                        res@trXMaxF            = maxiws2
     2258                     end if
     2259                  else
     2260                     res@trXMaxF            = xe 
     2261                  end if
    17122262                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    17132263               end if
     
    17232273                  res@gsnLeftString      = vNam(varn)
    17242274                  res@gsnRightString     = unit(varn)
    1725                   res@trXMinF            = miniwsususodz
    1726                   res@trXMaxF            = maxiwsususodz
     2275                  if (.not. isvar("xs")) then
     2276                     if (parameter(63) .NE. "x0") then
     2277                        res@trXMinF = stringtofloat(parameter(63))
     2278                     else
     2279                        res@trXMinF            = miniwsususodz
     2280                     end if
     2281                  else
     2282                     res@trXMinF            = xs
     2283                  end if
     2284                  if (.not. isvar("xe")) then
     2285                     if (parameter(65) .NE. "xdim") then
     2286                        res@trXMaxF = stringtofloat(parameter(65))
     2287                     else
     2288                        res@trXMaxF            = maxiwsususodz
     2289                     end if
     2290                  else
     2291                     res@trXMaxF            = xe 
     2292                  end if
    17272293                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
    17282294               end if 
     
    17372303                  res@gsnLeftString      = vNam(varn)
    17382304                  res@gsnRightString     = unit(varn)
    1739                   res@trXMinF            = miniwspsodz
    1740                   res@trXMaxF            = maxiwspsodz
     2305                  if (.not. isvar("xs")) then
     2306                     if (parameter(63) .NE. "x0") then
     2307                        res@trXMinF = stringtofloat(parameter(63))
     2308                     else
     2309                        res@trXMinF            = miniwspsodz
     2310                     end if
     2311                  else
     2312                     res@trXMinF            = xs
     2313                  end if
     2314                  if (.not. isvar("xe")) then
     2315                     if (parameter(65) .NE. "xdim") then
     2316                        res@trXMaxF = stringtofloat(parameter(65))
     2317                     else
     2318                        res@trXMaxF            = maxiwspsodz
     2319                     end if
     2320                  else
     2321                     res@trXMaxF            = xe 
     2322                  end if
    17412323                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
    17422324               end if
     
    17512333                  res@gsnLeftString      = vNam(varn)
    17522334                  res@gsnRightString     = unit(varn)
    1753                   res@trXMinF            = miniwpeodz
    1754                   res@trXMaxF            = maxiwpeodz
     2335                  if (.not. isvar("xs")) then
     2336                     if (parameter(63) .NE. "x0") then
     2337                        res@trXMinF = stringtofloat(parameter(63))
     2338                     else
     2339                        res@trXMinF            = miniwpeodz
     2340                     end if
     2341                  else
     2342                     res@trXMinF            = xs
     2343                  end if
     2344                  if (.not. isvar("xe")) then
     2345                     if (parameter(65) .NE. "xdim") then
     2346                        res@trXMaxF = stringtofloat(parameter(65))
     2347                     else
     2348                        res@trXMaxF            = maxiwpeodz
     2349                     end if
     2350                  else
     2351                     res@trXMaxF            = xe 
     2352                  end if
    17552353                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    17562354               end if
     
    17632361      delete(temp)
    17642362   end do
    1765    
     2363
     2364   if (count_var .EQ. 0) then
     2365      print(" ")
     2366      print("Please select a variable 'var=' or use the default value")
     2367      print(" ")
     2368      print("Your selection '"+var+"' does not exist on the input file")
     2369      print(" ")
     2370      exit
     2371   end if
     2372
    17662373   if (over .EQ. 1 ) then
    17672374
     
    18362443            z = f->$vNam(varn+1)$
    18372444           
    1838             ;res@gsnLeftString      = vNam(varn)
     2445            res@gsnLeftString      = vNam(varn)
    18392446            res@gsnRightString     = unit(varn)
    18402447            res@trYMinF            = min_z
    18412448            res@trYMaxF            = max_z 
    1842             res@trXMinF            = min(data(varn,:,:))
    1843             res@trXMaxF            = max(data(varn,:,:))
     2449            if (.not. isvar("xs")) then
     2450               if (parameter(63) .NE. "x0") then
     2451                  res@trXMinF = stringtofloat(parameter(63))
     2452               else
     2453                  res@trXMinF = min(data(varn,:,:))
     2454               end if
     2455            else
     2456               res@trXMinF = xs
     2457            end if
     2458            if (.not. isvar("xe")) then
     2459               if (parameter(65) .NE. "xdim") then
     2460                  res@trXMaxF = stringtofloat(parameter(65))
     2461               else
     2462                  res@trXMaxF = max(data(varn,:,:))
     2463            end if
     2464            else
     2465               res@trXMaxF = xe 
     2466            end if
    18442467            plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 
    18452468           
     
    18482471                  res@gsnLeftString      = "u, v and w"
    18492472                  res@gsnRightString     = unit(varn)
    1850                   res@trXMinF            = min((/miniu,miniv,miniw/))
    1851                   res@trXMaxF            = max((/maxiu,maxiv,maxiw/))
     2473                  if (.not. isvar("xs")) then
     2474                     if (parameter(63) .NE. "x0") then
     2475                        res@trXMinF = stringtofloat(parameter(63))
     2476                     else
     2477                        res@trXMinF = min((/miniu,miniv,miniw/))
     2478                     end if
     2479                  else
     2480                     res@trXMinF = xs
     2481                  end if
     2482                  if (.not. isvar("xe")) then
     2483                     if (parameter(65) .NE. "xdim") then
     2484                        res@trXMaxF = stringtofloat(parameter(65))
     2485                     else
     2486                        res@trXMaxF = max((/maxiu,maxiv,maxiw/))
     2487                     end if
     2488                  else
     2489                     res@trXMaxF = xe 
     2490                  end if
    18522491                  if (vNam(varn) .EQ. "w") then
    18532492                     plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     
    18852524                  res@gsnLeftString      = "pt, vpt and lpt"
    18862525                  res@gsnRightString     = unit(varn)
    1887                   res@trXMinF            = min((/minipt,minivpt,minilpt/))
    1888                   res@trXMaxF            = max((/maxipt,maxivpt,maxilpt/))
     2526                  if (.not. isvar("xs")) then
     2527                     if (parameter(63) .NE. "x0") then
     2528                        res@trXMinF = stringtofloat(parameter(63))
     2529                     else
     2530                        res@trXMinF = min((/minipt,minivpt,minilpt/))
     2531                     end if
     2532                  else
     2533                     res@trXMinF = xs
     2534                  end if
     2535                  if (.not. isvar("xe")) then
     2536                     if (parameter(65) .NE. "xdim") then
     2537                        res@trXMaxF = stringtofloat(parameter(65))
     2538                     else
     2539                        res@trXMaxF = max((/maxipt,maxivpt,maxilpt/))
     2540                     end if
     2541                  else
     2542                     res@trXMaxF = xe 
     2543                  end if
    18892544
    18902545                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     
    19182573                  res@gsnLeftString      = "q, qv and ql"
    19192574                  res@gsnRightString     = unit(varn)
    1920                   res@trXMinF            = min((/miniq,miniqv,miniql/))
    1921                   res@trXMaxF            = max((/maxiq,maxiqv,maxiql/))
     2575                  if (.not. isvar("xs")) then
     2576                     if (parameter(63) .NE. "x0") then
     2577                        res@trXMinF = stringtofloat(parameter(63))
     2578                     else
     2579                        res@trXMinF = min((/miniq,miniqv,miniql/))
     2580                     end if
     2581                  else
     2582                     res@trXMinF = xs
     2583                  end if
     2584                  if (.not. isvar("xe")) then
     2585                     if (parameter(65) .NE. "xdim") then
     2586                        res@trXMaxF = stringtofloat(parameter(65))
     2587                     else
     2588                        res@trXMaxF = max((/maxiq,maxiqv,maxiql/))
     2589                     end if
     2590                  else
     2591                     res@trXMaxF = xe 
     2592                  end if
    19222593
    19232594                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     
    19462617                  continue   
    19472618               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
     2619            end if   
     2620           
    19582621            if (vNam(varn) .EQ. "e" .OR. vNam(varn) .EQ. "es") then
    19592622               if (e .EQ. 0) then
    19602623                  res@gsnLeftString      = "e and es"
    19612624                  res@gsnRightString     = unit(varn)
    1962                   res@trXMinF            = min((/minie,minies/))
    1963                   res@trXMaxF            = max((/maxie,maxies/))
     2625                  if (.not. isvar("xs")) then
     2626                     if (parameter(63) .NE. "x0") then
     2627                        res@trXMinF = stringtofloat(parameter(63))
     2628                     else
     2629                        res@trXMinF = min((/minie,minies/))
     2630                     end if
     2631                  else
     2632                     res@trXMinF = xs
     2633                  end if
     2634                  if (.not. isvar("xe")) then
     2635                     if (parameter(65) .NE. "xdim") then
     2636                        res@trXMaxF = stringtofloat(parameter(65))
     2637                     else
     2638                        res@trXMaxF = max((/maxie,maxies/))
     2639                     end if
     2640                  else
     2641                     res@trXMaxF = xe 
     2642                  end if
    19642643
    19652644                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     
    19932672                  res@gsnLeftString      = "km and kh"
    19942673                  res@gsnRightString     = unit(varn)
    1995                   res@trXMinF            = min((/minikm,minikh/))
    1996                   res@trXMaxF            = max((/maxikm,maxikh/))
     2674                  if (.not. isvar("xs")) then
     2675                     if (parameter(63) .NE. "x0") then
     2676                        res@trXMinF = stringtofloat(parameter(63))
     2677                     else
     2678                        res@trXMinF = min((/minikm,minikh/))
     2679                     end if
     2680                  else
     2681                     res@trXMinF = xs
     2682                  end if
     2683                  if (.not. isvar("xe")) then
     2684                     if (parameter(65) .NE. "xdim") then
     2685                        res@trXMaxF = stringtofloat(parameter(65))
     2686                     else
     2687                        res@trXMaxF = max((/maxikm,maxikh/))
     2688                     end if
     2689                  else
     2690                     res@trXMaxF = xe 
     2691                  end if
    19972692
    19982693                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     
    20222717               end if
    20232718            end if           
    2024             if (vNam(varn) .EQ. "l") then
    2025                plot(n) = plot_l
    2026             end if
     2719           
    20272720            if (vNam(varn) .EQ. "wpup" .OR. vNam(varn) .EQ. "wsus" .OR. vNam(varn) .EQ. "wu") then
    20282721               if (wpup .EQ. 0) then
    20292722                  res@gsnLeftString      = "wpup, wsus and wu"
    20302723                  res@gsnRightString     = unit(varn)
    2031                   res@trXMinF            = min((/miniwpup,miniwsus,miniwu/))
    2032                   res@trXMaxF            = max((/maxiwpup,maxiwsus,maxiwu/))
     2724                  if (.not. isvar("xs")) then
     2725                     if (parameter(63) .NE. "x0") then
     2726                        res@trXMinF = stringtofloat(parameter(63))
     2727                     else
     2728                        res@trXMinF = min((/miniwpup,miniwsus,miniwu/))
     2729                     end if
     2730                  else
     2731                     res@trXMinF = xs
     2732                  end if
     2733                  if (.not. isvar("xe")) then
     2734                     if (parameter(65) .NE. "xdim") then
     2735                        res@trXMaxF = stringtofloat(parameter(65))
     2736                     else
     2737                        res@trXMaxF = max((/maxiwpup,maxiwsus,maxiwu/))
     2738                     end if
     2739                  else
     2740                     res@trXMaxF = xe 
     2741                  end if
    20332742
    20342743                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     
    20622771                  res@gsnLeftString      = "wpvp, wsus and wv"
    20632772                  res@gsnRightString     = unit(varn)
    2064                   res@trXMinF            = min((/miniwpvp,miniwsvs,miniwv/))
    2065                   res@trXMaxF            = max((/maxiwpvp,maxiwsvs,maxiwv/))
     2773                  if (.not. isvar("xs")) then
     2774                     if (parameter(63) .NE. "x0") then
     2775                        res@trXMinF = stringtofloat(parameter(63))
     2776                     else
     2777                        res@trXMinF = min((/miniwpvp,miniwsvs,miniwv/))
     2778                     end if
     2779                  else
     2780                     res@trXMinF = xs
     2781                  end if
     2782                  if (.not. isvar("xe")) then
     2783                     if (parameter(65) .NE. "xdim") then
     2784                        res@trXMaxF = stringtofloat(parameter(65))
     2785                     else
     2786                        res@trXMaxF = max((/maxiwpvp,maxiwsvs,maxiwv/))
     2787                     end if
     2788                  else
     2789                     res@trXMaxF = xe 
     2790                  end if
    20662791
    20672792                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     
    20952820                  res@gsnLeftString      = "wpptp, wspts and wv"
    20962821                  res@gsnRightString     = unit(varn)
    2097                   res@trXMinF            = min((/miniwpptp,miniwspts,miniwpt/))
    2098                   res@trXMaxF            = max((/maxiwpptp,maxiwspts,maxiwpt/))
     2822                  if (.not. isvar("xs")) then
     2823                     if (parameter(63) .NE. "x0") then
     2824                        res@trXMinF = stringtofloat(parameter(63))
     2825                     else
     2826                        res@trXMinF = min((/miniwpptp,miniwspts,miniwpt/))
     2827                     end if
     2828                  else
     2829                     res@trXMinF = xs
     2830                  end if
     2831                  if (.not. isvar("xe")) then
     2832                     if (parameter(65) .NE. "xdim") then
     2833                        res@trXMaxF = stringtofloat(parameter(65))
     2834                     else
     2835                        res@trXMaxF = max((/maxiwpptp,maxiwspts,maxiwpt/))
     2836                     end if
     2837                  else
     2838                     res@trXMaxF = xe 
     2839                  end if
    20992840
    21002841                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     
    21282869                  res@gsnLeftString      = "wsptsBC and wptBC"
    21292870                  res@gsnRightString     = unit(varn)
    2130                   res@trXMinF            = min((/miniwsptsBC,miniwptBC/))
    2131                   res@trXMaxF            = max((/maxiwsptsBC,maxiwptBC/))
     2871                  if (.not. isvar("xs")) then
     2872                     if (parameter(63) .NE. "x0") then
     2873                        res@trXMinF = stringtofloat(parameter(63))
     2874                     else
     2875                        res@trXMinF = min((/miniwsptsBC,miniwptBC/))
     2876                     end if
     2877                  else
     2878                     res@trXMinF = xs
     2879                  end if
     2880                  if (.not. isvar("xe")) then
     2881                     if (parameter(65) .NE. "xdim") then
     2882                        res@trXMaxF = stringtofloat(parameter(65))
     2883                     else
     2884                        res@trXMaxF = max((/maxiwsptsBC,maxiwptBC/))
     2885                     end if
     2886                  else
     2887                     res@trXMaxF = xe 
     2888                  end if
    21322889
    21332890                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     
    21612918                  res@gsnLeftString      = "wpvptp, wsvpts and wv"
    21622919                  res@gsnRightString     = unit(varn)
    2163                   res@trXMinF            = min((/miniwpvptp,miniwsvpts,miniwvpt/))
    2164                   res@trXMaxF            = max((/maxiwpvptp,maxiwsvpts,maxiwvpt/))
     2920                  if (.not. isvar("xs")) then
     2921                     if (parameter(63) .NE. "x0") then
     2922                        res@trXMinF = stringtofloat(parameter(63))
     2923                     else
     2924                        res@trXMinF = min((/miniwpvptp,miniwsvpts,miniwvpt/))
     2925                     end if
     2926                  else
     2927                     res@trXMinF = xs
     2928                  end if
     2929                  if (.not. isvar("xe")) then
     2930                     if (parameter(65) .NE. "xdim") then
     2931                        res@trXMaxF = stringtofloat(parameter(65))
     2932                     else
     2933                        res@trXMaxF = max((/maxiwpvptp,maxiwsvpts,maxiwvpt/))
     2934                     end if
     2935                  else
     2936                     res@trXMaxF = xe 
     2937                  end if
    21652938
    21662939                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     
    21942967                  res@gsnLeftString      = "wpqp, wsqs and wq"
    21952968                  res@gsnRightString     = unit(varn)
    2196                   res@trXMinF            = min((/miniwpqp,miniwsqs,miniwq/))
    2197                   res@trXMaxF            = max((/maxiwpqp,maxiwsqs,maxiwq/))
     2969                  if (.not. isvar("xs")) then
     2970                     if (parameter(63) .NE. "x0") then
     2971                        res@trXMinF = stringtofloat(parameter(63))
     2972                     else
     2973                        res@trXMinF = min((/miniwpqp,miniwsqs,miniwq/))
     2974                     end if
     2975                  else
     2976                     res@trXMinF = xs
     2977                  end if
     2978                  if (.not. isvar("xe")) then
     2979                     if (parameter(65) .NE. "xdim") then
     2980                        res@trXMaxF = stringtofloat(parameter(65))
     2981                     else
     2982                        res@trXMaxF = max((/maxiwpqp,maxiwsqs,maxiwq/))
     2983                     end if
     2984                  else
     2985                     res@trXMaxF = xe 
     2986                  end if
    21982987
    21992988                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     
    22273016                  res@gsnLeftString      = "wpqvp, wsqvs and wqv"
    22283017                  res@gsnRightString     = unit(varn)
    2229                   res@trXMinF            = min((/miniwpqp,miniwsqvs,miniwqv/))
    2230                   res@trXMaxF            = max((/maxiwpqp,maxiwsqvs,maxiwqv/))
     3018                  if (.not. isvar("xs")) then
     3019                     if (parameter(63) .NE. "x0") then
     3020                        res@trXMinF = stringtofloat(parameter(63))
     3021                     else
     3022                        res@trXMinF = min((/miniwpqp,miniwsqvs,miniwqv/))
     3023                     end if
     3024                  else
     3025                     res@trXMinF = xs
     3026                  end if
     3027                  if (.not. isvar("xe")) then
     3028                     if (parameter(65) .NE. "xdim") then
     3029                        res@trXMaxF = stringtofloat(parameter(65))
     3030                     else
     3031                        res@trXMaxF = max((/maxiwpqp,maxiwsqvs,maxiwqv/))
     3032                     end if
     3033                  else
     3034                     res@trXMaxF = xe 
     3035                  end if
    22313036
    22323037                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     
    22603065                  res@gsnLeftString      = "wpsp, wsss and ws"
    22613066                  res@gsnRightString     = unit(varn)
    2262                   res@trXMinF            = min((/miniwpsp,miniwsss,miniws/))
    2263                   res@trXMaxF            = max((/maxiwpsp,maxiwsss,maxiws/))
     3067                  if (.not. isvar("xs")) then
     3068                     if (parameter(63) .NE. "x0") then
     3069                        res@trXMinF = stringtofloat(parameter(63))
     3070                     else
     3071                        res@trXMinF = min((/miniwpsp,miniwsss,miniws/))
     3072                     end if
     3073                  else
     3074                     res@trXMinF = xs
     3075                  end if
     3076                  if (.not. isvar("xe")) then
     3077                     if (parameter(65) .NE. "xdim") then
     3078                        res@trXMaxF = stringtofloat(parameter(65))
     3079                     else
     3080                        res@trXMaxF = max((/maxiwpsp,maxiwsss,maxiws/))
     3081                     end if
     3082                  else
     3083                     res@trXMaxF = xe 
     3084                  end if
    22643085
    22653086                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     
    22933114                  res@gsnLeftString      = "wpsap, wssas and wsa"
    22943115                  res@gsnRightString     = unit(varn)
    2295                   res@trXMinF            = min((/miniwpsap,miniwssas,miniwsa/))
    2296                   res@trXMaxF            = max((/maxiwpsap,maxiwssas,maxiwsa/))
     3116                  if (.not. isvar("xs")) then
     3117                     if (parameter(63) .NE. "x0") then
     3118                        res@trXMinF = stringtofloat(parameter(63))
     3119                     else
     3120                        res@trXMinF = min((/miniwpsap,miniwssas,miniwsa/))
     3121                     end if
     3122                  else
     3123                     res@trXMinF = xs
     3124                  end if
     3125                  if (.not. isvar("xe")) then
     3126                     if (parameter(65) .NE. "xdim") then
     3127                        res@trXMaxF = stringtofloat(parameter(65))
     3128                     else
     3129                        res@trXMaxF = max((/maxiwpsap,maxiwssas,maxiwsa/))
     3130                     end if
     3131                  else
     3132                     res@trXMaxF = xe 
     3133                  end if
    22973134
    22983135                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     
    23223159               end if
    23233160            end if
    2324             if (vNam(varn) .EQ. "wses") then
    2325                plot(n) = plot_wses
    2326             end if
     3161         
    23273162            if (vNam(varn) .EQ. "us2" .OR. vNam(varn) .EQ. "vs2" .OR. vNam(varn) .EQ. "ws2") then
    23283163               if (us2 .EQ. 0) then
    23293164                  res@gsnLeftString      = "us2, vs2 and ws2"
    23303165                  res@gsnRightString     = unit(varn)
    2331                   res@trXMinF            = min((/minius2,minivs2,miniws2/))
    2332                   res@trXMaxF            = max((/maxius2,maxivs2,maxiws2/))
     3166                  if (.not. isvar("xs")) then
     3167                     if (parameter(63) .NE. "x0") then
     3168                        res@trXMinF = stringtofloat(parameter(63))
     3169                     else
     3170                        res@trXMinF = min((/minius2,minivs2,miniws2/))
     3171                     end if
     3172                  else
     3173                     res@trXMinF = xs
     3174                  end if
     3175                  if (.not. isvar("xe")) then
     3176                     if (parameter(65) .NE. "xdim") then
     3177                        res@trXMaxF = stringtofloat(parameter(65))
     3178                     else
     3179                        res@trXMaxF = max((/maxius2,maxivs2,maxiws2/))
     3180                     end if
     3181                  else
     3182                     res@trXMaxF = xe 
     3183                  end if
    23333184
    23343185                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     
    23583209               end if
    23593210            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
     3211           
    23753212            if (vNam(varn) .EQ. "wsususodz" .OR. vNam(varn) .EQ. "wspsodz" .OR. vNam(varn) .EQ. "wpeodz" ) then
    23763213               if (wsususodz .EQ. 0) then
    23773214                  res@gsnLeftString      = "wsususodz, wspsodz and ws2"
    23783215                  res@gsnRightString     = unit(varn)
    2379                   res@trXMinF            = min((/miniwsususodz,miniwspsodz,miniwpeodz/))
    2380                   res@trXMaxF            = max((/maxiwsususodz,maxiwspsodz,maxiwpeodz/))
     3216                  if (.not. isvar("xs")) then
     3217                     if (parameter(63) .NE. "x0") then
     3218                        res@trXMinF = stringtofloat(parameter(63))
     3219                     else
     3220                        res@trXMinF = min((/miniwsususodz,miniwspsodz,miniwpeodz/))
     3221                     end if
     3222                  else
     3223                     res@trXMinF = xs
     3224                  end if
     3225                  if (.not. isvar("xe")) then
     3226                     if (parameter(65) .NE. "xdim") then
     3227                        res@trXMaxF = stringtofloat(parameter(65))
     3228                     else
     3229                        res@trXMaxF = max((/maxiwsususodz,maxiwspsodz,maxiwpeodz/))
     3230                     end if
     3231                  else
     3232                     res@trXMaxF = xe 
     3233                  end if
    23813234
    23823235                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     
    24493302                     res@gsnLeftString  = c_var
    24503303                     res@gsnRightString = unit(varn)
    2451                      res@trXMinF        = min(mini)
    2452                      res@trXMaxF        = max(maxi)
     3304                     if (.not. isvar("xs")) then
     3305                        if (parameter(63) .NE. "x0") then
     3306                           res@trXMinF = stringtofloat(parameter(63))
     3307                        else
     3308                           res@trXMinF = min(mini)
     3309                        end if
     3310                     else
     3311                        res@trXMinF = xs
     3312                     end if
     3313                     if (.not. isvar("xe")) then
     3314                        if (parameter(65) .NE. "xdim") then
     3315                           res@trXMaxF = stringtofloat(parameter(65))
     3316                        else
     3317                           res@trXMaxF = max(maxi)
     3318                        end if
     3319                     else
     3320                        res@trXMaxF = xe 
     3321                     end if
    24533322                  end if
    24543323               end if
     
    24963365   ; merge plots onto one page
    24973366   ; ***************************************************
    2498  print(n)
     3367
    24993368   do m=0,n-1
    25003369      plot_(m)=plot(n-1-m)
  • palm/trunk/SCRIPTS/NCL/timeseries.ncl

    r161 r162  
    6363   if ( .not. isvar("over") ) then                      ; switches overlaying plots on
    6464      over = 0
    65       if (stringtointeger(parameter(73)) .NE. 0) then
    66          over = stringtointeger(parameter(73))
    67          if (stringtointeger(parameter(73)) .NE. 1) then
     65      if (stringtointeger(parameter(37)) .NE. 0) then
     66         over = stringtointeger(parameter(37))
     67         if (stringtointeger(parameter(37)) .NE. 1) then
    6868            print(" ")
    6969            print("Please set 'over' to 0 or 1")
     
    9393   t_all = f->time
    9494   nt  = dimsizes(t_all)
     95   delta_t=t_all(nt-1)/nt
    9596
    9697   ; ****************************************************       
     
    99100
    100101   if ( .not. isvar("start_time_step") ) then           
    101       start_time_step = 0
    102       if (parameter(13) .NE. "1") then
    103          if (parameter(13) .LE. "0")
    104             print(" ")
    105             print("Begin with time step 1")
     102      start_time_step=t_all(0)/3600
     103      if (parameter(13) .NE. "t(0)") then
     104         if (stringtodouble(parameter(13)) .GE. t_all(nt-1)/3600)
     105            print(" ")
     106            print("'start_time_step' = "+ parameter(13) +"h is equal or greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h")
     107            print(" ")
     108            print("Please select another 'start_time_step'")
    106109            print(" ")
    107110            exit
    108111         end if
    109          if (stringtointeger(parameter(13)) .GE. nt)
    110             print(" ")
    111             print("'start_time_step' = "+ parameter(13) +" is greater than available time steps = " + (nt-1))
     112         if (stringtofloat(parameter(13)) .LT. t_all(0)/3600)
     113            print(" ")
     114            print("'start_time_step' = "+ parameter(13) +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
     115            print(" ")
     116            print("Please select another 'start_time_step'")
    112117            print(" ")
    113118            exit
    114119         end if
    115          start_time_step = stringtointeger(parameter(13))-1
     120         start_time_step=stringtodouble(parameter(13))
    116121      end if
    117122   else
    118       if (start_time_step .LE. 0)
    119          print(" ")
    120          print("Begin with time step 1")
     123      if (start_time_step .GE. t_all(nt-1)/3600)
     124         print(" ")
     125         print("'start_time_step' = "+ start_time_step +"h is equal or greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h")
     126         print(" ")
     127         print("Please select another 'start_time_step'")
    121128         print(" ")
    122129         exit
    123130      end if
    124       if (start_time_step .GE. nt)
    125          print(" ")
    126          print("'start_time_step' = "+ start_time_step +" is greater than available time steps = " + (nt-1))
     131      if (start_time_step .LT. t_all(0)/3600)
     132         print(" ")
     133         print("'start_time_step' = "+ start_time_step +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
     134         print(" ")
     135         print("Please select another 'start_time_step'")
    127136         print(" ")
    128137         exit
    129138      end if
    130       start_time_step = start_time_step - 1
    131139   end if
    132 
     140   start_time_step = start_time_step*3600
     141   do i=0,nt-2     
     142      if (start_time_step .GE. t_all(i)-delta_t/2 .AND. start_time_step .LT. t_all(i)+delta_t/2)then
     143         st=i
     144         break
     145      end if
     146   end do
     147   if (start_time_step .GE. t_all(nt-1)-delta_t/2 .AND. start_time_step .LT. t_all(nt-1)) then
     148      st=nt-2   
     149   end if
     150     
    133151   ; ****************************************************
    134152   ; end of time step and different types of mistakes that could be done
     
    136154
    137155   if ( .not. isvar("end_time_step") ) then             
    138       end_time_step = nt-1
    139       if (parameter(15) .NE. "nt") then
    140          if (parameter(15) .LE. "0")
    141             print(" ")
    142             print("'end_time_step' = "+parameter(15)+ " is too small; 'end_time_step' should be at least 1 ")
     156      end_time_step = t_all(nt-1)/3600
     157      if (parameter(15) .NE. "t(end)") then
     158         if (stringtodouble(parameter(15)) .LE. t_all(0)/3600)
     159            print(" ")
     160            print("'end_time_step' = "+parameter(15)+ "h is lower or equal than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
     161            print(" ")
     162            print("Please select another 'end_time_step'")
    143163            print(" ")
    144164            exit
    145165         end if
    146          if (stringtointeger(parameter(15)) .GE. nt)
    147             print(" ")
    148             print("'end_time_step' = "+ parameter(15) +" is greater than available time steps = " + (nt-1)) 
     166         if (stringtodouble(parameter(15)) .GT. t_all(nt-1)/3600)
     167            print(" ")
     168            print("'end_time_step' = "+ parameter(15) +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h")
     169            print(" ")
     170            print("Please select another 'end_time_step'") 
    149171            print(" ")
    150172            exit
    151173         end if
    152          if (stringtointeger(parameter(15)) .LT. stringtointeger(parameter(13)) )
    153             print(" ")
    154             print("'end_time_step' = "+ parameter(15) +" is lower than 'start_time_step' = "+parameter(13))
     174         if (stringtodouble(parameter(15)) .LE. start_time_step/3600)
     175            print(" ")
     176            print("'end_time_step' = "+ parameter(15) +"h is equal or lower than 'start_time_step' = "+parameter(13)+"h")
     177            print(" ")
     178            print("Please select another 'start_time_step' or 'end_time_step'")
    155179            print(" ")
    156180            exit
    157181         end if
    158          end_time_step = stringtointeger(parameter(15))-1
     182         end_time_step = stringtodouble(parameter(15))
    159183      end if   
    160184   else
    161       if (end_time_step .LE. 0)
    162          print(" ")
    163          print("'end_time_step' = "+end_time_step+ " is too small; 'end_time_step' should be at least 1 ")
     185      if (end_time_step .LE. t_all(0)/3600)
     186         print(" ")
     187         print("'end_time_step' = "+end_time_step+ "h is lower or equal than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
     188         print(" ")
     189         print("Please select another 'end_time_step'")
    164190         print(" ")
    165191         exit
    166192      end if
    167       if (end_time_step .GE. nt)
    168          print(" ")
    169          print("'end_time_step' = "+ end_time_step +" is greater than available time steps = "+(nt-1))
     193      if (end_time_step .GT. t_all(nt-1)/3600)
     194         print(" ")
     195         print("'end_time_step' = "+ end_time_step +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h")
     196         print(" ")
     197         print("Please select another 'end_time_step'") 
    170198         print(" ")
    171199         exit
    172200      end if
    173       if (end_time_step .LT. start_time_step)
    174          print(" ")
    175          print("'end_time_step' = "+end_time_step +" is lower than 'start_time_step' = "+start_time_step)
     201      if (end_time_step .LE. start_time_step/3600)
     202         print(" ")
     203         print("'end_time_step' = "+ end_time_step +"h is equal or lower than 'start_time_step' = "+start_time_step+"h")
     204         print(" ")
     205         print("Please select another 'start_time_step' or 'end_time_step'")
    176206         print(" ")
    177207         exit
    178208      end if
    179       end_time_step = end_time_step - 1
    180    end if 
     209   end if
     210   end_time_step = end_time_step*3600
     211   do i=0,nt-1     
     212      if (end_time_step .GE. t_all(i)-delta_t/2 .AND. end_time_step .LT. t_all(i)+delta_t/2)then
     213         et=i
     214         break
     215      end if
     216   end do
     217 
     218   delete(start_time_step)
     219   start_time_step=round(st,3)
     220   delete(end_time_step)
     221   end_time_step=round(et,3)
    181222
    182223   t = f->time(start_time_step:end_time_step)
     
    266307      plot_splptz  = gsn_csm_xy(wks_ps,t,data_0(:),res)
    267308   end if
    268  
     309
     310   count_var=0
    269311   do varn = dim-1,0,1
    270312
     
    284326     
    285327      if(check) then
    286        
     328         count_var=count_var+1
     329
    287330         data_all = f ->$vNam(varn)$
    288331         unit(varn) = data_all@units
     
    432475   end do
    433476
     477   if (count_var .EQ. 0) then
     478      print(" ")
     479      print("Please select a variable 'var=' or use the default value")
     480      print(" ")
     481      print("Your selection '"+var+"' does not exist on the input file")
     482      print(" ")
     483      exit
     484   end if
     485
    434486   do varn = dim-1,0,1
    435487     
     
    457509            res@tiXAxisFontHeightF   = 0.07
    458510            res@txFontHeightF        = 0.07
    459             res@tiYAxisFontHeightF   = 0.07
    460             res@xyLabelMode          = "Custom"
    461            
     511            res@tiYAxisFontHeightF   = 0.07           
    462512
    463513            if (vNam(varn) .EQ. "E")
    464514               E=0
    465515               res@xyLineColors     = (/237/)
    466                res@xyExplicitLabels =  "E"
    467516               res@xyLineLabelFontHeightF = 0.05
    468517               res@xyLineLabelFontColor   = 237
     
    474523               Es=0
    475524               res@xyLineColors            = (/144/)
    476                res@xyExplicitLabels =  "Es"
    477525               res@xyLineLabelFontHeightF = 0.05
    478526               res@xyLineLabelFontColor   = 144
     
    483531               us=0
    484532               res@xyLineColors            = (/237/)
    485                res@xyExplicitLabels =  "us"
    486533               res@xyLineLabelFontHeightF = 0.05
    487534               res@xyLineLabelFontColor   = 237
     
    493540               ws=0
    494541               res@xyLineColors            = (/144/)
    495                res@xyExplicitLabels =  "ws"
    496542               res@xyLineLabelFontHeightF = 0.05
    497543               res@xyLineLabelFontColor   = 144
     
    502548               u=0
    503549               res@xyLineColors            = (/237/)
    504                res@xyExplicitLabels =  "umax"
    505550               res@xyLineLabelFontHeightF = 0.05
    506551               res@xyLineLabelFontColor   = 237
     
    512557               v=0
    513558               res@xyLineColors            = (/144/)
    514                res@xyExplicitLabels =  "vmax"
    515559               res@xyLineLabelFontHeightF = 0.05
    516560               res@xyLineLabelFontColor   = 144
     
    520564               w=0
    521565               res@xyLineColors            = (/80/)
    522                res@xyExplicitLabels =  "wmax"
    523566               res@xyLineLabelFontHeightF = 0.05
    524567               res@xyLineLabelFontColor   = 80
     
    529572               zw=0
    530573               res@xyLineColors            = (/237/)
    531                res@xyExplicitLabels =  "z_i_wpt"
    532574               res@xyLineLabelFontHeightF = 0.05
    533575               res@xyLineLabelFontColor   = 237
     
    539581               z=0
    540582               res@xyLineColors            = (/144/) 
    541                res@xyExplicitLabels =  "z_i_pt"
    542583               res@xyLineLabelFontHeightF = 0.05
    543584               res@xyLineLabelFontColor   = 144
     
    548589               w0=0
    549590               res@xyLineColors            = (/237/)
    550                res@xyExplicitLabels =  "wpptp0"
    551591               res@xyLineLabelFontHeightF = 0.05
    552592               res@xyLineLabelFontColor   = 237
     
    558598               wp=0
    559599               res@xyLineColors            = (/144/)
    560                res@xyExplicitLabels =  "wpptp"
    561600               res@xyLineLabelFontHeightF = 0.05
    562601               res@xyLineLabelFontColor   = 144
     
    566605               wt=0
    567606               res@xyLineColors            = (/80/)
    568                res@xyExplicitLabels =  "wpt"
    569607               res@xyLineLabelFontHeightF = 0.05
    570608               res@xyLineLabelFontColor   = 80
     
    575613               p=0
    576614               res@xyLineColors            = (/237/)
    577                res@xyExplicitLabels =  "pt_0_"
    578615               res@xyLineLabelFontHeightF = 0.05
    579616               res@xyLineLabelFontColor   = 237
     
    585622               pz=0
    586623               res@xyLineColors            = (/144/)
    587                res@xyExplicitLabels =  "pt_zp_"
    588624               res@xyLineLabelFontHeightF = 0.05
    589625               res@xyLineLabelFontColor   = 144
     
    594630               x=0
    595631               res@xyLineColors            = (/237/)
    596                res@xyExplicitLabels =  "splptx"
    597632               res@xyLineLabelFontHeightF = 0.05
    598633               res@xyLineLabelFontColor   = 237
     
    604639               y=0
    605640               res@xyLineColors            = (/144/)
    606                res@xyExplicitLabels =  "splpty"
    607641               res@xyLineLabelFontHeightF = 0.05
    608642               res@xyLineLabelFontColor   = 144
     
    612646               z=0
    613647               res@xyLineColors            = (/80/)
    614                res@xyExplicitLabels =  "splptz"
    615648               res@xyLineLabelFontHeightF = 0.05
    616649               res@xyLineLabelFontColor   = 80
     
    645678               overlay(plot_E,plot_Es)
    646679               n=n+1
    647                plot_ps(n) = plot_E               
     680               plot_ps(n) = plot_E   
     681
     682               ; ***************************************************
     683               ; legend for combined plot
     684               ; ***************************************************
     685     
     686               lgres                    = True
     687               lgMonoDashIndex          = False
     688               lgres@lgLabelFont        = "helvetica"   
     689               lgres@lgLabelFontHeightF = .1           
     690               lgres@vpWidthF           = 0.4           
     691               lgres@vpHeightF          = 0.4         
     692               lgres@lgDashIndexes      = (/0,0,0/)
     693               lgres@lgLineColors       = (/237,144,80/)
     694               lbid = gsn_create_legend(wks_ps,2,(/"E","Es"/),lgres)       
     695
     696               amres = True
     697               amres@amParallelPosF   = 0.6                 
     698               amres@amOrthogonalPosF = -0.2           
     699               annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)           
    648700            end if
    649701            if (vNam(varn) .EQ. "Es" .AND. E .NE. 1) then
     
    651703               overlay(plot_E,plot_Es)
    652704               n=n+1
    653                plot_ps(n) = plot_E           
     705               plot_ps(n) = plot_E 
     706
     707               ; ***************************************************
     708               ; legend for combined plot
     709               ; ***************************************************
     710     
     711               lgres                    = True
     712               lgMonoDashIndex          = False
     713               lgres@lgLabelFont        = "helvetica"   
     714               lgres@lgLabelFontHeightF = .1           
     715               lgres@vpWidthF           = 0.4           
     716               lgres@vpHeightF          = 0.4         
     717               lgres@lgDashIndexes      = (/0,0,0/)
     718               lgres@lgLineColors       = (/237,144,80/)
     719               lbid = gsn_create_legend(wks_ps,2,(/"E","Es"/),lgres)       
     720
     721               amres = True
     722               amres@amParallelPosF   = 0.6                 
     723               amres@amOrthogonalPosF = -0.2           
     724               annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)         
    654725            end if
    655726
     
    659730               n=n+1
    660731               plot_ps(n) = plot_us
     732
     733               ; ***************************************************
     734               ; legend for combined plot
     735               ; ***************************************************
     736     
     737               lgres                    = True
     738               lgMonoDashIndex          = False
     739               lgres@lgLabelFont        = "helvetica"   
     740               lgres@lgLabelFontHeightF = .1           
     741               lgres@vpWidthF           = 0.4           
     742               lgres@vpHeightF          = 0.4         
     743               lgres@lgDashIndexes      = (/0,0,0/)
     744               lgres@lgLineColors       = (/237,144,80/)
     745               lbid = gsn_create_legend(wks_ps,2,(/"us","ws"/),lgres)       
     746
     747               amres = True
     748               amres@amParallelPosF   = 0.6                 
     749               amres@amOrthogonalPosF = -0.2           
     750               annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)
    661751            end if
    662752            if (vNam(varn) .EQ. "ws" .AND. us .NE. 1) then
     
    665755               n=n+1
    666756               plot_ps(n) = plot_us
     757
     758               ; ***************************************************
     759               ; legend for combined plot
     760               ; ***************************************************
     761     
     762               lgres                    = True
     763               lgMonoDashIndex          = False
     764               lgres@lgLabelFont        = "helvetica"   
     765               lgres@lgLabelFontHeightF = .1           
     766               lgres@vpWidthF           = 0.4           
     767               lgres@vpHeightF          = 0.4         
     768               lgres@lgDashIndexes      = (/0,0,0/)
     769               lgres@lgLineColors       = (/237,144,80/)
     770               lbid = gsn_create_legend(wks_ps,2,(/"us","ws"/),lgres)       
     771
     772               amres = True
     773               amres@amParallelPosF   = 0.6                 
     774               amres@amOrthogonalPosF = -0.2           
     775               annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)
    667776            end if
    668777         
     
    674783                  n=n+1
    675784                  plot_ps(n) = plot_umax
     785
     786                  ; ***************************************************
     787                  ; legend for combined plot
     788                  ; ***************************************************
     789     
     790                  lgres                    = True
     791                  lgMonoDashIndex          = False
     792                  lgres@lgLabelFont        = "helvetica"   
     793                  lgres@lgLabelFontHeightF = .1           
     794                  lgres@vpWidthF           = 0.4           
     795                  lgres@vpHeightF          = 0.4         
     796                  lgres@lgDashIndexes      = (/0,0,0/)
     797                  lgres@lgLineColors       = (/237,144,80/)
     798                  lbid = gsn_create_legend(wks_ps,3,(/"umax","vmax","wmax"/),lgres)       
     799
     800                  amres = True
     801                  amres@amParallelPosF   = 0.6             
     802                  amres@amOrthogonalPosF = -0.2           
     803                  annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)
    676804               end if
    677805            end if
     
    683811                  n=n+1
    684812                  plot_ps(n) = plot_umax
     813
     814                  ; ***************************************************
     815                  ; legend for combined plot
     816                  ; ***************************************************
     817     
     818                  lgres                    = True
     819                  lgMonoDashIndex          = False
     820                  lgres@lgLabelFont        = "helvetica"   
     821                  lgres@lgLabelFontHeightF = .1         
     822                  lgres@vpWidthF           = 0.4           
     823                  lgres@vpHeightF          = 0.4         
     824                  lgres@lgDashIndexes      = (/0,0,0/)
     825                  lgres@lgLineColors       = (/237,144,80/)
     826                  lbid = gsn_create_legend(wks_ps,3,(/"umax","vmax","wmax"/),lgres)       
     827
     828                  amres = True
     829                  amres@amParallelPosF   = 0.6             
     830                  amres@amOrthogonalPosF = -0.2           
     831                  annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)
    685832               end if
    686833            end if
     
    692839                  n=n+1
    693840                  plot_ps(n) = plot_umax
     841
     842                  ; ***************************************************
     843                  ; legend for combined plot
     844                  ; ***************************************************
     845     
     846                  lgres                    = True
     847                  lgMonoDashIndex          = False
     848                  lgres@lgLabelFont        = "helvetica"   
     849                  lgres@lgLabelFontHeightF = .1           
     850                  lgres@vpWidthF           = 0.4           
     851                  lgres@vpHeightF          = 0.4         
     852                  lgres@lgDashIndexes      = (/0,0,0/)
     853                  lgres@lgLineColors       = (/237,144,80/)
     854                  lbid = gsn_create_legend(wks_ps,3,(/"umax","vmax","wmax"/),lgres)       
     855
     856                  amres = True
     857                  amres@amParallelPosF   = 0.6             
     858                  amres@amOrthogonalPosF = -0.2           
     859                  annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)
    694860               end if
    695861            end if
     
    699865               overlay(plot_z_i_wpt,plot_z_i_pt)
    700866               n=n+1
    701                plot_ps(n) = plot_z_i_wpt           
     867               plot_ps(n) = plot_z_i_wpt
     868       
     869               ; ***************************************************
     870               ; legend for combined plot
     871               ; ***************************************************
     872     
     873               lgres                    = True
     874               lgMonoDashIndex          = False
     875               lgres@lgLabelFont        = "helvetica"   
     876               lgres@lgLabelFontHeightF = .1           
     877               lgres@vpWidthF           = 0.4           
     878               lgres@vpHeightF          = 0.4         
     879               lgres@lgDashIndexes      = (/0,0,0/)
     880               lgres@lgLineColors       = (/237,144,80/)
     881               lbid = gsn_create_legend(wks_ps,2,(/"z_i_wpt","z_i_pt"/),lgres)       
     882
     883               amres = True
     884               amres@amParallelPosF   = 0.6                 
     885               amres@amOrthogonalPosF = -0.2           
     886               annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)         
    702887            end if
    703888            if (vNam(varn) .EQ. "z_i_pt" .AND. zw .NE. 1) then
     
    705890               overlay(plot_z_i_wpt,plot_z_i_pt)
    706891               n=n+1
    707                plot_ps(n) = plot_z_i_wpt           
     892               plot_ps(n) = plot_z_i_wpt
     893
     894               ; ***************************************************
     895               ; legend for combined plot
     896               ; ***************************************************
     897     
     898               lgres                    = True
     899               lgMonoDashIndex          = False
     900               lgres@lgLabelFont        = "helvetica"   
     901               lgres@lgLabelFontHeightF = .1           
     902               lgres@vpWidthF           = 0.4           
     903               lgres@vpHeightF          = 0.4         
     904               lgres@lgDashIndexes      = (/0,0,0/)
     905               lgres@lgLineColors       = (/237,144,80/)
     906               lbid = gsn_create_legend(wks_ps,2,(/"z_i_wpt","z_i_pt"/),lgres)       
     907
     908               amres = True
     909               amres@amParallelPosF   = 0.6                 
     910               amres@amOrthogonalPosF = -0.2           
     911               annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)           
    708912            end if   
    709913         
     
    715919                  n=n+1
    716920                  plot_ps(n) = plot_wpptp0
     921
     922                  ; ***************************************************
     923                  ; legend for combined plot
     924                  ; ***************************************************
     925     
     926                  lgres                    = True
     927                  lgMonoDashIndex          = False
     928                  lgres@lgLabelFont        = "helvetica"   
     929                  lgres@lgLabelFontHeightF = .1           
     930                  lgres@vpWidthF           = 0.4           
     931                  lgres@vpHeightF          = 0.4         
     932                  lgres@lgDashIndexes      = (/0,0,0/)
     933                  lgres@lgLineColors       = (/237,144,80/)
     934                  lbid = gsn_create_legend(wks_ps,3,(/"wpptp0","wpptp","wpt"/),lgres)       
     935
     936                  amres = True
     937                  amres@amParallelPosF   = 0.6             
     938                  amres@amOrthogonalPosF = -0.2           
     939                  annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)
    717940               end if           
    718941            end if
     
    723946                 overlay(plot_wpptp0,plot_wpt)
    724947                 n=n+1
    725                  plot_ps(n) = plot_wpptp0 
     948                 plot_ps(n) = plot_wpptp0
     949                 
     950                 ; ***************************************************
     951                  ; legend for combined plot
     952                  ; ***************************************************
     953     
     954                  lgres                    = True
     955                  lgMonoDashIndex          = False
     956                  lgres@lgLabelFont        = "helvetica"   
     957                  lgres@lgLabelFontHeightF = .1           
     958                  lgres@vpWidthF           = 0.4           
     959                  lgres@vpHeightF          = 0.4         
     960                  lgres@lgDashIndexes      = (/0,0,0/)
     961                  lgres@lgLineColors       = (/237,144,80/)
     962                  lbid = gsn_create_legend(wks_ps,3,(/"wpptp0","wpptp","wpt"/),lgres)       
     963
     964                  amres = True
     965                  amres@amParallelPosF   = 0.6             
     966                  amres@amOrthogonalPosF = -0.2           
     967                  annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) 
    726968               end if           
    727969            end if
     
    732974                  overlay(plot_wpptp0,plot_wpt)
    733975                  n=n+1
    734                   plot_ps(n) = plot_wpptp0             
     976                  plot_ps(n) = plot_wpptp0
     977
     978                  ; ***************************************************
     979                  ; legend for combined plot
     980                  ; ***************************************************
     981     
     982                  lgres                    = True
     983                  lgMonoDashIndex          = False
     984                  lgres@lgLabelFont        = "helvetica"   
     985                  lgres@lgLabelFontHeightF = .1           
     986                  lgres@vpWidthF           = 0.4           
     987                  lgres@vpHeightF          = 0.4         
     988                  lgres@lgDashIndexes      = (/0,0,0/)
     989                  lgres@lgLineColors       = (/237,144,80/)
     990                  lbid = gsn_create_legend(wks_ps,3,(/"wpptp0","wpptp","wpt"/),lgres)       
     991
     992                  amres = True
     993                  amres@amParallelPosF   = 0.6             
     994                  amres@amOrthogonalPosF = -0.2           
     995                  annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)
    735996               end if
    736997            end if
     
    7401001               overlay(plot_pt_0_,plot_pt_zp_)
    7411002               n=n+1
    742                plot_ps(n) = plot_pt_0_           
     1003               plot_ps(n) = plot_pt_0_ 
     1004     
     1005               ; ***************************************************
     1006               ; legend for combined plot
     1007               ; ***************************************************
     1008     
     1009               lgres                    = True
     1010               lgMonoDashIndex          = False
     1011               lgres@lgLabelFont        = "helvetica"   
     1012               lgres@lgLabelFontHeightF = .1           
     1013               lgres@vpWidthF           = 0.4           
     1014               lgres@vpHeightF          = 0.4         
     1015               lgres@lgDashIndexes      = (/0,0,0/)
     1016               lgres@lgLineColors       = (/237,144,80/)
     1017               lbid = gsn_create_legend(wks_ps,2,(/"pt_0_","pt_zp_"/),lgres)       
     1018
     1019               amres = True
     1020               amres@amParallelPosF   = 0.6                 
     1021               amres@amOrthogonalPosF = -0.2           
     1022               annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)
    7431023            end if
    7441024            if (vNam(varn) .EQ. "pt_zp_" .AND. p .NE. 1) then
     
    7461026               overlay(plot_pt_0_,plot_pt_zp_)
    7471027               n=n+1
    748                plot_ps(n) = plot_pt_0_           
     1028               plot_ps(n) = plot_pt_0_   
     1029
     1030               ; ***************************************************
     1031               ; legend for combined plot
     1032               ; ***************************************************
     1033     
     1034               lgres                    = True
     1035               lgMonoDashIndex          = False
     1036               lgres@lgLabelFont        = "helvetica"   
     1037               lgres@lgLabelFontHeightF = .1           
     1038               lgres@vpWidthF           = 0.4           
     1039               lgres@vpHeightF          = 0.4         
     1040               lgres@lgDashIndexes      = (/0,0,0/)
     1041               lgres@lgLineColors       = (/237,144,80/)
     1042               lbid = gsn_create_legend(wks_ps,2,(/"pt_0_","pt_zp_"/),lgres)       
     1043
     1044               amres = True
     1045               amres@amParallelPosF   = 0.6                 
     1046               amres@amOrthogonalPosF = -0.2           
     1047               annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)
    7491048            end if
    7501049           
     
    7551054                  overlay(plot_splptx,plot_splptz)
    7561055                  n=n+1
    757                   plot_ps(n) = plot_splptx           
     1056                  plot_ps(n) = plot_splptx   
     1057
     1058                  ; ***************************************************
     1059                  ; legend for combined plot
     1060                  ; ***************************************************
     1061     
     1062                  lgres                    = True
     1063                  lgMonoDashIndex          = False
     1064                  lgres@lgLabelFont        = "helvetica"   
     1065                  lgres@lgLabelFontHeightF = .1           
     1066                  lgres@vpWidthF           = 0.4           
     1067                  lgres@vpHeightF          = 0.4         
     1068                  lgres@lgDashIndexes      = (/0,0,0/)
     1069                  lgres@lgLineColors       = (/237,144,80/)
     1070                  lbid = gsn_create_legend(wks_ps,3,(/"splptx","splpty","splptz"/),lgres)       
     1071
     1072                  amres = True
     1073                  amres@amParallelPosF   = 0.6             
     1074                  amres@amOrthogonalPosF = -0.2           
     1075                  annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)
    7581076               end if
    7591077            end if
     
    7651083                  n=n+1
    7661084                  plot_ps(n) = plot_splptx
     1085
     1086                  ; ***************************************************
     1087                  ; legend for combined plot
     1088                  ; ***************************************************
     1089     
     1090                  lgres                    = True
     1091                  lgMonoDashIndex          = False
     1092                  lgres@lgLabelFont        = "helvetica"   
     1093                  lgres@lgLabelFontHeightF = .1           
     1094                  lgres@vpWidthF           = 0.4           
     1095                  lgres@vpHeightF          = 0.4         
     1096                  lgres@lgDashIndexes      = (/0,0,0/)
     1097                  lgres@lgLineColors       = (/237,144,80/)
     1098                  lbid = gsn_create_legend(wks_ps,3,(/"splptx","splpty","splptz"/),lgres)       
     1099
     1100                  amres = True
     1101                  amres@amParallelPosF   = 0.6             
     1102                  amres@amOrthogonalPosF = -0.2           
     1103                  annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)
    7671104               end if           
    7681105            end if
     
    7731110                  overlay(plot_splptx,plot_splptz)
    7741111                  n=n+1
    775                   plot_ps(n) = plot_splptx   
     1112                  plot_ps(n) = plot_splptx 
     1113
     1114                  ; ***************************************************
     1115                  ; legend for combined plot
     1116                  ; ***************************************************
     1117     
     1118                  lgres                    = True
     1119                  lgMonoDashIndex          = False
     1120                  lgres@lgLabelFont        = "helvetica"   
     1121                  lgres@lgLabelFontHeightF = .1           
     1122                  lgres@vpWidthF           = 0.4           
     1123                  lgres@vpHeightF          = 0.4         
     1124                  lgres@lgDashIndexes      = (/0,0,0/)
     1125                  lgres@lgLineColors       = (/237,144,80/)
     1126                  lbid = gsn_create_legend(wks_ps,3,(/"splptx","splpty","splptz"/),lgres)       
     1127
     1128                  amres = True
     1129                  amres@amParallelPosF   = 0.6             
     1130                  amres@amOrthogonalPosF = -0.2           
     1131                  annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)
    7761132               end if       
    7771133            end if
     
    8401196   ; merge plots onto one page
    8411197   ; ***************************************************
    842   
     1198 
    8431199   if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then
    8441200      gsn_panel(wks_ps,plot_ps(1:n),(/n,1/),resP)
Note: See TracChangeset for help on using the changeset viewer.