Changeset 218 for palm/trunk/SCRIPTS/NCL


Ignore:
Timestamp:
Dec 10, 2008 9:14:34 AM (15 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
Location:
palm/trunk/SCRIPTS/NCL
Files:
6 edited

Legend:

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

    r195 r218  
    3737   if (file_1 .EQ. "File in") then
    3838      print(" ")
    39       print("Please provide 1st input file 'file_1=' in 'ncl_preferences.ncl'")
     39      print("Declare input file 'file_1=' in 'ncl_preferences.ncl' or prompt")
    4040      print(" ")
    4141      exit
     
    4343      file_in = file_1   
    4444   end if
    45    if (.not. isfilepresent(file_in)) then
    46       print(" ")
    47       print("1st input file: '"+file_in+"' does not exist")
    48       print(" ")
    49       exit
    50    end if
    5145
    5246   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
     
    7367   if (fill_mode .NE. "AreaFill" .AND. fill_mode .NE. "RasterFill" .AND. fill_mode .NE. "CellFill") then
    7468      print(" ")
    75       print("Your 'fill_mode'= "+fill_mode+" is invalid and set to 'AreaFill'")
     69      print("'fill_mode'= "+fill_mode+" is invalid and set to 'AreaFill'")
    7670      print(" ")
    7771      fill_mode = "AreaFill"
     
    108102   if (xyc .EQ. 0 .AND. xzc .EQ. 0 .AND. yzc .EQ. 0) then
    109103      print(" ")
    110       print("Please select one crossection (xyc=1 or xzc=1 or yzc=1)")
     104      print("Select one crossection (xyc=1 or xzc=1 or yzc=1)")
    111105      print(" ")
    112106      exit
     
    115109      if (xzc .EQ. 1 .OR. yzc .EQ. 1) then
    116110         print(" ")
    117          print("Please select just one crossection (xyc=1 or xzc=1 or yzc=1)")
     111         print("Select just one crossection (xyc=1 or xzc=1 or yzc=1)")
    118112         print(" ")
    119113         exit
     
    123117      if (xyc .EQ. 1 .OR. yzc .EQ. 1) then
    124118         print(" ")
    125          print("Please select just one crossection (xyc=1 or xzc=1 or yzc=1)")
     119         print("Select just one crossection (xyc=1 or xzc=1 or yzc=1)")
    126120         print(" ")
    127121         exit
     
    131125      if (xyc .EQ. 1 .OR. xzc .EQ. 1) then
    132126         print(" ")
    133          print("Please select just one crossection (xyc=1 or xzc=1 or yzc=1)")
     127         print("Select just one crossection (xyc=1 or xzc=1 or yzc=1)")
    134128         print(" ")
    135129         exit
     
    139133   if (vector .NE. 0 .AND. vector .NE. 1) then
    140134      print(" ")
    141       print("Please set 'vector' to 0 or 1")
     135      print("Set 'vector' to 0 or 1")
    142136      print(" ")
    143137      exit
    144    end if   
     138   end if 
     139   
     140   if (norm_x .EQ. 0) then
     141      print(" ")
     142      print("Normalising with 0 is not allowed, 'norm_x' is set to 1.0")
     143      print(" ")
     144      norm_x = 1.0
     145   end if
     146   if (norm_y .EQ. 0) then
     147      print(" ")
     148      print("Normalising with 0 is not allowed, 'norm_y' is set to 1.0")
     149      print(" ")
     150      norm_y = 1.0
     151   end if
     152   if (norm_z .EQ. 0) then
     153      print(" ")
     154      print("Normalising with 0 is not allowed, 'norm_z' is set to 1.0")
     155      print(" ")
     156      norm_z = 1.0
     157   end if
    145158 
    146159   ; ***************************************************
    147160   ; open input file
    148161   ; ***************************************************
    149 
    150    f  = addfile( file_in, "r" )
    151 
    152    vNam  = getfilevarnames(f)
     162   
     163   file_in_1 = False
     164   if (isStrSubset(file_in, ".nc"))then
     165      start_f = -2
     166      end_f = -2
     167      file_in_1 = True     
     168   end if
     169
     170   if (start_f .EQ. -1)then
     171      print(" ")
     172      print("'start_f' must be one of the cyclic numbers (at least 0) of your input file(s)")
     173      print(" ") 
     174      exit
     175   end if
     176   if (end_f .EQ. -1)then
     177      print(" ")
     178      print("'end_f' must be one of the cyclic numbers (at least 0) of your input file(s)")
     179      print(" ") 
     180      exit
     181   end if
     182
     183   files=new(end_f-start_f+1,string)
     184
     185   if (file_in_1)then
     186      if (isfilepresent(file_in))then
     187         files(0)=file_in
     188      else
     189         print(" ")
     190         print("1st input file: '"+file_in+"' does not exist")
     191         print(" ")
     192         exit
     193      end if
     194   else   
     195      if (start_f .EQ. 0)then
     196         if (isfilepresent(file_in+".nc"))then
     197            files(0)=file_in+".nc"
     198            do i=1,end_f
     199               if (isfilepresent(file_in+"."+i+".nc"))then   
     200                  files(i)=file_in+"."+i+".nc"
     201               else
     202                  print(" ")
     203                  print("Input file: '"+file_in+"."+i+".nc' does not exist")
     204                  print(" ")
     205                  exit 
     206               end if       
     207            end do         
     208         else
     209            print(" ")
     210            print("Input file: '"+file_in+".nc' does not exist")
     211            print(" ")
     212            exit
     213         end if
     214      else
     215         do i=start_f,end_f
     216            if (isfilepresent(file_in+"."+i+".nc"))then   
     217               files(i-start_f)=file_in+"."+i+".nc"
     218            else
     219               print(" ")
     220               print("Input file: '"+file_in+"."+i+".nc' does not exist")
     221               print(" ")
     222               exit 
     223            end if
     224         end do
     225      end if
     226   end if
     227   
     228   f=addfiles(files,"r")
     229   f_att=addfile(files(0),"r")
     230   ListSetType(f,"cat")
     231
     232   vNam  = getfilevarnames(f_att)
    153233   print(" ")
    154234   print("Variables in input file:")
     
    225305   else
    226306      print(" ")
    227       print("Your input file: '"+file_in+"'")
    228       print("contains 3d or other data")
     307      print("Your input file contains 3d or other data")
    229308      print(" ")
    230309   end if
     
    242321
    243322   cs_res                          = True
     323   vecres                          = True
    244324   cs_res@gsnYAxisIrregular2Linear = True 
    245325 
     
    247327   cs_res@gsnFrame                = False
    248328   cs_res@gsnMaximize             = True
    249    cs_res@gsnPaperOrientation     = "portrait"
    250    cs_res@gsnPaperWidth           = 8.27
    251    cs_res@gsnPaperHeight          = 11.69
    252    cs_res@gsnPaperMargin          = 0.79
    253    cs_res@tmXBLabelFontHeightF   = .03
    254    cs_res@tmYLLabelFontHeightF   = .03
    255    cs_res@tiXAxisFontHeightF     = .03
    256    cs_res@tiYAxisFontHeightF     = .03
     329   
     330   cs_res@tmXBLabelFontHeightF   = font_size
     331   cs_res@tmYLLabelFontHeightF   = font_size
     332   cs_res@tiXAxisFontHeightF     = font_size
     333   cs_res@tiYAxisFontHeightF     = font_size
    257334   cs_res@tmXBMode                ="Automatic"
    258335   cs_res@tmYLMode                ="Automatic"
    259    cs_res@lgTitleFontHeightF     = .03
    260    cs_res@lgLabelFontHeightF     = .03
    261    cs_res@txFontHeightF          = .03
     336 
    262337   cs_res@cnLevelSelectionMode    = "ManualLevels"
     338   cs_res@lbLabelFontHeightF = font_size_legend
     339   cs_res@lbLabelStride = legend_label_stride
     340   
    263341
    264342   cs_resP = True
    265    cs_resP@txString               = f@title
     343   cs_resP@txString               = f_att@title
    266344   cs_resP@txFuncCode             = "~"                 
    267    cs_resP@txFontHeightF          = .02
    268    
     345   cs_resP@txFontHeightF          = 0.015       
    269346 
    270347   if ( mode .eq. "Fill" ) then
    271348      cs_res@cnFillOn             = True
    272349      cs_res@gsnSpreadColors      = True
    273       cs_res@cnFillMode           = fill_mode
    274       cs_res@lbOrientation        = "Vertical"         
     350      cs_res@cnFillMode           = fill_mode   
    275351      cs_res@cnLinesOn            = False       
    276352      cs_res@cnLineLabelsOn       = False
     
    280356      cs_res@cnFillOn             = True
    281357      cs_res@gsnSpreadColors      = True
    282       cs_res@cnFillMode           = fill_mode
    283       cs_res@lbOrientation        = "Vertical" 
     358      cs_res@cnFillMode           = fill_mode
    284359      cs_res@cnLinesOn            = True
    285360      cs_res@cnLineLabelsOn       = True
     
    290365   ; *********************************************
    291366
    292    t_all = f->time
     367   t_all = f[:]->time
    293368   nt = dimsizes(t_all)
    294369   delta_t = t_all(nt-1)/nt
     
    305380         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")
    306381         print(" ")
    307          print("Please select another 'start_time_step'")
     382         print("Select another 'start_time_step'")
    308383         print(" ")
    309384         exit
     
    313388         print("'start_time_step' = "+ start_time_step +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
    314389         print(" ")
    315          print("Please select another 'start_time_step'")
     390         print("Select another 'start_time_step'")
    316391         print(" ")
    317392         exit
    318393      end if
    319394   end if
    320    do i=0,nt-1     
     395   do i=0,nt-1   
    321396      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
    322397         st=i
     
    329404      print("'start_time_step' = "+ start_time_step +"h is invalid")
    330405      print(" ")
    331       print("Please select another 'start_time_step'")
     406      print("Select another 'start_time_step'")
    332407      print(" ")
    333408      exit
     
    345420         print("'end_time_step' = "+end_time_step+ "h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
    346421         print(" ")
    347          print("Please select another 'end_time_step'")
     422         print("Select another 'end_time_step'")
    348423         print(" ")
    349424         exit
     
    353428         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")
    354429         print(" ")
    355          print("Please select another 'end_time_step'") 
     430         print("Select another 'end_time_step'") 
    356431         print(" ")
    357432         exit
     
    361436         print("'end_time_step' = "+ end_time_step +"h is lower than 'start_time_step' = "+start_time_step+"h")
    362437         print(" ")
    363          print("Please select another 'start_time_step' or 'end_time_step'")
     438         print("Select another 'start_time_step' or 'end_time_step'")
    364439         print(" ")
    365440         exit
     
    377452      print("'end_time_step' = "+ end_time_step +"h is invalid")
    378453      print(" ")
    379       print("Please select another 'end_time_step'")
     454      print("Select another 'end_time_step'")
    380455      print(" ")
    381456      exit
     
    401476      if (vec1 .EQ. "component1") then
    402477         print(" ")
    403          print("Please indicate Vector 1 ('vec1') for Vector-Plot or set 'vector' to 0")
     478         print("Indicate Vector 1 ('vec1') for Vector-Plot or set 'vector' to 0")
    404479         print(" ")
    405480         exit
     
    407482      if (vec2 .EQ. "component2") then
    408483         print(" ")
    409          print("Please indicate Vector 2 ('vec2') for Vector-Plot or set 'vector' to 0")
     484         print("Indicate Vector 2 ('vec2') for Vector-Plot or set 'vector' to 0")
    410485         print(" ")
    411486         exit
     
    424499      do varn=0,dim-1
    425500         if (vNam(varn) .eq. "xu" .OR. vNam(varn) .eq. "x")then   
    426             x_d     = f->$vNam(varn)$
     501            x_d     = f_att->$vNam(varn)$
    427502            xdim    = dimsizes(x_d)-1
    428503            delta_x = x_d(1)-x_d(0)
     
    432507      do varn=0,dim-1
    433508         if (vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "y")then   
    434             y_d     = f->$vNam(varn)$
     509            y_d     = f_att->$vNam(varn)$
    435510            ydim    = dimsizes(y_d)-1
    436511            delta_y = y_d(1)-y_d(0)
     
    440515      do varn=0,dim-1
    441516         if (vNam(varn) .eq. "zu_3d" .OR. vNam(varn) .eq. "zw_3d")then
    442             z_d     = f->$vNam(varn)$
     517            z_d     = f_att->$vNam(varn)$
    443518            zdim    = dimsizes(z_d)-1
    444519            delta_z = 0
     
    446521         else
    447522            if (vNam(varn) .eq. "zu_xy" .OR. vNam(varn) .eq. "zw_xy") then
    448                z_d     = f->$vNam(varn)$
     523               z_d     = f_att->$vNam(varn)$
    449524               zdim    = dimsizes(z_d)-1
    450525               delta_z = -1.d
     
    460535      do varn=0,dim-1
    461536         if (vNam(varn) .eq. "xu"  .OR. vNam(varn) .eq. "x") then
    462             x_d     = f->$vNam(varn)$
     537            x_d     = f_att->$vNam(varn)$
    463538            xdim    = dimsizes(x_d)-1
    464539            delta_x = x_d(1)-x_d(0)
     
    468543      do varn=0,dim-1   
    469544         if (vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "zu" .OR. vNam(varn) .eq. "zu_3d" .or. vNam(varn) .eq. "zw_3d") then
    470             z_d     = f->$vNam(varn)$
     545            z_d     = f_att->$vNam(varn)$
    471546            zdim    = dimsizes(z_d)-1
    472547            delta_z = z_d(1)-z_d(0)
     
    476551      do varn=0,dim-1
    477552         if (vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "y") then
    478             y_d     = f->$vNam(varn)$
     553            y_d     = f_att->$vNam(varn)$
    479554            ydim    = dimsizes(y_d)-1
    480555            delta_y = y_d(1)-y_d(0)
     
    482557         else
    483558            if (vNam(varn) .eq. "y_xz" .or. vNam(varn) .eq. "yv_xz") then
    484                y_d     = f->$vNam(varn)$
     559               y_d     = f_att->$vNam(varn)$
    485560               ydim    = dimsizes(y_d)-1
    486561               delta_y = -1.d
     
    496571      do varn=0,dim-1 
    497572         if (vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "y") then
    498             y_d     = f->$vNam(varn)$
     573            y_d     = f_att->$vNam(varn)$
    499574            ydim    = dimsizes(y_d)-1
    500575            delta_y = y_d(1)-y_d(0)
     
    504579      do varn=0,dim-1
    505580         if (vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "zu" .OR. vNam(varn) .eq. "zu_3d" .or. vNam(varn) .eq. "zw_3d") then
    506             z_d     = f->$vNam(varn)$
     581            z_d     = f_att->$vNam(varn)$
    507582            zdim    = dimsizes(z_d)-1
    508583            delta_z = z_d(1)-z_d(0)
     
    512587      do varn=0,dim-1
    513588         if (vNam(varn) .eq. "xu" .or. vNam(varn) .eq. "x")
    514             x_d     = f->$vNam(varn)$
     589            x_d     = f_att->$vNam(varn)$
    515590            xdim    = dimsizes(x_d)-1
    516591            delta_x = x_d(1)-x_d(0)
     
    518593         else
    519594            if (vNam(varn) .eq. "xu_yz" .or. vNam(varn) .eq. "x_yz" ) then
    520                x_d     = f->$vNam(varn)$
     595               x_d     = f_att->$vNam(varn)$
    521596               xdim    = dimsizes(x_d)-1
    522597               delta_x = -1.d
     
    848923      end do
    849924   end if
    850    
     925 
    851926   if( shape .eq. 1 ) then
    852927      if (xyc .EQ. 1)then
    853928         cs_res@vpWidthF    = (xe-xs)/(ye-ys)       
    854929         cs_res@vpHeightF   = 1
     930         vecres@vpWidthF    = (xe-xs)/(ye-ys)       
     931         vecres@vpHeightF   = 1
     932         if (xe-xs .GT. ye-ys)then
     933            cs_res@gsnPaperOrientation     = "landscape"
     934            vecres@gsnPaperOrientation     = "landscape"
     935            cs_res@lbOrientation = "Horizontal"   
     936         else
     937            cs_res@gsnPaperOrientation     = "portrait"
     938            vecres@gsnPaperOrientation     = "portrait"
     939            cs_res@lbOrientation = "Vertical"
     940         end if
    855941      end if
    856942      if (xzc .EQ. 1)then
    857943         cs_res@vpWidthF    = (xe-xs)/(delta_x*(ze-zs))       
    858944         cs_res@vpHeightF   = 1
     945         vecres@vpWidthF    = (xe-xs)/(delta_x*(ze-zs))       
     946         vecres@vpHeightF   = 1
     947         if (xe-xs .GT. (delta_x*(ze-zs)))then
     948            cs_res@gsnPaperOrientation     = "landscape"
     949            vecres@gsnPaperOrientation     = "landscape"
     950            cs_res@lbOrientation = "Horizontal"   
     951         else
     952            cs_res@gsnPaperOrientation     = "portrait"
     953            vecres@gsnPaperOrientation     = "portrait"
     954            cs_res@lbOrientation = "Vertical"
     955         end if
    859956      end if
    860957      if (yzc .EQ. 1)then
    861958         cs_res@vpWidthF    = (ye-ys)/(delta_y*(ze-zs))       
    862959         cs_res@vpHeightF   = 1
    863       end if
    864    end if
    865    
     960         vecres@vpWidthF    = (ye-ys)/(delta_y*(ze-zs))       
     961         vecres@vpHeightF   = 1
     962         if (ye-ys .GT. (delta_y*(ze-zs)))then
     963            cs_res@gsnPaperOrientation     = "landscape"
     964            vecres@gsnPaperOrientation     = "landscape"
     965            cs_res@lbOrientation = "Horizontal"   
     966         else
     967            cs_res@gsnPaperOrientation     = "portrait"
     968            vecres@gsnPaperOrientation     = "portrait"
     969            cs_res@lbOrientation = "Vertical"
     970         end if
     971      end if
     972   end if
     973
    866974   delete(xs)
    867975   delete(xe)   
     
    874982   ye=yend
    875983
     984   if (xyc .EQ. 1) then
     985      d=(ye-ys+1)/(major_ticks_y-1)
     986      e=(xe-xs+1)/(major_ticks_x-1)
     987      array_yl       =new(major_ticks_y,integer)
     988      array_yl_labels=new(major_ticks_y,double)
     989      array_minor_yl =new((major_ticks_y-1)*4,double)
     990      array_xb       =new(major_ticks_x,integer)
     991      array_xb_labels=new(major_ticks_x,double)
     992      array_minor_xb =new((major_ticks_x-1)*4,double)
     993      array_yl(0)=ys
     994      array_xb(0)=xs
     995      array_yl_labels(0)=y_d(ys)
     996      array_xb_labels(0)=x_d(xs)
     997      do ar=1,major_ticks_y-1
     998         array_yl(ar)=d*(ar-1)+d-1
     999         array_yl_labels(ar) = y_d(array_yl(ar))
     1000         if (ar .GT. 0)
     1001            do min_ar=0,3
     1002               array_minor_yl(4*(ar-1)+min_ar)= int2dble(array_yl(ar-1))+int2dble(array_yl(ar)-array_yl(ar-1))/5*(min_ar+1)
     1003            end do
     1004         end if 
     1005      end do
     1006      do br=1,major_ticks_x-1
     1007         array_xb(br)=e*(br-1)+e-1
     1008         array_xb_labels(br) = x_d(array_xb(br))
     1009         if (br .GT. 0)
     1010            do min_br=0,3
     1011               array_minor_xb(4*(br-1)+min_br)= int2dble(array_xb(br-1))+int2dble(array_xb(br)-array_xb(br-1))/5*(min_br+1)
     1012            end do
     1013         end if
     1014      end do
     1015   end if
     1016 
     1017   if (xzc .EQ. 1) then
     1018      d=(ze-zs+1)/(major_ticks_y-1)
     1019      e=(xe-xs+1)/(major_ticks_x-1)
     1020      array_yl       =new(major_ticks_y,integer)
     1021      array_yl_labels=new(major_ticks_y,double)
     1022      array_minor_yl =new((major_ticks_y-1)*4,double)
     1023      array_xb       =new(major_ticks_x,integer)
     1024      array_xb_labels=new(major_ticks_x,double)
     1025      array_minor_xb =new((major_ticks_x-1)*4,double)
     1026      array_yl(0)=zs
     1027      array_xb(0)=xs
     1028      array_yl_labels(0)=z_d(zs)
     1029      array_xb_labels(0)=x_d(xs)
     1030      do ar=1,major_ticks_y-1
     1031         array_yl(ar)=d*(ar-1)+d-1
     1032         array_yl_labels(ar) = z_d(array_yl(ar))
     1033         if (ar .GT. 0)
     1034            do min_ar=0,3
     1035               array_minor_yl(4*(ar-1)+min_ar)= int2dble(array_yl(ar-1))+int2dble(array_yl(ar)-array_yl(ar-1))/5*(min_ar+1)
     1036            end do
     1037         end if 
     1038      end do
     1039      do br=1,major_ticks_x-1
     1040         array_xb(br)=e*(br-1)+e-1
     1041         array_xb_labels(br) = x_d(array_xb(br))
     1042         if (br .GT. 0)
     1043            do min_br=0,3
     1044               array_minor_xb(4*(br-1)+min_br)= int2dble(array_xb(br-1))+int2dble(array_xb(br)-array_xb(br-1))/5*(min_br+1)
     1045            end do
     1046         end if
     1047      end do
     1048   end if
     1049
     1050   if (yzc .EQ. 1) then
     1051      d=(ze-zs+1)/(major_ticks_y-1)
     1052      e=(ye-ys+1)/(major_ticks_x-1)
     1053      array_yl       =new(major_ticks_y,integer)
     1054      array_yl_labels=new(major_ticks_y,double)
     1055      array_minor_yl =new((major_ticks_y-1)*4,double)
     1056      array_xb       =new(major_ticks_x,integer)
     1057      array_xb_labels=new(major_ticks_x,double)
     1058      array_minor_xb =new((major_ticks_x-1)*4,double)
     1059      array_yl(0)=zs
     1060      array_xb(0)=ys
     1061      array_yl_labels(0)=z_d(zs)
     1062      array_xb_labels(0)=y_d(ys)
     1063      do ar=1,major_ticks_y-1
     1064         array_yl(ar)=d*(ar-1)+d-1
     1065         array_yl_labels(ar) = y_d(array_yl(ar))
     1066         if (ar .GT. 0)
     1067            do min_ar=0,3
     1068               array_minor_yl(4*(ar-1)+min_ar)= int2dble(array_yl(ar-1))+int2dble(array_yl(ar)-array_yl(ar-1))/5*(min_ar+1)
     1069            end do
     1070         end if 
     1071      end do
     1072      do br=1,major_ticks_x-1
     1073         array_xb(br)=e*(br-1)+e-1
     1074         array_xb_labels(br) = x_d(array_xb(br))
     1075         if (br .GT. 0)
     1076            do min_br=0,3
     1077               array_minor_xb(4*(br-1)+min_br)= int2dble(array_xb(br-1))+int2dble(array_xb(br)-array_xb(br-1))/5*(min_br+1)
     1078            end do
     1079         end if
     1080      end do
     1081   end if
     1082
     1083   if (axes_explicit .EQ. 1)then
     1084      cs_res@tmYLMode = "Explicit"
     1085      cs_res@tmXBMode = "Explicit"
     1086      cs_res@tmYLValues = array_yl
     1087      if (xyc .EQ. 1)then
     1088         cs_res@tmYLLabels = array_yl_labels/norm_y
     1089         cs_res@tmXBLabels = array_xb_labels/norm_x
     1090         if (norm_x .NE. 1.)then
     1091            cs_res@tiXAxisString = "x ["+unit_x+"]"
     1092         else
     1093            cs_res@tiXAxisString = "x [m]"
     1094         end if
     1095         if (norm_y .NE. 1.)then
     1096            cs_res@tiYAxisString = "y ["+unit_y+"]"
     1097         else
     1098            cs_res@tiYAxisString = "y [m]"
     1099         end if   
     1100      end if
     1101      if (xzc .EQ. 1)then
     1102         cs_res@tmYLLabels = array_yl_labels/norm_z
     1103         cs_res@tmXBLabels = array_xb_labels/norm_x
     1104         if (norm_x .NE. 1.)then
     1105            cs_res@tiXAxisString = "x ["+unit_x+"]"
     1106         else
     1107            cs_res@tiXAxisString = "x [m]"
     1108         end if
     1109         if (norm_z .NE. 1.)then
     1110            cs_res@tiYAxisString = "z ["+unit_z+"]"
     1111         else
     1112            cs_res@tiYAxisString = "z [m]"
     1113         end if
     1114      end if
     1115      if (yzc .EQ. 1)then
     1116         cs_res@tmYLLabels = array_yl_labels/norm_z
     1117         cs_res@tmXBLabels = array_xb_labels/norm_y
     1118         if (norm_y .NE. 1.)then
     1119            cs_res@tiXAxisString = "y ["+unit_y+"]"
     1120         else
     1121            cs_res@tiXAxisString = "y [m]"
     1122         end if
     1123         if (norm_z .NE. 1.)then
     1124            cs_res@tiYAxisString = "z ["+unit_z+"]"
     1125         else
     1126            cs_res@tiYAxisString = "z [m]"
     1127         end if
     1128      end if
     1129      cs_res@tmXBValues = array_xb     
     1130      cs_res@tmYLMinorValues = array_minor_yl
     1131      cs_res@tmXBMinorValues = array_minor_xb
     1132   else
     1133      if (axes_explicit .EQ. 0)then 
     1134         cs_res@tmYLMinorPerMajor = 4
     1135         cs_res@tmXBMinorPerMajor = 4
     1136      else
     1137         print(" ")
     1138         print("'axes_explicit' is invalid and set to 0")
     1139         print(" ")
     1140         axes_explicit = 0
     1141         cs_res@tmYLMinorPerMajor = 4
     1142         cs_res@tmXBMinorPerMajor = 4
     1143      end if
     1144      if (xyc .EQ. 1)then
     1145         cs_res@tiXAxisString = "x [gridpoints]"
     1146         cs_res@tiYAxisString = "y [gridpoints]"
     1147      end if
     1148      if (xzc .EQ. 1)then
     1149         cs_res@tiXAxisString = "x [gridpoints]"
     1150         cs_res@tiYAxisString = "z [gridpoints]"
     1151      end if
     1152      if (yzc .EQ. 1)then
     1153         cs_res@tiXAxisString = "y [gridpoints]"
     1154         cs_res@tiYAxisString = "z [gridpoints]"
     1155      end if
     1156   end if
     1157
    8761158   if (xyc .EQ. 1 .OR. xzc .EQ.1)then
    8771159      if (xe .EQ. xs+1) then
     
    9161198
    9171199   MinVal = new(dim,float)
    918    MaxVal = new(dim,float)
     1200   MaxVal = new(dim,float)
     1201   unit   = new(dim,string)
    9191202
    9201203   ; ****************************************************
     
    9801263
    9811264         if (xyc .EQ. 1) then
    982             data(varn,:,:,:,:)=f->$vNam(varn)$(:,zs:ze,ys:ye,xs:xe)     
     1265            temp = f[:]->$vNam(varn)$
     1266            data_att = f_att->$vNam(varn)$
     1267            data(varn,:,:,:,:)=temp(:,zs:ze,ys:ye,xs:xe)               
    9831268         end if
    9841269         if ( xzc .eq. 1 ) then
    985             data(varn,:,:,:,:)=f->$vNam(varn)$(:,zs:ze,ys:ye,xs:xe)
     1270            temp = f[:]->$vNam(varn)$
     1271            data_att = f_att->$vNam(varn)$
     1272            data(varn,:,:,:,:)=temp(:,zs:ze,ys:ye,xs:xe)
    9861273         end if
    9871274         if ( yzc .eq. 1) then
    988             data(varn,:,:,:,:)=f->$vNam(varn)$(:,zs:ze,ys:ye,xs:xe)
     1275            temp = f[:]->$vNam(varn)$
     1276            data_att = f_att->$vNam(varn)$
     1277            data(varn,:,:,:,:)=temp(:,zs:ze,ys:ye,xs:xe)
    9891278         end if
    9901279         if (check_vec1) then
     
    10031292         MinVal(varn) = min(data(varn,:,:,:,:))
    10041293         MaxVal(varn) = max(data(varn,:,:,:,:))
     1294         
     1295         unit(varn) = data_att@units
    10051296
    10061297      end if
     
    10751366   gsn_define_colormap(wks_ps,"rainbow+white")
    10761367
    1077    plot=new((/no_time*no_layer*no_var/),graphic)
    1078  
     1368   if (vector .EQ. 1 .AND. plotvec .EQ. "plotvec") then
     1369      plot=new((/no_time*no_layer*no_var+no_time*no_layer/),graphic)
     1370   else
     1371      plot=new((/no_time*no_layer*no_var/),graphic)
     1372   end if
     1373
    10791374   page = 0
    10801375   n=0
     
    10901385      do lo = los, loe                                         
    10911386         do li = lis, lie
    1092             level = "=" + data&z(lo) + "m"       
     1387            if (xyc .EQ. 1)then
     1388               if (sort .EQ. "time")then
     1389                  level = "z=" + z_d(lo) + "m"
     1390               else
     1391                  level = "z=" + z_d(li) + "m"
     1392               end if
     1393            end if
     1394            if (xzc .EQ. 1)then
     1395               if (sort .EQ. "time")then
     1396                  level = "y=" + y_d(lo) + "m"
     1397               else
     1398                  level = "y=" + y_d(li) + "m"
     1399               end if
     1400            end if
     1401            if (yzc .EQ. 1)then
     1402               if (sort .EQ. "time")then
     1403                  level = "x=" + x_d(lo) + "m"
     1404               else
     1405                  level = "x=" + x_d(li) + "m"
     1406               end if
     1407            end if               
    10931408            vecres                  = True            ; vector only resources
    10941409            vecres@gsnDraw          = False           ; don't draw
     
    10981413            vecres@vcRefLengthF     = 0.05            ; define length of vec ref
    10991414            vecres@gsnRightString   = "Vector plot of "+vec1+" and "+vec2
    1100             vecres@gsnLeftString = "t=" + data&t(li) +"s  z"+level
    1101             vecres@tiXAxisString    = " "                                               
    1102             plot(n) = gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
     1415            vecres@tmXBLabelFontHeightF   = font_size
     1416            vecres@tmYLLabelFontHeightF   = font_size
     1417            vecres@tiXAxisFontHeightF     = font_size
     1418            vecres@tiYAxisFontHeightF     = font_size
     1419            if (sort .EQ. "time")then
     1420               vecres@gsnLeftString = "t=" + decimalPlaces(t_all(li)/3600,2,True) +"h   "+level
     1421            else
     1422               vecres@gsnLeftString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) +"h   "+level
     1423            end if
     1424            vecres@tiXAxisString    = " "
     1425            if (xyc .EQ. 1)then 
     1426               if (sort .EQ. "time")then                                         
     1427                  plot(n) = gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
     1428               else
     1429                  plot(n) = gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres)
     1430               end if
     1431            end if
     1432            if (xzc .EQ. 1) then
     1433               if (sort .EQ. "time")then
     1434                  plot(n) = gsn_csm_vector(wks_ps,vect1(li,:,lo,:),vect2(li,:,lo,:),vecres)
     1435               else
     1436                  plot(n) = gsn_csm_vector(wks_ps,vect1(lo,:,li,:),vect2(lo,:,li,:),vecres)
     1437               end if
     1438            end if
     1439            if (yzc .EQ. 1) then
     1440               if (sort .EQ. "time")then
     1441                  plot(n) = gsn_csm_vector(wks_ps,vect1(li,:,:,lo),vect2(li,:,:,lo),vecres)
     1442               else
     1443                  plot(n) = gsn_csm_vector(wks_ps,vect1(lo,:,:,li),vect2(lo,:,:,li),vecres)
     1444               end if
     1445            end if
    11031446            n=n+1
    11041447         end do
     
    11231466   
    11241467      if(check) then
    1125    
     1468
    11261469         space=(MaxVal(varn)-MinVal(varn))/24
    11271470 
     
    11441487
    11451488               if ( xyc .eq. 1 ) then
    1146                
    1147                   cs_res@tiXAxisString = "x [m]"
    1148                   cs_res@tiYAxisString = "y [m]"
     1489         
    11491490                  cs_res@gsnLeftString = "Plot of "+vNam(varn)
     1491                  cs_res@gsnRightString = unit(varn)
    11501492                 
    11511493                  if ( sort .eq. "time" ) then
    1152                      if ( data&z(lo) .eq. -1)then
     1494                     if ( z_d(lo) .eq. -1)then
    11531495                        if (delta_z .EQ. -1) then
    11541496                           level = "-average"
    11551497                        else
    1156                            level = "=" + data&z(lo) + "m"
     1498                           level = "=" + z_d(lo) + "m"
    11571499                        end if
    11581500                     else
    1159                         level = "=" + data&z(lo) + "m"
     1501                        level = "=" + z_d(lo) + "m"
    11601502                     end if
    11611503                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) +"h  z"+level             
     
    11771519                 
    11781520                  if ( sort .eq. "layer" ) then
    1179                      if (data&z(li) .eq. -1) then
     1521                     if (z_d(li) .eq. -1) then
    11801522                        if (delta_z .EQ. -1) then
    11811523                           level = "-average"
    11821524                        else
    1183                            level = "=" + data&z(li) + "m"
     1525                           level = "=" + z_d(li) + "m"
    11841526                        end if
    11851527                     else
    1186                         level = "=" + data&z(li) + "m"
     1528                        level = "=" + z_d(li) + "m"
    11871529                     end if
    11881530                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h  z"+ level               
     
    12091551
    12101552               if ( xzc .eq. 1 ) then
    1211        
    1212                   cs_res@tiXAxisString   = "x [m]"
    1213                   cs_res@tiYAxisString   = "z [m]"
     1553                 
    12141554                  cs_res@gsnLeftString = "Plot of "+vNam(varn)
    12151555               
    12161556                  if ( sort .eq. "time" ) then
    1217                      if ( data&y(lo) .eq. -1 ) then
     1557                     if ( y_d(lo) .eq. -1 ) then
    12181558                        level = "-average"
    12191559                     else
    1220                         level = "=" + data&y(lo) + "m"
     1560                        level = "=" + y_d(lo) + "m"
    12211561                     end if
    1222                      cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "s  y"+ level
     1562                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "h  y"+ level
    12231563                     plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,lo,:),cs_res)
    12241564                     if (vector .EQ. 1 .AND. check_vecp) then
     
    12321572                        vecres@gsnLeftString    = " "             ; turn off left string
    12331573                        vecres@tiXAxisString    = " "   
    1234                         plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
     1574                        plot_vec=gsn_csm_vector(wks_ps,vect1(li,:,lo,:),vect2(li,:,lo,:),vecres)
    12351575                        overlay(plot(n), plot_vec)
    12361576                     end if
     
    12381578
    12391579                  if ( sort .eq. "layer" ) then
    1240                      if ( data&y(li) .eq. -1 ) then
     1580                     if ( y_d(li) .eq. -1 ) then
    12411581                        level = "-average"
    12421582                     else
    1243                         level = "=" + data&y(li) + "m"
     1583                        level = "=" + y_d(li) + "m"
    12441584                     end if
    1245                      cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "s  y"+ level
     1585                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h  y"+ level
    12461586                     plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,li,:),cs_res)
    12471587                     if (vector .EQ. 1 .AND. check_vecp) then
     
    12551595                        vecres@gsnLeftString    = " "             ; turn off left string
    12561596                        vecres@tiXAxisString    = " "   
    1257                         plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres)
     1597                        plot_vec=gsn_csm_vector(wks_ps,vect1(lo,:,li,:),vect2(lo,:,li,:),vecres)
    12581598                        overlay(plot(n), plot_vec)
    12591599                     end if
     
    12661606
    12671607               if ( yzc .eq. 1 ) then
    1268                
    1269                   cs_res@tiXAxisString   = "y [m]"
    1270                   cs_res@tiYAxisString   = "z [m]"
     1608                                 
    12711609                  cs_res@gsnLeftString = "Plot of "+vNam(varn)
    12721610
    12731611                  if ( sort .eq. "time" ) then
    1274                      if ( data&x(lo) .eq. -1 ) then
     1612                     if ( x_d(lo) .eq. -1 ) then
    12751613                        level = "-average"
    12761614                     else
    1277                         level = "=" + data&x(lo) + "m"
     1615                        level = "=" + x_d(lo) + "m"
    12781616                     end if
    1279                      cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "s  x"+ level
     1617                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "h  x"+ level
    12801618                     plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,:,lo),cs_res)
    12811619                     if (vector .EQ. 1 .AND. check_vecp) then
     
    12891627                        vecres@gsnLeftString    = " "             ; turn off left string
    12901628                        vecres@tiXAxisString    = " "   
    1291                         plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
     1629                        plot_vec=gsn_csm_vector(wks_ps,vect1(li,:,:,lo),vect2(li,:,:,lo),vecres)
    12921630                        overlay(plot(n), plot_vec)
    12931631                     end if
     
    12951633
    12961634                  if ( sort .eq. "layer" ) then
    1297                      if ( data&x(li) .eq. -1 ) then
     1635                     if ( x_d(li) .eq. -1 ) then
    12981636                        level = "-average"
    12991637                     else
    1300                         level = "=" + data&x(li) + "m"
     1638                        level = "=" + x_d(li) + "m"
    13011639                     end if
    1302                      cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "s  x"+ level
     1640                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h  x"+ level
    13031641                     plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,:,li),cs_res)
    13041642                     if (vector .EQ. 1 .AND. check_vecp)then
     
    13121650                        vecres@gsnLeftString    = " "             ; turn off left string
    13131651                        vecres@tiXAxisString    = " "   
    1314                         plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres)
     1652                        plot_vec=gsn_csm_vector(wks_ps,vect1(lo,:,:,li),vect2(lo,:,:,li),vecres)
    13151653                        overlay(plot(n), plot_vec)
    13161654                     end if
    13171655                  end if
    13181656               end if         
    1319                n=n+1   
     1657               n=n+1 
    13201658            end do     
    13211659         end do 
     
    13341672         print(" ")
    13351673      else
    1336          do np = 0,no_layer*no_time*(no_var+1)-1,no_lines*no_columns   
    1337             if ( np + no_lines*no_columns .gt. (no_layer*no_time*(no_var+1))-1) then
    1338                gsn_panel(wks_ps, plot(np:(no_layer*no_time*(no_var+1))-1),(/no_lines,no_columns/),cs_resP)
     1674         do np = 0,no_layer*no_time*(no_var+1)-1,no_rows*no_columns   
     1675            if ( np + no_rows*no_columns .gt. (no_layer*no_time*(no_var+1))-1) then
     1676               gsn_panel(wks_ps, plot(np:(no_layer*no_time*(no_var+1))-1),(/no_rows,no_columns/),cs_resP)
    13391677            else
    1340                gsn_panel(wks_ps, plot(np:np+no_lines*no_columns-1),(/no_lines,no_columns/),cs_resP)
     1678               gsn_panel(wks_ps, plot(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),cs_resP)
    13411679            end if
    13421680         end do
    13431681      end if
    1344    else         
     1682   else       
    13451683      if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then
    13461684         gsn_panel(wks_ps,plot(0:(no_time*no_layer*no_var)-1),(/no_var,no_layer*no_time/),cs_resP)
     
    13491687         print(" ")
    13501688      else
    1351          do np = 0,no_layer*no_time*no_var-1,no_lines*no_columns   
    1352             if ( np + no_lines*no_columns .gt. (no_layer*no_time*no_var)-1) then
    1353                gsn_panel(wks_ps, plot(np:(no_layer*no_time*no_var)-1),(/no_lines,no_columns/),cs_resP)
     1689         do np = 0,no_layer*no_time*no_var-1,no_rows*no_columns   
     1690            if ( np + no_rows*no_columns .gt. (no_layer*no_time*no_var)-1) then
     1691               gsn_panel(wks_ps, plot(np:(no_layer*no_time*no_var)-1),(/no_rows,no_columns/),cs_resP)
    13541692            else
    1355                gsn_panel(wks_ps, plot(np:np+no_lines*no_columns-1),(/no_lines,no_columns/),cs_resP)
     1693               gsn_panel(wks_ps, plot(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),cs_resP)
    13561694            end if
    13571695         end do
  • palm/trunk/SCRIPTS/NCL/ncl_preferences.ncl

    r194 r218  
    1616      ; REQUIRED --file_1-- INPUT FILE
    1717      ;
    18       ; input file produced by PALM; please declare path and name
    19       ;
    20       ; data type: string
     18      ; input file produced by PALM; if there is more than one file for all timesteps of a job chain,
     19      ; declare path and file name without cycle number and ".nc" (first and last cycle numbers are given with the parameters 'start_f' and 'end_f');
     20      ; otherwise declare path and full file name
     21      ;
     22      ; data type: string
     23      ;
     24      ; example: file_1 = "/path_to_file/file_xy_av"      if you use more than one cycle number
     25      ;          file_1 = "/path_to_file/file_xy_av.4.nc" if you use one file (e.g. with cycle number 4)
    2126      ;
    2227      ; default:   "File in"
     
    2530
    2631
    27          file_1 = "File in"
    28          
    29          
    30       end if
    31       ;***************************************************
    32       ; REQUIRED --xyc, xzc, yzc-- SECTION of XY or XZ or YZ
     32         file_1 = "file_1"
     33         
     34         
     35      end if
     36      ;***************************************************
     37      ; REQUIRED if more than one file of a job chain --start_f-- START OF CYCLIC NUMBER
     38      ;
     39      ; if there is more than one file for all timesteps of a job chain, declare the first cyclicnumber which contains timesteps you'd like to use
     40      ;
     41      ; data type: integer
     42      ;
     43      ; example:   start_f = 3 (if first file: example_ts.3.nc)
     44      ;
     45      ; default:   -1 
     46      ;***************************************************
     47      if (.not. isvar("start_f"))then 
     48     
     49         
     50         start_f = -1
     51         
     52         
     53      end if
     54      ;***************************************************
     55      ; REQUIRED if more than one file of a job chain --end_f-- END OF CYCLIC NUMBER
     56      ;
     57      ; if there is more than one file for all timesteps of a job chain, declare the last cyclicnumber which contains timesteps you'd like to use
     58      ;
     59      ; data type: integer
     60      ;
     61      ; example:   end_f = 48 (if last file: example_ts.48.nc)
     62      ;
     63      ; default:   -1 
     64      ;***************************************************
     65      if (.not. isvar("end_f"))then 
     66     
     67         
     68         end_f = -1
     69         
     70         
     71      end if
     72      ;***************************************************
     73      ; REQUIRED --xyc--xzc--yzc-- SELECTION of XY or XZ or YZ CROSS SECTIONS
    3374      ;
    3475      ; desired section has to be set to 1; e.g.: xyc=1, xzc=0 and yzc=0 for xy-section
    3576      ;
    3677      ; data type: integer
     78      ;
     79      ; example: xyc = 1
     80      ;          xzc = 0
     81      ;          yzc = 0
    3782      ;
    3883      ; default:   0
     
    56101      ; OPTIONAL --format_out-- OUTPUT FORMAT
    57102      ;
    58       ; supported file formats: x11, pdf, ps, eps, epsi or ncgm
    59       ;
    60       ; data type: string
     103      ; format of the output file; supported file formats: x11, pdf, ps, eps, epsi or ncgm
     104      ;
     105      ; data type: string
     106      ;
     107      ; example: format_out = "pdf"
    61108      ;
    62109      ; default:   "x11"
     
    72119      ; OPTIONAL --file_out-- OUTPUT FILE
    73120      ;
    74       ; please declare path and name
    75       ;
    76       ; data type: string
     121      ; path and name of the output file
     122      ;
     123      ; data type: string
     124      ;
     125      ; example: file_out = "/home/path_to_output/test_cs"
    77126      ;
    78127      ; default:   "~/test_cs"
     
    86135      end if     
    87136      ;***************************************************
    88       ; OPTIONAL --no_columns-- NUMBER OF ROWS
     137      ; OPTIONAL --no_columns-- NUMBER OF COLUMNS
    89138      ;
    90139      ; number of plots in one row
    91140      ;
    92141      ; data type: integer
     142      ;
     143      ; example: no_columns = 1
    93144      ;
    94145      ; default:   1
     
    102153      end if     
    103154      ;***************************************************
    104       ; OPTIONAL --no_lines-- NUMBER OF COLUMNS
     155      ; OPTIONAL --no_rows-- NUMBER OF ROWS
    105156      ;
    106157      ; number of plots in one column
    107158      ;
    108159      ; data type: integer
     160      ;
     161      ; example: no_rows = 2
    109162      ;
    110163      ; default:   2
    111164      ;***************************************************
    112       if(.not. isvar("no_lines"))then   
    113      
    114      
    115          no_lines = 2
     165      if(.not. isvar("no_rows"))then     
     166     
     167     
     168         no_rows = 2
    116169         
    117170         
     
    124177      ; data type: string
    125178      ;
     179      ; example: sort = "layer"
     180      ;
    126181      ; default:   "layer"
    127182      ;***************************************************
     
    136191      ; OPTIONAL --var-- OUTPUT VARIABLES
    137192      ;
    138       ; names of output variables; please inidcate them with one comma before and after each variable;
    139       ; e.g.: var=",u,v,w," (the windcomponents u, v and w will be plotted)
     193      ; names of output variables; inidcate them with one comma before and after each variable
    140194      ;
    141195      ; data type: string
    142       ;
    143       ; default:   "all" (all available variables will be plotted)
     196      ;
     197      ; example: var = ",u,v,w"
     198      ;
     199      ; default:   "all" (all available variables are plotted)
    144200      ;***************************************************
    145201      if(.not. isvar("var"))then
     
    153209      ; OPTIONAL --start_time_step-- FIRST TIME STEP
    154210      ;
    155       ; first time step of plot; you don't have to specify a precise time value from the input file,
    156       ; it will be rounded to the next existent time step
     211      ; first time step of plot; there is no need to specify a precise time value from the input file,
     212      ; 'start_time_step' is rounded to the next existent time step
    157213      ;
    158214      ; data type: double; dimension: [hour]
    159215      ;
     216      ; example:   start_time_step = 0.5
     217      ;
    160218      ; default:   -1.d (first available time step)
    161219      ;***************************************************
     
    170228      ; OPTIONAL --end_time_step-- LAST TIME STEP
    171229      ;
    172       ; last time step of plot; you don't have to specify a precise time value from the input file,
    173       ; it will be rounded to the next existent time step
     230      ; last time step of plot; there is no need to specify a precise time value from the input file,
     231      ; 'end_time_step' is rounded to the next existent time step
    174232      ;
    175233      ; data type: double; dimension: [hour]
    176234      ;
     235      ; example:   end_time_step = 2.0
     236      ;
    177237      ; default:   -1.d (last available time step)
    178238      ;***************************************************
     
    188248      ;
    189249      ; value for minimum of x-axis, selectable if there are NO preseted layers for x (as for XY or XZ 2D-DATA);
    190       ; you don't have to specify a precise meter value from the input file, it will be rounded to the next
    191       ; existent value
     250      ; there is no need to specify a precise meter value from the input file, it is rounded to the next existent value
    192251      ;
    193252      ; data type: double; dimension: [meter]
    194253      ;
     254      ; example: xs = 150.0
     255      ;
    195256      ; default:   -1.d (minimum of range)
    196257      ;***************************************************
     
    206267      ;
    207268      ; value for maximum of x-axis, selectable if there are NO preseted layers for x (as for XY or XZ 2D-DATA);
    208       ; you don't have to specify a precise meter value from the input file, it will be rounded to the next
    209       ; existent value
     269      ; there is no need to specify a precise meter value from the input file, it is rounded to the next existent value
    210270      ;
    211271      ; data type: double; dimension: [meter]
    212272      ;
     273      ; example: xe = 300.0
     274      ;
    213275      ; default:   -1.d (maximum of range)
    214276      ;***************************************************
     
    224286      ;
    225287      ; value for minimum of y-axis, selectable if there are NO preseted layers for y (as for XY or YZ 2D-DATA);
    226       ; you don't have to specify a precise meter value from the input file, it will be rounded to the next
    227       ; existent value
     288      ; there is no need to specify a precise meter value from the input file, it is rounded to the next existent value
    228289      ;
    229290      ; data type: double; dimension: [meter]
    230291      ;
     292      ; example: ys = 150.0
     293      ;
    231294      ; default:   -1.d (minimum of range)
    232295      ;***************************************************
     
    242305      ;
    243306      ; value for maximum of y-axis, selectable if there are NO preseted layers for y (as for XY or YZ 2D-DATA);
    244       ; you don't have to specify a precise meter value from the input file, it will be rounded to the next
    245       ; existent value
     307      ; there is no need to specify a precise meter value from the input file, it is rounded to the next existent value
    246308      ;
    247309      ; data type: double; dimension: [meter]
     310      ;
     311      ; example: ye = 300.0
    248312      ;
    249313      ; default:   -1.d (maximum of range)
     
    264328      ; data type: integer
    265329      ;
     330      ; example: zs = 0
     331      ;
    266332      ; default:   -1 (minimum of range)
    267333      ;***************************************************
     
    281347      ; data type: integer
    282348      ;
     349      ; example: ze = 15
     350      ;
    283351      ; default:   -1 (maximum of range)
    284352      ;***************************************************
     
    297365      ; data type: string
    298366      ;
     367      ; example: mode = "Fill"
     368      ;
    299369      ; default:   "Fill"
    300370      ;***************************************************
     
    313383      ; data type: string
    314384      ;
     385      ; example: fill_mode = "AreaFill"
     386      ;
    315387      ; default:   "AreaFill"
    316388      ;***************************************************
     
    325397      ; OPTIONAL --shape-- ASPECT RATIO
    326398      ;
    327       ; aspect ratio of axis is kept [=1] or  not[=0]
    328       ;
    329       ; data type: integer
     399      ; aspect ratio of axis is kept [=1] or not[=0]
     400      ;
     401      ; data type: integer
     402      ;
     403      ; example: shape = 1
    330404      ;
    331405      ; default:   1
     
    337411         
    338412         
     413      end if
     414      ;***************************************************
     415      ; OPTIONAL --font_size-- FONT SIZE OF STRINGS
     416      ;
     417      ; font size can be changed to fit to the current plot
     418      ;
     419      ; data type: float
     420      ;
     421      ; example: font_size = 0.04
     422      ;
     423      ; default:   0.04
     424      ;***************************************************
     425      if(.not. isvar("font_size"))then
     426     
     427         
     428         font_size = 0.04
     429         
     430         
     431      end if
     432      ;***************************************************
     433      ; OPTIONAL --font_size_legend-- FONT SIZE OF LEGEND STRINGS
     434      ;
     435      ; font size of the legend can be changed to fit to the current plot
     436      ;
     437      ; data type: float
     438      ;
     439      ; example: font_size_legend = 0.02
     440      ;
     441      ; default:   0.02
     442      ;***************************************************
     443      if(.not. isvar("font_size_legend"))then
     444     
     445         
     446         font_size_legend = 0.02
     447         
     448         
     449      end if   
     450      ;***************************************************
     451      ; OPTIONAL --legend_label_stride-- REDUCTION OF THE NUMBER OF LABELS IN THE LEGEND
     452      ;
     453      ; if legend_label_stride is set to 1 every label is shown; if set to 2 every second,...
     454      ;
     455      ; data type: integer
     456      ;
     457      ; example: legend_label_stride = 2
     458      ;
     459      ; default:   2
     460      ;***************************************************
     461      if(.not. isvar("legend_label_reduction"))then
     462     
     463         
     464         legend_label_stride = 2
     465         
     466         
     467      end if
     468      ;***************************************************
     469      ; OPTIONAL --axes_explicit-- EXPLICIT SETTINGS OF X- AND Y-AXES ARE SWITCHED ON
     470      ;
     471      ; to use several parameters to set up the axes, 'axes_explicit' must be switched [=1]; if switched off [=0] units of axes are [gridpoints]
     472      ;
     473      ; data type: integer
     474      ;
     475      ; example: axes_explicit = 0
     476      ;
     477      ; default:   0
     478      ;***************************************************
     479      if(.not. isvar("axes_explicit"))then
     480     
     481         
     482         axes_explicit = 0
     483         
     484         
     485      end if
     486      ;***************************************************
     487      ; OPTIONAL if axes_explicit = 1 --major_ticks_x-- NUMBER OF MAJOR TICK MARKS AT X-AXIS
     488      ;
     489      ; major_ticks_x can be set to any integer, best segmentation of x-axis can be achieved, if
     490      ; (number of gripdpoints in x-direction)/(major_ticks_x-1)=INTEGER, e.g. 128/8 = 16 -> major_ticks_x should be set to 9
     491      ;
     492      ; data type: integer
     493      ;
     494      ; example: major_ticks_x = 6
     495      ;
     496      ; default:   6
     497      ;***************************************************
     498      if(.not. isvar("major_ticks_x"))then
     499     
     500         
     501         major_ticks_x = 6
     502         
     503         
     504      end if
     505      ;***************************************************
     506      ; OPTIONAL if axes_explicit = 1 --major_ticks_y-- NUMBER OF MAJOR TICK MARKS AT Y-AXIS
     507      ;
     508      ; major_ticks_y can be set to any integer, best segmentation of y-axis can be achieved, if
     509      ; (number of gripdpoints in y-direction)/(major_ticks_y-1)=INTEGER, e.g. 128/8 = 16 -> major_ticks_y should be set to 9
     510      ;
     511      ; data type: integer
     512      ;
     513      ; example: major_ticks_y = 6
     514      ;
     515      ; default:   6
     516      ;***************************************************
     517      if(.not. isvar("major_ticks_y"))then
     518     
     519         
     520         major_ticks_y = 6
     521         
     522         
     523      end if
     524      ;***************************************************
     525      ; OPTIONAL if axes_explicit = 1 --norm_x--norm_y--norm_z-- NORMALISE X-, Y- and Z-AXES
     526      ;
     527      ; normalising the axes with the given value; units can explicitly set; by default no normalising is used and units are [meter]
     528      ;
     529      ; data type: float
     530      ;
     531      ; default:   1.
     532      ;***************************************************
     533      if(.not. isvar("norm_x"))then     
     534         
     535         norm_x = 1.     
     536         
     537      end if
     538      if(.not. isvar("norm_y"))then     
     539         
     540         norm_y = 1.     
     541         
     542      end if
     543      if(.not. isvar("norm_z"))then     
     544         
     545         norm_z = 1.     
     546         
     547      end if
     548      ;***************************************************
     549      ; OPTIONAL if axes_explicit = 1 --unit_x--unit_y--unit_z-- UNITS OF X-, Y- and Z-AXES
     550      ;
     551      ; units of the axes can be set; by default no units are given, if norm_x, norm_y or norm_z are unequal 1., otherwise units are [meter]
     552      ;
     553      ; data type: string,
     554      ;
     555      ; example: unit_x = "m/s"
     556      ;
     557      ; default:   " "
     558      ;***************************************************
     559      if(.not. isvar("unit_x"))then     
     560         
     561         unit_x = " "   
     562         
     563      end if
     564      if(.not. isvar("unit_y"))then     
     565         
     566         unit_y = " "   
     567         
     568      end if
     569      if(.not. isvar("unit_z"))then     
     570         
     571         unit_z = " "   
     572         
     573      end if
     574      ;***************************************************
     575      ; OPTIONAL --vector-- VECTOR PLOT
     576      ;
     577      ; a vector plot for one defined vector is switched on [=1] or off [=0]
     578      ;
     579      ; data type: integer
     580      ;
     581      ; example: vector = 0
     582      ;
     583      ; default:   0
     584      ;***************************************************
     585      if(.not. isvar("vector"))then
     586     
     587         
     588         vector = 0
     589         
     590         
    339591      end if     
    340592      ;***************************************************
    341       ; OPTIONAL --vector-- VECTOR PLOT
    342       ;
    343       ; a vector plot for one defined vector will be switched on [=1] or off [=0]
    344       ;
    345       ; data type: integer
    346       ;
    347       ; default:   0
    348       ;***************************************************
    349       if(.not. isvar("vector"))then
    350      
    351          
    352          vector = 0
    353          
     593      ; REQUIRED IF vector=1 --vec1, vec2-- VECTOR FOR VECTOR PLOT
     594      ;
     595      ; variables for the vector, vec1 hast to be set to component 1 and vec2 to component 2;
     596      ; inidcate them with one comma before and after each variable;
     597      ;
     598      ; data type: string
     599      ;
     600      ; example: vec1=",u,"
     601      ;          vec2=",v,"
     602      ;
     603      ; default:   vec1 = "component1", vec2 = "component2"
     604      ;***************************************************
     605      if(.not. isvar("vec1"))then     
     606         
     607         vec1 = "component1"
     608         
     609      end if
     610      if (.not. isvar("vec2"))then
     611     
     612         vec2 = "component2"     
    354613         
    355614      end if     
    356615      ;***************************************************
    357       ; REQUIRED IF vector=1 --vec1, vec2-- VECTOR FOR VECTOR PLOT
    358       ;
    359       ; variables for the vector, vec1 hast to be set to component 1 and vec2 to component 2;
    360       ; please inidcate them with one comma before and after each variable;
    361       ; e.g.: vec1=",u," and vec2=",v," for plotting the horizontal windvector
    362       ;
    363       ; data type: string
    364       ;
    365       ; default:   vec1 = "component1", vec2 = "component2"
    366       ;***************************************************
    367       if(.not. isvar("vec1"))then     
    368          
    369          vec1 = "component1"
    370          
    371       end if
    372       if (.not. isvar("vec2"))then
    373      
    374          vec2 = "component2"     
     616      ; OPTIONAL --plotvec-- VARIABLE FOR EXTRA VECTOR PLOT
     617      ;
     618      ; the vector plot can be combined with other plots of variables; if this is desired inidcate the variables,
     619      ; where a vector plot shall overlay; inidcate them with one comma before and after each variable
     620      ;
     621      ; data type: string
     622      ;
     623      ; example: plotvec = ",u,w,"
     624      ;
     625      ; default:   "plotvec" (no combining, the vector plot is created seperately)
     626      ;***************************************************
     627      if(.not. isvar("plotvec"))then
     628     
     629         
     630         plotvec = "plotvec"
     631         
    375632         
    376633      end if     
    377634      ;***************************************************
    378       ; OPTIONAL --plotvec-- VARIABLE FOR EXTRA VECTOR PLOT
    379       ;
    380       ; the vector plot can be combined with other variables; if desired inidcate the variables
    381       ; with one comma before and after it; e.g. plotvec=",u,v,w," (the vector plot
    382       ; will combined with the contour plots of u, v and w)
    383       ;
    384       ; data type: string
    385       ;
    386       ; default:   plotvec (no combining, the vector plot will be created seperately)
    387       ;***************************************************
    388       if(.not. isvar("plotvec"))then
    389      
    390          
    391          plotvec = "plotvec"
    392          
    393          
    394       end if     
    395       ;***************************************************
    396635      ; OPTIONAL --ref_mag-- REFERENCE VECTOR
    397636      ;
     
    399638      ;
    400639      ; data type: float
     640      ;
     641      ; example: ref_mag = 0.05
    401642      ;
    402643      ; default:   0.05
     
    420661
    421662      ;***************************************************
    422       ; REQUIRED --file_1-- INPUT FILE
    423       ;
    424       ; input file produced by PALM; please declare path and name
    425       ;
    426       ; data type: string
     663      ; REQUIRED --file_1-- 1ST INPUT FILE
     664      ;
     665      ; 1st input file produced by PALM; if there is more than one file for all timesteps of a job chain,
     666      ; declare path and file name without cycle number and ".nc" (first and last cycle numbers are given with the parameters 'start_f' and 'end_f');
     667      ; otherwise declare path and full file name
     668      ;
     669      ; data type: string
     670      ;
     671      ; example: file_1 = "/path_to_file/file_pr"      if you use more than one cycle number
     672      ;          file_1 = "/path_to_file/file_pr.4.nc" if you use one file (e.g. with cycle number 4)
    427673      ;
    428674      ; default:   "File in"
    429675      ;***************************************************
    430       if (.not. isvar("file_1"))then
    431      
    432      
    433          file_1 = "File in"
     676      if(.not. isvar("file_1"))then
     677
     678
     679         file_1 = "File in"
     680         
     681         
     682      end if
     683      ;***************************************************
     684      ; REQUIRED --start_f_1-- START OF CYCLIC NUMBER OF THE 1ST INPUT FILE
     685      ;
     686      ; if there is more than one file for all timesteps of a job chain, declare the first cyclicnumber which contains timesteps you'd like to use
     687      ;
     688      ; data type: integer
     689      ;
     690      ; example:   3 (if first file: example_ts.3.nc)
     691      ;
     692      ; default:   -1 
     693      ;***************************************************
     694      if (.not. isvar("start_f_1"))then 
     695     
     696         
     697         start_f_1 = -1
     698         
     699         
     700      end if
     701      ;***************************************************
     702      ; REQUIRED --end_f_1-- END OF CYCLIC NUMBER OF THE 1ST INPUT FILE
     703      ;
     704      ; if there is more than one file for all timesteps of a job chain, declare the last cyclicnumber which contains timesteps you'd like to use
     705      ;
     706      ; data type: integer
     707      ;
     708      ; example:   48 (if last file: example_ts.48.nc)
     709      ;
     710      ; default:   -1 
     711      ;***************************************************
     712      if (.not. isvar("end_f_1"))then 
     713     
     714         
     715         end_f_1 = -1
    434716         
    435717         
     
    470752      ; OPTIONAL --file_out-- OUTPUT FILE
    471753      ;
    472       ; please declare path and name
     754      ; declare path and name of the output file
    473755      ;
    474756      ; data type: string
     
    484766      end if     
    485767      ;***************************************************
    486       ; OPTIONAL --no_columns-- NUMBER OF ROWS
     768      ; OPTIONAL --no_columns-- NUMBER OF COLUMNS
    487769      ;
    488770      ; number of plots in one row
     
    500782      end if     
    501783      ;***************************************************
    502       ; OPTIONAL --no_lines-- NUMBER OF COLUMNS
     784      ; OPTIONAL --no_rows-- NUMBER OF ROWS
    503785      ;
    504786      ; number of plots in one column
     
    508790      ; default:   2
    509791      ;***************************************************
    510       if (.not. isvar("no_lines"))then 
     792      if (.not. isvar("no_rows"))then   
    511793     
    512794       
    513          no_lines = 2
     795         no_rows = 2
    514796         
    515797         
     
    518800      ; OPTIONAL --var-- OUTPUT VARIABLES
    519801      ;
    520       ; names of output variables; please inidcate them with one comma before and after each variable;
    521       ; e.g.: var=",u,v,w," (the windcomponents u, v and w will be plotted)
     802      ; names of output variables; inidcate them with one comma before and after each variable
    522803      ;
    523804      ; data type: string
    524       ;
    525       ; default:   "all" (all available variables will be plotted)
     805      ;
     806      ; example: var = ",u,v,w";
     807      ;
     808      ; default:   "all" (all available variables are plotted)
    526809      ;***************************************************
    527810      if (.not. isvar("var"))then
     
    535818      ; OPTIONAL ---no_files-- NUMBER OF INPUT FILES
    536819      ;
    537       ; up to 12 input files can be used; all input files must contain the same variables and dimensionalties;
    538       ; identical variables will be merged in one plot;
     820      ; up to 6 input files of different runs can be used; all input files must contain the same variables and dimensionalties;
     821      ; identical variables are merged in one plot;
    539822      ; combining or overlaying of any variables is not feasible;
    540       ; an extra legend (besides the time step legend) will be drawn where you can explicitily name the items
     823      ; an extra legend (besides the time step legend) is drawn where you can explicitily name the items
    541824      ;
    542825      ; data type: integer
     
    566849         
    567850         
    568       end if     
    569       ;***************************************************
    570       ; REQUIRED IF no_files > 1 --file_2-- 2nd INPUT FILE
    571       ;
    572       ; 2nd input file produced by PALM; please declare path and name
    573       ;
    574       ; data type: string
     851      end if
     852      ;***************************************************
     853      ; REQUIRED if no_files > 1 --file_2-- 2ND INPUT FILE
     854      ;
     855      ; 2nd input file produced by PALM; if there is more than one file for all timesteps of a job chain,
     856      ; declare path and file name without cycle number and ".nc" (first and last cycle numbers are given with the parameters 'start_f' and 'end_f');
     857      ; otherwise declare path and full file name
     858      ;
     859      ; data type: string
     860      ;
     861      ; example: file_2 = "/path_to_file/file_pr"      if you use more than one cycle number
     862      ;          file_2 = "/path_to_file/file_pr.4.nc" if you use one file (e.g. with cycle number 4)
    575863      ;
    576864      ; default:   "File in"
    577865      ;***************************************************
    578       if (.not. isvar("file_2"))then 
     866      if(.not. isvar("file_2"))then
     867
     868
     869         file_2 = "File in"
     870         
     871         
     872      end if
     873      ;***************************************************
     874      ; REQUIRED --start_f_2-- START OF CYCLIC NUMBER OF THE 2ND INPUT FILE
     875      ;
     876      ; if there is more than one file for all timesteps of a job chain, declare the first cyclicnumber which contains timesteps you'd like to use
     877      ;
     878      ; data type: integer
     879      ;
     880      ; example:   3 (if first file: example_ts.3.nc)
     881      ;
     882      ; default:   -1 
     883      ;***************************************************
     884      if (.not. isvar("start_f_2"))then 
    579885     
    580886         
    581          file_2 = "File in"
    582          
    583          
    584       end if     
     887         start_f_2 = -1
     888         
     889         
     890      end if
     891      ;***************************************************
     892      ; REQUIRED --end_f_2-- END OF CYCLIC NUMBER OF THE 2ND INPUT FILE
     893      ;
     894      ; if there is more than one file for all timesteps of a job chain, declare the last cyclicnumber which contains timesteps you'd like to use
     895      ;
     896      ; data type: integer
     897      ;
     898      ; example:   48 (if last file: example_ts.48.nc)
     899      ;
     900      ; default:   -1 
     901      ;***************************************************
     902      if (.not. isvar("end_f_2"))then 
     903     
     904         
     905         end_f_2 = -1
     906         
     907         
     908      end if             
    585909      ;***************************************************
    586910      ; OPTIONAL --name_legend_2-- 2nd LEGEND ITEM
     
    598922         
    599923         
    600       end if     
    601       ;***************************************************
    602       ; REQUIRED IF no_files > 2 --file_3-- 3rd INPUT FILE
    603       ;
    604       ; 3rd input file produced by PALM; please declare path and name
    605       ;
    606       ; data type: string
     924      end if
     925      ;***************************************************
     926      ; REQUIRED if no_files > 2 --file_3-- 3RD INPUT FILE
     927      ;
     928      ; 3rd input file produced by PALM; if there is more than one file for all timesteps of a job chain,
     929      ; declare path and file name without cycle number and ".nc" (first and last cycle numbers are given with the parameters 'start_f' and 'end_f');
     930      ; otherwise declare path and full file name
     931      ;
     932      ; data type: string
     933      ;
     934      ; example: file_3 = "/path_to_file/file_pr"      if you use more than one cycle number
     935      ;          file_3 = "/path_to_file/file_pr.4.nc" if you use one file (e.g. with cycle number 4)
    607936      ;
    608937      ; default:   "File in"
    609938      ;***************************************************
    610       if (.not. isvar("file_3"))then   
    611      
    612        
    613          file_3 = "File in"
    614          
    615          
    616       end if     
     939      if(.not. isvar("file_3"))then
     940
     941
     942         file_3 = "File in"
     943         
     944         
     945      end if
     946      ;***************************************************
     947      ; REQUIRED --start_f_3-- START OF CYCLIC NUMBER OF THE 3RD INPUT FILE
     948      ;
     949      ; if there is more than one file for all timesteps of a job chain, declare the first cyclicnumber which contains timesteps you'd like to use
     950      ;
     951      ; data type: integer
     952      ;
     953      ; example:   3 (if first file: example_ts.3.nc)
     954      ;
     955      ; default:   -1 
     956      ;***************************************************
     957      if (.not. isvar("start_f_3"))then 
     958     
     959         
     960         start_f_3 = -1
     961         
     962         
     963      end if
     964      ;***************************************************
     965      ; REQUIRED --end_f_3-- END OF CYCLIC NUMBER OF THE 3RD INPUT FILE
     966      ;
     967      ; if there is more than one file for all timesteps of a job chain, declare the last cyclicnumber which contains timesteps you'd like to use
     968      ;
     969      ; data type: integer
     970      ;
     971      ; example:   48 (if last file: example_ts.48.nc)
     972      ;
     973      ; default:   -1 
     974      ;***************************************************
     975      if (.not. isvar("end_f_3"))then 
     976     
     977         
     978         end_f_3 = -1
     979         
     980         
     981      end if   
    617982      ;***************************************************
    618983      ; OPTIONAL --name_legend_3-- 3rd LEGEND ITEM
     
    630995         
    631996         
    632       end if     
    633       ;***************************************************
    634       ; REQUIRED IF no_files > 3 --file_4-- 4th INPUT FILE
    635       ;
    636       ; 4th input file produced by PALM; please declare path and name
    637       ;
    638       ; data type: string
     997      end if
     998      ;***************************************************
     999      ; REQUIRED if no_files > 3 --file_4-- 4TH INPUT FILE
     1000      ;
     1001      ; 4th input file produced by PALM; if there is more than one file for all timesteps of a job chain,
     1002      ; declare path and file name without cycle number and ".nc" (first and last cycle numbers are given with the parameters 'start_f' and 'end_f');
     1003      ; otherwise declare path and full file name
     1004      ;
     1005      ; data type: string
     1006      ;
     1007      ; example: file_4 = "/path_to_file/file_pr"      if you use more than one cycle number
     1008      ;          file_4 = "/path_to_file/file_pr.4.nc" if you use one file (e.g. with cycle number 4)
    6391009      ;
    6401010      ; default:   "File in"
    6411011      ;***************************************************
    642       if (.not. isvar("file_4"))then
    643      
    644            
    645          file_4 = "File in"
    646          
    647          
    648       end if     
     1012      if(.not. isvar("file_4"))then
     1013
     1014
     1015         file_4 = "File in"
     1016         
     1017         
     1018      end if
     1019      ;***************************************************
     1020      ; REQUIRED --start_f_4-- START OF CYCLIC NUMBER OF THE 4TH INPUT FILE
     1021      ;
     1022      ; if there is more than one file for all timesteps of a job chain, declare the first cyclicnumber which contains timesteps you'd like to use
     1023      ;
     1024      ; data type: integer
     1025      ;
     1026      ; example:   3 (if first file: example_ts.3.nc)
     1027      ;
     1028      ; default:   -1 
     1029      ;***************************************************
     1030      if (.not. isvar("start_f_4"))then 
     1031     
     1032         
     1033         start_f_4 = -1
     1034         
     1035         
     1036      end if
     1037      ;***************************************************
     1038      ; REQUIRED --end_f_4-- END OF CYCLIC NUMBER OF THE 4TH INPUT FILE
     1039      ;
     1040      ; if there is more than one file for all timesteps of a job chain, declare the last cyclicnumber which contains timesteps you'd like to use
     1041      ;
     1042      ; data type: integer
     1043      ;
     1044      ; example:   48 (if last file: example_ts.48.nc)
     1045      ;
     1046      ; default:   -1 
     1047      ;***************************************************
     1048      if (.not. isvar("end_f_4"))then 
     1049     
     1050         
     1051         end_f_4 = -1
     1052         
     1053         
     1054      end if 
    6491055      ;***************************************************
    6501056      ; OPTIONAL --name_legend_4-- 4th LEGEND ITEM
     
    6621068         
    6631069         
    664       end if     
    665       ;***************************************************
    666       ; REQUIRED IF no_files > 4 --file_5-- 5th INPUT FILE
    667       ;
    668       ; 5th input file produced by PALM; please declare path and name
    669       ;
    670       ; data type: string
     1070      end if
     1071      ;***************************************************
     1072      ; REQUIRED if no_files > 4 --file_5-- 5TH INPUT FILE
     1073      ;
     1074      ; 5th input file produced by PALM; if there is more than one file for all timesteps of a job chain,
     1075      ; declare path and file name without cycle number and ".nc" (first and last cycle numbers are given with the parameters 'start_f' and 'end_f');
     1076      ; otherwise declare path and full file name
     1077      ;
     1078      ; data type: string
     1079      ;
     1080      ; example: file_5 = "/path_to_file/file_pr"      if you use more than one cycle number
     1081      ;          file_5 = "/path_to_file/file_pr.4.nc" if you use one file (e.g. with cycle number 4)
    6711082      ;
    6721083      ; default:   "File in"
    6731084      ;***************************************************
    674       if (.not. isvar("file_5"))then
    675      
    676            
    677          file_5 = "File in"
    678          
    679          
    680       end if     
     1085      if(.not. isvar("file_5"))then
     1086
     1087
     1088         file_5 = "File in"
     1089         
     1090         
     1091      end if
     1092      ;***************************************************
     1093      ; REQUIRED --start_f_5-- START OF CYCLIC NUMBER OF THE 5TH INPUT FILE
     1094      ;
     1095      ; if there is more than one file for all timesteps of a job chain, declare the first cyclicnumber which contains timesteps you'd like to use
     1096      ;
     1097      ; data type: integer
     1098      ;
     1099      ; example:   3 (if first file: example_ts.3.nc)
     1100      ;
     1101      ; default:   -1 
     1102      ;***************************************************
     1103      if (.not. isvar("start_f_5"))then 
     1104     
     1105         
     1106         start_f_5 = -1
     1107         
     1108         
     1109      end if
     1110      ;***************************************************
     1111      ; REQUIRED --end_f_5-- END OF CYCLIC NUMBER OF THE 5TH INPUT FILE
     1112      ;
     1113      ; if there is more than one file for all timesteps of a job chain, declare the last cyclicnumber which contains timesteps you'd like to use
     1114      ;
     1115      ; data type: integer
     1116      ;
     1117      ; example:   48 (if last file: example_ts.48.nc)
     1118      ;
     1119      ; default:   -1 
     1120      ;***************************************************
     1121      if (.not. isvar("end_f_5"))then 
     1122     
     1123         
     1124         end_f_5 = -1
     1125         
     1126         
     1127      end if     
    6811128      ;***************************************************
    6821129      ; OPTIONAL --name_legend_5-- 5th LEGEND ITEM
     
    6941141         
    6951142         
    696       end if     
    697       ;***************************************************
    698       ; REQUIRED IF no_files > 5 --file_6-- 6th INPUT FILE
    699       ;
    700       ; 6th input file produced by PALM; please declare path and name
    701       ;
    702       ; data type: string
     1143      end if
     1144      ;***************************************************
     1145      ; REQUIRED if no_files > 5 --file_6-- 6TH INPUT FILE
     1146      ;
     1147      ; 6th input file produced by PALM; if there is more than one file for all timesteps of a job chain,
     1148      ; declare path and file name without cycle number and ".nc" (first and last cycle numbers are given with the parameters 'start_f' and 'end_f');
     1149      ; otherwise declare path and full file name
     1150      ;
     1151      ; data type: string
     1152      ;
     1153      ; example: file_6 = "/path_to_file/file_pr"      if you use more than one cycle number
     1154      ;          file_6 = "/path_to_file/file_pr.4.nc" if you use one file (e.g. with cycle number 4)
    7031155      ;
    7041156      ; default:   "File in"
    7051157      ;***************************************************
    706       if (.not. isvar("file_6"))then   
    707      
    708          
    709          file_6 = "File in"
    710          
    711          
    712       end if     
    713       ;***************************************************
    714       ; OPTIONAL --name_legend_6-- 6th LEGEND ITEM
     1158      if(.not. isvar("file_6"))then
     1159
     1160
     1161         file_6 = "File in"
     1162         
     1163         
     1164      end if
     1165      ;***************************************************
     1166      ; REQUIRED --start_f_6-- START OF CYCLIC NUMBER OF THE 6TH INPUT FILE
     1167      ;
     1168      ; if there is more than one file for all timesteps of a job chain, declare the first cyclicnumber which contains timesteps you'd like to use
     1169      ;
     1170      ; data type: integer
     1171      ;
     1172      ; example:   3 (if first file: example_ts.3.nc)
     1173      ;
     1174      ; default:   -1 
     1175      ;***************************************************
     1176      if (.not. isvar("start_f_6"))then 
     1177     
     1178         
     1179         start_f_6 = -1
     1180         
     1181         
     1182      end if
     1183      ;***************************************************
     1184      ; REQUIRED --end_f_6-- END OF CYCLIC NUMBER OF THE 6TH INPUT FILE
     1185      ;
     1186      ; if there is more than one file for all timesteps of a job chain, declare the last cyclicnumber which contains timesteps you'd like to use
     1187      ;
     1188      ; data type: integer
     1189      ;
     1190      ; example:   48 (if last file: example_ts.48.nc)
     1191      ;
     1192      ; default:   -1 
     1193      ;***************************************************
     1194      if (.not. isvar("end_f_6"))then 
     1195     
     1196         
     1197         end_f_6 = -1
     1198         
     1199         
     1200      end if                     
     1201      ;***************************************************
     1202      ; OPTIONAL --name_legend_6-- 6TH LEGEND ITEM
    7151203      ;
    7161204      ; if no_files > 5: name of 6th item in extra legend
     
    7261214         
    7271215         
    728       end if     
    729       ;***************************************************
    730       ; REQUIRED IF no_files > 6 --file_7-- 7th INPUT FILE
    731       ;
    732       ; 7th input file produced by PALM; please declare path and name
    733       ;
    734       ; data type: string
    735       ;
    736       ; default:   "File in"
    737       ;***************************************************
    738       if (.not. isvar("file_7"))then
    739      
    740            
    741          file_7 = "File in"
    742          
    743          
    744       end if     
    745       ;***************************************************
    746       ; OPTIONAL --name_legend_7-- 7th LEGEND ITEM
    747       ;
    748       ; if no_files > 6: name of 7th item in extra legend
    749       ;
    750       ; data type: string
    751       ;
    752       ; default:   "File 7"
    753       ;***************************************************
    754       if (.not. isvar("name_legend_7"))then
    755      
    756            
    757          name_legend_7 = "File 7"
    758          
    759          
    760       end if     
    761       ;***************************************************
    762       ; REQUIRED IF no_files > 7 --file_8-- 8th INPUT FILE
    763       ;
    764       ; 8th input file produced by PALM; please declare path and name
    765       ;
    766       ; data type: string
    767       ;
    768       ; default:   "File in"
    769       ;***************************************************
    770       if (.not. isvar("file_8"))then
    771      
    772            
    773          file_8 = "File in"
    774          
    775          
    776       end if     
    777       ;***************************************************
    778       ; OPTIONAL --name_legend_8-- 8th LEGEND ITEM
    779       ;
    780       ; if no_files > 1: name of 8th item in extra legend
    781       ;
    782       ; data type: string
    783       ;
    784       ; default:   "File 8"
    785       ;***************************************************
    786       if (.not. isvar("name_legend_8"))then   
    787      
    788          
    789          name_legend_8 = "File 8"
    790          
    791          
    792       end if     
    793       ;***************************************************
    794       ; REQUIRED IF no_files > 8 --file_9-- 9th INPUT FILE
    795       ;
    796       ; 9th input file produced by PALM; please declare path and name
    797       ;
    798       ; data type: string
    799       ;
    800       ; default:   "File in"
    801       ;***************************************************
    802       if (.not. isvar("file_9"))then
    803      
    804            
    805          file_9 = "File in"
    806          
    807          
    808       end if     
    809       ;***************************************************
    810       ; OPTIONAL --name_legend_9-- 9th LEGEND ITEM
    811       ;
    812       ; if no_files > 8: name of 9th item in extra legend
    813       ;
    814       ; data type: string
    815       ;
    816       ; default:   "File 9"
    817       ;***************************************************
    818       if (.not. isvar("name_legend_9"))then
    819      
    820            
    821          name_legend_9 = "File 9"
    822          
    823          
    824       end if     
    825       ;***************************************************
    826       ; REQUIRED IF no_files > 9 --file_10-- 10th INPUT FILE
    827       ;
    828       ; 10th input file produced by PALM; please declare path and name
    829       ;
    830       ; data type: string
    831       ;
    832       ; default:   "File in"
    833       ;***************************************************
    834       if (.not. isvar("file_10"))then
    835      
    836            
    837          file_10 = "File in"
    838          
    839          
    840       end if     
    841       ;***************************************************
    842       ; OPTIONAL --name_legend_10-- 10th LEGEND ITEM
    843       ;
    844       ; if no_files > 9: name of 10th item in extra legend
    845       ;
    846       ; data type: string
    847       ;
    848       ; default:   "File 10"
    849       ;***************************************************
    850       if (.not. isvar("name_legend_10"))then 
    851      
    852          
    853          name_legend_10 = "File 10"
    854          
    855          
    856       end if     
    857       ;***************************************************
    858       ; REQUIRED IF no_files > 10 --file_11-- 11th INPUT FILE
    859       ;
    860       ; 11th input file produced by PALM; please declare path and name
    861       ;
    862       ; data type: string
    863       ;
    864       ; default:   "File in"
    865       ;***************************************************
    866       if (.not. isvar("file_11"))then
    867      
    868            
    869          file_11 = "File in"
    870          
    871          
    872       end if     
    873       ;***************************************************
    874       ; OPTIONAL --name_legend_11-- 11th LEGEND ITEM
    875       ;
    876       ; if no_files > 1: name of 11th item in extra legend
    877       ;
    878       ; data type: string
    879       ;
    880       ; default:   "File 11"
    881       ;***************************************************
    882       if (.not. isvar("name_legend_11"))then
    883      
    884            
    885          name_legend_11 = "File 11"
    886          
    887          
    888       end if     
    889       ;***************************************************
    890       ; REQUIRED IF no_files > 11 --file_12-- 12th INPUT FILE
    891       ;
    892       ; 12th input file produced by PALM; please declare path and name
    893       ;
    894       ; data type: string
    895       ;
    896       ; default:   "File in"
    897       ;***************************************************
    898       if (.not. isvar("file_12"))then
    899      
    900            
    901          file_12 = "File in"
    902          
    903          
    904       end if     
    905       ;***************************************************
    906       ; OPTIONAL --name_legend_12-- 12th LEGEND ITEM
    907       ;
    908       ; if no_files > 11: name of 12th item in extra legend
    909       ;
    910       ; data type: string
    911       ;
    912       ; default:   "File 12"
    913       ;***************************************************
    914       if (.not. isvar("name_legend_12"))then
    915      
    916            
    917          name_legend_12 = "File 12"
    918          
    919          
    920       end if     
     1216      end if             
    9211217      ;***************************************************
    9221218      ; OPTIONAL --start_time_step-- FIRST TIME STEP
    9231219      ;
    924       ; first time step of plot; you don't have to specify a precise time value from the input file,
    925       ; it will be rounded to the next existent time step
     1220      ; first time step of plot; there is no need to specify a precise time value from the input file,
     1221      ; 'start_time_step' is rounded to the next existent time step
    9261222      ;
    9271223      ; data type: double; dimension: [hour]
     1224      ;
     1225      ; example:   start_time_step = 0.5
    9281226      ;
    9291227      ; default:   -1.d (first available time step)
     
    9391237      ; OPTIONAL --end_time_step-- LAST TIME STEP
    9401238      ;
    941       ; last time step of plot; you don't have to specify a precise time value from the input file,
    942       ; it will be rounded to the next existent time step
     1239      ; last time step of plot; there is no need to specify a precise time value from the input file,
     1240      ; 'end_time_step' is rounded to the next existent time step
    9431241      ;
    9441242      ; data type: double; dimension: [hour]
    9451243      ;
     1244      ; example:   end_time_step = 2.0
     1245      ;
    9461246      ; default:   -1.d (last available time step)
    9471247      ;***************************************************
     
    9491249     
    9501250         
    951          end_time_step = -1.d     
    952          
    953          
    954       end if     
     1251         end_time_step = -1.d     
     1252         
     1253         
     1254      end if
     1255      ;***************************************************
     1256      ; OPTIONAL --start_x-- STARTVALUE IN X-DIRECTION 
     1257      ;
     1258      ; if 3D data is used for profiles you can choose a startvalue in x-direction for horizontal averaging
     1259      ;
     1260      ; data type: integer; dimension [grippoint]
     1261      ;
     1262      ; example: start_x = 0
     1263      ;
     1264      ; default:   0 (minimum of range)
     1265      ;***************************************************
     1266      if (.not. isvar("start_x"))then   
     1267     
     1268         
     1269         start_x = 0
     1270         
     1271         
     1272      end if
     1273      ;***************************************************
     1274      ; OPTIONAL --end_x-- ENDVALUE IN X-DIRECTION 
     1275      ;
     1276      ; if 3D data is used for profiles you can choose an endvalue in x-direction for horizontal averaging
     1277      ;
     1278      ; data type: integer; dimension [grippoint]
     1279      ;
     1280      ; example: end_x = 200
     1281      ;
     1282      ; default:   -1 (maximum of range excluding ghostpoint)
     1283      ;***************************************************
     1284      if (.not. isvar("end_x"))then   
     1285     
     1286         
     1287         end_x = -1
     1288         
     1289         
     1290      end if
     1291      ;***************************************************
     1292      ; OPTIONAL --start_y-- STARTVALUE IN Y-DIRECTION 
     1293      ;
     1294      ; if 3D data is used for profiles you can choose a startvalue in y-direction for horizontal averaging
     1295      ;
     1296      ; data type: integer; dimension [grippoint]
     1297      ;
     1298      ; example: start_y = 0
     1299      ;
     1300      ; default:   0 (minimum of range)
     1301      ;***************************************************
     1302      if (.not. isvar("start_y"))then   
     1303     
     1304         
     1305         start_y = 0
     1306         
     1307         
     1308      end if
     1309      ;***************************************************
     1310      ; OPTIONAL --end_y-- ENDVALUE IN Y-DIRECTION 
     1311      ;
     1312      ; if 3D data is used for profiles you can choose an endvalue in y-direction for horizontal averaging
     1313      ;
     1314      ; data type: integer; dimension [grippoint]
     1315      ;
     1316      ; example: end_y = 200
     1317      ;
     1318      ; default:   -1 (maximum of range excluding ghostpoint)
     1319      ;***************************************************
     1320      if (.not. isvar("end_y"))then   
     1321     
     1322         
     1323         end_y = -1
     1324         
     1325         
     1326      end if     
    9551327      ;***************************************************
    9561328      ; OPTIONAL --xs-- MINIMUM X-AXIS
     
    9591331      ;
    9601332      ; data type: float; dimension of variable
     1333      ;
     1334      ; example: xs = 300. (e.g. if var=",pt")
    9611335      ;
    9621336      ; default:   -1. (minimum of range)
     
    9761350      ; data type: float; dimension of variable
    9771351      ;
     1352      ; example: xe = 302. (e.g. if var=",pt")
     1353      ;
    9781354      ; default:   -1. (maximum of range)
    9791355      ;***************************************************
     
    9921368      ; data type: double; dimension: [meter]
    9931369      ;
     1370      ; example: min_z = 0.0
     1371      ;
    9941372      ; default:   -1.d (related to the minimum of z-axis in input file)
    9951373      ;***************************************************
     
    10081386      ; data type: double; dimension: [meter]
    10091387      ;
     1388      ; example: max_z = 1000.0
     1389      ;
    10101390      ; default:   -1.d (related to the maximum of z-axis in input file)
    10111391      ;***************************************************
     
    10181398      end if     
    10191399      ;***************************************************
    1020       ; OPTIONAL --logy-- LOGARITHMIC SCALE
    1021       ;
    1022       ; logarithmic scale for y-axis will be switched on [=1] or off [=0]
    1023       ;
    1024       ; data type: integer
     1400      ; OPTIONAL --log_z-- LOGARITHMIC SCALE OF Z-AXIS
     1401      ;
     1402      ; logarithmic scale for z-axis is switched on [=1] or off [=0]
     1403      ;
     1404      ; data type: integer
     1405      ;
     1406      ; example: log_z = 0
    10251407      ;
    10261408      ; default:   0
    10271409      ;***************************************************
    1028       if (.not. isvar("logy"))then
     1410      if (.not. isvar("log_z"))then
    10291411     
    10301412           
    1031          logy = 0
    1032          
    1033          
    1034       end if     
    1035       ;***************************************************
    1036       ; OPTIONAL --norm-- NORMALISE Y-AXIS
    1037       ;
    1038       ; value for normalising the y-axis
     1413         log_z = 0
     1414         
     1415         
     1416      end if     
     1417      ;***************************************************
     1418      ; OPTIONAL --norm_z-- NORMALISING Z-AXIS
     1419      ;
     1420      ; value for normalising the z-axis
    10391421      ;
    10401422      ; data type: float
    10411423      ;
    1042       ; default:   1 (no normalising)
    1043       ;***************************************************
    1044       if (.not. isvar("norm"))then
     1424      ; example: norm_z = 1.
     1425      ;
     1426      ; default:   1. (no normalising)
     1427      ;***************************************************
     1428      if (.not. isvar("norm_z"))then
    10451429     
    10461430           
    1047          norm = 1
     1431         norm_z = 1.
    10481432         
    10491433         
     
    10521436      ; OPTIONAL --over-- OVERLAYING
    10531437      ;
    1054       ; predefined overlaying of standard variables will be switched on [=1] or off [=0];
     1438      ; predefined overlaying of standard variables is switched on [=1] or off [=0];
    10551439      ; this feature cannot be used with statistic regions
    10561440      ;
    10571441      ; data type: integer
    10581442      ;
     1443      ; example: over = 0
     1444      ;
    10591445      ; default:   0
    10601446      ;***************************************************
     
    10721458      ;
    10731459      ; data type: integer
     1460      ;
     1461      ; example: combine = 0
    10741462      ;
    10751463      ; default:   0
     
    10891477      ; data type: integer
    10901478      ;
     1479      ; example: number_comb = 2
     1480      ;
    10911481      ; default:   -1
    10921482      ;***************************************************
     
    11011491      ; REQUIRED IF combine=1 --c_var-- VARIABLES FOR COMBINING
    11021492      ;
    1103       ; names of variables; please inidcate them with one comma before and after each variable;
    1104       ; e.g.: var=",u,v,w," (the windcomponents u, v and w will be combined)
    1105       ;
    1106       ; data type: string
     1493      ; names of variables; inidcate them with one comma before and after each variable;
     1494      ;
     1495      ; data type: string
     1496      ;
     1497      ; example: c_var = ",u,v,"
    11071498      ;
    11081499      ; default:   "c_variables"
     
    11221513      ; data type: integer
    11231514      ;
     1515      ; example: black = 0
     1516      ;
    11241517      ; default:   0
    11251518      ;***************************************************
     
    11381531      ; data type: integer
    11391532      ;
     1533      ; example: dash = 0
     1534      ;
    11401535      ; default:   0
    11411536      ;***************************************************
     
    11441539       
    11451540         dash = 0     
     1541         
     1542         
     1543      end if
     1544      ;***************************************************
     1545      ; OPTIONAL --font_size-- FONT SIZE OF STRINGS
     1546      ;
     1547      ; font size can be changed to fit to the current plot
     1548      ;
     1549      ; data type: float
     1550      ;
     1551      ; example: font_size = 0.02
     1552      ;
     1553      ; default:   0.02
     1554      ;***************************************************
     1555      if(.not. isvar("font_size"))then
     1556     
     1557         
     1558         font_size = 0.02
     1559         
     1560         
     1561      end if
     1562      ;***************************************************
     1563      ; OPTIONAL --font_size_legend-- FONT SIZE OF LEGEND STRINGS
     1564      ;
     1565      ; font size of the legend can be changed to fit to the current plot
     1566      ;
     1567      ; data type: float
     1568      ;
     1569      ; example: font_size_legend = 0.2
     1570      ;
     1571      ; default:   0.2
     1572      ;***************************************************
     1573      if(.not. isvar("font_size_legend"))then
     1574     
     1575         
     1576         font_size_legend = 0.2
    11461577         
    11471578         
     
    11601591      ; REQUIRED --file_1-- INPUT FILE
    11611592      ;
    1162       ; input file produced by PALM; please declare path and name
    1163       ;
    1164       ; data type: string
     1593      ; input file produced by PALM; if there is more than one file for all timesteps of a job chain,
     1594      ; declare path and file name without cycle number and ".nc" (first and last cycle numbers are given with the parameters 'start_f' and 'end_f');
     1595      ; otherwise declare path and full file name
     1596      ;
     1597      ; data type: string
     1598      ;
     1599      ; example: file_1 = "/path_to_file/file_sp"      if you use more than one cycle number
     1600      ;          file_1 = "/path_to_file/file_sp.4.nc" if you use one file (e.g. with cycle number 4)
    11651601      ;
    11661602      ; default:   "File in"
    11671603      ;***************************************************
    1168       if (.not. isvar("file_1"))then 
     1604      if(.not. isvar("file_1"))then
     1605
     1606
     1607         file_1 = "File in"
     1608         
     1609         
     1610      end if
     1611      ;***************************************************
     1612      ; REQUIRED if more than one file of a job chain --start_f-- START OF CYCLIC NUMBER
     1613      ;
     1614      ; if there is more than one file for all timesteps of a job chain, declare the first cyclicnumber which contains timesteps you'd like to use
     1615      ;
     1616      ; data type: integer
     1617      ;
     1618      ; example:   start_f = 3 (if first file: example_ts.3.nc)
     1619      ;
     1620      ; default:   -1 
     1621      ;***************************************************
     1622      if (.not. isvar("start_f"))then 
    11691623     
    11701624         
    1171          file_1 = "File in"
    1172          
    1173          
    1174       end if     
     1625         start_f = -1
     1626         
     1627         
     1628      end if
     1629      ;***************************************************
     1630      ; REQUIRED if more than one file of a job chain --end_f-- END OF CYCLIC NUMBER
     1631      ;
     1632      ; if there is more than one file for all timesteps of a job chain, declare the last cyclicnumber which contains timesteps you'd like to use
     1633      ;
     1634      ; data type: integer
     1635      ;
     1636      ; example:   end_f = 48 (if last file: example_ts.48.nc)
     1637      ;
     1638      ; default:   -1 
     1639      ;***************************************************
     1640      if (.not. isvar("end_f"))then 
     1641     
     1642         
     1643         end_f = -1
     1644         
     1645         
     1646      end if
    11751647      ;***************************************************
    11761648      ; OPTIONAL --format_out-- OUTPUT FORMAT
    11771649      ;
    1178       ; supported file formats: x11, pdf, ps, eps, epsi or ncgm
    1179       ;
    1180       ; data type: string
     1650      ; format of the output file; supported file formats: x11, pdf, ps, eps, epsi or ncgm
     1651      ;
     1652      ; data type: string
     1653      ;
     1654      ; example: format_out = "pdf"
    11811655      ;
    11821656      ; default:   "x11"
     
    11921666      ; OPTIONAL --file_out-- OUTPUT FILE
    11931667      ;
    1194       ; please declare path and name
    1195       ;
    1196       ; data type: string
     1668      ; path and name of the output file
     1669      ;
     1670      ; data type: string
     1671      ;
     1672      ; example: file_out = "/home/path_to_output/test_sp"
    11971673      ;
    11981674      ; default:   "~/test_sp"
     
    12061682      end if     
    12071683      ;***************************************************
    1208       ; OPTIONAL --no_columns-- NUMBER OF ROWS
     1684      ; OPTIONAL --no_columns-- NUMBER OF COLUMNS
    12091685      ;
    12101686      ; number of plots in one row
    12111687      ;
    12121688      ; data type: integer
     1689      ;
     1690      ; example: no_columns = 1
    12131691      ;
    12141692      ; default:   1
     
    12221700      end if     
    12231701      ;***************************************************
    1224       ; OPTIONAL --no_lines-- NUMBER OF COLUMNS
     1702      ; OPTIONAL --no_rows-- NUMBER OF ROWS
    12251703      ;
    12261704      ; number of plots in one column
    12271705      ;
    12281706      ; data type: integer
     1707      ;
     1708      ; example: no_rows = 2
    12291709      ;
    12301710      ; default:   2
    12311711      ;***************************************************
    1232       if (.not. isvar("no_lines"))then
    1233      
    1234          
    1235          no_lines = 2
     1712      if (.not. isvar("no_rows"))then
     1713     
     1714         
     1715         no_rows = 2
    12361716         
    12371717         
     
    12401720      ; OPTIONAL --var-- OUTPUT VARIABLES
    12411721      ;
    1242       ; names of output variables; please inidcate them with one comma before and after each variable;
    1243       ; e.g.: var=",u,v,w," (the windcomponents u, v and w will be plotted)
     1722      ; names of output variables; inidcate them with one comma before and after each variable
    12441723      ;
    12451724      ; data type: string
    1246       ;
    1247       ; default:   "all" (all available variables will be plotted)
     1725      ;
     1726      ; example: var = ",u,v,w"
     1727      ;
     1728      ; default:   "all" (all available variables are plotted)
    12481729      ;***************************************************
    12491730      if (.not. isvar("var"))then
     
    12571738      ; OPTIONAL --height_level-- HEIGHT LEVELS
    12581739      ;
    1259       ; defines if all heights or selected heights will be output; a 1D array with up to 10 elements
    1260       ; from 0 to 9 must be indicated, e.g.: height_level=(/0,3,7/) (level 0, 3 and 7 as in input file
    1261       ; will be output)
     1740      ; defines if all levels or selected levels are output; a 1D array with up to 100 elements
     1741      ; from 0 to 99 must be indicated
    12621742      ;
    12631743      ; data type: integer array
    12641744      ;
    1265       ; default:   (/-1/) (all levels will be output)
     1745      ; example: height_level=(/0,3,7/)
     1746      ;
     1747      ; default:   (/-1/) (all levels are output)
    12661748      ;***************************************************
    12671749      if (.not. isvar("height_level"))then
     
    12751757      ; OPTIONAL --sort-- TYPE OF SORTING
    12761758      ;
    1277       ; defines if all heights [="height"] or all timesteps [="time"] will be merged in one plot
    1278       ;
    1279       ; data type: string
     1759      ; defines if all heights [="height"] or all timesteps [="time"] are merged in one plot
     1760      ;
     1761      ; data type: string
     1762      ;
     1763      ; example: sort = "height"
    12801764      ;
    12811765      ; default:   "height"
     
    12911775      ; OPTIONAL --start_time_step-- FIRST TIME STEP
    12921776      ;
    1293       ; first time step of plot; you don't have to specify a precise time value from the input file,
    1294       ; it will be rounded to the next existent time step
     1777      ; first time step of plot; there is no need to specify a precise time value from the input file,
     1778      ; 'start_time_step' is rounded to the next existent time step
    12951779      ;
    12961780      ; data type: double; dimension: [hour]
    12971781      ;
     1782      ; example:   start_time_step = 0.5
     1783      ;
    12981784      ; default:   -1.d (first available time step)
    12991785      ;***************************************************
     
    13081794      ; OPTIONAL --end_time_step-- LAST TIME STEP
    13091795      ;
    1310       ; last time step of plot; you don't have to specify a precise time value from the input file,
    1311       ; it will be rounded to the next existent time step
     1796      ; last time step of plot; there is no need to specify a precise time value from the input file,
     1797      ; 'end_time_step' is rounded to the next existent time step
    13121798      ;
    13131799      ; data type: double; dimension: [hour]
    13141800      ;
     1801      ; example:   end_time_step = 2.0
     1802      ;
    13151803      ; default:   -1.d (last available time step)
    13161804      ;***************************************************
     
    13281816      ;
    13291817      ; data type: integer
     1818      ;
     1819      ; example: black = 0
    13301820      ;
    13311821      ; default:   0
     
    13451835      ; data type: integer
    13461836      ;
     1837      ; example: dash = 0
     1838      ;
    13471839      ; default:   0
    13481840      ;***************************************************
     
    13551847      end if
    13561848      ;***************************************************
    1357       ; OPTIONAL --logx-- LOGARITHMIC SCALE X-AXIS
    1358       ;
    1359       ; logarithmic scale for x-axis will be switched on [=1] or off [=0]
    1360       ;
    1361       ; data type: integer
     1849      ; OPTIONAL --log_x-- LOGARITHMIC SCALE X-AXIS
     1850      ;
     1851      ; logarithmic scale for x-axis is switched on [=1] or off [=0]
     1852      ;
     1853      ; data type: integer
     1854      ;
     1855      ; example: log_x = 1
    13621856      ;
    13631857      ; default:   1
    13641858      ;***************************************************
    1365       if (.not. isvar("logx"))then   
     1859      if (.not. isvar("log_x"))then   
    13661860     
    13671861         
    1368          logx = 1
     1862         log_x = 1
    13691863         
    13701864         
    13711865      end if     
    13721866      ;***************************************************
    1373       ; OPTIONAL --logy-- LOGARITHMIC SCALE Y-AXIS
    1374       ;
    1375       ; logarithmic scale for y-axis will be switched on [=1] or off [=0]
    1376       ;
    1377       ; data type: integer
     1867      ; OPTIONAL --log_y-- LOGARITHMIC SCALE Y-AXIS
     1868      ;
     1869      ; logarithmic scale for y-axis is switched on [=1] or off [=0]
     1870      ;
     1871      ; data type: integer
     1872      ;
     1873      ; example: log_y = 1
    13781874      ;
    13791875      ; default:   1
    13801876      ;***************************************************
    1381       if (.not. isvar("logy"))then   
     1877      if (.not. isvar("log_y"))then   
    13821878     
    13831879         
    1384          logy = 1
    1385          
    1386          
    1387       end if     
    1388       ;***************************************************
    1389       ; OPTIONAL --normx-- NORMALISE X-AXIS
     1880         log_y = 1
     1881         
     1882         
     1883      end if     
     1884      ;***************************************************
     1885      ; OPTIONAL --norm_x-- NORMALISING X-AXIS
    13901886      ;
    13911887      ; value for normalising the x-axis
     
    13931889      ; data type: float
    13941890      ;
     1891      ; example: norm_x = 1
     1892      ;
    13951893      ; default:   1. (no normalising)
    13961894      ;***************************************************
    1397       if (.not. isvar("normx"))then   
     1895      if (.not. isvar("norm_x"))then   
    13981896     
    13991897         
    1400          normx = 1.
    1401          
    1402          
    1403       end if     
    1404       ;***************************************************
    1405       ; OPTIONAL --normy-- NORMALISE Y-AXIS
     1898         norm_x = 1.
     1899         
     1900         
     1901      end if
     1902      ;***************************************************
     1903      ; OPTIONAL --norm_height-- NORMALISING X-AXIS WITH HEIGHT
     1904      ;
     1905      ; normalising the x-axis with the height of each spectra is switched on [=1] or off [=0]
     1906      ;
     1907      ; data type: integer
     1908      ;
     1909      ; example: norm_height = 0
     1910      ;
     1911      ; default:   0 (no normalising)
     1912      ;***************************************************
     1913      if (.not. isvar("norm_height"))then   
     1914     
     1915         
     1916         norm_height = 0
     1917         
     1918         
     1919      end if     
     1920      ;***************************************************
     1921      ; OPTIONAL --norm_y-- NORMALISE Y-AXIS
    14061922      ;
    14071923      ; value for normalising the y-axis
     
    14091925      ; data type: float
    14101926      ;
     1927      ; example: norm_y = 1.
     1928      ;
    14111929      ; default:   1. (no normalising)
    14121930      ;***************************************************
    1413       if (.not. isvar("normy"))then     
     1931      if (.not. isvar("norm_y"))then     
    14141932     
    14151933       
    1416          normy = 1.
    1417          
    1418          
    1419       end if     
     1934         norm_y = 1.
     1935         
     1936         
     1937      end if
     1938      ;***************************************************
     1939      ; OPTIONAL --unit_x--unit_y-- UNITS OF X-, Y-AXES
     1940      ;
     1941      ; unit of the x-axis can be set if norm_x is unequal 1, otherwise the unit is [1/m]; by default no unit is set for the y-axis
     1942      ;
     1943      ; data type: string,
     1944      ;
     1945      ; example: unit_x = "100/m"
     1946      ;
     1947      ; default:   " "
     1948      ;***************************************************
     1949      if(.not. isvar("unit_x"))then     
     1950         
     1951         unit_x = " "   
     1952         
     1953      end if
     1954      if(.not. isvar("unit_y"))then     
     1955         
     1956         unit_y = " "   
     1957         
     1958      end if
     1959      ;***************************************************
     1960      ; OPTIONAL --font_size-- FONT SIZE OF STRINGS
     1961      ;
     1962      ; font size can be changed to fit to the current plot
     1963      ;
     1964      ; data type: float
     1965      ;
     1966      ; example: font_size = 0.02
     1967      ;
     1968      ; default:   0.02
     1969      ;***************************************************
     1970      if(.not. isvar("font_size"))then
     1971     
     1972         
     1973         font_size = 0.02
     1974         
     1975         
     1976      end if
     1977      ;***************************************************
     1978      ; OPTIONAL --font_size_legend-- FONT SIZE OF LEGEND STRINGS
     1979      ;
     1980      ; font size of the legend can be changed to fit to the current plot
     1981      ;
     1982      ; data type: float
     1983      ;
     1984      ; example: font_size_legend = 0.2
     1985      ;
     1986      ; default:   0.2
     1987      ;***************************************************
     1988      if(.not. isvar("font_size_legend"))then
     1989     
     1990         
     1991         font_size_legend = 0.2
     1992         
     1993         
     1994      end if     
    14201995      ;***************************************************
    14211996     
     
    14312006      ; REQUIRED --file_1-- INPUT FILE
    14322007      ;
    1433       ; input file produced by PALM; please declare path and name
    1434       ;
    1435       ; data type: string
     2008      ; input file produced by PALM; if there is more than one file for all timesteps of a job chain,
     2009      ; declare path and file name without cycle number and ".nc" (first and last cycle numbers are given with the parameters 'start_f' and 'end_f');
     2010      ; otherwise declare path and full file name
     2011      ;
     2012      ; data type: string
     2013      ;
     2014      ; example: file_1 = "/path_to_file/file_ts"      if you use more than one cycle number
     2015      ;          file_1 = "/path_to_file/file_ts.4.nc" if you use one file (e.g. with cycle number 4)
    14362016      ;
    14372017      ; default:   "File in"
    14382018      ;***************************************************
    1439       if (.not. isvar("file_1"))then 
     2019      if(.not. isvar("file_1"))then
     2020
     2021
     2022         file_1 = "File in"
     2023         
     2024         
     2025      end if
     2026      ;***************************************************
     2027      ; REQUIRED if more than one file of a job chain --start_f-- START OF CYCLIC NUMBER
     2028      ;
     2029      ; if there is more than one file for all timesteps of a job chain, declare the first cyclicnumber which contains timesteps you'd like to use
     2030      ;
     2031      ; data type: integer
     2032      ;
     2033      ; example:   start_f = 3 (if first file: example_ts.3.nc)
     2034      ;
     2035      ; default:   -1 
     2036      ;***************************************************
     2037      if (.not. isvar("start_f"))then 
    14402038     
    14412039         
    1442          file_1 = "File in"
    1443          
    1444          
    1445       end if     
     2040         start_f = -1
     2041         
     2042         
     2043      end if
     2044      ;***************************************************
     2045      ; REQUIRED if more than one file of a job chain --end_f-- END OF CYCLIC NUMBER
     2046      ;
     2047      ; if there is more than one file for all timesteps of a job chain, declare the last cyclicnumber which contains timesteps you'd like to use
     2048      ;
     2049      ; data type: integer
     2050      ;
     2051      ; example:   end_f = 48 (if last file: example_ts.48.nc)
     2052      ;
     2053      ; default:   -1 
     2054      ;***************************************************
     2055      if (.not. isvar("end_f"))then 
     2056     
     2057         
     2058         end_f = -1
     2059         
     2060         
     2061      end if
    14462062      ;***************************************************
    14472063      ; OPTIONAL --format_out-- OUTPUT FORMAT
    14482064      ;
    1449       ; supported file formats: x11, pdf, ps, eps, epsi or ncgm
    1450       ;
    1451       ; data type: string
     2065      ; format of the output file; supported file formats: x11, pdf, ps, eps, epsi or ncgm
     2066      ;
     2067      ; data type: string
     2068      ;
     2069      ; example: format_out = "pdf"
    14522070      ;
    14532071      ; default:   "x11"
     
    14632081      ; OPTIONAL --file_out-- OUTPUT FILE
    14642082      ;
    1465       ; please declare path and name
    1466       ;
    1467       ; data type: string
     2083      ; path and name of the output file
     2084      ;
     2085      ; data type: string
     2086      ;
     2087      ; example: file_out = "/home/path_to_output/test_ts"
    14682088      ;
    14692089      ; default:   "~/test_ts"
     
    14772097      end if     
    14782098      ;***************************************************
    1479       ; OPTIONAL --no_columns-- NUMBER OF ROWS
     2099      ; OPTIONAL --no_columns-- NUMBER OF COLUMNS
    14802100      ;
    14812101      ; number of plots in one row
    14822102      ;
    14832103      ; data type: integer
     2104      ;
     2105      ; example: no_columns = 1
    14842106      ;
    14852107      ; default:   1
     
    14932115      end if     
    14942116      ;***************************************************
    1495       ; OPTIONAL --no_lines-- NUMBER OF COLUMNS
     2117      ; OPTIONAL --no_rows-- NUMBER OF ROWS
    14962118      ;
    14972119      ; number of plots in one column
    14982120      ;
    14992121      ; data type: integer
     2122      ;
     2123      ; example: no_rows = 2
    15002124      ;
    15012125      ; default:   2
    15022126      ;***************************************************
    1503       if (.not. isvar("no_lines"))then
    1504      
    1505          
    1506          no_lines = 2
     2127      if (.not. isvar("no_rows"))then
     2128     
     2129         
     2130         no_rows = 2
    15072131         
    15082132         
     
    15112135      ; OPTIONAL --var-- OUTPUT VARIABLES
    15122136      ;
    1513       ; names of output variables; please inidcate them with one comma before and after each variable;
    1514       ; e.g.: var=",u,v,w," (the windcomponents u, v and w will be plotted)
     2137      ; names of output variables; inidcate them with one comma before and after each variable
    15152138      ;
    15162139      ; data type: string
    1517       ;
    1518       ; default:   "all" (all available variables will be plotted)
     2140      ;
     2141      ; example: var = ",u,v,w"
     2142      ;
     2143      ; default:   "all" (all available variables are plotted)
    15192144      ;***************************************************
    15202145      if (.not. isvar("var"))then
     
    15282153      ; OPTIONAL --start_time_step-- FIRST TIME STEP
    15292154      ;
    1530       ; first time step of plot; you don't have to specify a precise time value from the input file,
    1531       ; it will be rounded to the next existent time step
     2155      ; first time step of plot; there is no need to specify a precise time value from the input file,
     2156      ; 'start_time_step' is rounded to the next existent time step
    15322157      ;
    15332158      ; data type: double; dimension: [hour]
    15342159      ;
     2160      ; example:   start_time_step = 0.5
     2161      ;
    15352162      ; default:   -1.d (first available time step)
    15362163      ;***************************************************
     
    15452172      ; OPTIONAL --end_time_step-- LAST TIME STEP
    15462173      ;
    1547       ; last time step of plot; you don't have to specify a precise time value from the input file,
    1548       ; it will be rounded to the next existent time step
     2174      ; last time step of plot; there is no need to specify a precise time value from the input file,
     2175      ; 'end_time_step' is rounded to the next existent time step
    15492176      ;
    15502177      ; data type: double; dimension: [hour]
    15512178      ;
     2179      ; example:   end_time_step = 2.0
     2180      ;
    15522181      ; default:   -1.d (last available time step)
    15532182      ;***************************************************
     
    15622191      ; OPTIONAL --over-- OVERLAYING
    15632192      ;
    1564       ; predefined overlaying of standard variables will be switched on [=1] or off [=0];
     2193      ; predefined overlaying of standard variables are switched on [=1] or off [=0];
    15652194      ; this feature cannot be used with statistic regions
    15662195      ;
    15672196      ; data type: integer
    15682197      ;
     2198      ; example: over = 0
     2199      ;
    15692200      ; default:   0
    15702201      ;***************************************************
     
    15752206         
    15762207         
    1577       end if
     2208      end if
     2209      ;***************************************************
     2210      ; OPTIONAL --font_size-- FONT SIZE OF STRINGS
     2211      ;
     2212      ; font size can be changed to fit to the current plot
     2213      ;
     2214      ; data type: float
     2215      ;
     2216      ; example: font_size = 0.07
     2217      ;
     2218      ; default:   0.07
     2219      ;***************************************************
     2220      if(.not. isvar("font_size"))then
     2221     
     2222         
     2223         font_size = 0.07
     2224         
     2225         
     2226      end if
     2227      ;***************************************************
     2228      ; OPTIONAL --norm_t-- NORMALISING X-AXIS OF TIMESERIES PLOTS (T-AXIS)
     2229      ;
     2230      ; normalising the x-axis with the given value; the unit can explicitly set; by default no normalising and unit is set to [s]
     2231      ;
     2232      ; data type: float
     2233      ;
     2234      ; example: norm_t = 3600
     2235      ;
     2236      ; default:   1.
     2237      ;***************************************************
     2238      if(.not. isvar("normt"))then
     2239     
     2240         
     2241         norm_t = 1.
     2242         
     2243         
     2244      end if
     2245      ;***************************************************
     2246      ; OPTIONAL --unit_t-- UNIT OF X-AXIS OF TIMESERIES PLOTS (T-AXIS)
     2247      ;
     2248      ; unit of the x-axis can be set; by default unit is set to [s]
     2249      ;
     2250      ; data type: string
     2251      ;
     2252      ; example: unit_t = "h"
     2253      ;
     2254      ; default:   " "
     2255      ;***************************************************
     2256      if(.not. isvar("unitt"))then
     2257     
     2258         
     2259         unit_t = " "
     2260         
     2261         
     2262      end if
    15782263      ;***************************************************
    15792264
  • 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
  • palm/trunk/SCRIPTS/NCL/spectra.ncl

    r194 r218  
    2626   end if
    2727end if
    28    
     28
    2929begin
    3030
     
    3535   if (file_1 .EQ. "File in") then
    3636      print(" ")
    37       print("Please provide 1st input file 'file_1=' in 'ncl_preferences.ncl'")
     37      print("Declare input file 'file_1=' in 'ncl_preferences.ncl' or prompt")
    3838      print(" ")
    3939      exit
     
    4141      file_in = file_1   
    4242   end if
    43    if (.not. isfilepresent(file_in)) then
    44       print(" ")
    45       print("1st input file: '"+file_in+"' does not exist")
    46       print(" ")
    47       exit
    48    end if
    4943
    5044   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
     
    5549   end if
    5650   
    57    if (logx .NE. 0 .AND. logx .NE. 1)then
    58       print(" ")
    59       print("'logx'= "+logx+" is invalid and set to 1")
    60       print(" ")
    61       logx = 1
     51   if (log_x .NE. 0 .AND. log_x .NE. 1)then
     52      print(" ")
     53      print("'log_x'= "+log_x+" is invalid and set to 1")
     54      print(" ")
     55      log_x = 1
    6256   end if 
    6357   
    64    if (logy .NE. 0 .AND. logy .NE. 1)then
    65       print(" ")
    66       print("'logy'= "+logy+" is invalid and set to 1")
    67       print(" ")
    68       logy = 1
     58   if (log_y .NE. 0 .AND. log_y .NE. 1)then
     59      print(" ")
     60      print("'log_y'= "+log_y+" is invalid and set to 1")
     61      print(" ")
     62      log_y = 1
    6963   end if   
    7064 
    71    if (normy .EQ. 0.) then
    72       print(" ")
    73       print("You cannot normalise the y-axis with 0, 'normy' is set to 1.0")
    74       print(" ")
    75       normy = 1.0
    76    end if
    77    if (normx .EQ. 0.) then
    78       print(" ")
    79       print("You cannot normalise the x-axis with 0, 'normx' is set to 1.0")
    80       print(" ")
    81       normx= 1.0
     65   if (norm_y .EQ. 0.) then
     66      print(" ")
     67      print("Normalising with 0 is not allowed, 'norm_y' is set to 1.0")
     68      print(" ")
     69      norm_y = 1.0
     70   end if
     71   if (norm_x .EQ. 0.) then
     72      print(" ")
     73      print("Normalising with 0 is not allowed, 'norm_x' is set to 1.0")
     74      print(" ")
     75      norm_x= 1.0
    8276   end if
    8377   
     
    106100   ; open input file
    107101   ;***************************************************
    108 
    109    f=addfile(file_in,"r")
    110    
    111    vNam = getfilevarnames(f)
     102   
     103   file_in_1 = False
     104   if (isStrSubset(file_in, ".nc"))then
     105      start_f = -2
     106      end_f = -2
     107      file_in_1 = True     
     108   end if
     109
     110   if (start_f .EQ. -1)then
     111      print(" ")
     112      print("'start_f' must be one of the cyclic numbers (at least 0) of your input file(s)")
     113      print(" ") 
     114      exit
     115   end if
     116   if (end_f .EQ. -1)then
     117      print(" ")
     118      print("'end_f' must be one of the cyclic numbers (at least 0) of your input file(s)")
     119      print(" ") 
     120      exit
     121   end if
     122
     123   files=new(end_f-start_f+1,string)
     124   
     125   if (file_in_1)then
     126      if (isfilepresent(file_in))then
     127         files(0)=file_in
     128      else
     129         print(" ")
     130         print("1st input file: '"+file_in+"' does not exist")
     131         print(" ")
     132         exit
     133      end if
     134   else   
     135      if (start_f .EQ. 0)then
     136         if (isfilepresent(file_in+".nc"))then
     137            files(0)=file_in+".nc"
     138            do i=1,end_f
     139               if (isfilepresent(file_in+"."+i+".nc"))then   
     140                  files(i)=file_in+"."+i+".nc"
     141               else
     142                  print(" ")
     143                  print("Input file: '"+file_in+"."+i+".nc' does not exist")
     144                  print(" ")
     145                  exit 
     146               end if       
     147            end do         
     148         else
     149            print(" ")
     150            print("Input file: '"+file_in+".nc' does not exist")
     151            print(" ")
     152            exit
     153         end if
     154      else
     155         do i=start_f,end_f
     156            if (isfilepresent(file_in+"."+i+".nc"))then   
     157               files(i-start_f)=file_in+"."+i+".nc"
     158            else
     159               print(" ")
     160               print("Input file: '"+file_in+"."+i+".nc' does not exist")
     161               print(" ")
     162               exit 
     163            end if
     164         end do
     165      end if
     166   end if
     167
     168   f=addfiles(files,"r")
     169   f_att=addfile(files(0),"r")
     170   ListSetType(f,"cat")
     171   
     172   vNam = getfilevarnames(f_att)
    112173   print(" ")
    113174   print("Variables in input file:")
     
    115176   print(" ")
    116177   dim = dimsizes(vNam)
    117    vDim = getfiledimsizes(f)
     178   vDim = getfiledimsizes(f_att)
    118179 
    119    t_all = f->time
     180   t_all = f[:]->time
    120181   nt    = dimsizes(t_all)
    121182   delta_t=t_all(nt-1)/nt
    122183   
    123    k_x=f->k_x
     184   k_x=f_att->k_x
    124185   dimx=dimsizes(k_x)
    125    k_y=f->k_y
     186   k_y=f_att->k_y
    126187   dimy=dimsizes(k_y)
    127188   
     
    131192   do i=0,dim-1
    132193      if (vNam(i) .EQ. "zu_sp")then
    133          zu=f->zu_sp     
     194         zu=f_att->zu_sp         
    134195         if (height_level(0) .EQ. -1)then
    135196            dimz=dimsizes(zu)
     
    150211      else
    151212         if (vNam(i) .EQ. "zw_sp")then
    152             zw=f->zw_sp
     213            zw=f_att->zw_sp
    153214            if (height_level(0) .EQ. -1)then             
    154215               dimz=dimsizes(zw)
     
    182243         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")
    183244         print(" ")
    184          print("Please select another 'start_time_step'")
     245         print("Select another 'start_time_step'")
    185246         print(" ")
    186247         exit
     
    204265      print("'start_time_step' = "+ start_time_step +"h is invalid")
    205266      print(" ")
    206       print("Please select another 'start_time_step'")
     267      print("Select another 'start_time_step'")
    207268      print(" ")
    208269      exit
     
    220281         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")
    221282         print(" ")
    222          print("Please select another 'end_time_step'") 
     283         print("Select another 'end_time_step'") 
    223284         print(" ")
    224285         exit
     
    228289         print("'end_time_step' = "+ end_time_step +"h is lower than 'start_time_step' = "+start_time_step+"h")
    229290         print(" ")
    230          print("Please select another 'start_time_step' or 'end_time_step'")
     291         print("Select another 'start_time_step' or 'end_time_step'")
    231292         print(" ")
    232293         exit
     
    245306      print("'end_time_step' = "+ end_time_step +"h is invalid")
    246307      print(" ")
    247       print("Please select another 'end_time_step'")
     308      print("Select another 'end_time_step'")
    248309      print(" ")
    249310      exit
     
    281342   res@lgLabelFont             = "helvetica"
    282343   res@tmLabelAutoStride       = True
    283    res@pmLegendDisplayMode     = "Always"
    284    res@pmLegendSide            = "Top"
    285    res@pmLegendParallelPosF    = 1.2
    286    res@pmLegendOrthogonalPosF  = -1.0
    287    res@pmLegendWidthF          = 0.12
    288    if (sort .EQ. "time")then
    289       res@pmLegendHeightF         = 0.04*(end_time_step-start_time_step+1)
    290    else
    291       res@pmLegendHeightF         = 0.04*dimz
    292    end if
    293    res@lgLabelFontHeightF     = .025
    294    res@lgTitleFontHeightF     = .025
    295    res@txFontHeightF      = 0.025
    296    res@tiXAxisFontHeightF = 0.025
    297    res@tiYAxisFontHeightF = 0.025
    298    
    299    if (logx .EQ. 1) then
     344   
     345   res@lgLabelFontHeightF     = font_size_legend
     346   res@lgTitleFontHeightF     = font_size
     347   res@txFontHeightF      = font_size
     348   res@tiXAxisFontHeightF = font_size
     349   res@tiYAxisFontHeightF = font_size
     350   res@tmXBLabelFontHeightF = font_size
     351   res@tmYLLabelFontHeightF = font_size
     352   
     353   res@tmXBMinorPerMajor = 4
     354   res@tmYLMinorPerMajor = 4
     355   
     356   if (log_x .EQ. 1) then
    300357      res@trXLog = True
    301358   else
    302359      res@trXLog = False
    303360   end if
    304    if (logy .EQ. 1)then
     361   if (log_y .EQ. 1)then
    305362      res@trYLog = True
    306363   else 
     
    326383      plot  = new(dim*dimt,graphic)
    327384      np=dimz
    328       res@lgTitleString = "Height [m]" 
     385     
    329386      do p=0,dimz-1
    330387         if (height_level(0) .EQ. -1)then
     
    340397   if (black .eq. 0 ) then
    341398      if (np .EQ. 1)then
    342          res@xyLineColors = 237
     399         color = 237
    343400      else   
    344401         step=round(235/(np-1),3)
    345          res@xyLineColors = ispan(2,237,step)
     402         color = ispan(2,237,step)
    346403      end if
    347404   end if
     
    352409   wks=gsn_open_wks(format_out,file_out)
    353410   gsn_define_colormap(wks,"rainbow+white")
    354 
    355    temp=new((/dimt,dimz,dimx/),float)
    356411
    357412   n=0
     
    369424
    370425      if(check) then
    371      
    372          temp = f->$vNam(varn)$(start_time_step:end_time_step,0:dimz-1,:)
    373            
    374          a=getvardims(temp)
     426
     427         temp = f[:]->$vNam(varn)$
     428         data = temp(start_time_step:end_time_step,0:dimz-1,:)
     429
     430         temp_att = f_att->$vNam(varn)$
     431         a=getvardims(temp_att)
    375432         b=dimsizes(a)
    376433
    377434         if (height_level(0) .NE. -1)then
    378435            do te=0,dimz-1
    379                temp(:,te,:) = f->$vNam(varn)$(start_time_step:end_time_step,height_level(te),:)       
     436            print(height_level(te))
     437               data(:,te,:) = temp(start_time_step:end_time_step,height_level(te),:)           
    380438            end do
    381439         end if
    382440
    383          temp=temp/(normy*normx)  ;SMOOTHING: #temp=smth9(temp/norm, 0.50, -0.25, False)#
     441         data=data/(norm_y*norm_x)  ;SMOOTHING: #temp=smth9(temp/norm, 0.50, -0.25, False)#
    384442           
    385443         do i=0,b-1           
     
    402460            end if
    403461         end do 
    404 
     462         
     463         min_x=new(dimz,double)
     464         max_x=new(dimz,double)
     465         min_y=new(dimz,float)
     466         max_y=new(dimz,float)
     467         plot_h  = new(dimz,graphic)
     468         
    405469         if (isStrSubset(vNam(varn),"x"))then
    406             x_axis = f->k_x
    407             x_axis = x_axis/normx
    408             if (normx .NE. 1.)then
    409                res@tiXAxisString = "k_x / "+normx
     470            x_axis = new((/dimz,dimx/),double)
     471            do q=0,dimz-1
     472               x_axis(q,:) = f_att->k_x
     473               x_axis = x_axis/norm_x
     474            end do
     475            if (norm_x .NE. 1.)then
     476               res@tiXAxisString = "k~B~x~N~ ["+unit_x+"]"
    410477            else
    411                res@tiXAxisString = "k_x"
     478               if (norm_height .EQ. 1)then
     479                  res@tiXAxisString = "k~B~x~N~ x z [1]"
     480               else
     481                  res@tiXAxisString = "k~B~x~N~ [1/m]"
     482               end if
    412483            end if
     484            dim_r=dimx
    413485         else
    414             x_axis = f->k_y
    415             x_axis = x_axis/normx
    416             if (normx .NE. 1.)then
    417                res@tiXAxisString = "k_y / "+normx
     486            x_axis=new((/dimz,dimy/),double)
     487            do q=0,dimz-1
     488               x_axis(q,:) = f_att->k_y
     489               x_axis = x_axis/norm_x
     490            end do
     491            if (norm_x .NE. 1.)then
     492               res@tiXAxisString = "k~B~x~N~ ["+unit_x+"]"
    418493            else
    419                res@tiXAxisString = "k_y"
     494               if (norm_height .EQ. 1)then
     495                  res@tiXAxisString = "k~B~x~N~ x z [1]"
     496               else
     497                  res@tiXAxisString = "k~B~x~N~ [1/m]"
     498               end if
    420499            end if
     500            dim_r=dimy
    421501         end if
    422502       
    423503         if (sort .EQ. "time")
     504            res@xyLineColors = color
     505            res@pmLegendDisplayMode     = "Always"
     506            res@pmLegendSide            = "Top"
     507            res@pmLegendParallelPosF    = 1.2
     508            res@pmLegendOrthogonalPosF  = -1.0
     509            res@pmLegendWidthF          = 0.12
     510            res@pmLegendHeightF         = 0.04*(end_time_step-start_time_step+1)
    424511            do p=dimz-1,0,1
    425                if (logy .EQ. 1)then 
     512               if (log_y .EQ. 1)then 
    426513                  do q=0,dimt-1
    427                      do r=0,dimsizes(x_axis)-1
    428                         if (temp(q,p,r) .EQ. 0)then
     514                     do r=0,dim_r-1
     515                        if (data(q,p,r) .EQ. 0)then
    429516                           st=p+start_time_step
    430517                           print(" ")
     
    436523                  end do
    437524               end if
    438                res@trXMinF = min(x_axis)
    439                res@trXMaxF = max(x_axis)
    440525               res@gsnLeftString      = vNam(varn)
    441                res@gsnRightString     = "Height = "+z(p)+"m"
    442                if (normy .NE. 1.)then
    443                   res@tiYAxisString      = vNam(varn)+" / "+normy
    444                else
    445                   res@tiYAxisString      = vNam(varn)
    446                end if
    447                res@xyExplicitLegendLabels  = legend_label
    448                plot(n)  = gsn_csm_xy(wks,x_axis,temp(:,p,:),res)
     526               res@gsnRightString     = "Height = "+z(p)+"m"               
     527               res@tiYAxisString      = "["+unit_y+"]"           
     528               res@xyExplicitLegendLabels  = legend_label             
     529               if (norm_height .EQ. 1)then
     530                  data(:,p,:)=data(:,p,:)*doubletofloat(z(p))
     531                  x_axis(p,:) = x_axis(p,:)*z(p)
     532               end if
     533               res@trXMinF = min(x_axis(p,:))
     534               res@trXMaxF = max(x_axis(p,:))
     535               plot(n)  = gsn_csm_xy(wks,x_axis(p,:),data(:,p,:),res)
    449536               n=n+1
    450537            end do
     
    453540               do p=0,dimt-1           
    454541                  do q=0,dimz-1
    455                      do r=0,dimsizes(x_axis)-1
    456                         if (temp(p,q,r) .EQ. 0)then
     542                     do r=0,dim_r-1
     543                        if (data(p,q,r) .EQ. 0)then
    457544                           st=p+start_time_step
    458545                           print(" ")
     
    462549                        end if
    463550                     end do
    464                   end do
    465                   res@trXMinF = min(x_axis)
    466                   res@trXMaxF = max(x_axis)
    467                   res@gsnLeftString      = vNam(varn)
    468                   res@gsnRightString     = "Time = "+legend_label(p)+"h"
    469                   if (normy .NE. 1.)then
    470                      res@tiYAxisString      = vNam(varn)+" / "+normy
    471                   else
    472                      res@tiYAxisString      = vNam(varn)
    473                   end if
    474                   res@xyExplicitLegendLabels  = legend_label_z
    475                   plot(n)  = gsn_csm_xy(wks,x_axis,temp(p,:,:),res)
    476                   n=n+1
     551                     if (norm_height .EQ. 1 .AND. p .EQ. 0)then
     552                        data(p,q,:) = data(p,q,:)*doubletofloat(legend_label_z(q))
     553                        x_axis(q,:) = x_axis(q,:)*doubletofloat(legend_label_z(q))
     554                     end if
     555                     max_y(q)=max(data(p,q,:))
     556                     min_y(q)=min(data(p,q,:))
     557                     min_x(q)=min(x_axis(q,:))
     558                     max_x(q)=max(x_axis(q,:))                                   
     559                  end do
     560                  do q=0,dimz-1
     561                     res@xyLineColor = color(q)
     562                     if (dash .EQ. 1)then
     563                        res@xyDashPattern = q
     564                     end if
     565                     if (q .EQ. 0)then
     566                        res@tiYAxisString      = "["+unit_y+"]"                 
     567                        res@gsnLeftString      = vNam(varn)
     568                        res@gsnRightString     = "Time = "+legend_label(p)+"h"
     569                        res@trXMinF = min(min_x)
     570                        res@trXMaxF = max(max_x)
     571                        res@trYMinF = min(min_y)
     572                        res@trYMaxF = max(max_y)
     573                       
     574                        plot_h(q)  = gsn_csm_xy(wks,x_axis(q,:),data(p,q,:),res)
     575                       
     576                        lgres = True
     577                        if (dash .EQ. 0)then
     578                           lgres@lgMonoDashIndex = True
     579                        else
     580                           lgres@lgDashIndexes   = ispan(0,dimz-1,1)
     581                        end if
     582                        if (black .EQ. 1)then
     583                           lgres@lgMonoLineColors = True
     584                        else
     585                           lgres@lgLineColors = color
     586                        end if
     587                        lgres@lgTitleString = "Height [m]" 
     588                        lgres@lgLabelFont        = "helvetica"
     589                        lgres@lgLabelFontHeightF     = font_size_legend
     590                        lgres@lgTitleFontHeightF     = font_size     
     591                        lgres@vpWidthF           = 0.12           
     592                        lgres@vpHeightF          = font_size_legend/5*dimz           
     593 
     594                        lbid = gsn_create_legend(wks,dimz,legend_label_z,lgres)       
     595
     596                        amres = True
     597                        amres@amParallelPosF   = 0.75               
     598                        amres@amOrthogonalPosF = 0.15           
     599                        annoid1 = gsn_add_annotation(plot_h(q),lbid,amres)
     600                     else
     601                        plot_h(q)  = gsn_csm_xy(wks,x_axis(q,:),data(p,q,:),res)
     602                        overlay(plot_h(0),plot_h(q))
     603                     end if
     604                  end do             
     605                  plot(n)=plot_h(0)
     606                  n=n+1
    477607               end do
    478608            end if
    479609         end if
    480          delete(temp)
     610         delete(data)
     611         delete(temp)
    481612         delete(x_axis)
     613         delete(min_x)
     614         delete(max_x)
     615         delete(min_y)
     616         delete(max_y)
     617         delete(plot_h)
    482618      end if
    483619   end do
     
    497633   resP                        = True
    498634   resP@txFont                 = "helvetica"
    499    resP@txString               = f@title
     635   resP@txString               = f_att@title
    500636   resP@txFuncCode             = "~"
    501    resP@txFontHeightF          = 0.014
     637   resP@txFontHeightF          = 0.015
    502638
    503639   if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then
    504640      gsn_panel(wks,plot,(/n,1/),resP)
    505641   else   
    506       do i = 0,n-1, no_lines*no_columns
    507          if( (i+no_lines*no_columns) .gt. (n-1)) then
    508             gsn_panel(wks,plot(i:n-1),(/no_lines,no_columns/),resP)
     642      do i = 0,n-1, no_rows*no_columns
     643         if( (i+no_rows*no_columns) .gt. (n-1)) then
     644            gsn_panel(wks,plot(i:n-1),(/no_rows,no_columns/),resP)
    509645         else
    510            gsn_panel(wks,plot(i:i+no_lines*no_columns-1),(/no_lines,no_columns/),resP)
     646           gsn_panel(wks,plot(i:i+no_rows*no_columns-1),(/no_rows,no_columns/),resP)
    511647         end if
    512648      end do
  • palm/trunk/SCRIPTS/NCL/timeseries.ncl

    r194 r218  
    3333   ; set up default parameter values and strings
    3434   ;***************************************************
    35  
     35   
    3636   if (file_1 .EQ. "File in") then
    3737      print(" ")
    38       print("Please provide 1st input file 'file_1=' in 'ncl_preferences.ncl'")
     38      print("Declare input file 'file_1=' in 'ncl_preferences.ncl' or prompt")
    3939      print(" ")
    4040      exit
     
    4242      file_in = file_1   
    4343   end if
    44    if (.not. isfilepresent(file_in)) then
    45       print(" ")
    46       print("1st input file: '"+file_in+"' does not exist")
    47       print(" ")
    48       exit
    49    end if
    5044
    5145   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
     
    6155      print(" ")
    6256      over = 0
    63    end if   
     57   end if 
     58   
     59   if (norm_t .EQ. 0) then
     60      print(" ")
     61      print("Normalising with 0 is not allowed, 'norm_t' is set to 1.0")
     62      print(" ")
     63      norm_t = 1.0
     64   end if
    6465 
    6566
     
    6768   ; open input file
    6869   ;***************************************************
    69 
    70    f  = addfile(file_in , "r" )
    71 
    72    vNam  = getfilevarnames(f)
     70   
     71   file_in_1 = False
     72   if (isStrSubset(file_in, ".nc"))then
     73      start_f = -2
     74      end_f = -2
     75      file_in_1 = True     
     76   end if
     77
     78   if (start_f .EQ. -1)then
     79      print(" ")
     80      print("'start_f' must be one of the cyclic numbers (at least 0) of your input file(s)")
     81      print(" ") 
     82      exit
     83   end if
     84   if (end_f .EQ. -1)then
     85      print(" ")
     86      print("'end_f' must be one of the cyclic numbers (at least 0) of your input file(s)")
     87      print(" ") 
     88      exit
     89   end if
     90
     91   files=new(end_f-start_f+1,string)
     92
     93   if (file_in_1)then
     94      if (isfilepresent(file_in))then
     95         files(0)=file_in
     96      else
     97         print(" ")
     98         print("1st input file: '"+file_in+"' does not exist")
     99         print(" ")
     100         exit
     101      end if
     102   else   
     103      if (start_f .EQ. 0)then
     104         if (isfilepresent(file_in+".nc"))then
     105            files(0)=file_in+".nc"
     106            do i=1,end_f
     107               if (isfilepresent(file_in+"."+i+".nc"))then   
     108                  files(i)=file_in+"."+i+".nc"
     109               else
     110                  print(" ")
     111                  print("Input file: '"+file_in+"."+i+".nc' does not exist")
     112                  print(" ")
     113                  exit 
     114               end if       
     115            end do         
     116         else
     117            print(" ")
     118            print("Input file: '"+file_in+".nc' does not exist")
     119            print(" ")
     120            exit
     121         end if
     122      else
     123         do i=start_f,end_f
     124            if (isfilepresent(file_in+"."+i+".nc"))then   
     125               files(i-start_f)=file_in+"."+i+".nc"
     126            else
     127               print(" ")
     128               print("Input file: '"+file_in+"."+i+".nc' does not exist")
     129               print(" ")
     130               exit 
     131            end if
     132         end do
     133      end if
     134   end if
     135
     136   f=addfiles(files,"r")
     137   f_att=addfile(files(0),"r")
     138   ListSetType(f,"cat")
     139
     140   vNam=getfilevarnames(f_att)
     141
    73142   print(" ")
    74143   print("Variables in input file:")
     
    82151   end if
    83152
    84    t_all = f->time
     153   t_all = f[:]->time
    85154   nt  = dimsizes(t_all)
    86155   delta_t=t_all(nt-1)/nt
    87    
     156
    88157   ;****************************************************       
    89158   ; start of time step and different types of mistakes that could be done
     
    97166         print("'start_time_step' = "+ start_time_step +"h is equal or greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h")
    98167         print(" ")
    99          print("Please select another 'start_time_step'")
     168         print("Select another 'start_time_step'")
    100169         print(" ")
    101170         exit
     
    105174         print("'start_time_step' = "+ start_time_step +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
    106175         print(" ")
    107          print("Please select another 'start_time_step'")
     176         print("Select another 'start_time_step'")
    108177         print(" ")
    109178         exit
     
    123192      print("'start_time_step' = "+ start_time_step +"h is invalid")
    124193      print(" ")
    125       print("Please select another 'start_time_step'")
     194      print("Select another 'start_time_step'")
    126195      print(" ")
    127196      exit
     
    139208         print("'end_time_step' = "+end_time_step+ "h is lower or equal than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
    140209         print(" ")
    141          print("Please select another 'end_time_step'")
     210         print("Select another 'end_time_step'")
    142211         print(" ")
    143212         exit
     
    147216         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")
    148217         print(" ")
    149          print("Please select another 'end_time_step'") 
     218         print("Select another 'end_time_step'") 
    150219         print(" ")
    151220         exit
     
    155224         print("'end_time_step' = "+ end_time_step +"h is equal or lower than 'start_time_step' = "+start_time_step+"h")
    156225         print(" ")
    157          print("Please select another 'start_time_step' or 'end_time_step'")
     226         print("Select another 'start_time_step' or 'end_time_step'")
    158227         print(" ")
    159228         exit
     
    171240      print("'end_time_step' = "+ end_time_step +"h is invalid")
    172241      print(" ")
    173       print("Please select another 'end_time_step'")
     242      print("Select another 'end_time_step'")
    174243      print(" ")
    175244      exit
     
    186255   print(" ")
    187256
    188    t = f->time(start_time_step:end_time_step)
    189 
     257   t = t_all(start_time_step:end_time_step)/norm_t
    190258 
    191259   ; ***************************************************
     
    210278   res@xyLineColors            = (/237/)
    211279   
    212    res@lgLabelFontHeightF     = .02
     280   res@lgLabelFontHeightF     = 0.02
    213281
    214282   resP                        = True
    215283   resP@txFont                 = "helvetica"
    216    resP@txString               = f@title+" time series "
     284   resP@txString               = f_att@title+" time series "
    217285   resP@txFuncCode             = "~"
    218286   resP@txFontHeightF          = 0.015
     287
     288   res@tmXBMinorPerMajor = 4
     289   res@tmYLMinorPerMajor = 4
    219290
    220291   res@vpWidthF=4
     
    290361         count_var=count_var+1
    291362
    292          data_all = f ->$vNam(varn)$
    293          unit(varn) = data_all@units
     363         data_all = f[:]->$vNam(varn)$
     364         data_att = f_att->$vNam(varn)$
     365         unit(varn) = data_att@units
    294366               
    295367         data(varn,:)=data_all(start_time_step:end_time_step)
     
    303375               if (mini(varn) .EQ. maxi(varn)) then
    304376                  if (min(data(varn,:)) .EQ. 0)then
    305                      mini(varn)= mini(varn)-1.
    306                      maxi(varn)= maxi(varn)+1.
     377                     mini(varn)= mini(varn)-0.1
     378                     maxi(varn)= maxi(varn)+0.1
    307379                  end if
    308380                  if (min(data(varn,:)) .LT. 0)then
     
    322394               if (mini(varn) .EQ. maxi(varn)) then
    323395                  if (min(data(varn,:)) .EQ. 0)then
    324                      mini(varn)= mini(varn)-1.
    325                      maxi(varn)= maxi(varn)+1.
     396                     mini(varn)= mini(varn)-0.1
     397                     maxi(varn)= maxi(varn)+0.1
    326398                  end if
    327399                  if (min(data(varn,:)) .LT. 0)then
     
    341413               if (mini(varn) .EQ. maxi(varn)) then
    342414                  if (mini(varn) .EQ. 0)then
    343                      mini(varn)= mini(varn)-1.
    344                      maxi(varn)= maxi(varn)+1.
     415                     mini(varn)= mini(varn)-0.1
     416                     maxi(varn)= maxi(varn)+0.1
    345417                  end if
    346418                  if (mini(varn) .LT. 0)then
     
    360432               if (mini(varn) .EQ. maxi(varn)) then
    361433                  if (min(data(varn,:)) .EQ. 0)then
    362                      mini(varn)= mini(varn)-1.
    363                      maxi(varn)= maxi(varn)+1.
     434                     mini(varn)= mini(varn)-0.1
     435                     maxi(varn)= maxi(varn)+0.1
    364436                  end if
    365437                  if (min(data(varn,:)) .LT. 0)then
     
    379451               if (mini(varn) .EQ. maxi(varn)) then
    380452                  if (min(data(varn,:)) .EQ. 0)then
    381                      mini(varn)= mini(varn)-1.
    382                      maxi(varn)= maxi(varn)+1.
     453                     mini(varn)= mini(varn)-0.1
     454                     maxi(varn)= maxi(varn)+0.1
    383455                  end if
    384456                  if (min(data(varn,:)) .LT. 0)then
     
    398470               if (mini(varn) .EQ. maxi(varn)) then
    399471                  if (min(data(varn,:)) .EQ. 0)then
    400                      mini(varn)= mini(varn)-1.
    401                      maxi(varn)= maxi(varn)+1.
     472                     mini(varn)= mini(varn)-0.1
     473                     maxi(varn)= maxi(varn)+0.1
    402474                  end if
    403475                  if (min(data(varn,:)) .LT. 0)then
     
    417489               if (mini(varn) .EQ. maxi(varn)) then
    418490                  if (min(data(varn,:)) .EQ. 0)then
    419                      mini(varn)= mini(varn)-1.
    420                      maxi(varn)= maxi(varn)+1.
     491                     mini(varn)= mini(varn)-0.1
     492                     maxi(varn)= maxi(varn)+0.1
    421493                  end if
    422494                  if (min(data(varn,:)) .LT. 0)then
     
    459531      if(check) then
    460532
    461         if (isStrSubset(vNam(varn),"_0" ))then
     533        if (isStrSubset(vNam(varn),"_0 " ))then
    462534            print(" ")
    463535            print("If you have Outputs of statistic regions you cannot overlay variables; 'over' is set to 0")
     
    470542            res@gsnLeftString       = "overlayed plot"
    471543            res@gsnRightString      = unit(varn)
    472             res@tiXAxisString        = " time [s] "
    473             res@tiYAxisString        = " "
    474             res@tiXAxisFontHeightF   = 0.07
    475             res@txFontHeightF        = 0.07
    476             res@tiYAxisFontHeightF   = 0.07           
     544            if (norm_t .NE. 1.)then
     545               res@tiXAxisString        = "t ["+unit_t+"]"
     546            else
     547               res@tiXAxisString        = "t [s]"
     548            end if
     549            res@tiYAxisString = " "
     550            res@tiXAxisFontHeightF   = font_size
     551            res@txFontHeightF        = font_size
     552            res@tiYAxisFontHeightF   = font_size           
    477553
    478554            if (vNam(varn) .EQ. "E")
     
    11051181               if (min(data(varn,:)) .EQ. max(data(varn,:))) then
    11061182                  if (min(data(varn,:)) .EQ. 0)then
    1107                      res@trYMaxF = min(data(varn,:))-1.
    1108                      res@trYMinF = max(data(varn,:))+1.
     1183                     res@trYMaxF = min(data(varn,:))-0.1
     1184                     res@trYMinF = max(data(varn,:))+0.1
    11091185                  end if
    11101186                  if (min(data(varn,:)) .LT. 0)then
     
    11281204            res@gsnLeftString       = vNam(varn)
    11291205            res@gsnRightString      = unit(varn)
    1130             res@tiXAxisString        = " time [s] "
    1131             res@tiYAxisString        = " "
    1132             res@tiXAxisFontHeightF   = 0.07
    1133             res@txFontHeightF        = 0.07
    1134             res@tiYAxisFontHeightF   = 0.07
     1206            if (norm_t .NE. 1.)then
     1207               res@tiXAxisString        = "t ["+unit_t+"]"
     1208            else
     1209               res@tiXAxisString        = "t [s]"
     1210            end if
     1211            res@tiYAxisString = " "
     1212            res@tiXAxisFontHeightF   = font_size
     1213            res@txFontHeightF        = font_size
     1214            res@tiYAxisFontHeightF   = font_size
     1215            res@tmXBLabelFontHeightF = font_size
     1216            res@tmYLLabelFontHeightF = font_size
    11351217            res@trYMaxF        = min(data(varn,:))
    11361218            res@trYMinF        = max(data(varn,:))
    11371219            if (min(data(varn,:)) .EQ. max(data(varn,:))) then
    11381220               if (min(data(varn,:)) .EQ. 0)then
    1139                      res@trYMaxF = min(data(varn,:))-1.
    1140                      res@trYMinF = max(data(varn,:))+1.
     1221                     res@trYMaxF = min(data(varn,:))-0.1
     1222                     res@trYMinF = max(data(varn,:))+0.1
    11411223                  end if
    11421224                  if (min(data(varn,:)) .LT. 0)then
     
    11621244      gsn_panel(wks_ps,plot_ps(1:n),(/n,1/),resP)
    11631245   else
    1164       do np = 1,n,no_lines*no_columns   
    1165          if ( np + no_lines*no_columns .gt. n) then   
    1166             gsn_panel(wks_ps, plot_ps(np:n),(/no_lines,no_columns/),resP)
     1246      do np = 1,n,no_rows*no_columns   
     1247         if ( np + no_rows*no_columns .gt. n) then   
     1248            gsn_panel(wks_ps, plot_ps(np:n),(/no_rows,no_columns/),resP)
    11671249         else
    1168             gsn_panel(wks_ps, plot_ps(np:np+no_lines*no_columns-1),(/no_lines,no_columns/),resP)
     1250            gsn_panel(wks_ps, plot_ps(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),resP)
    11691251         end if
    11701252      end do
Note: See TracChangeset for help on using the changeset viewer.