Changeset 175 for palm/trunk/SCRIPTS/NCL


Ignore:
Timestamp:
Jul 8, 2008 8:29:06 AM (16 years ago)
Author:
steinfeld
Message:

NCL scripts for spectra added. Bug fix concerning spectra in netcdf.f90

Location:
palm/trunk/SCRIPTS/NCL
Files:
5 edited

Legend:

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

    r174 r175  
    1 ___Parameter list________________________________________________________________________________
    2 ___Please write your values/strings(wihtout " ") below the corresponding parameter line__________
    3 _________________________________________________________________________________________________
    4 ___parameter name____example____________________________________default value_____________used by
    5 _________________________________________________________________________________________________
     1___Parameter list_______________________________________________________________________________________
     2___Please write your values/strings(wihtout " ") below the corresponding parameter line_________________
     3________________________________________________________________________________________________________
     4___parameter name__________example____________________________________default value______________used by
     5________________________________________________________________________________________________________
    66
    7 ___'file_in'_________[path/name.nc; i.e. ~/.../example.nc]______default = input file______[ALL]
    8 input file
    9 ___'format_out'______[ncgm; ps; eps; epsi; pdf; x11]____________default = x11_____________[ALL]
     7___'file_1'________________[path/name.nc; i.e. ~/.../example.nc]______default = File in_________[ALL]
     8File in
     9___'format_out'____________[ncgm; ps; eps; epsi; pdf; x11]____________default = x11_____________[ALL]
    1010x11
    11 ___'file_out'________[path/name; i.e. ~/.../test]_______________default = test____________[ALL]
     11___'file_out'______________[path/name; i.e. ~/.../test]_______________default = test____________[ALL]
    1212test
    13 ___start_time_step___[0;1;...]__________________________________default = t(0)____________[ALL]
     13___start_time_step_________[0;1;...]__________________________________default = t(0)____________[ALL]
    1414t(0)
    15 ___end_time_step_____[1;2;...]__________________________________default = t(end)__________[ALL]
     15___end_time_step___________[1;2;...]__________________________________default = t(end)__________[ALL]
    1616t(end)
    17 ___no_columns________[1;2;...]__________________________________default = 1_______________[ALL]
     17___no_columns______________[1;2;...]__________________________________default = 1_______________[ALL]
    18181
    19 ___no_lines__________[1;2;...]__________________________________default = 2_______________[ALL]
     19___no_lines________________[1;2;...]__________________________________default = 2_______________[ALL]
    20202
    21 ___'var'_____________[,E,dt,umax,;...]__________________________default = variables_______[ALL]
     21___'var'___________________[,E,dt,umax,;...]__________________________default = variables_______[ALL]
    2222variables
    23 ___combine___________[0] or [1]_________________________________default = 0_______________[PR]
     23___combine_________________[0] or [1]_________________________________default = 0_______________[PR]
    24240
    25 ___number_comb_______[2] or [3]_________________________________default = 0_______________[PR]
     25___number_comb_____________[2] or [3]_________________________________default = 0_______________[PR]
    26260
    27 ___'c_var'___________[,us2,vs2,ws2,;...]________________________default = c_variables_____[PR]
     27___'c_var'_________________[,us2,vs2,ws2,;...]________________________default = c_variables_____[PR]
    2828c_variables
    29 ___dash______________[0] or [1]_________________________________default = 0_______________[PR]
     29___dash____________________[0] or [1]_________________________________default = 0_______________[PR+SP]
    30300
    31 ___black_____________[0] or [1]_________________________________default = 0_______________[PR]
     31___black___________________[0] or [1]_________________________________default = 0_______________[PR+SP]
    32320
    33 ___min_z_____________[0;10;...]_________________________________default = 0_______________[PR]
     33___min_z___________________[0;10;...]_________________________________default = 0_______________[PR]
    34340
    35 ___max_z_____________[100;1000;...]_____________________________default = max(z_u)________[PR]
     35___max_z___________________[100;1000;...]_____________________________default = max(z_u)________[PR]
    3636max(z_u)
    37 ___over______________[0] or [1]_________________________________default = 0_______________[PR+TS]
     37___over____________________[0] or [1]_________________________________default = 0_______________[PR+TS]
    38380
    39 ___vector____________[0] or [1]_________________________________default = 0_______________[CS]
     39___vector__________________[0] or [1]_________________________________default = 0_______________[CS]
    40400
    41 ___'vec1'____________[,u,;,v,;...]______________________________default = vec1____________[CS]
     41___'vec1'__________________[,u,;,v,;...]______________________________default = vec1____________[CS]
    4242vec1
    43 ___'vec2'____________[,u,;,v,;...]______________________________default = vec2____________[CS]
     43___'vec2'__________________[,u,;,v,;...]______________________________default = vec2____________[CS]
    4444vec2
    45 __'plotvec'__________[,u,;,v,;...]______________________________default = plotvec_________[CS]
     45__'plotvec'________________[,u,;,v,;...]______________________________default = plotvec_________[CS]
    4646plotvec
    47 ___ref_mag___________[0.1;0.02;...]_____________________________default = 0.05____________[CS]
     47___ref_mag_________________[0.1;0.02;...]_____________________________default = 0.05____________[CS]
    48480.05
    49 ___'mode'____________[Fill], [Line] or [Both]___________________default = Fill____________[CS]
     49___'mode'__________________[Fill], [Line] or [Both]___________________default = Fill____________[CS]
    5050Fill
    51 ___'sort'____________[time] or [layer]__________________________default = time____________[CS]
    52 time
    53 ___'fill_mode'_______[AreaFill], [RasterFill] or [CellFill]_____default = AreaFill________[CS]
     51___'sort'__________________[time] or [layer]__________________________default = layer___________[CS+SP]
     52layer
     53___'fill_mode'_____________[AreaFill], [RasterFill] or [CellFill]_____default = AreaFill________[CS]
    5454AreaFill
    55 ___shape_____________[0] or [1]_________________________________default = 1_______________[CS]
     55___shape___________________[0] or [1]_________________________________default = 1_______________[CS]
    56561
    57 ___xyc_______________[0] or [1]_________________________________default = 0_______________[CS]
     57___xyc_____________________[0] or [1]_________________________________default = 0_______________[CS]
    58580
    59 ___xzc_______________[0] or [1]_________________________________default = 0_______________[CS]
     59___xzc_____________________[0] or [1]_________________________________default = 0_______________[CS]
    60600
    61 ___yzc_______________[0] or [1]_________________________________default = 0_______________[CS]
     61___yzc_____________________[0] or [1]_________________________________default = 0_______________[CS]
    62620
    63 ___xs________________[0,1,...]__________________________________default = x0______________[CS+PR]
     63___xs______________________[0,1,...]__________________________________default = x0______________[CS+PR]
    6464x0
    65 ___xe________________[1;2;...]__________________________________default = xdim____________[CS+PR]
     65___xe______________________[1;2;...]__________________________________default = xdim____________[CS+PR]
    6666xdim
    67 ___ys________________[0;1;...]__________________________________default = y0______________[CS]
     67___ys______________________[0;1;...]__________________________________default = y0______________[CS]
    6868y0
    69 ___ye________________[1;2;...]__________________________________default = ydim____________[CS]
     69___ye______________________[1;2;...]__________________________________default = ydim____________[CS]
    7070ydim
    71 ___zs________________[0;1;...]__________________________________default = z0______________[CS]
     71___zs______________________[0;1;...]__________________________________default = z0______________[CS]
    7272z0
    73 ___ze________________[1;2;...]__________________________________default = zdim____________[CS]
     73___ze______________________[1;2;...]__________________________________default = zdim____________[CS]
    7474zdim
    75 ___prof3d____________[0] or [1]_________________________________default = 0_______________[PR]
     75___prof3d__________________[0] or [1]_________________________________default = 0_______________[PR]
    76760
    77 ___end of file ".ncl_preferences"_____________________________________________________________
     77___logy____________________[0] or [1]_________________________________default = 0_______________[PR+SP]
     780
     79___norm____________________[1;5.4;233;...]____________________________default = 1_______________[PR+SP]
     801
     81___no_files________________[1;2,3;...]________________________________default = 1_______________[PR]
     821
     83___'name_legend_1'_________[i.e. File 2]______________________________default = File 1__________[PR]
     84File 1
     85___'file_2'________________[path/name.nc; i.e. ~/.../example.2.nc]____default = File in_________[PR]
     86File in
     87___'name_legend_2'_________[i.e. File 2]______________________________default = File 2__________[PR]
     88File 2
     89___'file_3'________________[path/name.nc; i.e. ~/.../example.3.nc]____default = File in_________[PR]
     90File in
     91___'name_legend_3'_________[i.e. File 3]______________________________default = File 3__________[PR]
     92File 3
     93___'file_4'________________[path/name.nc; i.e. ~/.../example.4.nc]____default = File in_________[PR]
     94File in
     95___'name_legend_4'_________[i.e. File 4]______________________________default = File 4__________[PR]
     96File 4
     97___'file_5'________________[path/name.nc; i.e. ~/.../example.5.nc]____default = File in_________[PR]
     98File in
     99___'name_legend_5'_________[i.e. File 5]______________________________default = File 5__________[PR]
     100File 5
     101___'file_6'________________[path/name.nc; i.e. ~/.../example.6.nc]____default = File in_________[PR]
     102File in
     103___'name_legend_6'_________[i.e. File 6]______________________________default = File 6__________[PR]
     104File 6
     105___'file_7'________________[path/name.nc; i.e. ~/.../example.7.nc]____default = File in_________[PR]
     106File in
     107___'name_legend_7'_________[i.e. File 7]______________________________default = File 7__________[PR]
     108File 7
     109___'file_8'________________[path/name.nc; i.e. ~/.../example.8.nc]____default = File in_________[PR]
     110File in
     111___'name_legend_8'_________[i.e. File 8]______________________________default = File 8__________[PR]
     112File 8
     113___'file_9'________________[path/name.nc; i.e. ~/.../example.9.nc]____default = File in_________[PR]
     114File in
     115___'name_legend_9'_________[i.e. File 9]______________________________default = File 9__________[PR]
     116File 9
     117___'file_10'_______________[path/name.nc; i.e. ~/.../example.10.nc]___default = File in_________[PR]
     118File in
     119___'name_legend_10'________[i.e. File 10]_____________________________default = File 10_________[PR]
     120File 10
     121___'file_11'_______________[path/name.nc; i.e. ~/.../example.11.nc]___default = File in_________[PR]
     122File in
     123___'name_legend_11'________[i.e. File 11]_____________________________default = File 11_________[PR]
     124File 11
     125___'file_12'_______________[path/name.nc; i.e. ~/.../example.12.nc]___default = File in_________[PR]
     126File in
     127___'name_legend_12'________[i.e. File 12]_____________________________default = File 12_________[PR]
     128File 12
     129___end of file ".ncl_preferences"_______________________________________________________________________
  • palm/trunk/SCRIPTS/NCL/cross_sections.ncl

    r174 r175  
    1111   ; ***************************************************
    1212
    13    if (isfilepresent(".ncl_preferences")) then
    14       parameter = asciiread(".ncl_preferences",77,"string")
     13   if (isfilepresent("~/.ncl_preferences")) then
     14      parameter = asciiread("~/.ncl_preferences",129,"string")
    1515      delete(parameter@_FillValue)
    1616   else
    17       print(" ")
    18       print("'.ncl_preferences' is not existent")
    19       print(" ")
    20       exit
     17      if (isfilepresent("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences")) then
     18         parameter = asciiread("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences",129,"string")
     19         delete(parameter@_FillValue)
     20      else
     21         print(" ")
     22         print("'.ncl_preferences' is not present in '~/palm/current_version/trunk/SRIPTS/NCL/'")
     23         print(" ")
     24         exit
     25      end if
    2126   end if
    2227
     
    2530   ; ***************************************************
    2631   
    27    if ( .not. isvar("file_in") ) then                   ; path+name of input file     
    28       if (parameter(7) .EQ. "input file") then
    29          print(" ")
    30          print("Please provide input file 'file_in = ' either in prompt or parameter_list")
     32   if ( .not. isvar("file_1") ) then                     
     33      if (parameter(7) .EQ. "File in") then
     34         print(" ")
     35         print("Please provide 1st input file 'file_1=' either in prompt or parameter_list")
    3136         print(" ")
    3237         exit
    3338      else
    3439         file_in = parameter(7)
    35       end if     
    36    end if
    37    if ( .not. isvar("format_out") ) then                ; format of output file
     40      end if   
     41   else
     42      file_in = file_1   
     43   end if
     44   if (.not. isfilepresent(file_in)) then
     45      print(" ")
     46      print("Your 1st input file: '"+file_in+"' does not exist")
     47      print(" ")
     48      exit
     49   end if
     50
     51   if ( .not. isvar("format_out") ) then               
    3852      format_out = "x11"
    3953      if (parameter(9) .NE. "x11") then
    4054         format_out = parameter(9) 
     55         if (format_out .NE. "x11" .AND. format_out .NE. "pdf" .AND. format_out .NE. "eps" .AND. format_out .NE. "ps" .AND. format_out .NE. "epsi" .AND. format_out .NE. "ncgm")then
     56            print(" ")
     57            print("Your 'format_out = "+format_out+"' is invalid and set to'x11'")
     58            print(" ")
     59         end if 
    4160      end if
    42    end if
    43    if ( .not. isvar("file_out") ) then                  ; path+name of output file
     61   else
     62      if (format_out .NE. "x11" .AND. format_out .NE. "pdf" .AND. format_out .NE. "eps" .AND. format_out .NE. "ps" .AND. format_out .NE. "epsi" .AND. format_out .NE. "ncgm")then
     63         print(" ")
     64         print("Your 'format_out = "+format_out+"' is invalid and set to'x11'")
     65         print(" ")
     66      end if   
     67   end if
     68
     69   if ( .not. isvar("file_out") ) then                 
    4470      file_out = "test"
    4571      if (parameter(11) .NE. "test") then
     
    4773     end if     
    4874   end if
    49    if ( .not. isvar("no_columns") ) then                ; number of plots in one row
     75   if ( .not. isvar("no_columns") ) then               
    5076      no_columns = 1
    5177      if (parameter(17) .NE. "1") then
     
    5379      end if
    5480   end if
    55    if ( .not. isvar("no_lines") ) then                  ; number of plot-lines on one sheet
     81   if ( .not. isvar("no_lines") ) then                 
    5682      no_lines = 2
    5783      if (parameter(19) .NE. "2") then
     
    5985      end if
    6086   end if
    61    if ( .not. isvar("sort") ) then                      ; sort of plots
    62       sort = "time"
    63       if (parameter(51) .NE. "time") then
     87
     88   if ( .not. isvar("sort") ) then                     
     89      sort = "layer"
     90      if (parameter(51) .NE. "layer") then
    6491         sort = parameter(51) 
     92         if (sort .NE. "time") then
     93            print(" ")
     94            print("Your 'sort'= "+sort+" is invalid and set to 'layer'")
     95            print(" ")
     96            sort = "layer" 
     97         end if
     98      end if
     99   else
     100      if (sort .NE. "time" .OR. sort .NE. "layer")then
     101         print(" ")
     102         print("Your 'sort'= "+sort+" is invalid and set to 'layer'")
     103         print(" ")
     104         sort = "layer"   
    65105      end if
    66106   end if
    67    if ( .not. isvar("mode") ) then                      ; pattern of contour plots
     107
     108   if ( .not. isvar("mode") ) then                     
    68109      mode = "Fill"
    69110      if (parameter(49) .NE. "Fill") then
    70111         mode = parameter(49) 
    71       end if
    72    end if
    73    if ( .not. isvar("fill_mode") ) then                 ; pattern of filling
     112         if (mode .NE. "Line" .AND. mode .NE. "Both")then
     113            print(" ")
     114            print("Your 'mode'= "+mode+" is invalid and set to 'Fill'")
     115            print(" ")
     116            mode = "Fill"
     117         end if
     118      end if
     119   else
     120      if (mode .NE. "Line" .AND. mode .NE. "Both")then
     121         print(" ")
     122         print("Your 'mode'= "+mode+" is invalid and set to 'Fill'")
     123         print(" ")
     124         mode = "Fill"
     125      end if   
     126   end if
     127
     128   if ( .not. isvar("fill_mode") ) then                 
    74129      fill_mode = "AreaFill"
    75130      if (parameter(53) .NE. "AreaFill") then
    76          mode = parameter(53) 
     131         fill_mode = parameter(53) 
     132         if (fill_mode .NE. "RasterFill" .AND. fill_mode .NE. "CellFill")then
     133            print(" ")
     134            print("Your 'fill_mode'= "+fill_mode+" is invalid and set to 'AreaFill'")
     135            print(" ")
     136            fill_mode = "AreaFill"
     137         end if
    77138      end if
    78    end if
    79    if ( .not. isvar("shape") ) then                     ; keeping of aspect ratio
     139   else
     140      if (fill_mode .NE. "RasterFill" .AND. fill_mode .NE. "CellFill")then
     141         print(" ")
     142         print("Your 'fill_mode'= "+fill_mode+" is invalid and set to 'AreaFill'")
     143         print(" ")
     144         fill_mode = "AreaFill"
     145      end if
     146   end if
     147
     148   if ( .not. isvar("shape") ) then                     
    80149      shape = 1
    81150      if (parameter(55) .NE. "1") then
    82151         shape = stringtointeger(parameter(55))
    83          if (stringtointeger(parameter(55)) .NE. 0) then
    84             print(" ")
    85             print("Please set 'shape' to 0 or 1")
    86             print(" ")
    87             exit
     152         if (shape .NE. 0) then
     153            print(" ")
     154            print("Your 'shape'= "+shape+" is invalid and set to 1")
     155            print(" ")
     156            shape = 1
    88157         end if
    89       end if 
    90    end if 
    91    if ( .not. isvar("var") ) then                       ; set output of all variables
     158      end if
     159   else
     160      if (shape .NE. 0) then
     161         print(" ")
     162         print("Your 'shape'= "+shape+" is invalid and set to 1")
     163         print(" ")
     164         shape = 1
     165      end if     
     166   end if
     167 
     168   if ( .not. isvar("var") ) then                       
    92169      check = True
    93170   end if
    94171
    95    if ( .not. isvar("xyc") ) then                       ; turn xy cross-section on or off
     172   if ( .not. isvar("xyc") ) then                       
    96173      xyc = 0
    97174      if (parameter(57) .NE. "0") then
    98175         xyc = stringtointeger(parameter(57))
    99          if (stringtointeger(parameter(57)) .NE. 1) then
    100             print(" ")
    101             print("Please set 'xyc' to 0 or 1")
    102             print(" ")
    103             exit
     176         if (xyc .NE. 1) then
     177            print(" ")
     178            print("Your 'xyc'= "+xyc+" is invalid and set to 0")
     179            print(" ")
     180            xyc = 0
    104181         end if
    105182      end if
     183   else
     184      if (xyc .NE. 1) then
     185         print(" ")
     186         print("Your 'xyc'= "+xyc+" is invalid and set to 0")
     187         print(" ")
     188         xyc = 0
     189      end if
    106190   end if
    107    if ( .not. isvar("xzc") ) then                       ; turn xz cross-section on or off
     191   if ( .not. isvar("xzc") ) then                       
    108192      xzc = 0
    109193      if (parameter(59) .NE. "0") then
    110194         xzc = stringtointeger(parameter(59))
    111          if (stringtointeger(parameter(59)) .NE. 1) then
    112             print(" ")
    113             print("Please set 'xzc' to 0 or 1")
    114             print(" ")
    115             exit
     195         if (xzc .NE. 1) then
     196            print(" ")
     197            print("Your 'xzc'= "+xzc+" is invalid and set to 0")
     198            print(" ")
     199            xzc = 0
    116200         end if
    117201      end if
    118    end if
    119    if ( .not. isvar("yzc") ) then                       ; turn yz cross-section on or off
     202   else
     203      if (xzc .NE. 1) then
     204         print(" ")
     205         print("Your 'xzc'= "+xzc+" is invalid and set to 0")
     206         print(" ")
     207         xzc = 0
     208      end if
     209   end if
     210   if ( .not. isvar("yzc") ) then                       
    120211      yzc = 0
    121212      if (parameter(61) .NE. "0") then
    122213         yzc = stringtointeger(parameter(61))
    123          if (stringtointeger(parameter(61)) .NE. 1) then
    124             print(" ")
    125             print("Please set 'yzc' to 0 or 1")
    126             print(" ")
    127             exit
     214         if (yzc .NE. 1) then
     215            print(" ")
     216            print("Your 'yzc'= "+yzc+" is invalid and set to 0")
     217            print(" ")
     218            yzc = 0
    128219         end if
    129220      end if
     221   else
     222      if (yzc .NE. 1) then
     223         print(" ")
     224         print("Your 'yzc'= "+yzc+" is invalid and set to 0")
     225         print(" ")
     226         yzc = 0
     227      end if
    130228   end if
    131229
     
    160258      end if
    161259   end if
    162    if ( .not. isvar("vector") ) then                    ; sort of plots
     260   if ( .not. isvar("vector") ) then           
    163261      vector = 0
    164262      if (parameter(39) .NE. "0") then
     
    172270      end if
    173271   end if
    174    if ( .not. isvar("ref_mag") ) then                           ; sort of plots
     272   if ( .not. isvar("ref_mag") ) then                           
    175273      ref_mag = 0.05
    176274      if (parameter(47) .NE. "0.05") then
     
    272370   cs_res@gsnYAxisIrregular2Linear = True 
    273371
    274    if( shape .eq. 1 ) then                              ; keep the shape
     372   if( shape .eq. 1 ) then                             
    275373      cs_res@gsnShape = True
    276374   end if
     
    296394   cs_resP = True
    297395   cs_resP@txString               = f@title
    298    cs_resP@txFuncCode             = "~"                 ; necessary for title
     396   cs_resP@txFuncCode             = "~"                 
    299397   cs_resP@txFontHeightF          = .02
    300398   
     
    304402      cs_res@gsnSpreadColors      = True
    305403      cs_res@cnFillMode           = fill_mode
    306       cs_res@lbOrientation        = "Vertical"          ; vertical label bar
     404      cs_res@lbOrientation        = "Vertical"         
    307405      cs_res@cnLinesOn            = False       
    308406      cs_res@cnLineLabelsOn       = False
     
    313411      cs_res@gsnSpreadColors      = True
    314412      cs_res@cnFillMode           = fill_mode
    315       cs_res@lbOrientation        = "Vertical"          ; vertical label bar
     413      cs_res@lbOrientation        = "Vertical" 
    316414      cs_res@cnLinesOn            = True
    317415      cs_res@cnLineLabelsOn       = True
     
    450548
    451549   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)
     550   print("Output of time steps from "+t_all(start_time_step)/3600+" h = "+t_all(start_time_step)+" s => index = "+start_time_step)
     551   print("                     till "+t_all(end_time_step)/3600+" h = "+t_all(end_time_step)+" s => index = "+end_time_step)
    454552   print(" ")
    455553 
     
    735833   end if
    736834 
    737    if ( .not. isvar("zs") ) then                        ; start of z-coordinate range
     835   if ( .not. isvar("zs") ) then                       
    738836      zs = 0
    739837      if (parameter(71) .NE. "z0") then
     
    12831381   end do
    12841382
    1285    if (no_var .EQ. 0) then
     1383   if (n .EQ. 0) then
    12861384      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")
     1385      print("The variables 'var=°"+var+"°' do not exist on your input file")
    12901386      print(" ")
    12911387      exit
  • palm/trunk/SCRIPTS/NCL/profiles.ncl

    r174 r175  
    99   ; ***************************************************
    1010
    11    if (isfilepresent(".ncl_preferences")) then
    12       parameter = asciiread(".ncl_preferences",77,"string")
     11   if (isfilepresent("~/.ncl_preferences")) then
     12      parameter = asciiread("~/.ncl_preferences",129,"string")
    1313      delete(parameter@_FillValue)
    1414   else
    15       print(" ")
    16       print("'.ncl_preferences' is not existent")
    17       print(" ")
    18       exit
     15      if (isfilepresent("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences")) then
     16         parameter = asciiread("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences",129,"string")
     17         delete(parameter@_FillValue)
     18      else
     19         print(" ")
     20         print("'.ncl_preferences' is not present in '~/palm/current_version/trunk/SRIPTS/NCL/'")
     21         print(" ")
     22         exit
     23      end if
    1924   end if
    2025 
     
    2227   ; set up default parameter values and strings if not assigned in prompt or parameter list
    2328   ; ***************************************************
     29 
     30   if ( .not. isvar("no_files") ) then
     31      no_files = 1 
     32      if (parameter(81) .NE. "1") then
     33         no_files = stringtointeger(parameter(81))
     34         if (no_files .LT. 1 .OR. no_files .GT. 12) then
     35            print(" ")
     36            print("Please assign 'no_files' between 1 and 12") 
     37            print(" ")
     38            exit
     39         end if
     40      end if
     41   else
     42      if (no_files .LT. 1 .OR. no_files .GT. 12) then
     43         print(" ")
     44         print("Please assign 'no_files' between 1 and 12") 
     45         print(" ")
     46         exit
     47      end if
     48   end if
     49
     50   file_in = new(no_files,string)
    2451 
    25    if ( .not. isvar("file_in") ) then                   ; path+name of input file      
    26       if (parameter(7) .EQ. "input file") then
    27          print(" ")
    28          print("Please provide input file 'file_in = ' either in prompt or parameter_list")
     52   if ( .not. isvar("file_1") ) then                         
     53      if (parameter(7) .EQ. "File in") then
     54         print(" ")
     55         print("Please provide 1st input file 'file_1=' either in prompt or parameter_list")
    2956         print(" ")
    3057         exit
    3158      else
    32          file_in = parameter(7)
    33       end if     
     59         file_in(0) = parameter(7)
     60      end if   
     61   else
     62      file_in(0) = file_1   
    3463   end if
    35    if ( .not. isvar("format_out") ) then                ; format of output file
     64   if (.not. isfilepresent(file_in(0))) then
     65      print(" ")
     66      print("Your 1st input file: '"+file_in(0)+"' does not exist")
     67      print(" ")
     68      exit
     69   end if
     70
     71   if (no_files .GT. 1) then
     72      if (.not. isvar("file_2"))then
     73         file_in(1) = parameter(85)
     74         if (file_in(1) .EQ. "File in")
     75            print(" ")
     76            print("Please provide 2nd input file 'file_2=' either in prompt or parameter_list or change 'no_files' to 1")
     77            print(" ")
     78            exit
     79         end if
     80      else
     81         file_in(1) = file_2
     82      end if
     83      if (.not. isfilepresent(file_in(1))) then
     84         print(" ")
     85         print("Your 2nd input file: '"+file_in(1)+"' does not exist")
     86         print(" ")
     87         exit
     88      end if
     89   end if
     90   if (no_files .GT. 2) then
     91      if (.not. isvar("file_3"))then
     92         file_in(2) = parameter(89)
     93         if (file_in(2) .EQ. "File in")
     94            print(" ")
     95            print("Please provide 3rd input file 'file_3=' either in prompt or parameter_list or change 'no_files' to 2")
     96            print(" ")
     97            exit
     98         end if
     99      else
     100         file_in(2) = file_3
     101      end if
     102      if (.not. isfilepresent(file_in(2))) then
     103         print(" ")
     104         print("Your 3rd input file: '"+file_in(2)+"' does not exist")
     105         print(" ")
     106         exit
     107      end if
     108   end if
     109   if (no_files .GT. 3) then
     110      if (.not. isvar("file_4"))then
     111         file_in(3) = parameter(93)
     112         if (file_in(3) .EQ. "File in")
     113            print(" ")
     114            print("Please provide 4th input file 'file_4=' either in prompt or parameter_list or change 'no_files' to 3")
     115            print(" ")
     116            exit
     117         end if
     118      else
     119         file_in(3) = file_4
     120      end if
     121      if (.not. isfilepresent(file_in(3))) then
     122         print(" ")
     123         print("Your 4th input file: '"+file_in(3)+"' does not exist")
     124         print(" ")
     125         exit
     126      end if
     127   end if
     128   if (no_files .GT. 4) then
     129      if (.not. isvar("file_5"))then
     130         file_in(4) = parameter(97)
     131         if (file_in(4) .EQ. "File in")
     132            print(" ")
     133            print("Please provide 5th input file 'file_5=' either in prompt or parameter_list or change 'no_files' to 4")
     134            print(" ")
     135            exit
     136         end if
     137      else
     138         file_in(4) = file_5
     139      end if
     140      if (.not. isfilepresent(file_in(4))) then
     141         print(" ")
     142         print("Your 5th input file: '"+file_in(4)+"' does not exist")
     143         print(" ")
     144         exit
     145      end if
     146   end if
     147   if (no_files .GT. 5) then
     148      if (.not. isvar("file_6"))then
     149         file_in(5) = parameter(101)
     150         if (file_in(5) .EQ. "File in")
     151            print(" ")
     152            print("Please provide 6th input file 'file_6=' either in prompt or parameter_list or change 'no_files' to 5")
     153            print(" ")
     154            exit
     155         end if
     156      else
     157         file_in(5) = file_6
     158      end if
     159      if (.not. isfilepresent(file_in(5))) then
     160         print(" ")
     161         print("Your 6th input file: '"+file_in(5)+"' does not exist")
     162         print(" ")
     163         exit
     164      end if
     165   end if
     166   if (no_files .GT. 6) then
     167      if (.not. isvar("file_7"))then
     168         file_in(6) = parameter(105)
     169         if (file_in(6) .EQ. "File in")
     170            print(" ")
     171            print("Please provide 7th input file 'file_7=' either in prompt or parameter_list or change 'no_files' to 6")
     172            print(" ")
     173            exit
     174         end if
     175      else
     176         file_in(6) = file_7
     177      end if
     178      if (.not. isfilepresent(file_in(6))) then
     179         print(" ")
     180         print("Your 7th input file: '"+file_in(6)+"' does not exist")
     181         print(" ")
     182         exit
     183      end if
     184   end if
     185   if (no_files .GT. 7) then
     186      if (.not. isvar("file_8"))then
     187         file_in(7) = parameter(109)
     188         if (file_in(7) .EQ. "File in")
     189            print(" ")
     190            print("Please provide 8th input file 'file_8=' either in prompt or parameter_list or change 'no_files' to 7")
     191            print(" ")
     192            exit
     193         end if
     194      else
     195         file_in(7) = file_8
     196      end if
     197      if (.not. isfilepresent(file_in(7))) then
     198         print(" ")
     199         print("Your 8th input file: '"+file_in(7)+"' does not exist")
     200         print(" ")
     201         exit
     202      end if
     203   end if
     204   if (no_files .GT. 8) then
     205      if (.not. isvar("file_9"))then
     206         file_in(8) = parameter(113)
     207         if (file_in(8) .EQ. "File in")
     208            print(" ")
     209            print("Please provide 9th input file 'file_9=' either in prompt or parameter_list or change 'no_files' to 8")
     210            print(" ")
     211            exit
     212         end if
     213      else
     214         file_in(8) = file_9
     215      end if
     216      if (.not. isfilepresent(file_in(8))) then
     217         print(" ")
     218         print("Your 9th input file: '"+file_in(8)+"' does not exist")
     219         print(" ")
     220         exit
     221      end if
     222   end if
     223   if (no_files .GT. 9) then
     224      if (.not. isvar("file_10"))then
     225         file_in(9) = parameter(117)
     226         if (file_in(9) .EQ. "File in")
     227            print(" ")
     228            print("Please provide 10th input file 'file_10=' either in prompt or parameter_list or change 'no_files' to 9")
     229            print(" ")
     230            exit
     231         end if
     232      else
     233         file_in(9) = file_10
     234      end if
     235      if (.not. isfilepresent(file_in(9))) then
     236         print(" ")
     237         print("Your 10th input file: '"+file_in(9)+"' does not exist")
     238         print(" ")
     239         exit
     240      end if
     241   end if
     242   if (no_files .GT. 10) then
     243      if (.not. isvar("file_11"))then
     244         file_in(10) = parameter(121)
     245         if (file_in(10) .EQ. "File in")
     246            print(" ")
     247            print("Please provide 11th input file 'file_11=' either in prompt or parameter_list or change 'no_files' to 10")
     248            print(" ")
     249            exit
     250         end if
     251      else
     252         file_in(10) = file_11
     253      end if
     254      if (.not. isfilepresent(file_in(10))) then
     255         print(" ")
     256         print("Your 11th input file: '"+file_in(10)+"' does not exist")
     257         print(" ")
     258         exit
     259      end if
     260   end if
     261   if (no_files .GT. 11) then
     262      if (.not. isvar("file_12"))then
     263         file_in(11) = parameter(125)
     264         if (file_in(11) .EQ. "File in")
     265            print(" ")
     266            print("Please provide 12th input file 'file_12=' either in prompt or parameter_list or change 'no_files' to 11")
     267            print(" ")
     268            exit
     269         end if
     270      else
     271         file_in(11) = file_12
     272      end if
     273      if (.not. isfilepresent(file_in(11))) then
     274         print(" ")
     275         print("Your 12th input file: '"+file_in(11)+"' does not exist")
     276         print(" ")
     277         exit
     278      end if
     279   end if
     280
     281   if ( .not. isvar("format_out") ) then               
    36282      format_out = "x11"
    37283      if (parameter(9) .NE. "x11") then
    38284         format_out = parameter(9) 
     285         if (format_out .NE. "x11" .OR. format_out .NE. "pdf" .OR. format_out .NE. "eps" .OR. format_out .NE. "ps" .OR. format_out .NE. "epsi" .OR. format_out .NE. "ncgm")then
     286            print(" ")
     287            print("Your 'format_out = "+format_out+"' is invalid and set to'x11'")
     288            print(" ")
     289         end if 
    39290      end if
     291   else
     292      if (format_out .NE. "x11" .OR. format_out .NE. "pdf" .OR. format_out .NE. "eps" .OR. format_out .NE. "ps" .OR. format_out .NE. "epsi" .OR. format_out .NE. "ncgm")then
     293         print(" ")
     294         print("Your 'format_out = "+format_out+"' is invalid and set to'x11'")
     295         print(" ")
     296      end if 
    40297   end if
    41    if ( .not. isvar("file_out") ) then                  ; path+name of output file
     298
     299   if ( .not. isvar("file_out") ) then                 
    42300      file_out = "test"
    43301      if (parameter(11) .NE. "test_ts") then
     
    45303     end if     
    46304   end if
    47    if ( .not. isvar("no_columns") ) then                ; number of plots in one row
     305   if ( .not. isvar("no_columns") ) then               
    48306      no_columns = 1
    49307      if (parameter(17) .NE. "1") then
     
    63321         if (stringtointeger(parameter(23)) .NE. 1) then
    64322            print(" ")
    65             print("Please set 'combine' to 0 or 1")
    66             print(" ")
    67             exit
    68          end if
    69       end if
     323            print("Your 'combine'= "+combine+" is invalid and set to 0")
     324            print(" ")
     325            combine = 0
     326         else
     327            if (no_files .GT. 1) then
     328               print(" ")
     329               print("If you have more than one input file you cannot combine variables: combine is set to 0")
     330               print(" ")
     331               combine = 0
     332            end if
     333         end if
     334      end if
     335   else
     336      if (combine .NE. 0 .AND. combine .NE. 1)then
     337         print(" ")
     338         print("Your 'combine'= "+combine+" is invalid and set to 0")
     339         print(" ")
     340         combine = 0
     341      end if
     342      if (no_files .GT. 1) then
     343         combine = 0
     344         print(" ")
     345         print("If you have more than one input file you cannot combine variables: combine is set to 0")
     346         print(" ")
     347      end if       
    70348   end if
     349
    71350   if (combine .EQ. 1) then
    72351      if( .not. isvar("c_var") ) then
     
    81360      end if
    82361   end if
     362
    83363   if ( .not. isvar("black") ) then                     ; color of lines
    84364      black = 0
     
    87367         if (stringtointeger(parameter(31)) .NE. 1) then
    88368            print(" ")
    89             print("Please set 'black' to 0 or 1")
    90             print(" ")
    91             exit
    92          end if
     369            print("Your 'black'= "+black+" is invalid and set to 0")
     370            print(" ")
     371            black = 0
     372         end if
     373      end if
     374   else
     375      if (black .NE. 0 .AND. black .NE. 1)then
     376         print(" ")
     377         print("Your 'black'= "+black+" is invalid and set to 0")
     378         print(" ")
     379         black = 0
    93380      end if
    94381   end if
    95    if ( .not. isvar("dash") ) then                      ; pattern of lines
     382
     383   if ( .not. isvar("dash") ) then                     
    96384      dash = 0
    97385      if (parameter(29) .NE. "0") then
     
    99387         if (stringtointeger(parameter(29)) .NE. 1) then
    100388            print(" ")
    101             print("Please set 'dash' to 0 or 1")
    102             print(" ")
    103             exit
     389            print("Your 'dash'= "+dash+" is invalid and set to 0")
     390            print(" ")
     391            dash = 0
    104392         end if 
    105393      end if
     394   else
     395      if (dash .NE. 0 .AND. dash .NE. 1)then
     396         print(" ")
     397         print("Your 'dash'= "+dash+" is invalid and set to 0")
     398         print(" ")
     399         dash = 0
     400      end if
    106401   end if
     402
    107403   if ( .not. isvar("over") ) then                      ; switches overlaying plots on
    108404      over = 0
     
    111407         if (stringtointeger(parameter(37)) .NE. 1) then
    112408            print(" ")
    113             print("Please set 'over' to 0 or 1")
    114             print(" ")
    115             exit
     409            print("Your 'over'= "+over+" is invalid and set to 0")
     410            print(" ")
     411            over = 0
     412         else
     413            if (no_files .GT. 1) then
     414               over = 0
     415               print(" ")
     416               print("If you have more than one input file you cannot overlay variables: over is set to 0")
     417               print(" ")
     418            end if
    116419         end if   
     420      end if
     421   else
     422      if (over .NE. 0 .AND. over .NE. 1)then
     423         print(" ")
     424         print("Your 'over'= "+over+" is invalid and set to 0")
     425         print(" ")
     426         over = 0
    117427      end if
    118428   end if
     
    129439         end if   
    130440      end if
     441   else
     442      if (prof3d .NE. 0 .AND. prof3d .NE. 1)then
     443         print(" ")
     444         print("Your 'prof3d'= "+prof3d+" is invalid; please set 'prof3d' to 0 or 1")
     445         print(" ")
     446         exit
     447      end if
    131448   end if
    132  
     449
     450   if (.not. isvar("logy"))then
     451      logy = 0
     452      if (stringtointeger(parameter(77)) .NE. 0) then
     453         logy = stringtointeger(parameter(77))
     454         if (stringtointeger(parameter(77)) .NE. 1) then
     455            print(" ")
     456            print("Your 'logy'= "+logy+" is invalid and set to 0")
     457            print(" ")
     458            logy = 0
     459         end if   
     460      end if
     461   else
     462      if (logy .NE. 0 .AND. logy .NE. 1)then
     463         print(" ")
     464         print("Your 'logy'= "+logy+" is invalid and set to 0")
     465         print(" ")
     466         logy = 0
     467      end if   
     468   end if
     469
     470   if ( .not. isvar("norm") ) then             
     471      norm = 1.0
     472      if (parameter(79) .NE. "1") then
     473         norm = stringtofloat(parameter(79))
     474         if (stringtofloat(parameter(79)) .EQ. 0) then
     475            print(" ")
     476            print("You cannot normalise with 0, 'norm' is set to 1")
     477            print(" ")
     478            norm = 1.0
     479         end if
     480      end if
     481   else
     482      if (norm .EQ. 0) then
     483         print(" ")
     484         print("You cannot normalise with 0, 'norm' is set to 1")
     485         print(" ")
     486         norm = 1.0
     487      end if
     488   end if
     489
    133490   ; ***************************************************
    134491   ; open input file
    135492   ; ***************************************************
    136493
    137    f=addfile( file_in,"r")
    138 
     494   do nof=0,no_files-1
     495
     496   f=addfile( file_in(nof),"r")
     497   
    139498   vNam = getfilevarnames(f)
     499   if (nof .EQ. 0)then
     500      vNam0=vNam
     501   end if
     502   if (nof .NE. 0)then
     503      if (dim0 .NE. dim)then
     504         print(" ")
     505         print("Your Input files does not contain the same variables")
     506         print(" ")
     507         exit
     508      else
     509         do i=0,dim0-1
     510            if (vNam0(i) .NE. vNam(i))then
     511               print(" ")
     512               print("Your Input files does not contain the same variables")
     513               print(" ")
     514               exit
     515            end if
     516         end do
     517      end if
     518   end if
     519   nof=nof+1
    140520   print(" ")
    141    print("Variable on netCDF file: " + vNam)
     521   print("Variable in input file "+nof+": " + vNam)
    142522   print(" ")
     523   nof=nof-1
    143524   dim = dimsizes(vNam)
     525   dim0=dim
    144526 
    145527   if (dim .EQ. 0) then
     
    149531   end if
    150532
     533   ;-----------------------------------------------------below steps only for first file -> nof=0
     534   if (nof .EQ. 0) then
     535
     536      plot = new(dim,graphic)
     537      plot_ = new(dim,graphic)
     538      if (no_files .GT. 1) then
     539         multi_plot = new((/no_files,dim/),graphic)
     540         max_nof = new((/no_files,dim/),float)
     541         min_nof = new((/no_files,dim/),float)
     542         name    = new((/no_files,dim/),string)
     543         unit_   = new((/no_files,dim/),string)
     544      end if
     545
    151546   if (prof3d .EQ. 0) then
    152 
     547 
    153548   do varn = dim-1,0,1
    154549      if ( isStrSubset( vNam(varn), "time") .OR. isStrSubset( vNam(varn), "NORM")) then
     
    156551         continue
    157552      end if
    158       if (vNam(varn) .EQ. "u" .OR. isStrSubset(vNam(varn), "u_"))
     553      if (vNam(varn) .EQ. "u" .OR. isStrSubset(vNam(varn), "u_"))then
    159554         z_u = f->$vNam(varn+1)$
    160555         break
     
    274669         continue
    275670      end if
    276       if (vNam(varn) .EQ. "w" .OR. isStrSubset(vNam(varn), "w_"))
     671      if (vNam(varn) .EQ. "w" .OR. isStrSubset(vNam(varn), "w_"))then
    277672         z_w = f->$vNam(varn+1)$
    278673         break
     
    452847
    453848   if (zu .EQ. 0 .AND. zw .EQ. 0) then
     849      co=0
    454850      do varn=0,dim-1     
    455851         if ( isStrSubset( vNam(varn), "time") .OR. isStrSubset( vNam(varn), "NORM")) then
     
    466862            end if
    467863         end if
    468          if (check)
     864         if (check)then
     865            co=co+1
    469866            z = f->$vNam(varn+1)$
    470867            dimz = dimsizes(z)
     
    472869         end if   
    473870      end do
     871      if (co .EQ. 0) then
     872         print(" ")
     873         print("The variables 'var=°"+var+"°' do not exist on your input file")
     874         print(" ")
     875         exit
     876      end if
    474877   end if
     878
    475879   if (isvar("z_u") ) then
    476880      dimz  = dimsizes(z_u)
     
    484888
    485889      do varn = dim-1,0,1
    486          if (vNam(varn) .EQ. "zu_3d")
     890         if (vNam(varn) .EQ. "zu_3d")then
    487891            z_u = f->zu_3d 
    488892            dimz  = dimsizes(z_u)         
    489893         else
    490             if (vNam(varn) .EQ. "zw_3d")
     894            if (vNam(varn) .EQ. "zw_3d")then
    491895               z_w = f->zw_3d
    492896               dimz  = dimsizes(z_w)
     
    501905   delta_t=t_all(nt-1)/nt
    502906
     907
    503908   ; ****************************************************       
    504909   ; start of time step and different types of mistakes that could be done
    505910   ; ****************************************************
    506 
     911   
    507912   if ( .not. isvar("start_time_step") ) then           
    508913      start_time_step=t_all(0)/3600
    509914      if (parameter(13) .NE. "t(0)") then
    510          if (stringtodouble(parameter(13)) .GT. t_all(nt-1)/3600)
     915         if (stringtodouble(parameter(13)) .GT. t_all(nt-1)/3600)then
    511916            print(" ")
    512917            print("'start_time_step' = "+ parameter(13) +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h")
     
    516921            exit
    517922         end if
    518          if (stringtofloat(parameter(13)) .LT. t_all(0)/3600)
     923         if (stringtofloat(parameter(13)) .LT. t_all(0)/3600)then
    519924            print(" ")
    520925            print("'start_time_step' = "+ parameter(13) +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")           
     
    524929      end if
    525930   else
    526       if (start_time_step .GT. t_all(nt-1)/3600)
     931      if (start_time_step .GT. t_all(nt-1)/3600)then
    527932         print(" ")
    528933         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")
     
    532937         exit
    533938      end if
    534       if (start_time_step .LT. t_all(0)/3600)
     939      if (start_time_step .LT. t_all(0)/3600)then
    535940         print(" ")
    536941         print("'start_time_step' = "+ start_time_step +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
     
    540945   end if
    541946   start_time_step = start_time_step*3600
    542    ;if (start_time_step .GE. t_all(0) .AND. start_time_step .LT. t_all(1)+delta_t/2)then
    543    ;   st=0
    544    ;end if
     947
    545948   do i=0,nt-1     
    546949      if (start_time_step .GE. t_all(i)-delta_t/2 .AND. start_time_step .LT. t_all(i)+delta_t/2)then
     
    557960      end_time_step = t_all(nt-1)/3600
    558961      if (parameter(15) .NE. "t(end)") then
    559          if (stringtodouble(parameter(15)) .GT. t_all(nt-1)/3600)
     962         if (stringtodouble(parameter(15)) .GT. t_all(nt-1)/3600)then
    560963            print(" ")
    561964            print("'end_time_step' = "+ parameter(15) +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h")
     
    565968            exit
    566969         end if
    567          if (stringtodouble(parameter(15)) .LT. start_time_step/3600)
     970         if (stringtodouble(parameter(15)) .LT. start_time_step/3600)then
    568971            print(" ")
    569972            print("'end_time_step' = "+ parameter(15) +"h is lower than 'start_time_step' = "+start_time_step/3600+"h")
     
    576979      end if   
    577980   else
    578       if (end_time_step .GT. t_all(nt-1)/3600)
     981      if (end_time_step .GT. t_all(nt-1)/3600)then
    579982         print(" ")
    580983         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")
     
    584987         exit
    585988      end if
    586       if (end_time_step .LT. start_time_step/3600)
     989      if (end_time_step .LT. start_time_step/3600)then
    587990         print(" ")
    588991         print("'end_time_step' = "+ end_time_step +"h is lower than 'start_time_step' = "+start_time_step+"h")
     
    594997   end if
    595998   end_time_step = end_time_step*3600
    596    ;if (end_time_step .GE. t_all(0) .AND. end_time_step .LT. t_all(1)+delta_t/2)then
    597    ;   et=1
    598    ;end if
     999
    5991000   do i=0,nt-1     
    6001001      if (end_time_step .GE. t_all(i)-delta_t/2 .AND. end_time_step .LT. t_all(i)+delta_t/2)then
     
    6081009   delete(end_time_step)
    6091010   end_time_step=round(et,3)
     1011
     1012   print(" ")
     1013   print("Output of time steps from "+t_all(start_time_step)/3600+" h = "+t_all(start_time_step)+" s => index = "+start_time_step)
     1014   print("                     till "+t_all(end_time_step)/3600+" h = "+t_all(end_time_step)+" s => index = "+end_time_step)
     1015   print(" ")
    6101016
    6111017   ; ****************************************************
     
    6151021   legend_label=new(nt,double)
    6161022   do p=start_time_step,end_time_step
    617       legend_label(p-start_time_step)=t_all(p)
     1023      if (t_all(p)/3600 .LT. 1) then
     1024         legend_label(p-start_time_step)=decimalPlaces(t_all(p)/3600,2,True)
     1025      else
     1026         legend_label(p-start_time_step)=decimalPlaces(t_all(p)/3600,0,True)
     1027      end if
    6181028   end do
    6191029   
    6201030   np = end_time_step-start_time_step+1 
    621    if ( black .eq. 0 ) then
    622       res=True     
    623       res@xyLineColors = ispan(2,237,235/np)
    624    end if
    6251031
    6261032   ; ***************************************************
     
    6281034   ; ***************************************************
    6291035
     1036   res                         = True
    6301037   res@gsnDraw                 = False
    6311038   res@gsnFrame                = False
     
    6481055   res@pmLegendOrthogonalPosF  = -1.0
    6491056   res@pmLegendWidthF          = 0.12
    650    res@pmLegendHeightF         = 0.3
     1057   res@pmLegendHeightF         = 0.04*(end_time_step-start_time_step+1)
    6511058   res@lgLabelFontHeightF     = .02
    6521059   res@txFontHeightF      = 0.02
    6531060   res@tiXAxisFontHeightF = 0.02
    6541061   res@tiYAxisFontHeightF = 0.02
    655    res@tiXAxisString      = " "   
    656    res@tiYAxisString      = "Height [z]"
    657    
     1062   res@tiXAxisString      = " "
     1063   if ( black .eq. 0 ) then 
     1064      res@xyLineColors = ispan(2,237,235/np)
     1065   end if
     1066   if (norm .EQ. 1)then
     1067      res@tiYAxisString      = "Height [m]"
     1068   else   
     1069      res@tiYAxisString      = "Height / "+norm+" [m]"
     1070   end if
     1071   
     1072   if (logy .EQ. 1) then
     1073      res@trYLog = True
     1074   end if
     1075
    6581076   if ( dash .eq. 0 ) then
    659       res@xyMonoDashPattern       = True 
     1077      res@xyMonoDashPattern       = True
     1078   else
     1079      if (no_files .GT. 1)
     1080         res@xyMonoDashPattern       = True   
     1081         print(" ")
     1082         print("If you use more than one file, patterns for different timesteps cannot be used")
     1083         print(" ")
     1084      end if
    6601085   end if
    6611086
     
    6701095   ; ***************************************************
    6711096
    672    plot = new(dim,graphic)
    673    plot_ = new(dim,graphic)
    674 
    6751097   if (combine .EQ. 1) then
    6761098      if ( .not. isvar("number_comb") ) then           
     
    7021124   wks=gsn_open_wks(format_out,file_out)
    7031125   gsn_define_colormap(wks,"rainbow+white")
    704  
     1126
     1127   ; ***************************************************
     1128   ; set up minimum and maximum height
     1129   ; ***************************************************
     1130
     1131   if (logy .EQ. 1)then
     1132      if (.not. isvar("min_z"))then
     1133         if (isvar("z_u"))then
     1134            min_z=z_u(1)
     1135         else
     1136            min_z=z_w(1)
     1137         end if
     1138         if (stringtofloat(parameter(33)) .NE. z_u(1) .OR. stringtofloat(parameter(33)) .NE. z_w(1)) then
     1139            if (stringtofloat(parameter(33)) .EQ. 0) then
     1140               if (isvar("z_u"))then
     1141                  min_z=z_u(1)
     1142               else
     1143                  min_z=z_w(1)
     1144               end if 
     1145            else
     1146               if (stringtofloat(parameter(33)) .GE. max(z_u) ) then
     1147                  print(" ")
     1148                  print("Minimum of height ('min_z'="+stringtofloat(parameter(33))+") is greater than available heights (="+max(z_u)+")")
     1149                  print(" ")
     1150                  exit
     1151               end if
     1152               if (stringtofloat(parameter(33)) .LT. z_u(1)) then
     1153                  print(" ")
     1154                  print("Begin height 'min_z' at least at level k=1 (="+z_u(1)+"m) due to the logarithmic scale of the y-axis")
     1155                  print(" ")
     1156                  exit
     1157               end if
     1158               min_z=stringtofloat(parameter(33))
     1159            end if
     1160         end if
     1161      else
     1162         if (min_z .GE. max(z_u) ) then
     1163            print(" ")
     1164            print("Minimum of height ('min_z'="+min_z+") is greater than available heights (="+max(z_u)+")")
     1165            print(" ")
     1166            exit
     1167         end if
     1168         if (min_z .LT. z_u(1) ) then
     1169            print(" ")
     1170            print("Begin height 'min_z' at least at level k=1 (="+z_u(1)+"m) due to the logarithmic scale of the y-axis")
     1171            print(" ")
     1172            exit
     1173         end if
     1174      end if
     1175   else
     1176      if (.not. isvar("min_z"))then
     1177         min_z=0.0     
     1178         if (stringtofloat(parameter(33)) .NE. 0) then
     1179            if (stringtofloat(parameter(33)) .GE. max(z_u) ) then
     1180               print(" ")
     1181               print("Minimum of height ('min_z'="+stringtofloat(parameter(33))+") is greater than available heights (="+max(z_u)+")")
     1182               print(" ")
     1183               exit
     1184            end if
     1185            if (stringtofloat(parameter(33)) .LT. 0 ) then
     1186               print(" ")
     1187               print("Begin minimum of height 'min_z' with 0")
     1188               print(" ")
     1189               exit
     1190            end if
     1191            min_z=stringtofloat(parameter(33))
     1192         end if
     1193      else
     1194         if (min_z .GE. max(z_u) ) then
     1195            print(" ")
     1196            print("Minimum of height ('min_z'="+min_z+") is greater than available heights (="+max(z_u)+")")
     1197            print(" ")
     1198            exit
     1199         end if
     1200         if (min_z .LT. 0 ) then
     1201            print(" ")
     1202            print("Begin minimum of height 'min_z' with 0")
     1203            print(" ")
     1204            exit
     1205         end if
     1206      end if
     1207   end if
     1208
     1209   if (.not. isvar("max_z"))then
     1210      max_z=max(z_u)
     1211      if ((parameter(35)) .NE. "max(z_u)") then
     1212         if (stringtofloat(parameter(35)) .GE. max(z_u) ) then
     1213            print(" ")
     1214            print("Maximum of height ('max_z'="+parameter(35)+") is greater than available heights (="+max(z_u)+")")
     1215            print(" ")
     1216            exit
     1217         end if
     1218         if (stringtofloat(parameter(35)) .LE. 0 ) then
     1219            print(" ")
     1220            print("Maximum of height 'max_z' should be at least 1")
     1221            print(" ")
     1222            exit
     1223         end if
     1224         max_z=stringtofloat(parameter(35))
     1225      end if
     1226   else
     1227      if (max_z .GE. max(z_u) ) then
     1228         print(" ")
     1229         print("Maximum of height ('max_z'="+max_z+") is greater than available heights (="+max(z_u)+")")
     1230         print(" ")
     1231         exit
     1232      end if
     1233      if (max_z .LE. 0 ) then
     1234         print(" ")
     1235         print("Maximum of height 'max_z' should be at least 1")
     1236         print(" ")
     1237         exit
     1238      end if
     1239   end if
     1240
     1241   min_z=min_z/norm
     1242   max_z=max_z/norm
     1243
     1244   ; ***************************************************
     1245   ; read data and create plots
     1246   ; ***************************************************
     1247     
     1248   do ti = start_time_step, end_time_step
     1249      if( t_all(ti) .lt. 10^36) then
     1250         start_time_step = ti
     1251         break
     1252      end if
     1253   end do 
     1254   
     1255   if (logy .EQ. 1) then
     1256      data   = new((/dim,(end_time_step-start_time_step)+1,dimz-1/),float)
     1257      data_0 = new((/(end_time_step-start_time_step)+1,dimz-1/),float)
     1258      data_0 = 0.1
     1259      t      = new((/(end_time_step-start_time_step)+1,dimz-1/),float)
     1260      t      = 0.0
     1261      unit   = new(dim,string)
     1262      if (isvar("z_u"))then
     1263         if (typeof(z_u) .EQ. "double")then
     1264            z_v    = new((/dim,dimz/),double)
     1265            z_     = new((/dim,dimz-1/),double)
     1266         else
     1267            if (typeof(z_u) .EQ. "float")then
     1268               z_v    = new((/dim,dimz/),float)
     1269               z_     = new((/dim,dimz-1/),float)
     1270            end if
     1271         end if
     1272      else
     1273         if (isvar("z_w"))then
     1274            if (typeof(z_w) .EQ. "double")then
     1275               z_v    = new((/dim,dimz/),double)
     1276               z_     = new((/dim,dimz-1/),double)
     1277            else
     1278               if (typeof(z_w) .EQ. "float")then
     1279                  z_v    = new((/dim,dimz/),float)
     1280                  z_     = new((/dim,dimz-1/),float)
     1281               end if
     1282            end if
     1283         end if
     1284      end if
     1285   else
     1286      data   = new((/dim,(end_time_step-start_time_step)+1,dimz/),float)
     1287      data_0 = new((/(end_time_step-start_time_step)+1,dimz/),float)
     1288      data_0 = 0.0
     1289      t      = new((/(end_time_step-start_time_step)+1,dimz/),float)
     1290      t      = 0.0
     1291      unit   = new(dim,string)
     1292      if (isvar("z_u"))then
     1293         if (typeof(z_u) .EQ. "double")then
     1294            z_v    = new((/dim,dimz/),double)
     1295            z_     = new((/dim,dimz/),double)
     1296         else
     1297            if (typeof(z_u) .EQ. "float")then
     1298               z_v    = new((/dim,dimz/),float)
     1299               z_     = new((/dim,dimz/),float)
     1300            end if
     1301         end if
     1302      else
     1303         if (isvar("z_w"))then
     1304            if (typeof(z_w) .EQ. "double")then
     1305               z_v    = new((/dim,dimz/),double)
     1306               z_     = new((/dim,dimz/),double)
     1307            else
     1308               if (typeof(z_w) .EQ. "float")then
     1309                  z_v    = new((/dim,dimz/),float)
     1310                  z_     = new((/dim,dimz/),float)
     1311               end if
     1312            end if
     1313         end if
     1314      end if
     1315   end if
     1316
     1317   end if
     1318   ;------------------------------------------------------ above steps only for first file
     1319
    7051320   ; ***************************************************
    7061321   ; indicate plot number
     
    7121327      n = 0
    7131328   end if
    714 
    715    ; ***************************************************
    716    ; set up minimum and maximum height
    717    ; ***************************************************
    718 
    719    if (.not. isvar("min_z"))
    720       min_z=0
    721       if (stringtointeger(parameter(33)) .NE. 0) then
    722          if (stringtointeger(parameter(33)) .GE. max(z_u) ) then
    723             print(" ")
    724             print("Minimum of height ('min_z'="+stringtointeger(parameter(33))+") is greater than available heights (="+max(z_u)+")")
    725             print(" ")
    726             exit
    727          end if
    728          if (stringtointeger(parameter(33)) .LT. 0 ) then
    729             print(" ")
    730             print("Begin minimum of height 'min_z' with 0")
    731             print(" ")
    732             exit
    733          end if
    734          min_z=stringtointeger(parameter(33))
    735       end if
    736    else
    737       if (min_z .GE. max(z_u) ) then
    738          print(" ")
    739          print("Minimum of height ('min_z'="+min_z+") is greater than available heights (="+max(z_u)+")")
    740          print(" ")
    741          exit
    742       end if
    743       if (min_z .LT. 0 ) then
    744          print(" ")
    745          print("Begin minimum of height 'min_z' with 0")
    746          print(" ")
    747          exit
    748       end if
    749    end if
    750 
    751    if (.not. isvar("max_z"))
    752       max_z=max(z_u)
    753       if ((parameter(35)) .NE. "max(z_u)") then
    754          if (stringtofloat(parameter(35)) .GE. max(z_u) ) then
    755             print(" ")
    756             print("Maximum of height ('max_z'="+parameter(35)+") is greater than available heights (="+max(z_u)+")")
    757             print(" ")
    758             exit
    759          end if
    760          if (stringtointeger(parameter(35)) .LE. 0 ) then
    761             print(" ")
    762             print("Maximum of height 'max_z' should be at least 1")
    763             print(" ")
    764             exit
    765          end if
    766          max_z=stringtointeger(parameter(35))
    767       end if
    768    else
    769       if (max_z .GE. max(z_pr) ) then
    770          print(" ")
    771          print("Maximum of height ('max_z'="+max_z+") is greater than available heights (="+max(z_u)+")")
    772          print(" ")
    773          exit
    774       end if
    775       if (max_z .LE. 0 ) then
    776          print(" ")
    777          print("Maximum of height 'max_z' should be at least 1")
    778          print(" ")
    779          exit
    780       end if
    781    end if
    782 
    783    ; ***************************************************
    784    ; read data and create plots
    785    ; ***************************************************
    786      
    787    do ti = start_time_step, end_time_step
    788       if( t_all(ti) .lt. 10^36) then
    789          start_time_step = ti
    790          break
    791       end if
    792    end do 
    793  
    794    data   = new((/dim,(end_time_step-start_time_step)+1,dimz/),float)
    795    data_0 = new((/(end_time_step-start_time_step)+1,dimz/),float)
    796    data_0 = 0.0
    797    t      = new((/(end_time_step-start_time_step)+1,dimz/),float)
    798    t      = 0.0
    799    unit   = new(dim,string)
    800    z_v    = new((/dim,dimz/),double)
    8011329
    8021330   if (over .EQ. 1) then
     
    9761504      if (combine .EQ. 1) then         
    9771505         com=isStrSubset(c_var,","+vNam(varn)+"," )     
    978          if (com)      
     1506         if (com) then      
    9791507            if (prof3d .EQ. 0) then
    9801508               temp = f->$vNam(varn)$
    981                data(varn,:,:) = temp(start_time_step:end_time_step,0:dimz-1)
     1509               if (logy .EQ. 1) then
     1510                  data(varn,:,:) = temp(start_time_step:end_time_step,1:dimz-1)
     1511               else
     1512                  data(varn,:,:) = temp(start_time_step:end_time_step,0:dimz-1)
     1513               end if
    9821514            else
    983                do i=0,dimz-1
    984                   do j=start_time_step,end_time_step
    985                      temp= f->$vNam(varn)$(j,i,:,:)
    986                      data(varn,j-start_time_step,i) = dim_avg_Wrap(dim_avg_Wrap(temp(:,:)))
     1515               if (logy .EQ. 1) then
     1516                  do i=1,dimz-1
     1517                     do j=start_time_step,end_time_step
     1518                        temp= f->$vNam(varn)$(j,i,:,:)
     1519                        data(varn,j-start_time_step,i-1) = dim_avg_Wrap(dim_avg_Wrap(temp(:,:)))
     1520                     end do
    9871521                  end do
    988                end do
     1522               else
     1523                  do i=0,dimz-1
     1524                     do j=start_time_step,end_time_step
     1525                        temp= f->$vNam(varn)$(j,i,:,:)
     1526                        data(varn,j-start_time_step,i) = dim_avg_Wrap(dim_avg_Wrap(temp(:,:)))
     1527                     end do
     1528                  end do
     1529               end if
    9891530               print(" ")
    9901531               print("Variable for combine '"+vNam(varn)+"' is read")
     
    10061547      if(check) then
    10071548
     1549         if (isStrSubset(vNam(varn),"_0" ))then
     1550            print(" ")
     1551            print("If you have Outputs of statistic regions you cannot overlay variables; 'over' is set to 0")
     1552            print(" ")
     1553            over = 0
     1554         end if
     1555       
    10081556         count_var=count_var+1
    10091557
     
    10111559            temp = f->$vNam(varn)$
    10121560         else
    1013             do i=0,dimz-1
    1014                do j=start_time_step,end_time_step
    1015                   temp = f->$vNam(varn)$(j,i,:,:)
    1016                   data(varn,j-start_time_step,i) = dim_avg_Wrap(dim_avg_Wrap(temp(:,:)))
     1561             if (logy .EQ. 1) then
     1562               do i=1,dimz-1
     1563                  do j=start_time_step,end_time_step
     1564                     temp= f->$vNam(varn)$(j,i,:,:)
     1565                     data(varn,j-start_time_step,i-1) = dim_avg_Wrap(dim_avg_Wrap(temp(:,:)))
     1566                  end do
    10171567               end do
    1018             end do
     1568            else
     1569               do i=0,dimz-1
     1570                  do j=start_time_step,end_time_step
     1571                     temp= f->$vNam(varn)$(j,i,:,:)
     1572                     data(varn,j-start_time_step,i) = dim_avg_Wrap(dim_avg_Wrap(temp(:,:)))
     1573                  end do
     1574               end do
     1575            end if
    10191576            print(" ")
    10201577            print("Variable '"+vNam(varn)+"' is read")
     
    10261583   
    10271584         if (prof3d .EQ. 0) then
    1028             z = f->$vNam(varn+1)$
    1029             unit(varn) = temp@units
    1030             data(varn,:,:) = temp(start_time_step:end_time_step,0:dimz-1)
     1585            if (logy .EQ. 1) then
     1586               z = f->$vNam(varn+1)$(1:dimz-1)
     1587               unit(varn) = temp@units
     1588               data(varn,:,:) = temp(start_time_step:end_time_step,1:dimz-1)
     1589            else
     1590               z = f->$vNam(varn+1)$
     1591               unit(varn) = temp@units
     1592               data(varn,:,:) = temp(start_time_step:end_time_step,:)
     1593            end if
    10311594         else
    10321595            do i=0,b-1           
    1033                if (isStrSubset( a(i),"zu_3d" ))
     1596               if (isStrSubset( a(i),"zu_3d" ))then
    10341597                  z_v(varn,:) = z_u
    1035                   z = z_v(varn,:)
    1036                else
    1037                   if (isStrSubset( a(i),"zw_3d" ))
     1598                  if (logy .EQ. 1) then
     1599                     z = z_v(varn,1:dimz-1)
     1600                  else
     1601                     z = z_v(varn,:)
     1602                  end if
     1603               else
     1604                  if (isStrSubset( a(i),"zw_3d" ))then
    10381605                     z_v(varn,:) = z_w
    1039                      z = z_v(varn,:)
     1606                     if (logy .EQ. 1) then
     1607                        z = z_v(varn,1:dimz-1)
     1608                     else
     1609                        z = z_v(varn,:)
     1610                     end if
    10401611                  end if                   
    10411612               end if
    10421613            end do           
    10431614         end if
     1615
     1616         if (data(varn,0,0) .GT. 1.E35) then
     1617            data(varn,0,:) = data(varn,1,:)
     1618         end if
     1619         if (nof .EQ. 0) then
     1620            z_(n,:)=z/norm
     1621            z    = z_(n,:)
     1622         else
     1623            z=z/norm
     1624         end if
     1625   
    10441626         if (over .EQ. 0) then 
     1627            res@xyDashPattern      = nof
    10451628            res@gsnLeftString      = vNam(varn)
    10461629            res@gsnRightString     = unit(varn)
     
    10641647            else
    10651648               res@trXMaxF            = xe 
    1066             end if                    
     1649            end if         
    10671650            plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 
    10681651         end if       
     
    10731656               if (over .EQ. 1) then
    10741657                  res@xyDashPattern  = 0
    1075                   plot_u = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1658                  plot_u = gsn_csm_xy(wks,data(varn,:,:),z,res)
    10761659               else
    10771660                  res@gsnLeftString      = vNam(varn)
     
    10951678                     res@trXMaxF            = xe 
    10961679                  end if               
    1097                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res) 
     1680                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 
    10981681               end if
    10991682            end if
     
    11031686               if (over .EQ. 1) then
    11041687                  res@xyDashPattern  = 1
    1105                   plot_v = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1688                  plot_v = gsn_csm_xy(wks,data(varn,:,:),z,res)
    11061689               else
    11071690                  res@gsnLeftString      = vNam(varn)
     
    11251708                     res@trXMaxF            = xe 
    11261709                  end if               
    1127                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1710                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    11281711               end if 
    11291712            end if
     
    11331716               if (over .EQ. 1) then
    11341717                  res@xyDashPattern  = 2
    1135                   plot_w = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1718                  plot_w = gsn_csm_xy(wks,data(varn,:,:),z,res)
    11361719               else
    11371720                  res@gsnLeftString      = vNam(varn)
     
    11551738                     res@trXMaxF            = xe 
    11561739                  end if           
    1157                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     1740                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    11581741               end if   
    11591742            end if
     
    11641747               if (over .EQ. 1) then
    11651748                  res@xyDashPattern  = 0
    1166                   plot_pt = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1749                  plot_pt = gsn_csm_xy(wks,data(varn,:,:),z,res)
    11671750               else
    11681751                  res@gsnLeftString      = vNam(varn)
     
    11861769                     res@trXMaxF            = xe 
    11871770                  end if
    1188                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1771                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    11891772               end if 
    11901773            end if
     
    11941777               if (over .EQ. 1) then
    11951778                  res@xyDashPattern  = 1
    1196                   plot_vpt = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1779                  plot_vpt = gsn_csm_xy(wks,data(varn,:,:),z,res)
    11971780               else
    11981781                  res@gsnLeftString      = vNam(varn)
     
    12161799                     res@trXMaxF            = xe 
    12171800                  end if
    1218                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1801                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    12191802               end if
    12201803            end if
     
    12241807               if (over .EQ. 1) then
    12251808                  res@xyDashPattern  = 2
    1226                   plot_lpt = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1809                  plot_lpt = gsn_csm_xy(wks,data(varn,:,:),z,res)
    12271810               else
    12281811                  res@gsnLeftString      = vNam(varn)
     
    12461829                     res@trXMaxF            = xe 
    12471830                  end if
    1248                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1831                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    12491832               end if
    12501833            end if
     
    12551838               if (over .EQ. 1) then
    12561839                  res@xyDashPattern  = 0
    1257                   plot_q = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1840                  plot_q = gsn_csm_xy(wks,data(varn,:,:),z,res)
    12581841               else
    12591842                  res@gsnLeftString      = vNam(varn)
     
    12771860                     res@trXMaxF            = xe 
    12781861                  end if
    1279                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1862                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    12801863               end if
    12811864            end if
     
    12851868               if (over .EQ. 1) then
    12861869                  res@xyDashPattern  = 1
    1287                   plot_qv = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1870                  plot_qv = gsn_csm_xy(wks,data(varn,:,:),z,res)
    12881871               else
    12891872                  res@gsnLeftString      = vNam(varn)
     
    13071890                     res@trXMaxF            = xe 
    13081891                  end if
    1309                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1892                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    13101893               end if
    13111894            end if
     
    13151898               if (over .EQ. 1) then
    13161899                  res@xyDashPattern  = 2
    1317                   plot_ql = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1900                  plot_ql = gsn_csm_xy(wks,data(varn,:,:),z,res)
    13181901               else
    13191902                  res@gsnLeftString      = vNam(varn)
     
    13371920                     res@trXMaxF            = xe 
    13381921                  end if
    1339                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1922                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    13401923               end if
    13411924            end if
     
    13461929               if (over .EQ. 1) then
    13471930                  res@xyDashPattern  = 0
    1348                   plot_e = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1931                  plot_e = gsn_csm_xy(wks,data(varn,:,:),z,res)
    13491932               else
    13501933                  res@gsnLeftString      = vNam(varn)
     
    13681951                     res@trXMaxF            = xe 
    13691952                  end if
    1370                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1953                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    13711954               end if
    13721955            end if
     
    13761959               if (over .EQ. 1) then
    13771960                  res@xyDashPattern  = 1
    1378                   plot_es = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1961                  plot_es = gsn_csm_xy(wks,data(varn,:,:),z,res)
    13791962               else
    13801963                  res@gsnLeftString      = vNam(varn)
     
    13981981                     res@trXMaxF            = xe 
    13991982                  end if
    1400                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1983                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    14011984               end if
    14021985            end if
     
    14071990               if (over .EQ. 1) then
    14081991                  res@xyDashPattern  = 0
    1409                   plot_km = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     1992                  plot_km = gsn_csm_xy(wks,data(varn,:,:),z,res)
    14101993               else
    14111994                  res@gsnLeftString      = vNam(varn)
     
    14292012                     res@trXMaxF            = xe 
    14302013                  end if
    1431                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     2014                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    14322015               end if
    14332016            end if
     
    14372020               if (over .EQ. 1) then
    14382021                  res@xyDashPattern  = 1
    1439                   plot_kh = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     2022                  plot_kh = gsn_csm_xy(wks,data(varn,:,:),z,res)
    14402023               else
    14412024                  res@gsnLeftString      = vNam(varn)
     
    14592042                     res@trXMaxF            = xe 
    14602043                  end if
    1461                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     2044                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    14622045               end if
    14632046            end if
     
    14682051               if (over .EQ. 1) then
    14692052                  res@xyDashPattern  = 0
    1470                   plot_wpup = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2053                  plot_wpup = gsn_csm_xy(wks,data(varn,:,:),z,res)
    14712054               else
    14722055                  res@gsnLeftString      = vNam(varn)
     
    14902073                     res@trXMaxF            = xe 
    14912074                  end if
    1492                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2075                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    14932076               end if
    14942077            end if
     
    14982081               if (over .EQ. 1) then
    14992082                  res@xyDashPattern  = 1
    1500                   plot_wsus = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2083                  plot_wsus = gsn_csm_xy(wks,data(varn,:,:),z,res)
    15012084               else
    15022085                  res@gsnLeftString      = vNam(varn)
     
    15202103                     res@trXMaxF            = xe 
    15212104                  end if
    1522                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2105                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    15232106               end if
    15242107            end if
     
    15282111               if (over .EQ. 1) then
    15292112                  res@xyDashPattern  = 2
    1530                   plot_wu = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2113                  plot_wu = gsn_csm_xy(wks,data(varn,:,:),z,res)
    15312114               else
    15322115                  res@gsnLeftString      = vNam(varn)
     
    15502133                     res@trXMaxF            = xe 
    15512134                  end if
    1552                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2135                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    15532136               end if
    15542137            end if
     
    15592142               if (over .EQ. 1) then
    15602143                  res@xyDashPattern  = 0
    1561                   plot_wpvp = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2144                  plot_wpvp = gsn_csm_xy(wks,data(varn,:,:),z,res)
    15622145               else
    15632146                  res@gsnLeftString      = vNam(varn)
     
    15812164                     res@trXMaxF            = xe 
    15822165                  end if
    1583                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2166                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    15842167               end if
    15852168            end if
     
    15892172               if (over .EQ. 1) then
    15902173                  res@xyDashPattern  = 1
    1591                   plot_wsvs = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2174                  plot_wsvs = gsn_csm_xy(wks,data(varn,:,:),z,res)
    15922175               else
    15932176                  res@gsnLeftString      = vNam(varn)
     
    16112194                     res@trXMaxF            = xe 
    16122195                  end if
    1613                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2196                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    16142197               end if
    16152198            end if
     
    16192202               if (over .EQ. 1) then
    16202203                  res@xyDashPattern  = 2
    1621                   plot_wv = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2204                  plot_wv = gsn_csm_xy(wks,data(varn,:,:),z,res)
    16222205               else
    16232206                  res@gsnLeftString      = vNam(varn)
     
    16412224                     res@trXMaxF            = xe 
    16422225                  end if
    1643                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2226                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    16442227               end if
    16452228            end if
     
    16502233               if (over .EQ. 1) then
    16512234                  res@xyDashPattern  = 0
    1652                   plot_wpptp = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2235                  plot_wpptp = gsn_csm_xy(wks,data(varn,:,:),z,res)
    16532236               else
    16542237                  res@gsnLeftString      = vNam(varn)
     
    16722255                     res@trXMaxF            = xe 
    16732256                  end if
    1674                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2257                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    16752258               end if
    16762259            end if
     
    16802263               if (over .EQ. 1) then
    16812264                  res@xyDashPattern  = 1
    1682                   plot_wspts = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2265                  plot_wspts = gsn_csm_xy(wks,data(varn,:,:),z,res)
    16832266               else
    16842267                  res@gsnLeftString      = vNam(varn)
     
    17022285                     res@trXMaxF            = xe 
    17032286                  end if
    1704                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2287                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    17052288               end if
    17062289            end if
     
    17102293               if (over .EQ. 1) then
    17112294                  res@xyDashPattern  = 2
    1712                   plot_wpt = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2295                  plot_wpt = gsn_csm_xy(wks,data(varn,:,:),z,res)
    17132296               else
    17142297                  res@gsnLeftString      = vNam(varn)
     
    17322315                     res@trXMaxF            = xe 
    17332316                  end if
    1734                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2317                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    17352318               end if
    17362319            end if
     
    17412324               if (over .EQ. 1) then
    17422325                  res@xyDashPattern  = 0
    1743                   plot_wsptsBC = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2326                  plot_wsptsBC = gsn_csm_xy(wks,data(varn,:,:),z,res)
    17442327               else
    17452328                  res@gsnLeftString      = vNam(varn)
     
    17632346                     res@trXMaxF            = xe 
    17642347                  end if
    1765                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2348                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    17662349               end if
    17672350            end if             
     
    17712354               if (over .EQ. 1) then
    17722355                  res@xyDashPattern  = 1
    1773                   plot_wptBC = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2356                  plot_wptBC = gsn_csm_xy(wks,data(varn,:,:),z,res)
    17742357               else
    17752358                  res@gsnLeftString      = vNam(varn)
     
    17932376                     res@trXMaxF            = xe 
    17942377                  end if
    1795                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2378                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    17962379               end if
    17972380            end if
     
    18022385               if (over .EQ. 1) then
    18032386                  res@xyDashPattern  = 0
    1804                   plot_wpvptp = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2387                  plot_wpvptp = gsn_csm_xy(wks,data(varn,:,:),z,res)
    18052388               else
    18062389                  res@gsnLeftString      = vNam(varn)
     
    18242407                     res@trXMaxF            = xe 
    18252408                  end if
    1826                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2409                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    18272410               end if
    18282411            end if
     
    18322415               if (over .EQ. 1) then
    18332416                  res@xyDashPattern  = 1
    1834                   plot_wsvpts = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2417                  plot_wsvpts = gsn_csm_xy(wks,data(varn,:,:),z,res)
    18352418               else
    18362419                  res@gsnLeftString      = vNam(varn)
     
    18542437                     res@trXMaxF            = xe 
    18552438                  end if
    1856                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2439                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    18572440               end if
    18582441            end if
     
    18622445               if (over .EQ. 1) then
    18632446                  res@xyDashPattern  = 2
    1864                   plot_wvpt = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2447                  plot_wvpt = gsn_csm_xy(wks,data(varn,:,:),z,res)
    18652448               else
    18662449                  res@gsnLeftString      = vNam(varn)
     
    18842467                     res@trXMaxF            = xe 
    18852468                  end if
    1886                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2469                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    18872470               end if
    18882471            end if
     
    18932476               if (over .EQ. 1) then
    18942477                  res@xyDashPattern  = 0
    1895                   plot_wpqp = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2478                  plot_wpqp = gsn_csm_xy(wks,data(varn,:,:),z,res)
    18962479               else
    18972480                  res@gsnLeftString      = vNam(varn)
     
    19152498                     res@trXMaxF            = xe 
    19162499                  end if
    1917                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2500                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    19182501               end if
    19192502            end if
     
    19232506               if (over .EQ. 1) then
    19242507                  res@xyDashPattern  = 1
    1925                   plot_wsqs = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2508                  plot_wsqs = gsn_csm_xy(wks,data(varn,:,:),z,res)
    19262509               else
    19272510                  res@gsnLeftString      = vNam(varn)
     
    19452528                     res@trXMaxF            = xe 
    19462529                  end if
    1947                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2530                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    19482531               end if
    19492532            end if
     
    19532536               if (over .EQ. 1) then
    19542537                  res@xyDashPattern  = 2
    1955                   plot_wq = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2538                  plot_wq = gsn_csm_xy(wks,data(varn,:,:),z,res)
    19562539               else
    19572540                  res@gsnLeftString      = vNam(varn)
     
    19752558                     res@trXMaxF            = xe 
    19762559                  end if
    1977                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2560                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    19782561               end if
    19792562            end if
     
    19842567               if (over .EQ. 1) then
    19852568                  res@xyDashPattern  = 0
    1986                   plot_wpqvp = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2569                  plot_wpqvp = gsn_csm_xy(wks,data(varn,:,:),z,res)
    19872570               else
    19882571                  res@gsnLeftString      = vNam(varn)
     
    20062589                     res@trXMaxF            = xe 
    20072590                  end if
    2008                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2591                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    20092592               end if
    20102593            end if
     
    20142597               if (over .EQ. 1) then
    20152598                  res@xyDashPattern  = 1
    2016                   plot_wsqvs = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2599                  plot_wsqvs = gsn_csm_xy(wks,data(varn,:,:),z,res)
    20172600               else
    20182601                  res@gsnLeftString      = vNam(varn)
     
    20362619                     res@trXMaxF            = xe 
    20372620                  end if
    2038                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2621                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    20392622               end if
    20402623            end if
     
    20442627               if (over .EQ. 1) then
    20452628                  res@xyDashPattern  = 2
    2046                   plot_wqv = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2629                  plot_wqv = gsn_csm_xy(wks,data(varn,:,:),z,res)
    20472630               else
    20482631                  res@gsnLeftString      = vNam(varn)
     
    20662649                     res@trXMaxF            = xe 
    20672650                  end if
    2068                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2651                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    20692652               end if
    20702653            end if
     
    20752658               if (over .EQ. 1) then
    20762659                  res@xyDashPattern  = 0
    2077                   plot_wpsp = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2660                  plot_wpsp = gsn_csm_xy(wks,data(varn,:,:),z,res)
    20782661               else
    20792662                  res@gsnLeftString      = vNam(varn)
     
    20972680                     res@trXMaxF            = xe 
    20982681                  end if
    2099                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2682                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    21002683               end if
    21012684            end if
     
    21052688               if (over .EQ. 1) then
    21062689                  res@xyDashPattern  = 1
    2107                   plot_wsss = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2690                  plot_wsss = gsn_csm_xy(wks,data(varn,:,:),z,res)
    21082691               else
    21092692                  res@gsnLeftString      = vNam(varn)
     
    21272710                     res@trXMaxF            = xe 
    21282711                  end if
    2129                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2712                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    21302713               end if
    21312714            end if
     
    21352718               if (over .EQ. 1) then
    21362719                  res@xyDashPattern  = 2
    2137                   plot_ws = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2720                  plot_ws = gsn_csm_xy(wks,data(varn,:,:),z,res)
    21382721               else
    21392722                  res@gsnLeftString      = vNam(varn)
     
    21572740                     res@trXMaxF            = xe 
    21582741                  end if
    2159                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2742                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    21602743               end if
    21612744            end if
     
    21662749               if (over .EQ. 1) then
    21672750                  res@xyDashPattern  = 0
    2168                   plot_wpsap = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2751                  plot_wpsap = gsn_csm_xy(wks,data(varn,:,:),z,res)
    21692752               else
    21702753                  res@gsnLeftString      = vNam(varn)
     
    21882771                     res@trXMaxF            = xe 
    21892772                  end if
    2190                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2773                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    21912774               end if
    21922775            end if
     
    21962779               if (over .EQ. 1) then
    21972780                  res@xyDashPattern  = 1
    2198                   plot_wssas = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2781                  plot_wssas = gsn_csm_xy(wks,data(varn,:,:),z,res)
    21992782               else
    22002783                  res@gsnLeftString      = vNam(varn)
     
    22182801                     res@trXMaxF            = xe 
    22192802                  end if
    2220                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2803                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    22212804               end if
    22222805            end if
     
    22262809               if (over .EQ. 1) then
    22272810                  res@xyDashPattern  = 2
    2228                   plot_wsa = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2811                  plot_wsa = gsn_csm_xy(wks,data(varn,:,:),z,res)
    22292812               else
    22302813                  res@gsnLeftString      = vNam(varn)
     
    22482831                     res@trXMaxF            = xe 
    22492832                  end if
    2250                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2833                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    22512834               end if
    22522835            end if
     
    22572840               if (over .EQ. 1) then
    22582841                  res@xyDashPattern  = 0
    2259                   plot_us2 = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     2842                  plot_us2 = gsn_csm_xy(wks,data(varn,:,:),z,res)
    22602843               else
    22612844                  res@gsnLeftString      = vNam(varn)
     
    22792862                     res@trXMaxF            = xe 
    22802863                  end if
    2281                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     2864                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    22822865               end if
    22832866            end if
     
    22872870               if (over .EQ. 1) then
    22882871                  res@xyDashPattern  = 1
    2289                   plot_vs2 = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     2872                  plot_vs2 = gsn_csm_xy(wks,data(varn,:,:),z,res)
    22902873               else
    22912874                  res@gsnLeftString      = vNam(varn)
     
    23092892                     res@trXMaxF            = xe 
    23102893                  end if
    2311                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     2894                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    23122895               end if
    23132896            end if
     
    23172900               if (over .EQ. 1) then
    23182901                  res@xyDashPattern  = 2
    2319                   plot_ws2 = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2902                  plot_ws2 = gsn_csm_xy(wks,data(varn,:,:),z,res)
    23202903               else
    23212904                  res@gsnLeftString      = vNam(varn)
     
    23392922                     res@trXMaxF            = xe 
    23402923                  end if
    2341                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2924                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    23422925               end if
    23432926            end if
     
    23482931               if (over .EQ. 1) then
    23492932                  res@xyDashPattern  = 0
    2350                   plot_wsususodz = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     2933                  plot_wsususodz = gsn_csm_xy(wks,data(varn,:,:),z,res)
    23512934               else
    23522935                  res@gsnLeftString      = vNam(varn)
     
    23702953                     res@trXMaxF            = xe 
    23712954                  end if
    2372                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     2955                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    23732956               end if 
    23742957            end if
     
    23782961               if (over .EQ. 1) then
    23792962                  res@xyDashPattern  = 1
    2380                   plot_wspsodz = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     2963                  plot_wspsodz = gsn_csm_xy(wks,data(varn,:,:),z,res)
    23812964               else
    23822965                  res@gsnLeftString      = vNam(varn)
     
    24002983                     res@trXMaxF            = xe 
    24012984                  end if
    2402                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     2985                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    24032986               end if
    24042987            end if
     
    24082991               if (over .EQ. 1) then
    24092992                  res@xyDashPattern  = 2
    2410                   plot_wpeodz = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     2993                  plot_wpeodz = gsn_csm_xy(wks,data(varn,:,:),z,res)
    24112994               else
    24122995                  res@gsnLeftString      = vNam(varn)
     
    24303013                     res@trXMaxF            = xe 
    24313014                  end if
    2432                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     3015                  plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
    24333016               end if
    24343017            end if
     3018         if (no_files .GT. 1) then
     3019            multi_plot(nof,n)=plot(n)
     3020            max_nof(nof,n)=max(data(varn,:,:))
     3021            min_nof(nof,n)=min(data(varn,:,:))
     3022            name(nof,n)   =vNam(varn)
     3023            unit_(nof,n)  =unit(varn)
     3024         end if
    24353025         if (over .EQ. 0) then
    24363026            n=n+1 
     
    24423032      end if         
    24433033   end do
     3034   if (no_files .GT. 1) then
     3035      delete(vNam)
     3036   end if
     3037   end do
     3038
     3039   if (count_var .EQ. 0) then
     3040      print(" ")
     3041      print("The variables 'var=°"+var+"°' do not exist on your input file")
     3042      print(" ")
     3043      exit
     3044   end if
     3045   
     3046   if (no_files .GT. 1) then
     3047      multi_legend=new(12,string)
     3048      string_len=new(12,integer)
     3049      multi_dash=new(no_files,string)
     3050      if (.not. isvar("name_legend_1"))
     3051         multi_legend(0)="  "+parameter(83)
     3052      else
     3053         multi_legend(0)="  "+name_legend_1
     3054      end if
     3055      string_len(0)=strlen(multi_legend(0))
     3056      if (.not. isvar("name_legend_2"))
     3057         multi_legend(1)="  "+parameter(87)
     3058      else
     3059         multi_legend(1)="  "+name_legend_2
     3060      end if
     3061      string_len(1)=strlen(multi_legend(1))
     3062      if (.not. isvar("name_legend_3"))
     3063         multi_legend(2)="  "+parameter(91)
     3064      else
     3065         multi_legend(2)="  "+name_legend_3
     3066      end if
     3067      string_len(2)=strlen(multi_legend(2))
     3068      if (.not. isvar("name_legend_4"))
     3069         multi_legend(3)="  "+parameter(95)
     3070      else
     3071         multi_legend(3)="  "+name_legend_4
     3072      end if
     3073      string_len(3)=strlen(multi_legend(3))
     3074      if (.not. isvar("name_legend_5"))
     3075         multi_legend(4)="  "+parameter(99)
     3076      else
     3077         multi_legend(4)="  "+name_legend_5
     3078      end if
     3079      string_len(4)=strlen(multi_legend(4))
     3080      if (.not. isvar("name_legend_6"))
     3081         multi_legend(5)="  "+parameter(103)
     3082      else
     3083         multi_legend(5)="  "+name_legend_6
     3084      end if
     3085      string_len(5)=strlen(multi_legend(5))
     3086      if (.not. isvar("name_legend_7"))
     3087         multi_legend(6)="  "+parameter(107)
     3088      else
     3089         multi_legend(6)="  "+name_legend_7
     3090      end if
     3091      string_len(6)=strlen(multi_legend(6))
     3092      if (.not. isvar("name_legend_8"))
     3093         multi_legend(7)="  "+parameter(111)
     3094      else
     3095         multi_legend(7)="  "+name_legend_8
     3096      end if
     3097      string_len(7)=strlen(multi_legend(7))
     3098      if (.not. isvar("name_legend_9"))
     3099         multi_legend(8)="  "+parameter(115)
     3100      else
     3101         multi_legend(8)="  "+name_legend_9
     3102      end if
     3103      string_len(8)=strlen(multi_legend(8))
     3104      if (.not. isvar("name_legend_10"))
     3105         multi_legend(9)="  "+parameter(119)
     3106      else
     3107         multi_legend(9)="  "+name_legend_10
     3108      end if
     3109      string_len(9)=strlen(multi_legend(9))
     3110      if (.not. isvar("name_legend_11"))
     3111         multi_legend(10)="  "+parameter(123)
     3112      else
     3113         multi_legend(10)="  "+name_legend_11
     3114      end if
     3115      string_len(10)=strlen(multi_legend(10))
     3116      if (.not. isvar("name_legend_12"))
     3117         multi_legend(11)="  "+parameter(127)
     3118      else
     3119         multi_legend(11)="  "+name_legend_12
     3120      end if
     3121      string_len(11)=strlen(multi_legend(11))
     3122      do ml=1,no_files
     3123         multi_dash(ml-1)=ml-1
     3124      end do
     3125      delete(plot)
     3126      plot = new(dim,graphic)
     3127      do pl=0,n-1
     3128         plot0 = new(1,graphic)
     3129         res@trXMinF = min(min_nof(:,pl))
     3130         res@trXMaxF = max(max_nof(:,pl))
     3131         res@gsnLeftString  = name(0,pl)
     3132         res@gsnRightString = unit_(0,pl)
     3133   
     3134         plot0 = gsn_csm_xy(wks,data_0(:,:),z_(pl,:),res)
     3135
     3136         ; ***************************************************
     3137         ; legend for combined plot
     3138         ; ***************************************************
     3139
     3140         lgres                    = True
     3141         lgMonoDashIndex          = False
     3142         lgres@lgLabelFont        = "helvetica"   
     3143         lgres@lgLabelFontHeightF = .2           
     3144         lgres@vpWidthF           = max(string_len)*0.012           
     3145         lgres@vpHeightF          = 0.04*no_files         
     3146         lgres@lgDashIndexes      = multi_dash(no_files-1:0)
     3147         lbid = gsn_create_legend(wks,no_files,multi_legend(no_files-1:0),lgres)       
     3148
     3149         amres = True
     3150         amres@amParallelPosF   = max(string_len)*0.01+0.78                 
     3151         amres@amOrthogonalPosF = -0.0315*no_files+0.431         
     3152         annoid1 = gsn_add_annotation(plot0,lbid,amres)
     3153
     3154         do plo=0,no_files-1
     3155            overlay(plot0,multi_plot(plo,pl))
     3156            plot(pl)=plot0
     3157         end do
     3158         delete(plot0)
     3159      end do
     3160   end if
    24443161
    24453162   if (count_var .EQ. 0) then
     
    25273244         end if     
    25283245
    2529          if (check)
    2530 
    2531             if (prof3d .EQ. 1) then
    2532 
    2533             end if
    2534          
     3246         if (check)then
     3247
    25353248            if (prof3d .EQ. 0) then
    2536                z = f->$vNam(varn+1)$
    2537             else
    2538                z = z_v(varn,:)
    2539             end if
     3249               if (logy .EQ. 1) then
     3250                  z = f->$vNam(varn+1)$(1:dimz-1)
     3251               else
     3252                  z = f->$vNam(varn+1)$               
     3253               end if
     3254            else
     3255               do i=0,b-1           
     3256                  if (isStrSubset( a(i),"zu_3d" ))then
     3257                     z_v(varn,:) = z_u
     3258                     if (logy .EQ. 1) then
     3259                        z = z_v(varn,1:dimz-1)
     3260                     else
     3261                        z = z_v(varn,:)
     3262                     end if
     3263                  else
     3264                     if (isStrSubset( a(i),"zw_3d" ))then
     3265                        z_v(varn,:) = z_w
     3266                        if (logy .EQ. 1) then
     3267                           z = z_v(varn,1:dimz-1)
     3268                        else
     3269                           z = z_v(varn,:)
     3270                        end if
     3271                     end if                   
     3272                  end if
     3273               end do           
     3274            end if
     3275
     3276            z=z/norm
    25403277
    25413278            res@gsnLeftString      = vNam(varn)
     
    25843321                  else
    25853322                     res@trXMaxF = xe 
    2586                   end if
    2587                   if (vNam(varn) .EQ. "w") then
    2588                      plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
    2589                   else
    2590                      plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_u,res)
    2591                   end if
     3323                  end if 
     3324                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res)
    25923325
    25933326                  ; ***************************************************
     
    26413374                  end if
    26423375
    2643                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     3376                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res)
    26443377
    26453378                  ; ***************************************************
     
    26923425                  end if
    26933426
    2694                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     3427                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res)
    26953428
    26963429                  ; ***************************************************
     
    27443477                  end if
    27453478
    2746                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     3479                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res)
    27473480
    27483481                  ; ***************************************************
     
    27953528                  end if
    27963529
    2797                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_u,res)
     3530                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res)
    27983531
    27993532                  ; ***************************************************
     
    28473580                  end if
    28483581
    2849                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     3582                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res)
    28503583
    28513584                  ; ***************************************************
     
    28983631                  end if
    28993632
    2900                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     3633                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res)
    29013634
    29023635                  ; ***************************************************
     
    29493682                  end if
    29503683
    2951                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     3684                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res)
    29523685
    29533686                  ; ***************************************************
     
    30003733                  end if
    30013734
    3002                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     3735                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res)
    30033736
    30043737                  ; ***************************************************
     
    30513784                  end if
    30523785
    3053                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     3786                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res)
    30543787
    30553788                  ; ***************************************************
     
    31023835                  end if
    31033836
    3104                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     3837                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res)
    31053838
    31063839                  ; ***************************************************
     
    31533886                  end if
    31543887
    3155                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     3888                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res)
    31563889
    31573890                  ; ***************************************************
     
    32043937                  end if
    32053938
    3206                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     3939                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res)
    32073940
    32083941                  ; ***************************************************
     
    32553988                  end if
    32563989
    3257                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     3990                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res)
    32583991
    32593992                  ; ***************************************************
     
    33074040                  end if
    33084041
    3309                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     4042                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res)
    33104043
    33114044                  ; ***************************************************
     
    33594092                  end if
    33604093
    3361                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z_w,res)
     4094                  plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res)
    33624095
    33634096                  ; ***************************************************
     
    34144147         if (.not. isvar("var")) then
    34154148            if (parameter(21) .NE. "variables") then
    3416                var=parameter(21)
     4149               var=parameter(21)               
    34174150               check = isStrSubset( var,","+vNam(varn)+"," )
    34184151            end if
     
    34214154         end if     
    34224155
    3423          if (check)
    3424 
     4156         if (check)then
     4157           
    34254158            if (prof3d .EQ. 0) then
    3426                z = f->$vNam(varn+1)$
    3427             else
    3428                z = z_v(varn,:) 
    3429             end if
    3430      
     4159               if (logy .EQ. 1) then
     4160                  z = f->$vNam(varn+1)$(1:dimz-1)
     4161               else
     4162                  z = f->$vNam(varn+1)$               
     4163               end if
     4164            else
     4165               do i=0,b-1           
     4166                  if (isStrSubset( a(i),"zu_3d" ))then
     4167                     z_v(varn,:) = z_u
     4168                     if (logy .EQ. 1) then
     4169                        z = z_v(varn,1:dimz-1)
     4170                     else
     4171                        z = z_v(varn,:)
     4172                     end if
     4173                  else
     4174                     if (isStrSubset( a(i),"zw_3d" ))then
     4175                        z_v(varn,:) = z_w
     4176                        if (logy .EQ. 1) then
     4177                           z = z_v(varn,1:dimz-1)
     4178                        else
     4179                           z = z_v(varn,:)
     4180                        end if
     4181                     end if                   
     4182                  end if
     4183               end do           
     4184            end if
     4185
     4186            z=z/norm
     4187           
    34314188            com=isStrSubset( c_var,","+vNam(varn)+"," )
    34324189       
    3433             if (com)
     4190            if (com)then
    34344191               co = co+1           
    34354192               if (n_o .EQ. 1) then
    3436                   res@xyDashPattern  = 1
    3437                                  
     4193                  res@xyDashPattern  = 1                                   
    34384194               else           
    34394195                  if (n_o .EQ. 2) then
     
    34414197                  else
    34424198                     res@xyDashPattern  = 0
    3443                      res@gsnLeftString  = c_var
     4199                     res@gsnLeftString  = "Combined Plot of "+c_var
    34444200                     res@gsnRightString = unit(varn)
    34454201                     if (.not. isvar("xs")) then
     
    34784234            overlay(plot_o(0),plot_o(1))
    34794235         else
    3480             print("'c_var' is not conform with existing variables on the input file")
     4236            if (.not. isvar("var") .AND. parameter(21) .EQ. "variables") then
     4237               print(" ")
     4238               print("'c_var'(= "+c_var+") is not conform with existing variables on the input file")
     4239               print(" ")
     4240            else
     4241               print(" ")
     4242               print("'c_var'(= "+c_var+") must include two variables of the general plots ('var' = "+var+")")
     4243               print(" ")
     4244            end if
    34814245         end if
    34824246      end if
     
    34864250            overlay(plot_o(0),plot_o(2))
    34874251         else
    3488             print("'c_var' is not conform with existing variables on the input file")
     4252            if (.not. isvar("var") .AND. parameter(21) .EQ. "variables") then
     4253               print(" ")
     4254               print("'c_var'(= "+c_var+") is not conform with existing variables on the input file")
     4255               print(" ")
     4256            else
     4257               print(" ")
     4258               print("'c_var'(= "+c_var+") must include three variables of the general plots ('var' = "+var+")")
     4259               print(" ")
     4260            end if
    34894261         end if
    34904262      end if
     
    35224294
    35234295   if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then
    3524       gsn_panel(wks,plot_(0:n-1),(/n,1/),resP)
     4296      gsn_panel(wks,plot_,(/n,1/),resP)
    35254297   else   
    35264298      do i = 0,n-1, no_lines*no_columns
  • palm/trunk/SCRIPTS/NCL/timeseries.ncl

    r174 r175  
    1010   ; ***************************************************
    1111   
    12    if (isfilepresent(".ncl_preferences")) then
    13       parameter = asciiread(".ncl_preferences",77,"string")
     12   if (isfilepresent("~/.ncl_preferences")) then
     13      parameter = asciiread("~/.ncl_preferences",129,"string")
    1414      delete(parameter@_FillValue)
    1515   else
    16       print(" ")
    17       print("'.ncl_preferences' is not existent")
    18       print(" ")
    19       exit
     16      if (isfilepresent("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences")) then
     17         parameter = asciiread("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences",129,"string")
     18         delete(parameter@_FillValue)
     19      else
     20         print(" ")
     21         print("'.ncl_preferences' is not present in '~/palm/current_version/trunk/SRIPTS/NCL/'")
     22         print(" ")
     23         exit
     24      end if
    2025   end if
    2126
     
    2429   ; ***************************************************
    2530 
    26    if ( .not. isvar("file_in") ) then                   ; path+name of input file     
    27       if (parameter(7) .EQ. "input file") then
    28          print(" ")
    29          print("Please provide input file 'file_in = ' either in prompt or parameter_list")
     31   if ( .not. isvar("file_1") ) then                     
     32      if (parameter(7) .EQ. "File in") then
     33         print(" ")
     34         print("Please provide 1st input file 'file_1=' either in prompt or parameter_list")
    3035         print(" ")
    3136         exit
    3237      else
    3338         file_in = parameter(7)
    34       end if     
    35    end if
    36    if ( .not. isvar("format_out") ) then                ; format of output file
     39      end if   
     40   else
     41      file_in = file_1   
     42   end if
     43   if (.not. isfilepresent(file_in)) then
     44      print(" ")
     45      print("Your 1st input file: '"+file_in+"' does not exist")
     46      print(" ")
     47      exit
     48   end if
     49
     50   if ( .not. isvar("format_out") ) then               
    3751      format_out = "x11"
    3852      if (parameter(9) .NE. "x11") then
    3953         format_out = parameter(9) 
     54         if (format_out .NE. "x11" .AND. format_out .NE. "pdf" .AND. format_out .NE. "eps" .AND. format_out .NE. "ps" .AND. format_out .NE. "epsi" .AND. format_out .NE. "ncgm")then
     55            print(" ")
     56            print("Your 'format_out = "+format_out+"' is invalid and set to'x11'")
     57            print(" ")
     58         end if 
    4059      end if
    41    end if
     60   else
     61      if (format_out .NE. "x11" .AND. format_out .NE. "pdf" .AND. format_out .NE. "eps" .AND. format_out .NE. "ps" .AND. format_out .NE. "epsi" .AND. format_out .NE. "ncgm")then
     62         print(" ")
     63         print("Your 'format_out = "+format_out+"' is invalid and set to'x11'")
     64         print(" ")
     65      end if   
     66   end if
     67
    4268   if ( .not. isvar("file_out") ) then                  ; path+name of output file
    4369      file_out = "test"
     
    4672      end if     
    4773   end if
     74
    4875   if ( .not. isvar("no_columns") ) then                ; number of plots in one row
    4976      no_columns = 1
     
    5279      end if
    5380   end if
     81
    5482   if ( .not. isvar("no_lines") ) then                  ; number of plot-lines on one sheet
    5583      no_lines = 2
     
    5886      end if
    5987   end if 
     88
    6089   if ( .not. isvar("var") ) then                       ; variable name
    6190      check = True
    6291   end if
     92
    6393   if ( .not. isvar("over") ) then                      ; switches overlaying plots on
    6494      over = 0
     
    6797         if (stringtointeger(parameter(37)) .NE. 1) then
    6898            print(" ")
    69             print("Please set 'over' to 0 or 1")
    70             print(" ")
    71             exit
     99            print("Your 'over'= "+over+" is invalid and set to 0")
     100            print(" ")
     101            over = 0
    72102         end if   
    73103      end if
    74    end if
    75  
     104   else
     105      if (over .NE. 0 .AND. over .NE. 1)then
     106         print(" ")
     107         print("Your 'over'= "+over+" is invalid and set to 0")
     108         print(" ")
     109         over = 0
     110      end if
     111   end if
     112
    76113   ; ***************************************************
    77114   ; open input file
     
    220257   delete(end_time_step)
    221258   end_time_step=round(et,3)
     259
     260   print(" ")
     261   print("Output of time steps from "+t_all(start_time_step)/3600+" h = "+t_all(start_time_step)+" s => index = "+start_time_step)
     262   print("                     till "+t_all(end_time_step)/3600+" h = "+t_all(end_time_step)+" s => index = "+end_time_step)
     263   print(" ")
    222264
    223265   t = f->time(start_time_step:end_time_step)
     
    477519   if (count_var .EQ. 0) then
    478520      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")
     521      print("The variables 'var=°"+var+"°' do not exist on your input file")
    482522      print(" ")
    483523      exit
    484    end if 
     524   end if
    485525
    486526   do varn = dim-1,0,1
     
    500540 
    501541      if(check) then
     542
     543        if (isStrSubset(vNam(varn),"_0" ))then
     544            print(" ")
     545            print("If you have Outputs of statistic regions you cannot overlay variables; 'over' is set to 0")
     546            print(" ")
     547            over = 0
     548         end if
    502549
    503550        if (over .EQ. 1) then
Note: See TracChangeset for help on using the changeset viewer.