Ignore:
Timestamp:
Dec 10, 2008 9:14:34 AM (16 years ago)
Author:
letzel
Message:
  • User can check user parameters and deduce further quantities in user_check_parameters
  • Topography definition according to new user parameter topography_grid_convention (init_grid, modules, user_header, user_init_grid, user_parin)
  • New subdirectory trunk/EXAMPLES with two examples highlighting the topography_grid_convention
File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/NCL/profiles.ncl

    r194 r218  
    3333   ;***************************************************
    3434
    35    if (no_files .LT. 1 .OR. no_files .GT. 12) then
    36       print(" ")
    37       print("Please assign 'no_files' between 1 and 12") 
     35   if (no_files .LT. 1 .OR. no_files .GT. 6) then
     36      print(" ")
     37      print("Assign 'no_files' between 1 and 6") 
    3838      print(" ")
    3939      exit
    4040   end if
    41 
    42    file_in = new(no_files,string)
     41   
     42   file_in   = new(no_files,string)
     43   file_in_1 = new(no_files,logical)
     44   start_f   = new(no_files,integer)
     45   end_f = new(no_files,integer)
    4346   
    4447   if (file_1 .EQ. "File in") then
    4548      print(" ")
    46       print("Please provide 1st input file 'file_1=' in 'ncl_preferences.ncl'")
     49      print("Declare 1st input file 'file_1=' in 'ncl_preferences.ncl' or prompt")
    4750      print(" ")
    4851      exit
    4952   else
    5053      file_in(0) = file_1   
    51    end if
    52    if (.not. isfilepresent(file_in(0))) then
    53       print(" ")
    54       print("Your 1st input file: '"+file_in+"' does not exist")
    55       print(" ")
     54   end if     
     55   file_in_1(0) = False
     56   if (isStrSubset(file_in(0), ".nc"))then
     57      start_f_1 = -2
     58      end_f_1 = -2
     59      file_in_1(0) = True     
     60   end if 
     61   if (start_f_1 .EQ. -1)then
     62      print(" ")
     63      print("'start_f_1' must be one of the cyclic numbers (at least 0) of your input file(s)")
     64      print(" ") 
    5665      exit
    57    end if
    58    
     66   end if
     67   if (end_f_1 .EQ. -1)then
     68      print(" ")
     69      print("'end_f_1' must be one of the cyclic numbers (at least 0) of your input file(s)")
     70      print(" ") 
     71      exit
     72   end if           
     73   start_f(0) = start_f_1
     74   end_f(0) = end_f_1   
     75     
    5976   if (prof3d .EQ. -1)then
    6077      print(" ")
    61       print("Please set 'prof3d' to 0 or 1")
     78      print("Set 'prof3d' to 0 or 1")
    6279      print(" ")
    6380      exit
     
    7491      if (file_2 .EQ. "File in") then
    7592         print(" ")
    76          print("Please provide 2nd input file 'file_2=' in 'ncl_preferences.ncl'")
     93         print("Declare 2nd input file 'file_2=' in 'ncl_preferences.ncl' or prompt")
    7794         print(" ")
    7895         exit
    7996      else
    8097         file_in(1) = file_2   
     98      end if     
     99      file_in_1(1) = False
     100      if (isStrSubset(file_in(1), ".nc"))then
     101         start_f_1 = -2
     102         end_f_1 = -2
     103         file_in_1(1) = True     
    81104      end if
    82       if (.not. isfilepresent(file_in(1))) then
    83          print(" ")
    84          print("Your 2nd input file: '"+file_in+"' does not exist")
    85          print(" ")
     105      if (start_f_2 .EQ. -1)then
     106         print(" ")
     107         print("'start_f_2' must be one of the cyclic numbers (at least 0) of your input file(s)")
     108         print(" ") 
    86109         exit
    87       end if
    88    end if
     110      end if
     111      if (end_f_2 .EQ. -1)then
     112         print(" ")
     113         print("'end_f_2' must be one of the cyclic numbers (at least 0) of your input file(s)")
     114         print(" ") 
     115         exit
     116      end if     
     117      start_f(1) = start_f_2
     118      end_f(1) = end_f_2   
     119   end if   
    89120   
    90121   if (no_files .GT. 2) then
    91122      if (file_3 .EQ. "File in") then
    92123         print(" ")
    93          print("Please provide 3rd input file 'file_3=' in 'ncl_preferences.ncl'")
     124         print("Declare 3rd input file 'file_3=' in 'ncl_preferences.ncl' or prompt")
    94125         print(" ")
    95126         exit
    96127      else
    97128         file_in(2) = file_3   
     129      end if     
     130      file_in_1(2) = False
     131      if (isStrSubset(file_in(2), ".nc"))then
     132         start_f_1 = -2
     133         end_f_1 = -2
     134         file_in_1(2) = True     
    98135      end if
    99       if (.not. isfilepresent(file_in(2))) then
    100          print(" ")
    101          print("Your 3rd input file: '"+file_in+"' does not exist")
    102          print(" ")
     136      if (start_f_3 .EQ. -1)then
     137         print(" ")
     138         print("'start_f_3' must be one of the cyclic numbers (at least 0) of your input file(s)")
     139         print(" ") 
    103140         exit
    104       end if
     141      end if
     142      if (end_f_3 .EQ. -1)then
     143         print(" ")
     144         print("'end_f_3' must be one of the cyclic numbers (at least 0) of your input file(s)")
     145         print(" ") 
     146         exit
     147      end if     
     148      start_f(2) = start_f_3
     149      end_f(2) = end_f_3 
    105150   end if
    106151   
     
    108153      if (file_4 .EQ. "File in") then
    109154         print(" ")
    110          print("Please provide 4th input file 'file_4=' in 'ncl_preferences.ncl'")
     155         print("Declare 4th input file 'file_4=' in 'ncl_preferences.ncl' or prompt")
    111156         print(" ")
    112157         exit
    113158      else
    114159         file_in(3) = file_4   
     160      end if     
     161      file_in_1(3) = False
     162      if (isStrSubset(file_in(3), ".nc"))then
     163         start_f_1 = -2
     164         end_f_1 = -2
     165         file_in_1(3) = True     
    115166      end if
    116       if (.not. isfilepresent(file_in(3))) then
    117          print(" ")
    118          print("Your 4th input file: '"+file_in+"' does not exist")
    119          print(" ")
     167      if (start_f_4 .EQ. -1)then
     168         print(" ")
     169         print("'start_f_4' must be one of the cyclic numbers (at least 0) of your input file(s)")
     170         print(" ") 
    120171         exit
    121       end if
     172      end if
     173      if (end_f_4 .EQ. -1)then
     174         print(" ")
     175         print("'end_f_4' must be one of the cyclic numbers (at least 0) of your input file(s)")
     176         print(" ") 
     177         exit
     178      end if     
     179      start_f(3) = start_f_4
     180      end_f(3) = end_f_4
    122181   end if
    123182   
     
    125184      if (file_5 .EQ. "File in") then
    126185         print(" ")
    127          print("Please provide 5th input file 'file_5=' in 'ncl_preferences.ncl'")
     186         print("Declare 5th input file 'file_5=' in 'ncl_preferences.ncl' or prompt")
    128187         print(" ")
    129188         exit
    130189      else
    131190         file_in(4) = file_5   
     191      end if     
     192      file_in_1(4) = False
     193      if (isStrSubset(file_in(4), ".nc"))then
     194         start_f_1 = -2
     195         end_f_1 = -2
     196         file_in_1(4) = True     
    132197      end if
    133       if (.not. isfilepresent(file_in(4))) then
    134          print(" ")
    135          print("Your 5th input file: '"+file_in+"' does not exist")
    136          print(" ")
     198      if (start_f_5 .EQ. -1)then
     199         print(" ")
     200         print("'start_f_5' must be one of the cyclic numbers (at least 0) of your input file(s)")
     201         print(" ") 
    137202         exit
    138       end if 
     203      end if
     204      if (end_f_5 .EQ. -1)then
     205         print(" ")
     206         print("'end_f_5' must be one of the cyclic numbers (at least 0) of your input file(s)")
     207         print(" ") 
     208         exit
     209      end if     
     210      start_f(4) = start_f_5
     211      end_f(4) = end_f_5   
    139212   end if
     213   
    140214   if (no_files .GT. 5) then
    141215      if (file_6 .EQ. "File in") then
    142216         print(" ")
    143          print("Please provide 6th input file 'file_6=' in 'ncl_preferences.ncl'")
     217         print("Declare 6th input file 'file_6=' in 'ncl_preferences.ncl' or prompt")
    144218         print(" ")
    145219         exit
    146220      else
    147221         file_in(5) = file_6   
     222      end if     
     223      file_in_1(5) = False
     224      if (isStrSubset(file_in(5), ".nc"))then
     225         start_f_1 = -2
     226         end_f_1 = -2
     227         file_in_1(5) = True     
    148228      end if
    149       if (.not. isfilepresent(file_in(5))) then
    150          print(" ")
    151          print("Your 6th input file: '"+file_in+"' does not exist")
    152          print(" ")
     229      if (start_f_6 .EQ. -1)then
     230         print(" ")
     231         print("'start_f_6' must be one of the cyclic numbers (at least 0) of your input file(s)")
     232         print(" ") 
    153233         exit
    154       end if   
     234      end if
     235      if (end_f_6 .EQ. -1)then
     236         print(" ")
     237         print("'end_f_6' must be one of the cyclic numbers (at least 0) of your input file(s)")
     238         print(" ") 
     239         exit
     240      end if     
     241      start_f(5) = start_f_6
     242      end_f(5) = end_f_6   
    155243   end if
    156    if (no_files .GT. 6) then
    157       if (file_7 .EQ. "File in") then
    158          print(" ")
    159          print("Please provide 7th input file 'file_7=' in 'ncl_preferences.ncl'")
    160          print(" ")
    161          exit
    162       else
    163          file_in(6) = file_7   
    164       end if
    165       if (.not. isfilepresent(file_in(6))) then
    166          print(" ")
    167          print("Your 7th input file: '"+file_in+"' does not exist")
    168          print(" ")
    169          exit
    170       end if   
    171    end if
    172    if (no_files .GT. 7) then
    173       if (file_8 .EQ. "File in") then
    174          print(" ")
    175          print("Please provide 8th input file 'file_8=' in 'ncl_preferences.ncl'")
    176          print(" ")
    177          exit
    178       else
    179          file_in(7) = file_8   
    180       end if
    181       if (.not. isfilepresent(file_in(7))) then
    182          print(" ")
    183          print("Your 8th input file: '"+file_in+"' does not exist")
    184          print(" ")
    185          exit
    186       end if   
    187    end if
    188    if (no_files .GT. 8) then
    189       if (file_9 .EQ. "File in") then
    190          print(" ")
    191          print("Please provide 9th input file 'file_9=' in 'ncl_preferences.ncl'")
    192          print(" ")
    193          exit
    194       else
    195          file_in(8) = file_9   
    196       end if
    197       if (.not. isfilepresent(file_in(8))) then
    198          print(" ")
    199          print("Your 9th input file: '"+file_in+"' does not exist")
    200          print(" ")
    201          exit
    202       end if   
    203    end if
    204    if (no_files .GT. 9) then
    205       if (file_10 .EQ. "File in") then
    206          print(" ")
    207          print("Please provide 10th input file 'file_10=' in 'ncl_preferences.ncl'")
    208          print(" ")
    209          exit
    210       else
    211          file_in(9) = file_10   
    212       end if
    213       if (.not. isfilepresent(file_in(9))) then
    214          print(" ")
    215          print("Your 10th input file: '"+file_in+"' does not exist")
    216          print(" ")
    217          exit
    218       end if   
    219    end if
    220    if (no_files .GT. 10) then
    221       if (file_11 .EQ. "File in") then
    222          print(" ")
    223          print("Please provide 11th input file 'file_11=' in 'ncl_preferences.ncl'")
    224          print(" ")
    225          exit
    226       else
    227          file_in(10) = file_11   
    228       end if
    229       if (.not. isfilepresent(file_in(10))) then
    230          print(" ")
    231          print("Your 11th input file: '"+file_in+"' does not exist")
    232          print(" ")
    233          exit
    234       end if   
    235    end if
    236    if (no_files .GT. 11) then
    237       if (file_12 .EQ. "File in") then
    238          print(" ")
    239          print("Please provide 12th input file 'file_12=' in 'ncl_preferences.ncl'")
    240          print(" ")
    241          exit
    242       else
    243          file_in(11) = file_12   
    244       end if
    245       if (.not. isfilepresent(file_in(11))) then
    246          print(" ")
    247          print("Your 12th input file: '"+file_in+"' does not exist")
    248          print(" ")
    249          exit
    250       end if   
    251    end if
     244
    252245   
    253246   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
     
    285278   if (combine .EQ. 1 .AND. number_comb .EQ. -1) then
    286279      print(" ")
    287       print("Please set 'number_comb' to 2 or 3 or combine to 0")
     280      print("Set 'number_comb' to 2 or 3 or combine to 0")
    288281      print(" ")
    289282      exit
     
    292285      if (number_comb .EQ. -1) then
    293286         print(" ")
    294          print("Please set 'number_comb' to 2 or 3 or combine to 0")
     287         print("Set 'number_comb' to 2 or 3 or combine to 0")
    295288         print(" ")
    296289         exit
     
    298291      if (number_comb .NE. 2 .AND. number_comb .NE. 3) then
    299292         print(" ")
    300          print("Please set 'number_comb' to 2 or 3 or combine to 0")
     293         print("Set 'number_comb' to 2 or 3 or combine to 0")
    301294         print(" ")
    302295         exit
     
    305298   if (combine .EQ. 1 .AND. c_var .EQ. "c_variables") then
    306299      print(" ")
    307       print("Please select variables for overlaying ('c_var') or set combine to 0")
     300      print("Select variables for overlaying ('c_var') or set combine to 0")
    308301      print(" ")
    309302      exit
    310303   end if
    311304
    312    if (logy .NE. 0 .AND. logy .NE. 1)then
    313       print(" ")
    314       print("'logy'= "+logy+" is invalid and set to 0")
    315       print(" ")
    316       logy = 0
     305   if (log_z .NE. 0 .AND. log_z .NE. 1)then
     306      print(" ")
     307      print("'log_z'= "+log_z+" is invalid and set to 0")
     308      print(" ")
     309      log_z = 0
    317310   end if   
    318311 
    319    if (norm .EQ. 0) then
    320       print(" ")
    321       print("You cannot normalise with 0, 'norm' is set to 1")
    322       print(" ")
    323       norm = 1.0
     312   if (norm_z .EQ. 0) then
     313      print(" ")
     314      print("Normalising with 0 is not allowed, 'norm_z' is set to 1.0")
     315      print(" ")
     316      norm_z = 1.0
    324317   end if
    325318
     
    330323   do nof=0,no_files-1
    331324
    332    f=addfile( file_in(nof),"r")
     325   files=new(end_f(nof)-start_f(nof)+1,string)
     326   if (file_in_1(nof))then
     327      if (isfilepresent(file_in(nof)))then
     328         files(0)=file_in
     329      else
     330         print(" ")
     331         print("1st input file: '"+file_in+"' does not exist")
     332         print(" ")
     333         exit
     334      end if
     335   else
     336      if (start_f(nof) .EQ. 0)then
     337         if (isfilepresent(file_in(nof)+".nc"))then
     338            files(0)=file_in(nof)+".nc"
     339            do i=1,end_f(nof)
     340            if (isfilepresent(file_in(nof)+"."+i+".nc"))then   
     341               files(i)=file_in(nof)+"."+i+".nc"
     342            else
     343               print(" ")
     344               print("Input file: '"+file_in(nof)+"."+i+".nc' does not exist")
     345               print(" ")
     346               exit 
     347            end if         
     348         end do         
     349         else
     350            print(" ")
     351            print("Input file: '"+file_in(nof)+".nc' does not exist")
     352            print(" ")
     353            exit
     354         end if
     355      else
     356         do i=start_f(nof),end_f(nof)
     357            if (isfilepresent(file_in(nof)+"."+i+".nc"))then   
     358               files(i-start_f(nof))=file_in(nof)+"."+i+".nc"
     359            else
     360               print(" ")
     361               print("Input file: '"+file_in(nof)+"."+i+".nc' does not exist")
     362               print(" ")
     363               exit 
     364            end if
     365         end do
     366      end if
     367   end if
     368
     369   f=addfiles(files,"r")
     370   f_att=addfile(files(0),"r")
     371   ListSetType(f,"cat")
    333372   
    334    vNam = getfilevarnames(f)
     373   vNam = getfilevarnames(f_att)
     374
    335375   if (nof .EQ. 0)then
    336376      vNam0=vNam
     
    364404   if (dim .EQ. 0) then
    365405      print(" ")
    366       print("There are no data on file")
     406      print("There is no data on file")
    367407      print(" ")
    368408   end if
     
    389429      end if
    390430      if (vNam(varn) .EQ. "u" .OR. isStrSubset(vNam(varn), "u_"))then
    391          z_u = f->$vNam(varn+1)$
     431         z_u = f_att->$vNam(varn+1)$
    392432         break
    393433      else
    394434         if (vNam(varn) .EQ. "v" .OR. isStrSubset(vNam(varn), "v_"))then 
    395             z_u = f->$vNam(varn+1)$
     435            z_u = f_att->$vNam(varn+1)$
    396436            break
    397437         else
    398438            if(vNam(varn) .EQ. "pt" .OR. isStrSubset(vNam(varn), "pt_"))then
    399                z_u = f->$vNam(varn+1)$
     439               z_u = f_att->$vNam(varn+1)$
    400440               break
    401441            else
     
    405445               else
    406446                  if(vNam(varn) .EQ. "lpt" .OR. isStrSubset(vNam(varn), "lpt_"))then
    407                      z_u = f->$vNam(varn+1)$
     447                     z_u = f_att->$vNam(varn+1)$
    408448                     break
    409449                  else   
    410450                     if(vNam(varn) .EQ. "q" .OR. isStrSubset(vNam(varn), "q_") )then
    411                         z_u = f->$vNam(varn+1)$
     451                        z_u = f_att->$vNam(varn+1)$
    412452                        break
    413453                     else
    414454                        if(vNam(varn) .EQ. "qv" .OR. isStrSubset(vNam(varn), "qv_"))then
    415                            z_u = f->$vNam(varn+1)$
     455                           z_u = f_att->$vNam(varn+1)$
    416456                           break
    417457                        else
    418458                           if(vNam(varn) .EQ. "ql" .OR. isStrSubset(vNam(varn), "ql_"))then
    419                               z_u = f->$vNam(varn+1)$
     459                              z_u = f_att->$vNam(varn+1)$
    420460                              break
    421461                           else
    422462                              if(vNam(varn) .EQ. "rho" .OR. isStrSubset(vNam(varn), "rho_"))then
    423                                  z_u = f->$vNam(varn+1)$
     463                                 z_u = f_att->$vNam(varn+1)$
    424464                                 break
    425465                              else
    426466                                 if(vNam(varn) .EQ. "s" .OR. isStrSubset(vNam(varn), "s_") )then
    427                                     z_u = f->$vNam(varn+1)$
     467                                    z_u = f_att->$vNam(varn+1)$
    428468                                    break
    429469                                 else
    430470                                    if(vNam(varn) .EQ. "sa" .OR. isStrSubset(vNam(varn), "sa_"))then
    431                                        z_u = f->$vNam(varn+1)$
     471                                       z_u = f_att->$vNam(varn+1)$
    432472                                       break
    433473                                    else
    434474                                       if(vNam(varn) .EQ. "e" .OR. isStrSubset(vNam(varn), "e_"))then
    435                                           z_u = f->$vNam(varn+1)$
     475                                          z_u = f_att->$vNam(varn+1)$
    436476                                          break
    437477                                       else
    438478                                          if(vNam(varn) .EQ. "es" .OR. isStrSubset(vNam(varn), "es_"))then
    439                                              z_u = f->$vNam(varn+1)$
     479                                             z_u = f_att->$vNam(varn+1)$
    440480                                             break
    441481                                          else
    442482                                             if(vNam(varn) .EQ. "km" .OR. isStrSubset(vNam(varn), "km_"))then
    443                                                 z_u = f->$vNam(varn+1)$
     483                                                z_u = f_att->$vNam(varn+1)$
    444484                                                break
    445485                                             else
    446486                                                if(vNam(varn) .EQ. "kh" .OR. isStrSubset(vNam(varn), "kh_"))then
    447                                                    z_u = f->$vNam(varn+1)$
     487                                                   z_u = f_att->$vNam(varn+1)$
    448488                                                   break
    449489                                                else
    450490                                                   if(vNam(varn) .EQ. "l" .OR. isStrSubset(vNam(varn), "l_"))then
    451                                                       z_u = f->$vNam(varn+1)$
     491                                                      z_u = f_att->$vNam(varn+1)$
    452492                                                      break
    453493                                                   else
    454494                                                      if(vNam(varn) .EQ. "us2" .OR. isStrSubset(vNam(varn), "us2_"))then
    455                                                          z_u = f->$vNam(varn+1)$
     495                                                         z_u = f_att->$vNam(varn+1)$
    456496                                                         break
    457497                                                      else
    458498                                                         if(vNam(varn) .EQ. "vs2" .OR. isStrSubset(vNam(varn), "vs2_") )then
    459                                                             z_u = f->$vNam(varn+1)$
     499                                                            z_u = f_att->$vNam(varn+1)$
    460500                                                            break
    461501                                                         else
    462502                                                            if(vNam(varn) .EQ. "pts2" .OR. isStrSubset(vNam(varn), "pts2_"))then
    463                                                                z_u = f->$vNam(varn+1)$
     503                                                               z_u = f_att->$vNam(varn+1)$
    464504                                                               break
    465505                                                            else
    466506                                                               if(vNam(varn) .EQ. "wsususodz" .OR. isStrSubset(vNam(varn), "wsususodz_"))then
    467                                                                   z_u = f->$vNam(varn+1)$
     507                                                                  z_u = f_att->$vNam(varn+1)$
    468508                                                                  break
    469509                                                               else
    470510                                                                  if(vNam(varn) .EQ. "wspsodz" .OR. isStrSubset(vNam(varn), "wspsodz_"))then
    471                                                                      z_u = f->$vNam(varn+1)$
     511                                                                     z_u = f_att->$vNam(varn+1)$
    472512                                                                     break
    473513                                                                  else
    474514                                                                     if(vNam(varn) .EQ. "wpeodz" .OR. isStrSubset(vNam(varn), "wpeodz_"))then
    475                                                                         z_u = f->$vNam(varn+1)$
     515                                                                        z_u = f_att->$vNam(varn+1)$
    476516                                                                        break                                                                       
    477517                                                                     end if
     
    506546      end if
    507547      if (vNam(varn) .EQ. "w" .OR. isStrSubset(vNam(varn), "w_"))then
    508          z_w = f->$vNam(varn+1)$
     548         z_w = f_att->$vNam(varn+1)$
    509549         break
    510550      else
    511551         if (vNam(varn) .EQ. "wpup" .OR. isStrSubset(vNam(varn), "wpup_"))then
    512             z_w = f->$vNam(varn+1)$
     552            z_w = f_att->$vNam(varn+1)$
    513553            break
    514554         else
    515555            if(vNam(varn) .EQ. "wsus" .OR. isStrSubset(vNam(varn), "wsus_"))then
    516                z_w = f->$vNam(varn+1)$
     556               z_w = f_att->$vNam(varn+1)$
    517557               break
    518558            else
    519559               if(vNam(varn) .EQ. "wu" .OR. isStrSubset(vNam(varn), "wu_"))then
    520                   z_w = f->$vNam(varn+1)$
     560                  z_w = f_att->$vNam(varn+1)$
    521561                  break
    522562               else
    523563                  if(vNam(varn) .EQ. "wpvp" .OR. isStrSubset(vNam(varn), "wpvp_"))then
    524                      z_w = f->$vNam(varn+1)$
     564                     z_w = f_att->$vNam(varn+1)$
    525565                     break
    526566                  else   
    527567                     if(vNam(varn) .EQ. "wsvs" .OR. isStrSubset(vNam(varn), "wsvs_"))then
    528                         z_w = f->$vNam(varn+1)$
     568                        z_w = f_att->$vNam(varn+1)$
    529569                        break
    530570                     else
    531571                        if(vNam(varn) .EQ. "wv" .OR. isStrSubset(vNam(varn), "wv_"))then
    532                            z_w = f->$vNam(varn+1)$
     572                           z_w = f_att->$vNam(varn+1)$
    533573                           break
    534574                        else
    535575                           if(vNam(varn) .EQ. "wptpp" .OR. isStrSubset(vNam(varn), "wptpp_"))then
    536                               z_w = f->$vNam(varn+1)$
     576                              z_w = f_att->$vNam(varn+1)$
    537577                              break
    538578                           else
    539579                              if(vNam(varn) .EQ. "wspts" .OR. isStrSubset(vNam(varn), "wspts_"))then
    540                                  z_w = f->$vNam(varn+1)$
     580                                 z_w = f_att->$vNam(varn+1)$
    541581                                 break
    542582                              else
    543583                                 if(vNam(varn) .EQ. "wpt" .OR. isStrSubset(vNam(varn), "wpz_"))then
    544                                     z_w = f->$vNam(varn+1)$
     584                                    z_w = f_att->$vNam(varn+1)$
    545585                                    break
    546586                                 else
    547587                                    if(vNam(varn) .EQ. "wsptsBC" .OR. isStrSubset(vNam(varn), "wsptsBC_"))then
    548                                        z_w = f->$vNam(varn+1)$
     588                                       z_w = f_att->$vNam(varn+1)$
    549589                                       break
    550590                                    else
    551591                                       if(vNam(varn) .EQ. "wptBC" .OR. isStrSubset(vNam(varn), "wptBC_"))then
    552                                           z_w = f->$vNam(varn+1)$
     592                                          z_w = f_att->$vNam(varn+1)$
    553593                                          break
    554594                                       else
    555595                                          if(vNam(varn) .EQ. "wpvptp" .OR. isStrSubset(vNam(varn), "wpvptp_"))then
    556                                              z_w = f->$vNam(varn+1)$
     596                                             z_w = f_att->$vNam(varn+1)$
    557597                                             break
    558598                                          else
    559599                                             if(vNam(varn) .EQ. "wsvpts" .OR. isStrSubset(vNam(varn), "wsvpts_"))then
    560                                                 z_w = f->$vNam(varn+1)$
     600                                                z_w = f_att->$vNam(varn+1)$
    561601                                                break
    562602                                             else
    563603                                                if(vNam(varn) .EQ. "wvpt" .OR. isStrSubset(vNam(varn), "wvpt_"))then
    564                                                    z_w = f->$vNam(varn+1)$
     604                                                   z_w = f_att->$vNam(varn+1)$
    565605                                                   break
    566606                                                else
    567607                                                   if(vNam(varn) .EQ. "wpqp" .OR. isStrSubset(vNam(varn), "wpqp_"))then
    568                                                       z_w = f->$vNam(varn+1)$
     608                                                      z_w = f_att->$vNam(varn+1)$
    569609                                                      break
    570610                                                   else
    571611                                                      if(vNam(varn) .EQ. "wsqs" .OR. isStrSubset(vNam(varn), "wsqs_"))then
    572                                                          z_w = f->$vNam(varn+1)$
     612                                                         z_w = f_att->$vNam(varn+1)$
    573613                                                         break
    574614                                                      else
    575615                                                         if(vNam(varn) .EQ. "wq" .OR. isStrSubset(vNam(varn), "wq_"))then
    576                                                             z_w = f->$vNam(varn+1)$
     616                                                            z_w = f_att->$vNam(varn+1)$
    577617                                                            break
    578618                                                         else
    579619                                                            if(vNam(varn) .EQ. "wpqvp" .OR. isStrSubset(vNam(varn), "wpqvp_"))then
    580                                                                z_w = f->$vNam(varn+1)$
     620                                                               z_w = f_att->$vNam(varn+1)$
    581621                                                               break
    582622                                                            else
    583623                                                               if(vNam(varn) .EQ. "wsqvs" .OR. isStrSubset(vNam(varn), "wsqvs_"))then
    584                                                                   z_w = f->$vNam(varn+1)$
     624                                                                  z_w = f_att->$vNam(varn+1)$
    585625                                                                  break
    586626                                                               else
    587627                                                                  if(vNam(varn) .EQ. "wqv" .OR. isStrSubset(vNam(varn), "wqv_"))then
    588                                                                      z_w = f->$vNam(varn+1)$
     628                                                                     z_w = f_att->$vNam(varn+1)$
    589629                                                                     break
    590630                                                                  else
    591631                                                                     if(vNam(varn) .EQ. "wpsp" .OR. isStrSubset(vNam(varn), "wpsp_"))then
    592                                                                         z_w = f->$vNam(varn+1)$
     632                                                                        z_w = f_att->$vNam(varn+1)$
    593633                                                                        break
    594634                                                                     else
    595635                                                                        if(vNam(varn) .EQ. "wsss" .OR. isStrSubset(vNam(varn), "wsss_"))then
    596                                                                            z_w = f->$vNam(varn+1)$
     636                                                                           z_w = f_att->$vNam(varn+1)$
    597637                                                                           break
    598638                                                                        else
    599639                                                                           if(vNam(varn) .EQ. "ws" .OR. isStrSubset(vNam(varn), "ws_"))then
    600                                                                               z_w = f->$vNam(varn+1)$
     640                                                                              z_w = f_att->$vNam(varn+1)$
    601641                                                                              break
    602642                                                                           else
    603643                                                                              if(vNam(varn) .EQ. "wpsap" .OR. isStrSubset(vNam(varn), "wpsap_"))then
    604                                                                                  z_w = f->$vNam(varn+1)$
     644                                                                                 z_w = f_att->$vNam(varn+1)$
    605645                                                                                 break
    606646                                                                              else
    607647                                                                                 if(vNam(varn) .EQ. "wssas" .OR. isStrSubset(vNam(varn), "wssas_") )then
    608                                                                                     z_w = f->$vNam(varn+1)$
     648                                                                                    z_w = f_att->$vNam(varn+1)$
    609649                                                                                    break
    610650                                                                                 else
    611651                                                                                    if(vNam(varn) .EQ. "wsa" .OR. isStrSubset(vNam(varn), "wsa_"))then
    612                                                                                        z_w = f->$vNam(varn+1)$
     652                                                                                       z_w = f_att->$vNam(varn+1)$
    613653                                                                                       break
    614654                                                                                    else
    615655                                                                                       if(vNam(varn) .EQ. "wses" .OR. isStrSubset(vNam(varn), "wses_"))then
    616                                                                                           z_w = f->$vNam(varn+1)$
     656                                                                                          z_w = f_att->$vNam(varn+1)$
    617657                                                                                          break
    618658                                                                                       else
    619659                                                                                          if(vNam(varn) .EQ. "ws2" .OR. isStrSubset(vNam(varn), "ws2_"))then
    620                                                                                              z_w = f->$vNam(varn+1)$
     660                                                                                             z_w = f_att->$vNam(varn+1)$
    621661                                                                                             break
    622662                                                                                          else
    623663                                                                                             if(vNam(varn) .EQ. "ws3" .OR. isStrSubset(vNam(varn), "ws3_"))then
    624                                                                                                 z_w = f->$vNam(varn+1)$
     664                                                                                                z_w = f_att->$vNam(varn+1)$
    625665                                                                                                break
    626666                                                                                             else
    627667                                                                                                if(vNam(varn) .EQ. "Sw" .OR. isStrSubset(vNam(varn), "Sw_"))then
    628                                                                                                    z_w = f->$vNam(varn+1)$
     668                                                                                                   z_w = f_att->$vNam(varn+1)$
    629669                                                                                                   break
    630670                                                                                                else
    631671                                                                                                   if(vNam(varn) .EQ. "ws2pts".OR. isStrSubset(vNam(varn), "ws2pts_") )then
    632                                                                                                       z_w = f->$vNam(varn+1)$
     672                                                                                                      z_w = f_att->$vNam(varn+1)$
    633673                                                                                                      break
    634674                                                                                                   else
    635675                                                                                                      if(vNam(varn) .EQ. "wspts2" .OR. isStrSubset(vNam(varn), "wspts2_"))then
    636                                                                                                          z_w = f->$vNam(varn+1)$
     676                                                                                                         z_w = f_att->$vNam(varn+1)$
    637677                                                                                                         break                                           
    638678                                                                                                      end if
     
    685725         if (check)then
    686726            co=co+1
    687             z = f->$vNam(varn+1)$
     727            z = f_att->$vNam(varn+1)$
    688728            if (getvardims(z) .EQ. "zu")then
    689729               z_u = z
     
    718758      do varn = dim-1,0,1
    719759         if (vNam(varn) .EQ. "zu_3d")then
    720             z_u = f->zu_3d 
     760            z_u = f_att->zu_3d 
    721761            dimz  = dimsizes(z_u)         
    722762         else
    723763            if (vNam(varn) .EQ. "zw_3d")then
    724                z_w = f->zw_3d
     764               z_w = f_att->zw_3d
    725765               dimz  = dimsizes(z_w)
    726766            end if
    727767         end if
     768         if (vNam(varn) .EQ. "x")then
     769            x = f_att->x
     770            dimx=dimsizes(x)
     771         else
     772            if (vNam(varn) .EQ. "xu")then
     773               x = f_att->xu
     774               dimx=dimsizes(x)
     775            end if
     776         end if
     777         if (vNam(varn) .EQ. "y")then
     778            y = f_att->y
     779            dimy=dimsizes(y)
     780         else
     781            if (vNam(varn) .EQ. "yv")then
     782               y = f_att->yv
     783               dimy=dimsizes(y)
     784            end if
     785         end if
    728786      end do
    729787
     
    733791      print(" ")
    734792      print("Program aborts - there are no z-variables available")
    735       print("Please be sure if 'plot_3d' is set correctly")
     793      print("Be sure if 'plot_3d' is set correctly")
    736794      print(" ")
    737795      exit
    738796   end if
    739797   
    740    t_all = f->time
     798   if (prof3d .EQ. 1)then
     799      t_all = f[:]->time
     800   else
     801      t_all = f[:]->time(1:)
     802   end if
    741803   nt    = dimsizes(t_all)
    742804   delta_t=t_all(nt-1)/nt
    743 
    744805
    745806   ; ****************************************************       
     
    754815         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")
    755816         print(" ")
    756          print("Please select another 'start_time_step'")
     817         print("Select another 'start_time_step'")
    757818         print(" ")
    758819         exit
     
    766827   end if
    767828
    768    do i=0,nt-1     
     829   do i=0,nt-1   
    769830      if (start_time_step .GE. (t_all(i)-delta_t/2)/3600 .AND. start_time_step .LT. (t_all(i)+delta_t/2)/3600)then
    770831         st=i
     
    776837      print("'start_time_step' = "+ start_time_step +"h is invalid")
    777838      print(" ")
    778       print("Please select another 'start_time_step'")
     839      print("Select another 'start_time_step'")
    779840      print(" ")
    780841      exit
     
    792853         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")
    793854         print(" ")
    794          print("Please select another 'end_time_step'") 
     855         print("Select another 'end_time_step'") 
    795856         print(" ")
    796857         exit
     
    800861         print("'end_time_step' = "+ end_time_step +"h is lower than 'start_time_step' = "+start_time_step+"h")
    801862         print(" ")
    802          print("Please select another 'start_time_step' or 'end_time_step'")
     863         print("Select another 'start_time_step' or 'end_time_step'")
    803864         print(" ")
    804865         exit
     
    816877      print("'end_time_step' = "+ end_time_step +"h is invalid")
    817878      print(" ")
    818       print("Please select another 'end_time_step'")
     879      print("Select another 'end_time_step'")
    819880      print(" ")
    820881      exit
     
    838899   do p=start_time_step,end_time_step
    839900      if (t_all(p)/3600 .LT. 1) then
    840          legend_label(p-start_time_step)=decimalPlaces(t_all(p)/3600,2,True)
     901         legend_label(p-start_time_step)=decimalPlaces(t_all(p)/3600,3,True)
    841902      else
    842903         legend_label(p-start_time_step)=decimalPlaces(t_all(p)/3600,0,True)
     
    872933   res@pmLegendWidthF          = 0.12
    873934   res@pmLegendHeightF         = 0.04*(end_time_step-start_time_step+1)
    874    res@lgLabelFontHeightF     = .02
     935   res@lgLabelFontHeightF     = font_size
    875936   res@lgTitleString      = "Time [h]"
    876    res@lgTitleFontHeightF = 0.02   
    877    res@txFontHeightF      = 0.02
    878    res@tiXAxisFontHeightF = 0.02
    879    res@tiYAxisFontHeightF = 0.02
     937   res@lgTitleFontHeightF = font_size   
     938   res@txFontHeightF      = font_size
     939   res@tiXAxisFontHeightF = font_size
     940   res@tiYAxisFontHeightF = font_size
     941   res@tmXBLabelFontHeightF = font_size
     942   res@tmYLLabelFontHeightF = font_size
    880943   res@tiXAxisString      = " "
    881944   if ( black .eq. 0 ) then 
    882945      res@xyLineColors = ispan(2,237,235/np)
    883946   end if
    884    if (norm .EQ. 1)then
     947   if (norm_z .EQ. 1)then
    885948      res@tiYAxisString      = "Height [m]"
    886949   else   
    887       res@tiYAxisString      = "Height / "+norm+" [m]"
     950      res@tiYAxisString      = "Height / "+norm_z+" [m]"
    888951   end if
    889952   
    890    if (logy .EQ. 1) then
     953   if (log_z .EQ. 1) then
    891954      res@trYLog = True
    892955   end if
     
    902965      end if       
    903966   end if
     967   
     968   res@tmXBMinorPerMajor = 4
     969   res@tmYLMinorPerMajor = 4
    904970
    905971   resP                        = True
    906972   resP@txFont                 = "helvetica"
    907    resP@txString               = f@title
     973   resP@txString               = f_att@title
    908974   resP@txFuncCode             = "~"
    909    resP@txFontHeightF          = 0.014
     975   resP@txFontHeightF          = 0.015
    910976
    911977   ; ***************************************************
     
    928994   ; ***************************************************
    929995
    930    if (logy .EQ. 1)then
     996   if (log_z .EQ. 1)then
    931997      if (min_z .EQ. -1)then
    932998         if (isvar("z_u"))then
     
    10161082   end if
    10171083
    1018    min_z=min_z/norm
    1019    max_z=max_z/norm
     1084   min_z=min_z/norm_z
     1085   max_z=max_z/norm_z
    10201086
    10211087   ; ***************************************************
     
    10301096   end do 
    10311097   
    1032    if (logy .EQ. 1) then
     1098   if (log_z .EQ. 1) then
    10331099      data   = new((/dim,(end_time_step-start_time_step)+1,dimz-1/),float)
    10341100      data_0 = new((/(end_time_step-start_time_step)+1,dimz-1/),float)
     
    12521318      maxiwpeodz =-1.E27
    12531319   end if
    1254  
     1320
     1321   if (prof3d .EQ. 1)then
     1322
     1323   if (end_x .EQ. -1) then
     1324      end_x=dimx-2
     1325   end if
     1326   if (end_y .EQ. -1)then
     1327      end_y=dimy-2
     1328   end if
     1329   if (start_x .LT. 0)then
     1330      print(" ")
     1331      print("'start_x' is lower than 0 and set to 0")
     1332      print(" ")
     1333      start_x=0
     1334   end if
     1335   if (start_x .GT. dimx-1)then
     1336      print(" ")
     1337      print("'start_x' is greater than available x-range and set to maximum of x-range (excluding ghostpoint)")
     1338      print(" ")
     1339      start_x=dimx-2
     1340   end if
     1341   if (end_x .EQ. dimx-1)then
     1342      print(" ")
     1343      print("'end_x' = "+end_x+" and includes the ghostpoint")
     1344      print(" ")
     1345   end if
     1346   if (end_x .GT. dimx-1)then
     1347      print(" ")
     1348      print("'end_x' = "+end_x+" is greater than available x-range and set to maximum of x-range (excluding ghostpoint)")
     1349      print(" ")
     1350      end_x=dimx-2
     1351   end if
     1352   if (end_x .LT. start_x)then
     1353      print(" ")
     1354      print("'end_x' = "+end_x+" is lower than 'start_x' = "+start_x+" and set to maximum of x-range (excluding ghostpoint)")
     1355      print(" ")
     1356      end_x=dimx-2
     1357   end if
     1358   if (start_y .LT. 0)then
     1359      print(" ")
     1360      print("'start_y' is lower than 0 and set to 0")
     1361      print(" ")
     1362      start_y=0
     1363   end if
     1364   if (start_y .GT. dimy-1)then
     1365      print(" ")
     1366      print("'start_y' is greater than available y-range and set to maximum of y-range (excluding ghostpoint)")
     1367      print(" ")
     1368      start_x=dimy-2
     1369   end if
     1370   if (end_y .EQ. dimy-1)then
     1371      print(" ")
     1372      print("'end_y' = "+end_y+" and includes the ghostpoint")
     1373      print(" ")
     1374   end if
     1375   if (end_y .GT. dimy-1)then
     1376      print(" ")
     1377      print("'end_y' = "+end_y+" is greater than available y-range and set to maximum of y-range (excluding ghostpoint)")
     1378      print(" ")
     1379      end_x=dimy-2
     1380   end if
     1381   if (end_y .LT. start_y)then
     1382      print(" ")
     1383      print("'end_y' = "+end_y+" is lower than 'start_y' = "+start_y+" and set to maximum of y-range (excluding ghostpoint)")
     1384      print(" ")
     1385      end_y=dimy-2
     1386   end if
     1387   
     1388   end if
     1389 
    12551390   n_o=0
    12561391   count_var=0
     
    12781413         if (com) then     
    12791414            if (prof3d .EQ. 0) then
    1280                temp = f->$vNam(varn)$
    1281                if (logy .EQ. 1) then
     1415               temp = f[:]->$vNam(varn)$(1:,:)
     1416               temp_att = f_att->$vNam(varn)$
     1417               if (log_z .EQ. 1) then
    12821418                  data(varn,:,:) = temp(start_time_step:end_time_step,1:dimz-1)
    12831419               else
     
    12851421               end if
    12861422            else
    1287                if (logy .EQ. 1) then
     1423               if (log_z .EQ. 1) then
    12881424                  do i=1,dimz-1
    12891425                     do j=start_time_step,end_time_step
    1290                         temp= f->$vNam(varn)$(j,i,:,:)
    1291                         data(varn,j-start_time_step,i-1) = dim_avg_Wrap(dim_avg_Wrap(temp(:,:)))
     1426                        temp= f[:]->$vNam(varn)$
     1427                        temp_att = f_att->$vNam(varn)$
     1428                        data_temp = temp(j,i,start_y:end_y,start_x:end_x)
     1429                        data(varn,j-start_time_step,i-1) = dim_avg_Wrap(dim_avg_Wrap(data_temp))
    12921430                     end do
    12931431                  end do
     
    12951433                  do i=0,dimz-1
    12961434                     do j=start_time_step,end_time_step
    1297                         temp= f->$vNam(varn)$(j,i,:,:)
    1298                         data(varn,j-start_time_step,i) = dim_avg_Wrap(dim_avg_Wrap(temp(:,:)))
     1435                        temp= f[:]->$vNam(varn)$
     1436                        temp_att = f_att->$vNam(varn)$
     1437                        data_temp = temp(j,i,start_y:end_y,start_x:end_x)
     1438                        data(varn,j-start_time_step,i) = dim_avg_Wrap(dim_avg_Wrap(data_temp))
    12991439                     end do
    13001440                  end do
     
    13041444               print(" ")
    13051445            end if                 
    1306             unit(varn) = temp@units
     1446            unit(varn) = temp_att@units
    13071447            if (n_o .GT. number_comb-1) then
    13081448               print(" ")
    1309                print("Please set 'number_comb' to the number of overlaying variables ('c_var' = "+c_var+")")
     1449               print("Set 'number_comb' to the number of overlaying variables ('c_var' = "+c_var+")")
    13101450               print(" ")
    13111451               exit
     
    13181458
    13191459      if(check) then
    1320 
    13211460         if (isStrSubset(vNam(varn),"_0" ))then
    13221461            print(" ")
     
    13291468
    13301469         if (prof3d .EQ. 0) then
    1331             temp = f->$vNam(varn)$
     1470            temp = f[:]->$vNam(varn)$(1:,:)
     1471            temp_att = f_att->$vNam(varn)$
    13321472         else
    1333              if (logy .EQ. 1) then
     1473             if (log_z .EQ. 1) then
    13341474               do i=1,dimz-1
    13351475                  do j=start_time_step,end_time_step
    1336                      temp= f->$vNam(varn)$(j,i,:,:)
    1337                      data(varn,j-start_time_step,i-1) = dim_avg_Wrap(dim_avg_Wrap(temp(:,:)))
     1476                     temp= f[:]->$vNam(varn)$(j,i,start_y:end_y,start_x:end_x)
     1477                     temp_att = f_att->$vNam(varn)$
     1478                     data_temp = temp(j,i,start_y:end_y,start_x:end_x)
     1479                     data(varn,j-start_time_step,i-1) = dim_avg_Wrap(dim_avg_Wrap(data_temp))
    13381480                  end do
    13391481               end do
     
    13411483               do i=0,dimz-1
    13421484                  do j=start_time_step,end_time_step
    1343                      temp= f->$vNam(varn)$(j,i,:,:)
    1344                      data(varn,j-start_time_step,i) = dim_avg_Wrap(dim_avg_Wrap(temp(:,:)))
     1485                     temp= f[:]->$vNam(varn)$;(j,i,start_y:end_y,start_x:end_x)
     1486                     temp_att = f_att->$vNam(varn)$
     1487                     data_temp = temp(j,i,start_y:end_y,start_x:end_x)
     1488                     data_temp!0 = "t"
     1489                     data_temp!1 = "z"
     1490                     data(varn,j-start_time_step,i) = dim_avg_Wrap(dim_avg_Wrap(data_temp))
    13451491                  end do
    13461492               end do
     
    13491495            print("Variable '"+vNam(varn)+"' is read")
    13501496            print(" ")
    1351             unit(varn) = temp@units
    1352             a=getvaratts(temp)
     1497            unit(varn) = temp_att@units
     1498            a=getvardims(temp_att)
    13531499            b=dimsizes(a)
    13541500         end if
    1355    
     1501
    13561502         if (prof3d .EQ. 0) then
    1357             if (logy .EQ. 1) then
    1358                z = f->$vNam(varn+1)$(1:dimz-1)
    1359                unit(varn) = temp@units
     1503            if (log_z .EQ. 1) then
     1504               z = f_att->$vNam(varn+1)$(1:dimz-1)
     1505               unit(varn) = temp_att@units
    13601506               data(varn,:,:) = temp(start_time_step:end_time_step,1:dimz-1)
    13611507            else
    1362                z = f->$vNam(varn+1)$
    1363                unit(varn) = temp@units
     1508               z = f_att->$vNam(varn+1)$
     1509               unit(varn) = temp_att@units
    13641510               data(varn,:,:) = temp(start_time_step:end_time_step,:)
    13651511            end if
    13661512         else
    1367             do i=0,b-1            
     1513            do i=0,b-1           
    13681514               if (isStrSubset( a(i),"zu_3d" ))then
    13691515                  z_v(varn,:) = z_u
    1370                   if (logy .EQ. 1) then
     1516                  if (log_z .EQ. 1) then
    13711517                     z = z_v(varn,1:dimz-1)
    13721518                  else
     
    13761522                  if (isStrSubset( a(i),"zw_3d" ))then
    13771523                     z_v(varn,:) = z_w
    1378                      if (logy .EQ. 1) then
     1524                     if (log_z .EQ. 1) then
    13791525                        z = z_v(varn,1:dimz-1)
    13801526                     else
     
    13901536         end if
    13911537         if (nof .EQ. 0) then
    1392             z_(n,:)=z/norm
     1538            z_(n,:)=z/norm_z
    13931539            z    = z_(n,:)
    13941540         else
    1395             z=z/norm
     1541            z=z/norm_z
    13961542         end if
    13971543   
    13981544         if (over .EQ. 0) then 
    13991545            res@gsnLeftString      = vNam(varn)
    1400             res@gsnRightString     = unit(varn)
     1546            res@tiXAxisString      = "["+unit(varn)+"]"
     1547            res@gsnRightString     = " "
    14011548            res@trYMinF            = min_z
    14021549            res@trYMaxF            = max_z
     
    14221569               else
    14231570                  res@gsnLeftString      = vNam(varn)
    1424                   res@gsnRightString     = unit(varn)
     1571                  res@tiXAxisString      = "["+unit(varn)+"]"
     1572                  res@gsnRightString     = " "                 
    14251573                  if (xs .EQ. -1) then
    14261574                     res@trXMinF            = miniu
     
    14441592               else
    14451593                  res@gsnLeftString      = vNam(varn)
    1446                   res@gsnRightString     = unit(varn)
     1594                  res@tiXAxisString      = "["+unit(varn)+"]"
     1595                  res@gsnRightString     = " "                 
    14471596                  if (xs .EQ. -1) then
    14481597                     res@trXMinF            = miniv
     
    14661615               else
    14671616                  res@gsnLeftString      = vNam(varn)
    1468                   res@gsnRightString     = unit(varn)
     1617                  res@tiXAxisString      = "["+unit(varn)+"]"
     1618                  res@gsnRightString     = " "
    14691619                  if (xs .EQ. -1) then
    14701620                     res@trXMinF            = miniw
     
    14891639               else
    14901640                  res@gsnLeftString      = vNam(varn)
    1491                   res@gsnRightString     = unit(varn)
     1641                  res@tiXAxisString      = "["+unit(varn)+"]"
     1642                  res@gsnRightString     = " "
    14921643                  if (xs .EQ. -1) then
    14931644                     res@trXMinF            = minipt
     
    15111662               else
    15121663                  res@gsnLeftString      = vNam(varn)
    1513                   res@gsnRightString     = unit(varn)
     1664                  res@tiXAxisString      = "["+unit(varn)+"]"
     1665                  res@gsnRightString     = " "
    15141666                  if (xs .EQ. -1) then
    15151667                     res@trXMinF            = minivpt
     
    15331685               else
    15341686                  res@gsnLeftString      = vNam(varn)
    1535                   res@gsnRightString     = unit(varn)
     1687                  res@tiXAxisString      = "["+unit(varn)+"]"
     1688                  res@gsnRightString     = " "
    15361689                  if (xs .EQ. -1) then
    15371690                     res@trXMinF            = minilpt
     
    15561709               else
    15571710                  res@gsnLeftString      = vNam(varn)
    1558                   res@gsnRightString     = unit(varn)
     1711                  res@tiXAxisString      = "["+unit(varn)+"]"
     1712                  res@gsnRightString     = " "
    15591713                  if (xs .EQ. -1) then
    15601714                     res@trXMinF            = minilq
     
    15781732               else
    15791733                  res@gsnLeftString      = vNam(varn)
    1580                   res@gsnRightString     = unit(varn)
     1734                  res@tiXAxisString      = "["+unit(varn)+"]"
     1735                  res@gsnRightString     = " "
    15811736                  if (xs .EQ. -1) then
    15821737                     res@trXMinF            = minilqv
     
    16001755               else
    16011756                  res@gsnLeftString      = vNam(varn)
    1602                   res@gsnRightString     = unit(varn)
     1757                  res@tiXAxisString      = "["+unit(varn)+"]"
     1758                  res@gsnRightString     = " "
    16031759                  if (xs .EQ. -1) then
    16041760                     res@trXMinF            = miniql
     
    16231779               else
    16241780                  res@gsnLeftString      = vNam(varn)
    1625                   res@gsnRightString     = unit(varn)
     1781                  res@tiXAxisString      = "["+unit(varn)+"]"
     1782                  res@gsnRightString     = " "
    16261783                  if (xs .EQ. -1) then
    16271784                     res@trXMinF            = minie
     
    16451802               else
    16461803                  res@gsnLeftString      = vNam(varn)
    1647                   res@gsnRightString     = unit(varn)
     1804                  res@tiXAxisString      = "["+unit(varn)+"]"
     1805                  res@gsnRightString     = " "
    16481806                  if (xs .EQ. -1) then
    16491807                     res@trXMinF            = minies
     
    16681826               else
    16691827                  res@gsnLeftString      = vNam(varn)
    1670                   res@gsnRightString     = unit(varn)
     1828                  res@tiXAxisString      = "["+unit(varn)+"]"
     1829                  res@gsnRightString     = " "
    16711830                  if (xs .EQ. -1) then
    16721831                     res@trXMinF            = minikm
     
    16901849               else
    16911850                  res@gsnLeftString      = vNam(varn)
    1692                   res@gsnRightString     = unit(varn)
     1851                  res@tiXAxisString      = "["+unit(varn)+"]"
     1852                  res@gsnRightString     = " "
    16931853                  if (xs .EQ. -1) then
    16941854                     res@trXMinF            = minikh
     
    17131873               else
    17141874                  res@gsnLeftString      = vNam(varn)
    1715                   res@gsnRightString     = unit(varn)
     1875                  res@tiXAxisString      = "["+unit(varn)+"]"
     1876                  res@gsnRightString     = " "
    17161877                  if (xs .EQ. -1) then
    17171878                     res@trXMinF            = miniwpup
     
    17351896               else
    17361897                  res@gsnLeftString      = vNam(varn)
    1737                   res@gsnRightString     = unit(varn)
     1898                  res@tiXAxisString      = "["+unit(varn)+"]"
     1899                  res@gsnRightString     = " "
    17381900                  if (xs .EQ. -1) then
    17391901                     res@trXMinF            = miniwsus
     
    17571919               else
    17581920                  res@gsnLeftString      = vNam(varn)
    1759                   res@gsnRightString     = unit(varn)
     1921                  res@tiXAxisString      = "["+unit(varn)+"]"
     1922                  res@gsnRightString     = " "
    17601923                  if (xs .EQ. -1) then
    17611924                     res@trXMinF            = miniwu
     
    17801943               else
    17811944                  res@gsnLeftString      = vNam(varn)
    1782                   res@gsnRightString     = unit(varn)
     1945                  res@tiXAxisString      = "["+unit(varn)+"]"
     1946                  res@gsnRightString     = " "
    17831947                  if (xs .EQ. -1) then
    17841948                     res@trXMinF            = miniwpvp
     
    18021966               else
    18031967                  res@gsnLeftString      = vNam(varn)
    1804                   res@gsnRightString     = unit(varn)
     1968                  res@tiXAxisString      = "["+unit(varn)+"]"
     1969                  res@gsnRightString     = " "
    18051970                  if (xs .EQ. -1) then
    18061971                     res@trXMinF            = miniwsvs
     
    18241989               else
    18251990                  res@gsnLeftString      = vNam(varn)
    1826                   res@gsnRightString     = unit(varn)
     1991                  res@tiXAxisString      = "["+unit(varn)+"]"
     1992                  res@gsnRightString     = " "
    18271993                  if (xs .EQ. -1) then
    18281994                     res@trXMinF            = miniwv
     
    18472013               else
    18482014                  res@gsnLeftString      = vNam(varn)
    1849                   res@gsnRightString     = unit(varn)
     2015                  res@tiXAxisString      = "["+unit(varn)+"]"
     2016                  res@gsnRightString     = " "
    18502017                  if (xs .EQ. -1) then
    18512018                     res@trXMinF            = miniwpptp
     
    18692036               else
    18702037                  res@gsnLeftString      = vNam(varn)
    1871                   res@gsnRightString     = unit(varn)
     2038                  res@tiXAxisString      = "["+unit(varn)+"]"
     2039                  res@gsnRightString     = " "
    18722040                  if (xs .EQ. -1) then
    18732041                     res@trXMinF            = miniwspts
     
    18912059               else
    18922060                  res@gsnLeftString      = vNam(varn)
    1893                   res@gsnRightString     = unit(varn)
     2061                  res@tiXAxisString      = "["+unit(varn)+"]"
     2062                  res@gsnRightString     = " "
    18942063                  if (xs .EQ. -1) then
    18952064                     res@trXMinF            = miniwpt
     
    19142083               else
    19152084                  res@gsnLeftString      = vNam(varn)
    1916                   res@gsnRightString     = unit(varn)
     2085                  res@tiXAxisString      = "["+unit(varn)+"]"
     2086                  res@gsnRightString     = " "
    19172087                  if (xs .EQ. -1) then
    19182088                     res@trXMinF            = miniwsptsBC
     
    19362106               else
    19372107                  res@gsnLeftString      = vNam(varn)
    1938                   res@gsnRightString     = unit(varn)
     2108                  res@tiXAxisString      = "["+unit(varn)+"]"
     2109                  res@gsnRightString     = " "
    19392110                  if (xs .EQ. -1) then
    19402111                     res@trXMinF            = miniwptBC
     
    19592130               else
    19602131                  res@gsnLeftString      = vNam(varn)
    1961                   res@gsnRightString     = unit(varn)
     2132                  res@tiXAxisString      = "["+unit(varn)+"]"
     2133                  res@gsnRightString     = " "
    19622134                  if (xs .EQ. -1) then
    19632135                     res@trXMinF            = miniwpvptp
     
    19812153               else
    19822154                  res@gsnLeftString      = vNam(varn)
    1983                   res@gsnRightString     = unit(varn)
     2155                  res@tiXAxisString      = "["+unit(varn)+"]"
     2156                  res@gsnRightString     = " "
    19842157                  if (xs .EQ. -1) then
    19852158                     res@trXMinF            = miniwsvpts
     
    20032176               else
    20042177                  res@gsnLeftString      = vNam(varn)
    2005                   res@gsnRightString     = unit(varn)
     2178                  res@tiXAxisString      = "["+unit(varn)+"]"
     2179                  res@gsnRightString     = " "
    20062180                  if (xs .EQ. -1) then
    20072181                     res@trXMinF            = miniwvpt
     
    20262200               else
    20272201                  res@gsnLeftString      = vNam(varn)
    2028                   res@gsnRightString     = unit(varn)
     2202                  res@tiXAxisString      = "["+unit(varn)+"]"
     2203                  res@gsnRightString     = " "
    20292204                  if (xs .EQ. -1) then
    20302205                     res@trXMinF            = miniwpqp
     
    20482223               else
    20492224                  res@gsnLeftString      = vNam(varn)
    2050                   res@gsnRightString     = unit(varn)
     2225                  res@tiXAxisString      = "["+unit(varn)+"]"
     2226                  res@gsnRightString     = " "
    20512227                  if (xs .EQ. -1) then
    20522228                     res@trXMinF            = miniwsqs
     
    20702246               else
    20712247                  res@gsnLeftString      = vNam(varn)
    2072                   res@gsnRightString     = unit(varn)
     2248                  res@tiXAxisString      = "["+unit(varn)+"]"
     2249                  res@gsnRightString     = " "
    20732250                  if (xs .EQ. -1) then
    20742251                     res@trXMinF            = miniwq
     
    20932270               else
    20942271                  res@gsnLeftString      = vNam(varn)
    2095                   res@gsnRightString     = unit(varn)
     2272                  res@tiXAxisString      = "["+unit(varn)+"]"
     2273                  res@gsnRightString     = " "
    20962274                  if (xs .EQ. -1) then
    20972275                     res@trXMinF            = miniwpqvp
     
    21152293               else
    21162294                  res@gsnLeftString      = vNam(varn)
    2117                   res@gsnRightString     = unit(varn)
     2295                  res@tiXAxisString      = "["+unit(varn)+"]"
     2296                  res@gsnRightString     = " "
    21182297                  if (xs .EQ. -1) then
    21192298                     res@trXMinF            = miniwsqvs
     
    21372316               else
    21382317                  res@gsnLeftString      = vNam(varn)
    2139                   res@gsnRightString     = unit(varn)
     2318                  res@tiXAxisString      = "["+unit(varn)+"]"
     2319                  res@gsnRightString     = " "
    21402320                  if (xs .EQ. -1) then
    21412321                     res@trXMinF            = miniwqv
     
    21602340               else
    21612341                  res@gsnLeftString      = vNam(varn)
    2162                   res@gsnRightString     = unit(varn)
     2342                  res@tiXAxisString      = "["+unit(varn)+"]"
     2343                  res@gsnRightString     = " "
    21632344                  if (xs .EQ. -1) then
    21642345                     res@trXMinF            = miniwpsp
     
    21822363               else
    21832364                  res@gsnLeftString      = vNam(varn)
    2184                   res@gsnRightString     = unit(varn)
     2365                  res@tiXAxisString      = "["+unit(varn)+"]"
     2366                  res@gsnRightString     = " "
    21852367                  if (xs .EQ. -1) then
    21862368                     res@trXMinF            = miniwsss
     
    22042386               else
    22052387                  res@gsnLeftString      = vNam(varn)
    2206                   res@gsnRightString     = unit(varn)
     2388                  res@tiXAxisString      = "["+unit(varn)+"]"
     2389                  res@gsnRightString     = " "
    22072390                  if (xs .EQ. -1) then
    22082391                     res@trXMinF            = miniws
     
    22272410               else
    22282411                  res@gsnLeftString      = vNam(varn)
    2229                   res@gsnRightString     = unit(varn)
     2412                  res@tiXAxisString      = "["+unit(varn)+"]"
     2413                  res@gsnRightString     = " "
    22302414                  if (xs .EQ. -1) then
    22312415                     res@trXMinF            = miniwpsap
     
    22492433               else
    22502434                  res@gsnLeftString      = vNam(varn)
    2251                   res@gsnRightString     = unit(varn)
     2435                  res@tiXAxisString      = "["+unit(varn)+"]"
     2436                  res@gsnRightString     = " "
    22522437                  if (xs .EQ. -1) then
    22532438                     res@trXMinF            = miniwssas
     
    22712456               else
    22722457                  res@gsnLeftString      = vNam(varn)
    2273                   res@gsnRightString     = unit(varn)
     2458                  res@tiXAxisString      = "["+unit(varn)+"]"
     2459                  res@gsnRightString     = " "
    22742460                  if (xs .EQ. -1) then
    22752461                     res@trXMinF            = miniwsa
     
    22942480               else
    22952481                  res@gsnLeftString      = vNam(varn)
    2296                   res@gsnRightString     = unit(varn)
     2482                  res@tiXAxisString      = "["+unit(varn)+"]"
     2483                  res@gsnRightString     = " "
    22972484                  if (xs .EQ. -1) then
    22982485                     res@trXMinF            = minius2
     
    23162503               else
    23172504                  res@gsnLeftString      = vNam(varn)
    2318                   res@gsnRightString     = unit(varn)
     2505                  res@tiXAxisString      = "["+unit(varn)+"]"
     2506                  res@gsnRightString     = " "
    23192507                  if (xs .EQ. -1) then
    23202508                     res@trXMinF            = minivs2
     
    23382526               else
    23392527                  res@gsnLeftString      = vNam(varn)
    2340                   res@gsnRightString     = unit(varn)
     2528                  res@tiXAxisString      = "["+unit(varn)+"]"
     2529                  res@gsnRightString     = " "
    23412530                  if (xs .EQ. -1) then
    23422531                     res@trXMinF            = miniws2
     
    23612550               else
    23622551                  res@gsnLeftString      = vNam(varn)
    2363                   res@gsnRightString     = unit(varn)
     2552                  res@tiXAxisString      = "["+unit(varn)+"]"
     2553                  res@gsnRightString     = " "
    23642554                  if (xs .EQ. -1) then
    23652555                     res@trXMinF            = miniwsususodz
     
    23832573               else
    23842574                  res@gsnLeftString      = vNam(varn)
    2385                   res@gsnRightString     = unit(varn)
     2575                  res@tiXAxisString      = "["+unit(varn)+"]"
     2576                  res@gsnRightString     = " "
    23862577                  if (xs .EQ. -1) then
    23872578                     res@trXMinF            = miniwspsodz
     
    24052596               else
    24062597                  res@gsnLeftString      = vNam(varn)
    2407                   res@gsnRightString     = unit(varn)
     2598                  res@tiXAxisString      = "["+unit(varn)+"]"
     2599                  res@gsnRightString     = " "
    24082600                  if (xs .EQ. -1) then
    24092601                     res@trXMinF            = miniwpeodz
     
    24372629   if (no_files .GT. 1) then
    24382630      delete(vNam)
    2439    end if
     2631      delete(files)
     2632   end if
     2633   
    24402634   end do
    2441 
     2635   ;#########ENDE DO LOOP FOR no_files GT 1#############
     2636   
    24422637   if (count_var .EQ. 0) then
    24432638      print(" ")
     
    24492644   
    24502645   if (no_files .GT. 1) then
    2451       multi_legend=new(12,string)
    2452       string_len=new(12,integer)
     2646      multi_legend=new(6,string)
     2647      string_len=new(6,integer)
    24532648      multi_dash=new(no_files,string)
    24542649      multi_legend(0)="  "+name_legend_1
     
    24642659      multi_legend(5)="  "+name_legend_6
    24652660      string_len(5)=strlen(multi_legend(5))
    2466       multi_legend(6)="  "+name_legend_7
    2467       string_len(6)=strlen(multi_legend(6))
    2468       multi_legend(7)="  "+name_legend_8
    2469       string_len(7)=strlen(multi_legend(7))
    2470       multi_legend(8)="  "+name_legend_9
    2471       string_len(8)=strlen(multi_legend(8))
    2472       multi_legend(9)="  "+name_legend_10
    2473       string_len(9)=strlen(multi_legend(9))
    2474       multi_legend(10)="  "+name_legend_11
    2475       string_len(10)=strlen(multi_legend(10))
    2476       multi_legend(11)="  "+name_legend_12
    2477       string_len(11)=strlen(multi_legend(11))
    24782661      do ml=1,no_files
    24792662         multi_dash(ml-1)=ml-1
     
    24972680         lgMonoDashIndex          = False
    24982681         lgres@lgLabelFont        = "helvetica"   
    2499          lgres@lgLabelFontHeightF = .2           
     2682         lgres@lgLabelFontHeightF = font_size_legend           
    25002683         lgres@vpWidthF           = max(string_len)*0.012           
    25012684         lgres@vpHeightF          = 0.04*no_files         
     
    25182701   if (count_var .EQ. 0) then
    25192702      print(" ")
    2520       print("Please select a variable 'var=' or use the default value")
     2703      print("Select a variable 'var=' or use the default value")
    25212704      print(" ")
    25222705      print("Your selection '"+var+"' does not exist on the input file")
     
    25982781
    25992782            if (prof3d .EQ. 0) then
    2600                if (logy .EQ. 1) then
     2783               if (log_z .EQ. 1) then
    26012784                  z = f->$vNam(varn+1)$(1:dimz-1)
    26022785               else
     
    26072790                  if (isStrSubset( a(i),"zu_3d" ))then
    26082791                     z_v(varn,:) = z_u
    2609                      if (logy .EQ. 1) then
     2792                     if (log_z .EQ. 1) then
    26102793                        z = z_v(varn,1:dimz-1)
    26112794                     else
     
    26152798                     if (isStrSubset( a(i),"zw_3d" ))then
    26162799                        z_v(varn,:) = z_w
    2617                         if (logy .EQ. 1) then
     2800                        if (log_z .EQ. 1) then
    26182801                           z = z_v(varn,1:dimz-1)
    26192802                        else
     
    26252808            end if
    26262809
    2627             z=z/norm
     2810            z=z/norm_z
    26282811
    26292812            res@gsnLeftString      = vNam(varn)
    2630             res@gsnRightString     = unit(varn)
     2813            res@tiXAxisString      = "["+unit(varn)+"]"
     2814            res@gsnRightString     = " "
    26312815            res@trYMinF            = min_z
    26322816            res@trYMaxF            = max_z 
     
    26462830               if (u .EQ. 0) then
    26472831                  res@gsnLeftString      = "u, v and w"
    2648                   res@gsnRightString     = unit(varn)
     2832                  res@tiXAxisString      = "["+unit(varn)+"]"
     2833                  res@gsnRightString     = " "
    26492834                  if (xs .EQ. -1) then
    26502835                     res@trXMinF = min((/miniu,miniv,miniw/))
     
    26662851                  lgMonoDashIndex          = False
    26672852                  lgres@lgLabelFont        = "helvetica"   
    2668                   lgres@lgLabelFontHeightF = .1           
     2853                  lgres@lgLabelFontHeightF = font_size_legend           
    26692854                  lgres@vpWidthF           = 0.12           
    26702855                  lgres@vpHeightF          = 0.1         
     
    26892874               if (pt .EQ. 0) then
    26902875                  res@gsnLeftString      = "pt, vpt and lpt"
    2691                   res@gsnRightString     = unit(varn)
     2876                  res@tiXAxisString      = "["+unit(varn)+"]"
     2877                  res@gsnRightString     = " "
    26922878                  if (xs .EQ. -1) then
    26932879                     res@trXMinF = min((/minipt,minivpt,minilpt/))
     
    27102896                  lgMonoDashIndex          = False
    27112897                  lgres@lgLabelFont        = "helvetica"   
    2712                   lgres@lgLabelFontHeightF = .1            
     2898                  lgres@lgLabelFontHeightF = font_size_legend           
    27132899                  lgres@vpWidthF           = 0.12           
    27142900                  lgres@vpHeightF          = 0.1         
     
    27322918               if (q .EQ. 0) then
    27332919                  res@gsnLeftString      = "q, qv and ql"
    2734                   res@gsnRightString     = unit(varn)
     2920                  res@tiXAxisString      = "["+unit(varn)+"]"
     2921                  res@gsnRightString     = " "
    27352922                  if (xs .EQ. -1) then
    27362923                     res@trXMinF = min((/miniq,miniqv,miniql/))
     
    27532940                  lgMonoDashIndex          = False
    27542941                  lgres@lgLabelFont        = "helvetica"   
    2755                   lgres@lgLabelFontHeightF = .1           
     2942                  lgres@lgLabelFontHeightF = font_size_legend           
    27562943                  lgres@vpWidthF           = 0.12           
    27572944                  lgres@vpHeightF          = 0.1         
     
    27762963               if (e .EQ. 0) then
    27772964                  res@gsnLeftString      = "e and es"
    2778                   res@gsnRightString     = unit(varn)
     2965                  res@tiXAxisString      = "["+unit(varn)+"]"
     2966                  res@gsnRightString     = " "
    27792967                  if (xs .EQ. -1) then
    27802968                     res@trXMinF = min((/minie,minies/))
     
    27972985                  lgMonoDashIndex          = False
    27982986                  lgres@lgLabelFont        = "helvetica"   
    2799                   lgres@lgLabelFontHeightF = .1            
     2987                  lgres@lgLabelFontHeightF = font_size_legend           
    28002988                  lgres@vpWidthF           = 0.12           
    28012989                  lgres@vpHeightF          = 0.1         
     
    28193007               if (km .EQ. 0) then
    28203008                  res@gsnLeftString      = "km and kh"
    2821                   res@gsnRightString     = unit(varn)
     3009                  res@tiXAxisString      = "["+unit(varn)+"]"
     3010                  res@gsnRightString     = " "
    28223011                  if (xs .EQ. -1) then
    28233012                     res@trXMinF = min((/minikm,minikh/))
     
    28403029                  lgMonoDashIndex          = False
    28413030                  lgres@lgLabelFont        = "helvetica"   
    2842                   lgres@lgLabelFontHeightF = .1            
     3031                  lgres@lgLabelFontHeightF = font_size_legend           
    28433032                  lgres@vpWidthF           = 0.12           
    28443033                  lgres@vpHeightF          = 0.1         
     
    28633052               if (wpup .EQ. 0) then
    28643053                  res@gsnLeftString      = "wpup, wsus and wu"
    2865                   res@gsnRightString     = unit(varn)
     3054                  res@tiXAxisString      = "["+unit(varn)+"]"
     3055                  res@gsnRightString     = " "
    28663056                  if (xs .EQ. -1) then
    28673057                     res@trXMinF = min((/miniwpup,miniwsus,miniwu/))
     
    28843074                  lgMonoDashIndex          = False
    28853075                  lgres@lgLabelFont        = "helvetica"   
    2886                   lgres@lgLabelFontHeightF = .1           
     3076                  lgres@lgLabelFontHeightF = font_size_legend           
    28873077                  lgres@vpWidthF           = 0.12           
    28883078                  lgres@vpHeightF          = 0.1         
     
    29063096               if (wpvp .EQ. 0) then
    29073097                  res@gsnLeftString      = "wpvp, wsus and wv"
    2908                   res@gsnRightString     = unit(varn)
     3098                  res@tiXAxisString      = "["+unit(varn)+"]"
     3099                  res@gsnRightString     = " "
    29093100                  if (xs .EQ. -1) then
    29103101                     res@trXMinF = min((/miniwpvp,miniwsvs,miniwv/))
     
    29273118                  lgMonoDashIndex          = False
    29283119                  lgres@lgLabelFont        = "helvetica"   
    2929                   lgres@lgLabelFontHeightF = .1           
     3120                  lgres@lgLabelFontHeightF = font_size_legend           
    29303121                  lgres@vpWidthF           = 0.12           
    29313122                  lgres@vpHeightF          = 0.1         
     
    29493140               if (wpptp .EQ. 0) then
    29503141                  res@gsnLeftString      = "wpptp, wspts and wv"
    2951                   res@gsnRightString     = unit(varn)
     3142                  res@tiXAxisString      = "["+unit(varn)+"]"
     3143                  res@gsnRightString     = " "
    29523144                  if (xs .EQ. -1) then
    29533145                     res@trXMinF = min((/miniwpptp,miniwspts,miniwpt/))
     
    29703162                  lgMonoDashIndex          = False
    29713163                  lgres@lgLabelFont        = "helvetica"   
    2972                   lgres@lgLabelFontHeightF = .1           
     3164                  lgres@lgLabelFontHeightF = font_size_legend           
    29733165                  lgres@vpWidthF           = 0.12           
    29743166                  lgres@vpHeightF          = 0.1         
     
    29923184               if (wsptsBC .EQ. 0) then
    29933185                  res@gsnLeftString      = "wsptsBC and wptBC"
    2994                   res@gsnRightString     = unit(varn)
     3186                  res@tiXAxisString      = "["+unit(varn)+"]"
     3187                  res@gsnRightString     = " "
    29953188                  if (xs .EQ. -1) then
    29963189                     res@trXMinF = min((/miniwsptsBC,miniwptBC/))
     
    30133206                  lgMonoDashIndex          = False
    30143207                  lgres@lgLabelFont        = "helvetica"   
    3015                   lgres@lgLabelFontHeightF = .1           
     3208                  lgres@lgLabelFontHeightF = font_size_legend           
    30163209                  lgres@vpWidthF           = 0.12           
    30173210                  lgres@vpHeightF          = 0.1         
     
    30353228               if (wpvptp .EQ. 0) then
    30363229                  res@gsnLeftString      = "wpvptp, wsvpts and wv"
    3037                   res@gsnRightString     = unit(varn)
     3230                  res@tiXAxisString      = "["+unit(varn)+"]"
     3231                  res@gsnRightString     = " "
    30383232                  if (xs .EQ. -1) then
    30393233                     res@trXMinF = min((/miniwpvptp,miniwsvpts,miniwvpt/))
     
    30563250                  lgMonoDashIndex          = False
    30573251                  lgres@lgLabelFont        = "helvetica"   
    3058                   lgres@lgLabelFontHeightF = .1           
     3252                  lgres@lgLabelFontHeightF = font_size_legend           
    30593253                  lgres@vpWidthF           = 0.12           
    30603254                  lgres@vpHeightF          = 0.1         
     
    30783272               if (wpqp .EQ. 0) then
    30793273                  res@gsnLeftString      = "wpqp, wsqs and wq"
    3080                   res@gsnRightString     = unit(varn)
     3274                  res@tiXAxisString      = "["+unit(varn)+"]"
     3275                  res@gsnRightString     = " "
    30813276                  if (xs .EQ. -1) then
    30823277                     res@trXMinF = min((/miniwpqp,miniwsqs,miniwq/))
     
    30993294                  lgMonoDashIndex          = False
    31003295                  lgres@lgLabelFont        = "helvetica"   
    3101                   lgres@lgLabelFontHeightF = .1            
     3296                  lgres@lgLabelFontHeightF = font_size_legend           
    31023297                  lgres@vpWidthF           = 0.12           
    31033298                  lgres@vpHeightF          = 0.1         
     
    31213316               if (wpqvp .EQ. 0) then
    31223317                  res@gsnLeftString      = "wpqvp, wsqvs and wqv"
    3123                   res@gsnRightString     = unit(varn)
     3318                  res@tiXAxisString      = "["+unit(varn)+"]"
     3319                  res@gsnRightString     = " "
    31243320                  if (xs .EQ. -1) then
    31253321                     res@trXMinF = min((/miniwpqp,miniwsqvs,miniwqv/))
     
    31423338                  lgMonoDashIndex          = False
    31433339                  lgres@lgLabelFont        = "helvetica"   
    3144                   lgres@lgLabelFontHeightF = .1           
     3340                  lgres@lgLabelFontHeightF = font_size_legend           
    31453341                  lgres@vpWidthF           = 0.12           
    31463342                  lgres@vpHeightF          = 0.1         
     
    31643360               if (wpsp .EQ. 0) then
    31653361                  res@gsnLeftString      = "wpsp, wsss and ws"
    3166                   res@gsnRightString     = unit(varn)
     3362                  res@tiXAxisString      = "["+unit(varn)+"]"
     3363                  res@gsnRightString     = " "
    31673364                  if (xs .EQ. -1) then
    31683365                     res@trXMinF = min((/miniwpsp,miniwsss,miniws/))
     
    31853382                  lgMonoDashIndex          = False
    31863383                  lgres@lgLabelFont        = "helvetica"   
    3187                   lgres@lgLabelFontHeightF = .1           
     3384                  lgres@lgLabelFontHeightF = font_size_legend           
    31883385                  lgres@vpWidthF           = 0.12           
    31893386                  lgres@vpHeightF          = 0.1         
     
    32073404               if (wpsap .EQ. 0) then
    32083405                  res@gsnLeftString      = "wpsap, wssas and wsa"
    3209                   res@gsnRightString     = unit(varn)
     3406                  res@tiXAxisString      = "["+unit(varn)+"]"
     3407                  res@gsnRightString     = " "
    32103408                  if (xs .EQ. -1) then
    32113409                     res@trXMinF = min((/miniwpsap,miniwssas,miniwsa/))
     
    32283426                  lgMonoDashIndex          = False
    32293427                  lgres@lgLabelFont        = "helvetica"   
    3230                   lgres@lgLabelFontHeightF = .1           
     3428                  lgres@lgLabelFontHeightF = font_size_legend           
    32313429                  lgres@vpWidthF           = 0.12           
    32323430                  lgres@vpHeightF          = 0.1         
     
    32513449               if (us2 .EQ. 0) then
    32523450                  res@gsnLeftString      = "us2, vs2 and ws2"
    3253                   res@gsnRightString     = unit(varn)
     3451                  res@tiXAxisString      = "["+unit(varn)+"]"
     3452                  res@gsnRightString     = " "
    32543453                  if (xs .EQ. -1) then
    32553454                     res@trXMinF = min((/minius2,minivs2,miniws2/))
     
    32723471                  lgMonoDashIndex          = False
    32733472                  lgres@lgLabelFont        = "helvetica"   
    3274                   lgres@lgLabelFontHeightF = .1           
     3473                  lgres@lgLabelFontHeightF = font_size_legend           
    32753474                  lgres@vpWidthF           = 0.12           
    32763475                  lgres@vpHeightF          = 0.1         
     
    32953494               if (wsususodz .EQ. 0) then
    32963495                  res@gsnLeftString      = "wsususodz, wspsodz and ws2"
    3297                   res@gsnRightString     = unit(varn)
     3496                  res@tiXAxisString      = "["+unit(varn)+"]"
     3497                  res@gsnRightString     = " "
    32983498                  if (xs .EQ. -1) then
    32993499                     res@trXMinF = min((/miniwsususodz,miniwspsodz,miniwpeodz/))
     
    33163516                  lgMonoDashIndex          = False
    33173517                  lgres@lgLabelFont        = "helvetica"   
    3318                   lgres@lgLabelFontHeightF = .1           
     3518                  lgres@lgLabelFontHeightF = font_size_legend           
    33193519                  lgres@vpWidthF           = 0.12           
    33203520                  lgres@vpHeightF          = 0.1         
     
    33693569           
    33703570            if (prof3d .EQ. 0) then
    3371                if (logy .EQ. 1) then
     3571               if (log_z .EQ. 1) then
    33723572                  z = f->$vNam(varn+1)$(1:dimz-1)
    33733573               else
     
    33783578                  if (isStrSubset( a(i),"zu_3d" ))then
    33793579                     z_v(varn,:) = z_u
    3380                      if (logy .EQ. 1) then
     3580                     if (log_z .EQ. 1) then
    33813581                        z = z_v(varn,1:dimz-1)
    33823582                     else
     
    33863586                     if (isStrSubset( a(i),"zw_3d" ))then
    33873587                        z_v(varn,:) = z_w
    3388                         if (logy .EQ. 1) then
     3588                        if (log_z .EQ. 1) then
    33893589                           z = z_v(varn,1:dimz-1)
    33903590                        else
     
    33963596            end if
    33973597
    3398             z=z/norm
     3598            z=z/norm_z
    33993599           
    34003600            com_var_avail(n_o)=vNam(varn)
     
    34123612                     res@xyDashPattern  = 0
    34133613                     res@gsnLeftString  = "Combined Plot of "+c_var
    3414                      res@gsnRightString = unit(varn)
     3614                     res@tiXAxisString      = "["+unit(varn)+"]"
     3615                     res@gsnRightString     = " "
    34153616                     if (xs .EQ. -1) then
    34163617                        res@trXMinF = min(mini)
     
    34723673      lgres@lgDashIndexes      = (/0,1,2/)
    34733674      lgres@lgLabelFont        = "helvetica"   
    3474       lgres@lgLabelFontHeightF = .1            
     3675      lgres@lgLabelFontHeightF = font_size_legend           
    34753676      lgres@vpWidthF           = 0.12           
    34763677      lgres@vpHeightF          = 0.1           
     
    34983699      gsn_panel(wks,plot_,(/n,1/),resP)
    34993700   else   
    3500       do i = 0,n-1, no_lines*no_columns
    3501          if( (i+no_lines*no_columns) .gt. (n-1)) then
    3502             gsn_panel(wks,plot_(i:n-1),(/no_lines,no_columns/),resP)
     3701      do i = 0,n-1, no_rows*no_columns
     3702         if( (i+no_rows*no_columns) .gt. (n-1)) then
     3703            gsn_panel(wks,plot_(i:n-1),(/no_rows,no_columns/),resP)
    35033704         else
    3504            gsn_panel(wks,plot_(i:i+no_lines*no_columns-1),(/no_lines,no_columns/),resP)
     3705           gsn_panel(wks,plot_(i:i+no_rows*no_columns-1),(/no_rows,no_columns/),resP)
    35053706         end if
    35063707      end do
Note: See TracChangeset for help on using the changeset viewer.