Index: /palm/trunk/SCRIPTS/NCL/cross_sections.ncl
===================================================================
--- /palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 217)
+++ /palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 218)
@@ -37,5 +37,5 @@
    if (file_1 .EQ. "File in") then
       print(" ")
-      print("Please provide 1st input file 'file_1=' in 'ncl_preferences.ncl'")
+      print("Declare input file 'file_1=' in 'ncl_preferences.ncl' or prompt")
       print(" ")
       exit 
@@ -43,10 +43,4 @@
       file_in = file_1   
    end if
-   if (.not. isfilepresent(file_in)) then
-      print(" ")
-      print("1st input file: '"+file_in+"' does not exist")
-      print(" ")
-      exit
-   end if 
 
    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
@@ -73,5 +67,5 @@
    if (fill_mode .NE. "AreaFill" .AND. fill_mode .NE. "RasterFill" .AND. fill_mode .NE. "CellFill") then
       print(" ")
-      print("Your 'fill_mode'= "+fill_mode+" is invalid and set to 'AreaFill'")
+      print("'fill_mode'= "+fill_mode+" is invalid and set to 'AreaFill'")
       print(" ")
       fill_mode = "AreaFill"
@@ -108,5 +102,5 @@
    if (xyc .EQ. 0 .AND. xzc .EQ. 0 .AND. yzc .EQ. 0) then
       print(" ")
-      print("Please select one crossection (xyc=1 or xzc=1 or yzc=1)")
+      print("Select one crossection (xyc=1 or xzc=1 or yzc=1)")
       print(" ")
       exit
@@ -115,5 +109,5 @@
       if (xzc .EQ. 1 .OR. yzc .EQ. 1) then
          print(" ")
-         print("Please select just one crossection (xyc=1 or xzc=1 or yzc=1)")
+         print("Select just one crossection (xyc=1 or xzc=1 or yzc=1)")
          print(" ") 
          exit
@@ -123,5 +117,5 @@
       if (xyc .EQ. 1 .OR. yzc .EQ. 1) then
          print(" ")
-         print("Please select just one crossection (xyc=1 or xzc=1 or yzc=1)")
+         print("Select just one crossection (xyc=1 or xzc=1 or yzc=1)")
          print(" ")
          exit
@@ -131,5 +125,5 @@
       if (xyc .EQ. 1 .OR. xzc .EQ. 1) then
          print(" ")
-         print("Please select just one crossection (xyc=1 or xzc=1 or yzc=1)")
+         print("Select just one crossection (xyc=1 or xzc=1 or yzc=1)")
          print(" ")
          exit
@@ -139,16 +133,102 @@
    if (vector .NE. 0 .AND. vector .NE. 1) then
       print(" ")
-      print("Please set 'vector' to 0 or 1")
+      print("Set 'vector' to 0 or 1")
       print(" ")
       exit
-   end if   
+   end if  
+   
+   if (norm_x .EQ. 0) then 
+      print(" ")
+      print("Normalising with 0 is not allowed, 'norm_x' is set to 1.0")
+      print(" ")
+      norm_x = 1.0
+   end if
+   if (norm_y .EQ. 0) then 
+      print(" ")
+      print("Normalising with 0 is not allowed, 'norm_y' is set to 1.0")
+      print(" ")
+      norm_y = 1.0
+   end if 
+   if (norm_z .EQ. 0) then 
+      print(" ")
+      print("Normalising with 0 is not allowed, 'norm_z' is set to 1.0")
+      print(" ")
+      norm_z = 1.0
+   end if 
  
    ; ***************************************************
    ; open input file
    ; ***************************************************
-
-   f  = addfile( file_in, "r" )
-
-   vNam  = getfilevarnames(f) 
+   
+   file_in_1 = False
+   if (isStrSubset(file_in, ".nc"))then
+      start_f = -2
+      end_f = -2 
+      file_in_1 = True     
+   end if
+
+   if (start_f .EQ. -1)then
+      print(" ")
+      print("'start_f' must be one of the cyclic numbers (at least 0) of your input file(s)")
+      print(" ")  
+      exit
+   end if 
+   if (end_f .EQ. -1)then
+      print(" ")
+      print("'end_f' must be one of the cyclic numbers (at least 0) of your input file(s)")
+      print(" ")  
+      exit
+   end if 
+
+   files=new(end_f-start_f+1,string)
+
+   if (file_in_1)then
+      if (isfilepresent(file_in))then
+         files(0)=file_in
+      else
+         print(" ")
+         print("1st input file: '"+file_in+"' does not exist")
+         print(" ")
+         exit
+      end if
+   else   
+      if (start_f .EQ. 0)then
+         if (isfilepresent(file_in+".nc"))then
+            files(0)=file_in+".nc"
+            do i=1,end_f
+	       if (isfilepresent(file_in+"."+i+".nc"))then    
+                  files(i)=file_in+"."+i+".nc"
+	       else
+	          print(" ")
+                  print("Input file: '"+file_in+"."+i+".nc' does not exist")
+                  print(" ")
+                  exit  
+	       end if	    
+            end do         
+         else
+            print(" ")
+            print("Input file: '"+file_in+".nc' does not exist")
+            print(" ")
+            exit
+         end if
+      else
+         do i=start_f,end_f
+            if (isfilepresent(file_in+"."+i+".nc"))then    
+               files(i-start_f)=file_in+"."+i+".nc"
+	    else
+	       print(" ")
+               print("Input file: '"+file_in+"."+i+".nc' does not exist")
+               print(" ")
+               exit  
+	    end if
+         end do
+      end if
+   end if
+   
+   f=addfiles(files,"r")
+   f_att=addfile(files(0),"r")
+   ListSetType(f,"cat")
+
+   vNam  = getfilevarnames(f_att) 
    print(" ")
    print("Variables in input file:")
@@ -225,6 +305,5 @@
    else
       print(" ")
-      print("Your input file: '"+file_in+"'")
-      print("contains 3d or other data")
+      print("Your input file contains 3d or other data")
       print(" ")
    end if
@@ -242,4 +321,5 @@
 
    cs_res                          = True
+   vecres                          = True
    cs_res@gsnYAxisIrregular2Linear = True  
   
@@ -247,30 +327,26 @@
    cs_res@gsnFrame                = False
    cs_res@gsnMaximize             = True 
-   cs_res@gsnPaperOrientation     = "portrait"
-   cs_res@gsnPaperWidth           = 8.27
-   cs_res@gsnPaperHeight          = 11.69
-   cs_res@gsnPaperMargin          = 0.79
-   cs_res@tmXBLabelFontHeightF   = .03
-   cs_res@tmYLLabelFontHeightF   = .03
-   cs_res@tiXAxisFontHeightF     = .03
-   cs_res@tiYAxisFontHeightF     = .03
+   
+   cs_res@tmXBLabelFontHeightF   = font_size
+   cs_res@tmYLLabelFontHeightF   = font_size
+   cs_res@tiXAxisFontHeightF     = font_size
+   cs_res@tiYAxisFontHeightF     = font_size
    cs_res@tmXBMode                ="Automatic"
    cs_res@tmYLMode                ="Automatic"
-   cs_res@lgTitleFontHeightF     = .03 
-   cs_res@lgLabelFontHeightF     = .03
-   cs_res@txFontHeightF          = .03
+  
    cs_res@cnLevelSelectionMode    = "ManualLevels"
+   cs_res@lbLabelFontHeightF = font_size_legend
+   cs_res@lbLabelStride = legend_label_stride
+   
 
    cs_resP = True
-   cs_resP@txString               = f@title
+   cs_resP@txString               = f_att@title
    cs_resP@txFuncCode             = "~"         	
-   cs_resP@txFontHeightF          = .02
-   
+   cs_resP@txFontHeightF          = 0.015        
   
    if ( mode .eq. "Fill" ) then
       cs_res@cnFillOn             = True
       cs_res@gsnSpreadColors      = True
-      cs_res@cnFillMode           = fill_mode
-      cs_res@lbOrientation        = "Vertical"  	
+      cs_res@cnFillMode           = fill_mode	
       cs_res@cnLinesOn            = False	
       cs_res@cnLineLabelsOn       = False
@@ -280,6 +356,5 @@
       cs_res@cnFillOn             = True
       cs_res@gsnSpreadColors      = True
-      cs_res@cnFillMode           = fill_mode
-      cs_res@lbOrientation        = "Vertical"  
+      cs_res@cnFillMode           = fill_mode 
       cs_res@cnLinesOn            = True
       cs_res@cnLineLabelsOn       = True
@@ -290,5 +365,5 @@
    ; *********************************************
 
-   t_all = f->time
+   t_all = f[:]->time
    nt = dimsizes(t_all)
    delta_t = t_all(nt-1)/nt
@@ -305,5 +380,5 @@
          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")
          print(" ")
-         print("Please select another 'start_time_step'")
+         print("Select another 'start_time_step'")
          print(" ")
          exit
@@ -313,10 +388,10 @@
          print("'start_time_step' = "+ start_time_step +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
          print(" ")
-         print("Please select another 'start_time_step'")
+         print("Select another 'start_time_step'")
          print(" ")
          exit
       end if
    end if
-   do i=0,nt-1     
+   do i=0,nt-1    
       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
          st=i
@@ -329,5 +404,5 @@
       print("'start_time_step' = "+ start_time_step +"h is invalid")
       print(" ")
-      print("Please select another 'start_time_step'")
+      print("Select another 'start_time_step'")
       print(" ")
       exit
@@ -345,5 +420,5 @@
          print("'end_time_step' = "+end_time_step+ "h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
          print(" ")
-         print("Please select another 'end_time_step'")
+         print("Select another 'end_time_step'")
          print(" ")
          exit
@@ -353,5 +428,5 @@
          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")
          print(" ")
-         print("Please select another 'end_time_step'")  
+         print("Select another 'end_time_step'")  
          print(" ")
          exit
@@ -361,5 +436,5 @@
          print("'end_time_step' = "+ end_time_step +"h is lower than 'start_time_step' = "+start_time_step+"h")
          print(" ")
-         print("Please select another 'start_time_step' or 'end_time_step'")
+         print("Select another 'start_time_step' or 'end_time_step'")
          print(" ")
          exit
@@ -377,5 +452,5 @@
       print("'end_time_step' = "+ end_time_step +"h is invalid")
       print(" ")
-      print("Please select another 'end_time_step'")
+      print("Select another 'end_time_step'")
       print(" ")
       exit
@@ -401,5 +476,5 @@
       if (vec1 .EQ. "component1") then
          print(" ")
-         print("Please indicate Vector 1 ('vec1') for Vector-Plot or set 'vector' to 0")
+         print("Indicate Vector 1 ('vec1') for Vector-Plot or set 'vector' to 0")
          print(" ")
          exit
@@ -407,5 +482,5 @@
       if (vec2 .EQ. "component2") then
          print(" ")
-         print("Please indicate Vector 2 ('vec2') for Vector-Plot or set 'vector' to 0")
+         print("Indicate Vector 2 ('vec2') for Vector-Plot or set 'vector' to 0")
          print(" ")
          exit
@@ -424,5 +499,5 @@
       do varn=0,dim-1
          if (vNam(varn) .eq. "xu" .OR. vNam(varn) .eq. "x")then    
-            x_d     = f->$vNam(varn)$
+            x_d     = f_att->$vNam(varn)$
             xdim    = dimsizes(x_d)-1
             delta_x = x_d(1)-x_d(0)
@@ -432,5 +507,5 @@
       do varn=0,dim-1
          if (vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "y")then   
-            y_d     = f->$vNam(varn)$
+            y_d     = f_att->$vNam(varn)$
             ydim    = dimsizes(y_d)-1
             delta_y = y_d(1)-y_d(0)
@@ -440,5 +515,5 @@
       do varn=0,dim-1
          if (vNam(varn) .eq. "zu_3d" .OR. vNam(varn) .eq. "zw_3d")then
-            z_d     = f->$vNam(varn)$
+            z_d     = f_att->$vNam(varn)$
             zdim    = dimsizes(z_d)-1
             delta_z = 0
@@ -446,5 +521,5 @@
          else
             if (vNam(varn) .eq. "zu_xy" .OR. vNam(varn) .eq. "zw_xy") then
-               z_d     = f->$vNam(varn)$
+               z_d     = f_att->$vNam(varn)$
                zdim    = dimsizes(z_d)-1 
                delta_z = -1.d
@@ -460,5 +535,5 @@
       do varn=0,dim-1
          if (vNam(varn) .eq. "xu"  .OR. vNam(varn) .eq. "x") then 
-            x_d     = f->$vNam(varn)$
+            x_d     = f_att->$vNam(varn)$
             xdim    = dimsizes(x_d)-1
             delta_x = x_d(1)-x_d(0)
@@ -468,5 +543,5 @@
       do varn=0,dim-1   
          if (vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "zu" .OR. vNam(varn) .eq. "zu_3d" .or. vNam(varn) .eq. "zw_3d") then
-            z_d     = f->$vNam(varn)$
+            z_d     = f_att->$vNam(varn)$
             zdim    = dimsizes(z_d)-1 
             delta_z = z_d(1)-z_d(0)
@@ -476,5 +551,5 @@
       do varn=0,dim-1 
          if (vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "y") then
-            y_d     = f->$vNam(varn)$
+            y_d     = f_att->$vNam(varn)$
             ydim    = dimsizes(y_d)-1
             delta_y = y_d(1)-y_d(0)
@@ -482,5 +557,5 @@
          else
             if (vNam(varn) .eq. "y_xz" .or. vNam(varn) .eq. "yv_xz") then
-               y_d     = f->$vNam(varn)$
+               y_d     = f_att->$vNam(varn)$
                ydim    = dimsizes(y_d)-1 
                delta_y = -1.d
@@ -496,5 +571,5 @@
       do varn=0,dim-1  
          if (vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "y") then
-            y_d     = f->$vNam(varn)$
+            y_d     = f_att->$vNam(varn)$
             ydim    = dimsizes(y_d)-1
             delta_y = y_d(1)-y_d(0)
@@ -504,5 +579,5 @@
       do varn=0,dim-1 
          if (vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "zu" .OR. vNam(varn) .eq. "zu_3d" .or. vNam(varn) .eq. "zw_3d") then
-            z_d     = f->$vNam(varn)$
+            z_d     = f_att->$vNam(varn)$
             zdim    = dimsizes(z_d)-1 
             delta_z = z_d(1)-z_d(0)
@@ -512,5 +587,5 @@
       do varn=0,dim-1 
          if (vNam(varn) .eq. "xu" .or. vNam(varn) .eq. "x")
-            x_d     = f->$vNam(varn)$
+            x_d     = f_att->$vNam(varn)$
             xdim    = dimsizes(x_d)-1 
             delta_x = x_d(1)-x_d(0)
@@ -518,5 +593,5 @@
          else
             if (vNam(varn) .eq. "xu_yz" .or. vNam(varn) .eq. "x_yz" ) then
-               x_d     = f->$vNam(varn)$
+               x_d     = f_att->$vNam(varn)$
                xdim    = dimsizes(x_d)-1 
                delta_x = -1.d
@@ -848,20 +923,53 @@
       end do 
    end if
-   
+  
    if( shape .eq. 1 ) then 
       if (xyc .EQ. 1)then
          cs_res@vpWidthF    = (xe-xs)/(ye-ys)        
          cs_res@vpHeightF   = 1
+	 vecres@vpWidthF    = (xe-xs)/(ye-ys)        
+         vecres@vpHeightF   = 1
+	 if (xe-xs .GT. ye-ys)then
+	    cs_res@gsnPaperOrientation     = "landscape"
+	    vecres@gsnPaperOrientation     = "landscape"
+	    cs_res@lbOrientation = "Horizontal"   
+	 else
+	    cs_res@gsnPaperOrientation     = "portrait"
+	    vecres@gsnPaperOrientation     = "portrait"
+	    cs_res@lbOrientation = "Vertical" 
+	 end if
       end if
       if (xzc .EQ. 1)then
          cs_res@vpWidthF    = (xe-xs)/(delta_x*(ze-zs))        
          cs_res@vpHeightF   = 1
+	 vecres@vpWidthF    = (xe-xs)/(delta_x*(ze-zs))        
+         vecres@vpHeightF   = 1
+	 if (xe-xs .GT. (delta_x*(ze-zs)))then
+	    cs_res@gsnPaperOrientation     = "landscape"
+	    vecres@gsnPaperOrientation     = "landscape"
+	    cs_res@lbOrientation = "Horizontal"   
+	 else
+	    cs_res@gsnPaperOrientation     = "portrait"
+	    vecres@gsnPaperOrientation     = "portrait"
+	    cs_res@lbOrientation = "Vertical" 
+	 end if
       end if
       if (yzc .EQ. 1)then
          cs_res@vpWidthF    = (ye-ys)/(delta_y*(ze-zs))        
          cs_res@vpHeightF   = 1
-      end if
-   end if
-   
+	 vecres@vpWidthF    = (ye-ys)/(delta_y*(ze-zs))        
+         vecres@vpHeightF   = 1
+	 if (ye-ys .GT. (delta_y*(ze-zs)))then
+            cs_res@gsnPaperOrientation     = "landscape"
+	    vecres@gsnPaperOrientation     = "landscape"
+	    cs_res@lbOrientation = "Horizontal"   
+	 else
+	    cs_res@gsnPaperOrientation     = "portrait"
+	    vecres@gsnPaperOrientation     = "portrait"
+	    cs_res@lbOrientation = "Vertical" 
+	 end if
+      end if
+   end if
+
    delete(xs)
    delete(xe)   
@@ -874,4 +982,178 @@
    ye=yend
 
+   if (xyc .EQ. 1) then
+      d=(ye-ys+1)/(major_ticks_y-1)
+      e=(xe-xs+1)/(major_ticks_x-1)
+      array_yl       =new(major_ticks_y,integer)
+      array_yl_labels=new(major_ticks_y,double)
+      array_minor_yl =new((major_ticks_y-1)*4,double)
+      array_xb       =new(major_ticks_x,integer)
+      array_xb_labels=new(major_ticks_x,double)
+      array_minor_xb =new((major_ticks_x-1)*4,double)
+      array_yl(0)=ys
+      array_xb(0)=xs
+      array_yl_labels(0)=y_d(ys)
+      array_xb_labels(0)=x_d(xs)
+      do ar=1,major_ticks_y-1
+         array_yl(ar)=d*(ar-1)+d-1
+	 array_yl_labels(ar) = y_d(array_yl(ar))
+	 if (ar .GT. 0)
+	    do min_ar=0,3
+	       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)
+	    end do 
+	 end if	 
+      end do 
+      do br=1,major_ticks_x-1
+         array_xb(br)=e*(br-1)+e-1 
+	 array_xb_labels(br) = x_d(array_xb(br)) 
+	 if (br .GT. 0)
+	    do min_br=0,3
+	       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)
+	    end do 
+	 end if	
+      end do 
+   end if
+ 
+   if (xzc .EQ. 1) then
+      d=(ze-zs+1)/(major_ticks_y-1)
+      e=(xe-xs+1)/(major_ticks_x-1)
+      array_yl       =new(major_ticks_y,integer)
+      array_yl_labels=new(major_ticks_y,double)
+      array_minor_yl =new((major_ticks_y-1)*4,double)
+      array_xb       =new(major_ticks_x,integer)
+      array_xb_labels=new(major_ticks_x,double)
+      array_minor_xb =new((major_ticks_x-1)*4,double)
+      array_yl(0)=zs
+      array_xb(0)=xs
+      array_yl_labels(0)=z_d(zs)
+      array_xb_labels(0)=x_d(xs)
+      do ar=1,major_ticks_y-1
+         array_yl(ar)=d*(ar-1)+d-1
+	 array_yl_labels(ar) = z_d(array_yl(ar))
+	 if (ar .GT. 0)
+	    do min_ar=0,3
+	       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)
+	    end do 
+	 end if	 
+      end do 
+      do br=1,major_ticks_x-1
+         array_xb(br)=e*(br-1)+e-1 
+	 array_xb_labels(br) = x_d(array_xb(br)) 
+	 if (br .GT. 0)
+	    do min_br=0,3
+	       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)
+	    end do 
+	 end if	
+      end do 
+   end if
+
+   if (yzc .EQ. 1) then
+      d=(ze-zs+1)/(major_ticks_y-1)
+      e=(ye-ys+1)/(major_ticks_x-1)
+      array_yl       =new(major_ticks_y,integer)
+      array_yl_labels=new(major_ticks_y,double)
+      array_minor_yl =new((major_ticks_y-1)*4,double)
+      array_xb       =new(major_ticks_x,integer)
+      array_xb_labels=new(major_ticks_x,double)
+      array_minor_xb =new((major_ticks_x-1)*4,double)
+      array_yl(0)=zs
+      array_xb(0)=ys
+      array_yl_labels(0)=z_d(zs)
+      array_xb_labels(0)=y_d(ys)
+      do ar=1,major_ticks_y-1
+         array_yl(ar)=d*(ar-1)+d-1
+	 array_yl_labels(ar) = y_d(array_yl(ar))
+	 if (ar .GT. 0)
+	    do min_ar=0,3
+	       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)
+	    end do 
+	 end if	 
+      end do 
+      do br=1,major_ticks_x-1
+         array_xb(br)=e*(br-1)+e-1 
+	 array_xb_labels(br) = x_d(array_xb(br)) 
+	 if (br .GT. 0)
+	    do min_br=0,3
+	       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)
+	    end do 
+	 end if	
+      end do
+   end if
+
+   if (axes_explicit .EQ. 1)then
+      cs_res@tmYLMode = "Explicit"
+      cs_res@tmXBMode = "Explicit"
+      cs_res@tmYLValues = array_yl
+      if (xyc .EQ. 1)then
+         cs_res@tmYLLabels = array_yl_labels/norm_y
+	 cs_res@tmXBLabels = array_xb_labels/norm_x
+	 if (norm_x .NE. 1.)then
+	    cs_res@tiXAxisString = "x ["+unit_x+"]"
+	 else
+	    cs_res@tiXAxisString = "x [m]"
+	 end if 
+	 if (norm_y .NE. 1.)then
+            cs_res@tiYAxisString = "y ["+unit_y+"]"
+	 else
+	    cs_res@tiYAxisString = "y [m]"
+	 end if   
+      end if
+      if (xzc .EQ. 1)then
+         cs_res@tmYLLabels = array_yl_labels/norm_z
+	 cs_res@tmXBLabels = array_xb_labels/norm_x
+	 if (norm_x .NE. 1.)then
+	    cs_res@tiXAxisString = "x ["+unit_x+"]"
+	 else
+	    cs_res@tiXAxisString = "x [m]"
+	 end if 
+	 if (norm_z .NE. 1.)then
+            cs_res@tiYAxisString = "z ["+unit_z+"]"
+	 else
+	    cs_res@tiYAxisString = "z [m]"
+	 end if
+      end if
+      if (yzc .EQ. 1)then
+         cs_res@tmYLLabels = array_yl_labels/norm_z
+	 cs_res@tmXBLabels = array_xb_labels/norm_y
+	 if (norm_y .NE. 1.)then
+	    cs_res@tiXAxisString = "y ["+unit_y+"]"
+	 else
+	    cs_res@tiXAxisString = "y [m]"
+	 end if 
+	 if (norm_z .NE. 1.)then
+            cs_res@tiYAxisString = "z ["+unit_z+"]"
+	 else
+	    cs_res@tiYAxisString = "z [m]"
+	 end if
+      end if
+      cs_res@tmXBValues = array_xb      
+      cs_res@tmYLMinorValues = array_minor_yl
+      cs_res@tmXBMinorValues = array_minor_xb
+   else 
+      if (axes_explicit .EQ. 0)then  
+         cs_res@tmYLMinorPerMajor = 4
+         cs_res@tmXBMinorPerMajor = 4
+      else
+         print(" ")
+	 print("'axes_explicit' is invalid and set to 0")
+	 print(" ")
+	 axes_explicit = 0
+	 cs_res@tmYLMinorPerMajor = 4
+         cs_res@tmXBMinorPerMajor = 4
+      end if
+      if (xyc .EQ. 1)then
+         cs_res@tiXAxisString = "x [gridpoints]"
+         cs_res@tiYAxisString = "y [gridpoints]"
+      end if
+      if (xzc .EQ. 1)then
+         cs_res@tiXAxisString = "x [gridpoints]"
+         cs_res@tiYAxisString = "z [gridpoints]"
+      end if
+      if (yzc .EQ. 1)then
+         cs_res@tiXAxisString = "y [gridpoints]"
+         cs_res@tiYAxisString = "z [gridpoints]"
+      end if
+   end if
+
    if (xyc .EQ. 1 .OR. xzc .EQ.1)then
       if (xe .EQ. xs+1) then
@@ -916,5 +1198,6 @@
 
    MinVal = new(dim,float)
-   MaxVal = new(dim,float) 
+   MaxVal = new(dim,float)
+   unit   = new(dim,string) 
 
    ; ****************************************************
@@ -980,11 +1263,17 @@
 
          if (xyc .EQ. 1) then
-            data(varn,:,:,:,:)=f->$vNam(varn)$(:,zs:ze,ys:ye,xs:xe) 	
+	    temp = f[:]->$vNam(varn)$
+	    data_att = f_att->$vNam(varn)$
+            data(varn,:,:,:,:)=temp(:,zs:ze,ys:ye,xs:xe) 	    	
          end if
          if ( xzc .eq. 1 ) then
-            data(varn,:,:,:,:)=f->$vNam(varn)$(:,zs:ze,ys:ye,xs:xe) 
+	    temp = f[:]->$vNam(varn)$
+	    data_att = f_att->$vNam(varn)$
+            data(varn,:,:,:,:)=temp(:,zs:ze,ys:ye,xs:xe) 
          end if
          if ( yzc .eq. 1) then
-            data(varn,:,:,:,:)=f->$vNam(varn)$(:,zs:ze,ys:ye,xs:xe) 
+	    temp = f[:]->$vNam(varn)$
+	    data_att = f_att->$vNam(varn)$
+            data(varn,:,:,:,:)=temp(:,zs:ze,ys:ye,xs:xe) 
          end if
          if (check_vec1) then
@@ -1003,4 +1292,6 @@
          MinVal(varn) = min(data(varn,:,:,:,:))
          MaxVal(varn) = max(data(varn,:,:,:,:))
+	 
+	 unit(varn) = data_att@units
 
       end if
@@ -1075,6 +1366,10 @@
    gsn_define_colormap(wks_ps,"rainbow+white")
 
-   plot=new((/no_time*no_layer*no_var/),graphic)
- 
+   if (vector .EQ. 1 .AND. plotvec .EQ. "plotvec") then
+      plot=new((/no_time*no_layer*no_var+no_time*no_layer/),graphic)
+   else
+      plot=new((/no_time*no_layer*no_var/),graphic)
+   end if
+
    page = 0
    n=0
@@ -1090,5 +1385,25 @@
       do lo = los, loe           				
          do li = lis, lie
-            level = "=" + data&z(lo) + "m" 	  
+	    if (xyc .EQ. 1)then
+	       if (sort .EQ. "time")then
+                  level = "z=" + z_d(lo) + "m"
+	       else
+	          level = "z=" + z_d(li) + "m"
+	       end if
+	    end if
+	    if (xzc .EQ. 1)then
+	       if (sort .EQ. "time")then
+                  level = "y=" + y_d(lo) + "m" 
+	       else
+	          level = "y=" + y_d(li) + "m"
+	       end if
+	    end if
+	    if (yzc .EQ. 1)then
+	       if (sort .EQ. "time")then
+                  level = "x=" + x_d(lo) + "m" 
+	       else
+	          level = "x=" + x_d(li) + "m" 
+	       end if
+	    end if	    	  
             vecres                  = True            ; vector only resources
             vecres@gsnDraw          = False           ; don't draw
@@ -1098,7 +1413,35 @@
   	    vecres@vcRefLengthF     = 0.05            ; define length of vec ref
   	    vecres@gsnRightString   = "Vector plot of "+vec1+" and "+vec2
-            vecres@gsnLeftString = "t=" + data&t(li) +"s  z"+level 
-  	    vecres@tiXAxisString    = " "                                                
-            plot(n) = gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
+	    vecres@tmXBLabelFontHeightF   = font_size
+            vecres@tmYLLabelFontHeightF   = font_size
+            vecres@tiXAxisFontHeightF     = font_size
+            vecres@tiYAxisFontHeightF     = font_size
+	    if (sort .EQ. "time")then
+               vecres@gsnLeftString = "t=" + decimalPlaces(t_all(li)/3600,2,True) +"h   "+level	
+	    else
+	       vecres@gsnLeftString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) +"h   "+level	
+	    end if
+	    vecres@tiXAxisString    = " " 
+	    if (xyc .EQ. 1)then  
+	       if (sort .EQ. "time")then                                          
+                  plot(n) = gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
+	       else
+	          plot(n) = gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres)
+	       end if
+	    end if
+	    if (xzc .EQ. 1) then
+	       if (sort .EQ. "time")then 
+	          plot(n) = gsn_csm_vector(wks_ps,vect1(li,:,lo,:),vect2(li,:,lo,:),vecres)
+	       else
+	          plot(n) = gsn_csm_vector(wks_ps,vect1(lo,:,li,:),vect2(lo,:,li,:),vecres)
+	       end if
+	    end if
+	    if (yzc .EQ. 1) then
+	       if (sort .EQ. "time")then 
+	          plot(n) = gsn_csm_vector(wks_ps,vect1(li,:,:,lo),vect2(li,:,:,lo),vecres)
+	       else
+	          plot(n) = gsn_csm_vector(wks_ps,vect1(lo,:,:,li),vect2(lo,:,:,li),vecres)
+	       end if
+	    end if
             n=n+1
          end do
@@ -1123,5 +1466,5 @@
     
       if(check) then
-   
+
          space=(MaxVal(varn)-MinVal(varn))/24
   
@@ -1144,18 +1487,17 @@
 
                if ( xyc .eq. 1 ) then 
-                
-                  cs_res@tiXAxisString = "x [m]"
-                  cs_res@tiYAxisString = "y [m]"
+          
                   cs_res@gsnLeftString = "Plot of "+vNam(varn)
+		  cs_res@gsnRightString = unit(varn)
                   
                   if ( sort .eq. "time" ) then
-                     if ( data&z(lo) .eq. -1)then
+                     if ( z_d(lo) .eq. -1)then
 		        if (delta_z .EQ. -1) then
                            level = "-average"
 			else
-			   level = "=" + data&z(lo) + "m"
+			   level = "=" + z_d(lo) + "m"
 			end if
                      else 
-                        level = "=" + data&z(lo) + "m"
+                        level = "=" + z_d(lo) + "m"
                      end if
                      cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) +"h  z"+level		     
@@ -1177,12 +1519,12 @@
                  
                   if ( sort .eq. "layer" ) then
-		     if (data&z(li) .eq. -1) then
+		     if (z_d(li) .eq. -1) then
 		        if (delta_z .EQ. -1) then
                            level = "-average"
 			else
-			   level = "=" + data&z(li) + "m"
+			   level = "=" + z_d(li) + "m"
 			end if
                      else 
-                        level = "=" + data&z(li) + "m"
+                        level = "=" + z_d(li) + "m"
                      end if 
                      cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h  z"+ level		
@@ -1209,16 +1551,14 @@
 
                if ( xzc .eq. 1 ) then
-        
-                  cs_res@tiXAxisString   = "x [m]"
-                  cs_res@tiYAxisString   = "z [m]"
+                  
 		  cs_res@gsnLeftString = "Plot of "+vNam(varn)
                
                   if ( sort .eq. "time" ) then
-                     if ( data&y(lo) .eq. -1 ) then
+                     if ( y_d(lo) .eq. -1 ) then
                         level = "-average"
                      else 
-                        level = "=" + data&y(lo) + "m"
+                        level = "=" + y_d(lo) + "m"
                      end if
-                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "s  y"+ level
+                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "h  y"+ level
                      plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,lo,:),cs_res)
                      if (vector .EQ. 1 .AND. check_vecp) then
@@ -1232,5 +1572,5 @@
   			vecres@gsnLeftString    = " "             ; turn off left string
   			vecres@tiXAxisString    = " "   
-                        plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
+                        plot_vec=gsn_csm_vector(wks_ps,vect1(li,:,lo,:),vect2(li,:,lo,:),vecres)
                         overlay(plot(n), plot_vec)
                      end if
@@ -1238,10 +1578,10 @@
 
                   if ( sort .eq. "layer" ) then
-                     if ( data&y(li) .eq. -1 ) then
+                     if ( y_d(li) .eq. -1 ) then
                         level = "-average"
                      else 
-                        level = "=" + data&y(li) + "m"
+                        level = "=" + y_d(li) + "m"
                      end if
-                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "s  y"+ level
+                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h  y"+ level
                      plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,li,:),cs_res)
                      if (vector .EQ. 1 .AND. check_vecp) then
@@ -1255,5 +1595,5 @@
   			vecres@gsnLeftString    = " "             ; turn off left string
   			vecres@tiXAxisString    = " "   
-                        plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres)
+                        plot_vec=gsn_csm_vector(wks_ps,vect1(lo,:,li,:),vect2(lo,:,li,:),vecres)
                         overlay(plot(n), plot_vec)
                      end if
@@ -1266,16 +1606,14 @@
 
                if ( yzc .eq. 1 ) then
-               
-                  cs_res@tiXAxisString   = "y [m]"
-                  cs_res@tiYAxisString   = "z [m]"
+                                  
 		  cs_res@gsnLeftString = "Plot of "+vNam(varn)
 
                   if ( sort .eq. "time" ) then
-                     if ( data&x(lo) .eq. -1 ) then
+                     if ( x_d(lo) .eq. -1 ) then
                         level = "-average"
                      else 
-                        level = "=" + data&x(lo) + "m"
+                        level = "=" + x_d(lo) + "m"
                      end if
-                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "s  x"+ level
+                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "h  x"+ level
                      plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,:,lo),cs_res)
     	             if (vector .EQ. 1 .AND. check_vecp) then
@@ -1289,5 +1627,5 @@
   			vecres@gsnLeftString    = " "             ; turn off left string
   			vecres@tiXAxisString    = " "   
-                        plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres)
+                        plot_vec=gsn_csm_vector(wks_ps,vect1(li,:,:,lo),vect2(li,:,:,lo),vecres)
                         overlay(plot(n), plot_vec)
                      end if
@@ -1295,10 +1633,10 @@
 
                   if ( sort .eq. "layer" ) then
-                     if ( data&x(li) .eq. -1 ) then
+                     if ( x_d(li) .eq. -1 ) then
                         level = "-average"
                      else 
-                        level = "=" + data&x(li) + "m"
+                        level = "=" + x_d(li) + "m"
                      end if
-                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "s  x"+ level
+                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h  x"+ level
                      plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,:,li),cs_res)
                      if (vector .EQ. 1 .AND. check_vecp)then
@@ -1312,10 +1650,10 @@
   			vecres@gsnLeftString    = " "             ; turn off left string
   			vecres@tiXAxisString    = " "   
-                        plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres)
+                        plot_vec=gsn_csm_vector(wks_ps,vect1(lo,:,:,li),vect2(lo,:,:,li),vecres)
                         overlay(plot(n), plot_vec)
                      end if 
                   end if
                end if	      
-               n=n+1   
+               n=n+1  
             end do 	
          end do  
@@ -1334,13 +1672,13 @@
          print(" ")
       else
-         do np = 0,no_layer*no_time*(no_var+1)-1,no_lines*no_columns   
-            if ( np + no_lines*no_columns .gt. (no_layer*no_time*(no_var+1))-1) then 
-               gsn_panel(wks_ps, plot(np:(no_layer*no_time*(no_var+1))-1),(/no_lines,no_columns/),cs_resP)
+         do np = 0,no_layer*no_time*(no_var+1)-1,no_rows*no_columns   
+            if ( np + no_rows*no_columns .gt. (no_layer*no_time*(no_var+1))-1) then 
+               gsn_panel(wks_ps, plot(np:(no_layer*no_time*(no_var+1))-1),(/no_rows,no_columns/),cs_resP)
             else
-               gsn_panel(wks_ps, plot(np:np+no_lines*no_columns-1),(/no_lines,no_columns/),cs_resP)
+               gsn_panel(wks_ps, plot(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),cs_resP)
             end if
          end do
       end if
-   else          
+   else        
       if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then
          gsn_panel(wks_ps,plot(0:(no_time*no_layer*no_var)-1),(/no_var,no_layer*no_time/),cs_resP)
@@ -1349,9 +1687,9 @@
          print(" ")
       else
-         do np = 0,no_layer*no_time*no_var-1,no_lines*no_columns   
-            if ( np + no_lines*no_columns .gt. (no_layer*no_time*no_var)-1) then
-               gsn_panel(wks_ps, plot(np:(no_layer*no_time*no_var)-1),(/no_lines,no_columns/),cs_resP)
+         do np = 0,no_layer*no_time*no_var-1,no_rows*no_columns   
+            if ( np + no_rows*no_columns .gt. (no_layer*no_time*no_var)-1) then
+               gsn_panel(wks_ps, plot(np:(no_layer*no_time*no_var)-1),(/no_rows,no_columns/),cs_resP)
             else
-               gsn_panel(wks_ps, plot(np:np+no_lines*no_columns-1),(/no_lines,no_columns/),cs_resP)
+               gsn_panel(wks_ps, plot(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),cs_resP)
             end if
          end do
Index: /palm/trunk/SCRIPTS/NCL/ncl_preferences.ncl
===================================================================
--- /palm/trunk/SCRIPTS/NCL/ncl_preferences.ncl	(revision 217)
+++ /palm/trunk/SCRIPTS/NCL/ncl_preferences.ncl	(revision 218)
@@ -16,7 +16,12 @@
       ; REQUIRED --file_1-- INPUT FILE
       ;
-      ; input file produced by PALM; please declare path and name
-      ;
-      ; data type: string
+      ; input file produced by PALM; if there is more than one file for all timesteps of a job chain, 
+      ; 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'); 
+      ; otherwise declare path and full file name
+      ;
+      ; data type: string
+      ;
+      ; example: file_1 = "/path_to_file/file_xy_av"      if you use more than one cycle number
+      ;          file_1 = "/path_to_file/file_xy_av.4.nc" if you use one file (e.g. with cycle number 4)
       ;
       ; default:   "File in" 
@@ -25,14 +30,54 @@
 
 
-         file_1 = "File in" 
-	 
-	 
-      end if
-      ;***************************************************
-      ; REQUIRED --xyc, xzc, yzc-- SECTION of XY or XZ or YZ
+         file_1 = "file_1" 
+	 
+	 
+      end if
+      ;***************************************************
+      ; REQUIRED if more than one file of a job chain --start_f-- START OF CYCLIC NUMBER
+      ;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; example:   start_f = 3 (if first file: example_ts.3.nc)
+      ;
+      ; default:   -1  
+      ;***************************************************
+      if (.not. isvar("start_f"))then  
+      
+          
+         start_f = -1
+	 
+	 
+      end if 
+      ;***************************************************
+      ; REQUIRED if more than one file of a job chain --end_f-- END OF CYCLIC NUMBER
+      ;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; example:   end_f = 48 (if last file: example_ts.48.nc)
+      ;
+      ; default:   -1  
+      ;***************************************************
+      if (.not. isvar("end_f"))then  
+      
+          
+         end_f = -1
+	 
+	 
+      end if
+      ;***************************************************
+      ; REQUIRED --xyc--xzc--yzc-- SELECTION of XY or XZ or YZ CROSS SECTIONS
       ;
       ; desired section has to be set to 1; e.g.: xyc=1, xzc=0 and yzc=0 for xy-section
       ;
       ; data type: integer
+      ;
+      ; example: xyc = 1
+      ;	         xzc = 0
+      ;	         yzc = 0
       ;
       ; default:   0
@@ -56,7 +101,9 @@
       ; OPTIONAL --format_out-- OUTPUT FORMAT
       ;
-      ; supported file formats: x11, pdf, ps, eps, epsi or ncgm 
-      ;
-      ; data type: string
+      ; format of the output file; supported file formats: x11, pdf, ps, eps, epsi or ncgm 
+      ;
+      ; data type: string
+      ;
+      ; example: format_out = "pdf"
       ;
       ; default:   "x11" 
@@ -72,7 +119,9 @@
       ; OPTIONAL --file_out-- OUTPUT FILE
       ;
-      ; please declare path and name 
-      ;
-      ; data type: string
+      ; path and name of the output file
+      ;
+      ; data type: string
+      ;
+      ; example: file_out = "/home/path_to_output/test_cs"
       ;
       ; default:   "~/test_cs" 
@@ -86,9 +135,11 @@
       end if	 
       ;***************************************************
-      ; OPTIONAL --no_columns-- NUMBER OF ROWS
+      ; OPTIONAL --no_columns-- NUMBER OF COLUMNS
       ;
       ; number of plots in one row 
       ;
       ; data type: integer
+      ; 
+      ; example: no_columns = 1
       ;
       ; default:   1
@@ -102,16 +153,18 @@
       end if	 
       ;***************************************************
-      ; OPTIONAL --no_lines-- NUMBER OF COLUMNS
+      ; OPTIONAL --no_rows-- NUMBER OF ROWS
       ;
       ; number of plots in one column 
       ;
       ; data type: integer
+      ; 
+      ; example: no_rows = 2
       ;
       ; default:   2 
       ;***************************************************
-      if(.not. isvar("no_lines"))then	 
-      
-      
-         no_lines = 2
+      if(.not. isvar("no_rows"))then	 
+      
+      
+         no_rows = 2
 	 
 	 
@@ -124,4 +177,6 @@
       ; data type: string
       ;
+      ; example: sort = "layer"
+      ;
       ; default:   "layer" 
       ;***************************************************
@@ -136,10 +191,11 @@
       ; OPTIONAL --var-- OUTPUT VARIABLES
       ;
-      ; names of output variables; please inidcate them with one comma before and after each variable;
-      ; e.g.: var=",u,v,w," (the windcomponents u, v and w will be plotted)
+      ; names of output variables; inidcate them with one comma before and after each variable
       ;
       ; data type: string 
-      ;
-      ; default:   "all" (all available variables will be plotted)
+      ; 
+      ; example: var = ",u,v,w"
+      ;
+      ; default:   "all" (all available variables are plotted)
       ;***************************************************
       if(.not. isvar("var"))then
@@ -153,9 +209,11 @@
       ; OPTIONAL --start_time_step-- FIRST TIME STEP
       ;
-      ; first time step of plot; you don't have to specify a precise time value from the input file,
-      ; it will be rounded to the next existent time step
+      ; first time step of plot; there is no need to specify a precise time value from the input file,
+      ; 'start_time_step' is rounded to the next existent time step
       ;
       ; data type: double; dimension: [hour]
       ;
+      ; example:   start_time_step = 0.5 
+      ;
       ; default:   -1.d (first available time step)
       ;***************************************************
@@ -170,9 +228,11 @@
       ; OPTIONAL --end_time_step-- LAST TIME STEP
       ;
-      ; last time step of plot; you don't have to specify a precise time value from the input file,
-      ; it will be rounded to the next existent time step
+      ; last time step of plot; there is no need to specify a precise time value from the input file,
+      ; 'end_time_step' is rounded to the next existent time step
       ;
       ; data type: double; dimension: [hour]
       ;
+      ; example:   end_time_step = 2.0
+      ;
       ; default:   -1.d (last available time step)
       ;***************************************************
@@ -188,9 +248,10 @@
       ;
       ; value for minimum of x-axis, selectable if there are NO preseted layers for x (as for XY or XZ 2D-DATA);
-      ; you don't have to specify a precise meter value from the input file, it will be rounded to the next 
-      ; existent value
+      ; there is no need to specify a precise meter value from the input file, it is rounded to the next existent value
       ;
       ; data type: double; dimension: [meter]
       ;
+      ; example: xs = 150.0
+      ;
       ; default:   -1.d (minimum of range)
       ;***************************************************
@@ -206,9 +267,10 @@
       ;
       ; value for maximum of x-axis, selectable if there are NO preseted layers for x (as for XY or XZ 2D-DATA);
-      ; you don't have to specify a precise meter value from the input file, it will be rounded to the next 
-      ; existent value
+      ; there is no need to specify a precise meter value from the input file, it is rounded to the next existent value
       ;
       ; data type: double; dimension: [meter] 
       ;
+      ; example: xe = 300.0
+      ;
       ; default:   -1.d (maximum of range)
       ;***************************************************
@@ -224,9 +286,10 @@
       ;
       ; value for minimum of y-axis, selectable if there are NO preseted layers for y (as for XY or YZ 2D-DATA);
-      ; you don't have to specify a precise meter value from the input file, it will be rounded to the next 
-      ; existent value
+      ; there is no need to specify a precise meter value from the input file, it is rounded to the next existent value
       ;
       ; data type: double; dimension: [meter]
       ;
+      ; example: ys = 150.0
+      ;
       ; default:   -1.d (minimum of range)
       ;***************************************************
@@ -242,8 +305,9 @@
       ;
       ; value for maximum of y-axis, selectable if there are NO preseted layers for y (as for XY or YZ 2D-DATA);
-      ; you don't have to specify a precise meter value from the input file, it will be rounded to the next 
-      ; existent value 
+      ; there is no need to specify a precise meter value from the input file, it is rounded to the next existent value 
       ;
       ; data type: double; dimension: [meter]
+      ;
+      ; example: ye = 300.0
       ;
       ; default:   -1.d (maximum of range)
@@ -264,4 +328,6 @@
       ; data type: integer
       ;
+      ; example: zs = 0
+      ;
       ; default:   -1 (minimum of range)
       ;***************************************************
@@ -281,4 +347,6 @@
       ; data type: integer
       ;
+      ; example: ze = 15
+      ;
       ; default:   -1 (maximum of range)
       ;***************************************************
@@ -297,4 +365,6 @@
       ; data type: string
       ;
+      ; example: mode = "Fill"
+      ;
       ; default:   "Fill" 
       ;***************************************************
@@ -313,4 +383,6 @@
       ; data type: string
       ;
+      ; example: fill_mode = "AreaFill"
+      ;
       ; default:   "AreaFill" 
       ;***************************************************
@@ -325,7 +397,9 @@
       ; OPTIONAL --shape-- ASPECT RATIO 
       ;
-      ; aspect ratio of axis is kept [=1] or  not[=0]
-      ;
-      ; data type: integer
+      ; aspect ratio of axis is kept [=1] or not[=0]
+      ;
+      ; data type: integer
+      ;
+      ; example: shape = 1
       ;
       ; default:   1 
@@ -337,61 +411,226 @@
 	 
 	 
+      end if
+      ;***************************************************
+      ; OPTIONAL --font_size-- FONT SIZE OF STRINGS 
+      ;
+      ; font size can be changed to fit to the current plot
+      ;
+      ; data type: float
+      ;
+      ; example: font_size = 0.04
+      ;
+      ; default:   0.04 
+      ;***************************************************
+      if(.not. isvar("font_size"))then
+      
+      	 
+         font_size = 0.04
+	 
+	 
+      end if
+      ;***************************************************
+      ; OPTIONAL --font_size_legend-- FONT SIZE OF LEGEND STRINGS 
+      ;
+      ; font size of the legend can be changed to fit to the current plot
+      ;
+      ; data type: float
+      ;
+      ; example: font_size_legend = 0.02
+      ;
+      ; default:   0.02 
+      ;***************************************************
+      if(.not. isvar("font_size_legend"))then
+      
+      	 
+         font_size_legend = 0.02
+	 
+	 
+      end if	
+      ;***************************************************
+      ; OPTIONAL --legend_label_stride-- REDUCTION OF THE NUMBER OF LABELS IN THE LEGEND
+      ;
+      ; if legend_label_stride is set to 1 every label is shown; if set to 2 every second,...
+      ;
+      ; data type: integer
+      ;
+      ; example: legend_label_stride = 2
+      ;
+      ; default:   2 
+      ;***************************************************
+      if(.not. isvar("legend_label_reduction"))then
+      
+      	 
+         legend_label_stride = 2
+	 
+	 
+      end if 
+      ;***************************************************
+      ; OPTIONAL --axes_explicit-- EXPLICIT SETTINGS OF X- AND Y-AXES ARE SWITCHED ON
+      ;
+      ; to use several parameters to set up the axes, 'axes_explicit' must be switched [=1]; if switched off [=0] units of axes are [gridpoints]
+      ;
+      ; data type: integer
+      ;
+      ; example: axes_explicit = 0
+      ;
+      ; default:   0 
+      ;***************************************************
+      if(.not. isvar("axes_explicit"))then
+      
+      	 
+         axes_explicit = 0
+	 
+	 
+      end if
+      ;***************************************************
+      ; OPTIONAL if axes_explicit = 1 --major_ticks_x-- NUMBER OF MAJOR TICK MARKS AT X-AXIS
+      ;
+      ; major_ticks_x can be set to any integer, best segmentation of x-axis can be achieved, if 
+      ; (number of gripdpoints in x-direction)/(major_ticks_x-1)=INTEGER, e.g. 128/8 = 16 -> major_ticks_x should be set to 9
+      ;
+      ; data type: integer
+      ;
+      ; example: major_ticks_x = 6
+      ;
+      ; default:   6 
+      ;***************************************************
+      if(.not. isvar("major_ticks_x"))then
+      
+      	 
+         major_ticks_x = 6
+	 
+	 
+      end if
+      ;***************************************************
+      ; OPTIONAL if axes_explicit = 1 --major_ticks_y-- NUMBER OF MAJOR TICK MARKS AT Y-AXIS
+      ;
+      ; major_ticks_y can be set to any integer, best segmentation of y-axis can be achieved, if 
+      ; (number of gripdpoints in y-direction)/(major_ticks_y-1)=INTEGER, e.g. 128/8 = 16 -> major_ticks_y should be set to 9
+      ;
+      ; data type: integer
+      ;
+      ; example: major_ticks_y = 6
+      ;
+      ; default:   6 
+      ;***************************************************
+      if(.not. isvar("major_ticks_y"))then
+      
+      	 
+         major_ticks_y = 6
+	 
+	 
+      end if
+      ;***************************************************
+      ; OPTIONAL if axes_explicit = 1 --norm_x--norm_y--norm_z-- NORMALISE X-, Y- and Z-AXES
+      ;
+      ; normalising the axes with the given value; units can explicitly set; by default no normalising is used and units are [meter]
+      ;
+      ; data type: float
+      ;
+      ; default:   1. 
+      ;***************************************************
+      if(.not. isvar("norm_x"))then      
+      	 
+         norm_x = 1.	 
+	 
+      end if
+      if(.not. isvar("norm_y"))then      
+      	 
+         norm_y = 1.	 
+	 
+      end if
+      if(.not. isvar("norm_z"))then      
+      	 
+         norm_z = 1.	 
+	 
+      end if
+      ;***************************************************
+      ; OPTIONAL if axes_explicit = 1 --unit_x--unit_y--unit_z-- UNITS OF X-, Y- and Z-AXES
+      ;
+      ; 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]
+      ;
+      ; data type: string, 
+      ;
+      ; example: unit_x = "m/s"
+      ;
+      ; default:   " " 
+      ;***************************************************
+      if(.not. isvar("unit_x"))then      
+      	 
+         unit_x = " "	 
+	 
+      end if
+      if(.not. isvar("unit_y"))then      
+      	 
+         unit_y = " "	 
+	 
+      end if
+      if(.not. isvar("unit_z"))then      
+      	 
+         unit_z = " "	 
+	 
+      end if
+      ;***************************************************
+      ; OPTIONAL --vector-- VECTOR PLOT 
+      ;
+      ; a vector plot for one defined vector is switched on [=1] or off [=0]
+      ;
+      ; data type: integer
+      ;
+      ; example: vector = 0
+      ;
+      ; default:   0 
+      ;***************************************************
+      if(.not. isvar("vector"))then
+      
+      	 
+         vector = 0
+	 
+	 
       end if	 
       ;***************************************************
-      ; OPTIONAL --vector-- VECTOR PLOT 
-      ;
-      ; a vector plot for one defined vector will be switched on [=1] or off [=0]
-      ;
-      ; data type: integer
-      ;
-      ; default:   0 
-      ;***************************************************
-      if(.not. isvar("vector"))then
-      
-      	 
-         vector = 0
-	 
+      ; REQUIRED IF vector=1 --vec1, vec2-- VECTOR FOR VECTOR PLOT 
+      ;
+      ; variables for the vector, vec1 hast to be set to component 1 and vec2 to component 2;
+      ; inidcate them with one comma before and after each variable;
+      ;
+      ; data type: string
+      ;
+      ; example: vec1=",u,"
+      ;          vec2=",v,"
+      ;
+      ; default:   vec1 = "component1", vec2 = "component2" 
+      ;***************************************************
+      if(.not. isvar("vec1"))then     
+      	 
+         vec1 = "component1"
+	 
+      end if
+      if (.not. isvar("vec2"))then 
+      
+	 vec2 = "component2"	 
 	 
       end if	 
       ;***************************************************
-      ; REQUIRED IF vector=1 --vec1, vec2-- VECTOR FOR VECTOR PLOT 
-      ;
-      ; variables for the vector, vec1 hast to be set to component 1 and vec2 to component 2;
-      ; please inidcate them with one comma before and after each variable;
-      ; e.g.: vec1=",u," and vec2=",v," for plotting the horizontal windvector
-      ;
-      ; data type: string
-      ;
-      ; default:   vec1 = "component1", vec2 = "component2" 
-      ;***************************************************
-      if(.not. isvar("vec1"))then     
-      	 
-         vec1 = "component1"
-	 
-      end if
-      if (.not. isvar("vec2"))then 
-      
-	 vec2 = "component2"	 
+      ; OPTIONAL --plotvec-- VARIABLE FOR EXTRA VECTOR PLOT
+      ;
+      ; the vector plot can be combined with other plots of variables; if this is desired inidcate the variables, 
+      ; where a vector plot shall overlay; inidcate them with one comma before and after each variable
+      ;
+      ; data type: string
+      ;
+      ; example: plotvec = ",u,w,"
+      ;
+      ; default:   "plotvec" (no combining, the vector plot is created seperately) 
+      ;***************************************************
+      if(.not. isvar("plotvec"))then
+      
+      	 
+         plotvec = "plotvec"
+	 
 	 
       end if	 
       ;***************************************************
-      ; OPTIONAL --plotvec-- VARIABLE FOR EXTRA VECTOR PLOT
-      ;
-      ; the vector plot can be combined with other variables; if desired inidcate the variables 
-      ; with one comma before and after it; e.g. plotvec=",u,v,w," (the vector plot 
-      ; will combined with the contour plots of u, v and w)
-      ;
-      ; data type: string
-      ;
-      ; default:   plotvec (no combining, the vector plot will be created seperately) 
-      ;***************************************************
-      if(.not. isvar("plotvec"))then
-      
-      	 
-         plotvec = "plotvec"
-	 
-	 
-      end if	 
-      ;***************************************************
       ; OPTIONAL --ref_mag-- REFERENCE VECTOR 
       ;
@@ -399,4 +638,6 @@
       ;
       ; data type: float
+      ;
+      ; example: ref_mag = 0.05
       ;
       ; default:   0.05 
@@ -420,16 +661,57 @@
 
       ;***************************************************
-      ; REQUIRED --file_1-- INPUT FILE
-      ;
-      ; input file produced by PALM; please declare path and name
-      ;
-      ; data type: string
+      ; REQUIRED --file_1-- 1ST INPUT FILE
+      ;
+      ; 1st input file produced by PALM; if there is more than one file for all timesteps of a job chain, 
+      ; 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'); 
+      ; otherwise declare path and full file name
+      ;
+      ; data type: string
+      ;
+      ; example: file_1 = "/path_to_file/file_pr"      if you use more than one cycle number
+      ;          file_1 = "/path_to_file/file_pr.4.nc" if you use one file (e.g. with cycle number 4)
       ;
       ; default:   "File in" 
       ;***************************************************
-      if (.not. isvar("file_1"))then
-      
-      
-         file_1 = "File in"
+      if(.not. isvar("file_1"))then
+
+
+         file_1 = "File in" 
+	 
+	 
+      end if 
+      ;***************************************************
+      ; REQUIRED --start_f_1-- START OF CYCLIC NUMBER OF THE 1ST INPUT FILE
+      ;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; example:   3 (if first file: example_ts.3.nc)
+      ;
+      ; default:   -1  
+      ;***************************************************
+      if (.not. isvar("start_f_1"))then  
+      
+          
+         start_f_1 = -1
+	 
+	 
+      end if 
+      ;***************************************************
+      ; REQUIRED --end_f_1-- END OF CYCLIC NUMBER OF THE 1ST INPUT FILE
+      ;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; example:   48 (if last file: example_ts.48.nc)
+      ;
+      ; default:   -1  
+      ;***************************************************
+      if (.not. isvar("end_f_1"))then  
+      
+          
+         end_f_1 = -1 
 	 
 	 
@@ -470,5 +752,5 @@
       ; OPTIONAL --file_out-- OUTPUT FILE
       ;
-      ; please declare path and name 
+      ; declare path and name of the output file
       ;
       ; data type: string
@@ -484,5 +766,5 @@
       end if 	 
       ;***************************************************
-      ; OPTIONAL --no_columns-- NUMBER OF ROWS
+      ; OPTIONAL --no_columns-- NUMBER OF COLUMNS
       ;
       ; number of plots in one row 
@@ -500,5 +782,5 @@
       end if 	 
       ;***************************************************
-      ; OPTIONAL --no_lines-- NUMBER OF COLUMNS
+      ; OPTIONAL --no_rows-- NUMBER OF ROWS
       ;
       ; number of plots in one column 
@@ -508,8 +790,8 @@
       ; default:   2 
       ;***************************************************
-      if (.not. isvar("no_lines"))then	
+      if (.not. isvar("no_rows"))then	
       
        
-         no_lines = 2
+         no_rows = 2
 	 
 	 
@@ -518,10 +800,11 @@
       ; OPTIONAL --var-- OUTPUT VARIABLES
       ;
-      ; names of output variables; please inidcate them with one comma before and after each variable;
-      ; e.g.: var=",u,v,w," (the windcomponents u, v and w will be plotted)
+      ; names of output variables; inidcate them with one comma before and after each variable
       ;
       ; data type: string 
-      ;
-      ; default:   "all" (all available variables will be plotted)
+      ; 
+      ; example: var = ",u,v,w"; 
+      ;
+      ; default:   "all" (all available variables are plotted)
       ;***************************************************
       if (.not. isvar("var"))then
@@ -535,8 +818,8 @@
       ; OPTIONAL ---no_files-- NUMBER OF INPUT FILES
       ;
-      ; up to 12 input files can be used; all input files must contain the same variables and dimensionalties;
-      ; identical variables will be merged in one plot;
+      ; up to 6 input files of different runs can be used; all input files must contain the same variables and dimensionalties;
+      ; identical variables are merged in one plot;
       ; combining or overlaying of any variables is not feasible;
-      ; an extra legend (besides the time step legend) will be drawn where you can explicitily name the items
+      ; an extra legend (besides the time step legend) is drawn where you can explicitily name the items
       ;
       ; data type: integer
@@ -566,21 +849,62 @@
 	 
 	 
-      end if 	 
-      ;***************************************************
-      ; REQUIRED IF no_files > 1 --file_2-- 2nd INPUT FILE
-      ;
-      ; 2nd input file produced by PALM; please declare path and name
-      ;
-      ; data type: string
+      end if
+      ;***************************************************
+      ; REQUIRED if no_files > 1 --file_2-- 2ND INPUT FILE
+      ;
+      ; 2nd input file produced by PALM; if there is more than one file for all timesteps of a job chain, 
+      ; 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'); 
+      ; otherwise declare path and full file name
+      ;
+      ; data type: string
+      ;
+      ; example: file_2 = "/path_to_file/file_pr"      if you use more than one cycle number
+      ;          file_2 = "/path_to_file/file_pr.4.nc" if you use one file (e.g. with cycle number 4)
       ;
       ; default:   "File in" 
       ;***************************************************
-      if (.not. isvar("file_2"))then  
+      if(.not. isvar("file_2"))then
+
+
+         file_2 = "File in" 
+	 
+	 
+      end if 
+      ;***************************************************
+      ; REQUIRED --start_f_2-- START OF CYCLIC NUMBER OF THE 2ND INPUT FILE
+      ;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; example:   3 (if first file: example_ts.3.nc)
+      ;
+      ; default:   -1  
+      ;***************************************************
+      if (.not. isvar("start_f_2"))then  
       
           
-         file_2 = "File in"
-	 
-	 
-      end if 	 
+         start_f_2 = -1
+	 
+	 
+      end if 
+      ;***************************************************
+      ; REQUIRED --end_f_2-- END OF CYCLIC NUMBER OF THE 2ND INPUT FILE
+      ;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; example:   48 (if last file: example_ts.48.nc)
+      ;
+      ; default:   -1  
+      ;***************************************************
+      if (.not. isvar("end_f_2"))then  
+      
+          
+         end_f_2 = -1 
+	 
+	 
+      end if 	 	 
       ;***************************************************
       ; OPTIONAL --name_legend_2-- 2nd LEGEND ITEM
@@ -598,21 +922,62 @@
 	 
 	 
-      end if 	 
-      ;***************************************************
-      ; REQUIRED IF no_files > 2 --file_3-- 3rd INPUT FILE
-      ;
-      ; 3rd input file produced by PALM; please declare path and name
-      ;
-      ; data type: string
+      end if 
+      ;***************************************************
+      ; REQUIRED if no_files > 2 --file_3-- 3RD INPUT FILE
+      ;
+      ; 3rd input file produced by PALM; if there is more than one file for all timesteps of a job chain, 
+      ; 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'); 
+      ; otherwise declare path and full file name
+      ;
+      ; data type: string
+      ;
+      ; example: file_3 = "/path_to_file/file_pr"      if you use more than one cycle number
+      ;          file_3 = "/path_to_file/file_pr.4.nc" if you use one file (e.g. with cycle number 4)
       ;
       ; default:   "File in" 
       ;***************************************************
-      if (.not. isvar("file_3"))then    
-      
-        
-         file_3 = "File in"
-	 
-	 
-      end if 	 
+      if(.not. isvar("file_3"))then
+
+
+         file_3 = "File in" 
+	 
+	 
+      end if 
+      ;***************************************************
+      ; REQUIRED --start_f_3-- START OF CYCLIC NUMBER OF THE 3RD INPUT FILE
+      ;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; example:   3 (if first file: example_ts.3.nc)
+      ;
+      ; default:   -1  
+      ;***************************************************
+      if (.not. isvar("start_f_3"))then  
+      
+          
+         start_f_3 = -1
+	 
+	 
+      end if 
+      ;***************************************************
+      ; REQUIRED --end_f_3-- END OF CYCLIC NUMBER OF THE 3RD INPUT FILE
+      ;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; example:   48 (if last file: example_ts.48.nc)
+      ;
+      ; default:   -1  
+      ;***************************************************
+      if (.not. isvar("end_f_3"))then  
+      
+          
+         end_f_3 = -1 
+	 
+	 
+      end if   
       ;***************************************************
       ; OPTIONAL --name_legend_3-- 3rd LEGEND ITEM
@@ -630,21 +995,62 @@
 	 
 	 
-      end if 	 
-      ;***************************************************
-      ; REQUIRED IF no_files > 3 --file_4-- 4th INPUT FILE
-      ;
-      ; 4th input file produced by PALM; please declare path and name
-      ;
-      ; data type: string
+      end if
+      ;***************************************************
+      ; REQUIRED if no_files > 3 --file_4-- 4TH INPUT FILE
+      ;
+      ; 4th input file produced by PALM; if there is more than one file for all timesteps of a job chain, 
+      ; 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'); 
+      ; otherwise declare path and full file name
+      ;
+      ; data type: string
+      ;
+      ; example: file_4 = "/path_to_file/file_pr"      if you use more than one cycle number
+      ;          file_4 = "/path_to_file/file_pr.4.nc" if you use one file (e.g. with cycle number 4)
       ;
       ; default:   "File in" 
       ;***************************************************
-      if (.not. isvar("file_4"))then
-      
-            
-         file_4 = "File in"
-	 
-	 
-      end if 	 
+      if(.not. isvar("file_4"))then
+
+
+         file_4 = "File in" 
+	 
+	 
+      end if 
+      ;***************************************************
+      ; REQUIRED --start_f_4-- START OF CYCLIC NUMBER OF THE 4TH INPUT FILE
+      ;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; example:   3 (if first file: example_ts.3.nc)
+      ;
+      ; default:   -1  
+      ;***************************************************
+      if (.not. isvar("start_f_4"))then  
+      
+          
+         start_f_4 = -1
+	 
+	 
+      end if 
+      ;***************************************************
+      ; REQUIRED --end_f_4-- END OF CYCLIC NUMBER OF THE 4TH INPUT FILE
+      ;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; example:   48 (if last file: example_ts.48.nc)
+      ;
+      ; default:   -1  
+      ;***************************************************
+      if (.not. isvar("end_f_4"))then  
+      
+          
+         end_f_4 = -1 
+	 
+	 
+      end if  
       ;***************************************************
       ; OPTIONAL --name_legend_4-- 4th LEGEND ITEM
@@ -662,21 +1068,62 @@
 	 
 	 
-      end if 	 
-      ;***************************************************
-      ; REQUIRED IF no_files > 4 --file_5-- 5th INPUT FILE
-      ;
-      ; 5th input file produced by PALM; please declare path and name
-      ;
-      ; data type: string
+      end if
+      ;***************************************************
+      ; REQUIRED if no_files > 4 --file_5-- 5TH INPUT FILE
+      ;
+      ; 5th input file produced by PALM; if there is more than one file for all timesteps of a job chain, 
+      ; 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'); 
+      ; otherwise declare path and full file name
+      ;
+      ; data type: string
+      ;
+      ; example: file_5 = "/path_to_file/file_pr"      if you use more than one cycle number
+      ;          file_5 = "/path_to_file/file_pr.4.nc" if you use one file (e.g. with cycle number 4)
       ;
       ; default:   "File in" 
       ;***************************************************
-      if (.not. isvar("file_5"))then 
-      
-           
-         file_5 = "File in"
-	 
-	 
-      end if 	 
+      if(.not. isvar("file_5"))then
+
+
+         file_5 = "File in" 
+	 
+	 
+      end if 
+      ;***************************************************
+      ; REQUIRED --start_f_5-- START OF CYCLIC NUMBER OF THE 5TH INPUT FILE
+      ;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; example:   3 (if first file: example_ts.3.nc)
+      ;
+      ; default:   -1  
+      ;***************************************************
+      if (.not. isvar("start_f_5"))then  
+      
+          
+         start_f_5 = -1
+	 
+	 
+      end if 
+      ;***************************************************
+      ; REQUIRED --end_f_5-- END OF CYCLIC NUMBER OF THE 5TH INPUT FILE
+      ;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; example:   48 (if last file: example_ts.48.nc)
+      ;
+      ; default:   -1  
+      ;***************************************************
+      if (.not. isvar("end_f_5"))then  
+      
+          
+         end_f_5 = -1 
+	 
+	 
+      end if   	 
       ;***************************************************
       ; OPTIONAL --name_legend_5-- 5th LEGEND ITEM
@@ -694,23 +1141,64 @@
 	 
 	 
-      end if 	 
-      ;***************************************************
-      ; REQUIRED IF no_files > 5 --file_6-- 6th INPUT FILE
-      ;
-      ; 6th input file produced by PALM; please declare path and name
-      ;
-      ; data type: string
+      end if
+      ;***************************************************
+      ; REQUIRED if no_files > 5 --file_6-- 6TH INPUT FILE
+      ;
+      ; 6th input file produced by PALM; if there is more than one file for all timesteps of a job chain, 
+      ; 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'); 
+      ; otherwise declare path and full file name
+      ;
+      ; data type: string
+      ;
+      ; example: file_6 = "/path_to_file/file_pr"      if you use more than one cycle number
+      ;          file_6 = "/path_to_file/file_pr.4.nc" if you use one file (e.g. with cycle number 4)
       ;
       ; default:   "File in" 
       ;***************************************************
-      if (.not. isvar("file_6"))then   
-      
-         
-         file_6 = "File in"
-	 
-	 
-      end if 	 
-      ;***************************************************
-      ; OPTIONAL --name_legend_6-- 6th LEGEND ITEM
+      if(.not. isvar("file_6"))then
+
+
+         file_6 = "File in" 
+	 
+	 
+      end if 
+      ;***************************************************
+      ; REQUIRED --start_f_6-- START OF CYCLIC NUMBER OF THE 6TH INPUT FILE
+      ;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; example:   3 (if first file: example_ts.3.nc)
+      ;
+      ; default:   -1  
+      ;***************************************************
+      if (.not. isvar("start_f_6"))then  
+      
+          
+         start_f_6 = -1
+	 
+	 
+      end if 
+      ;***************************************************
+      ; REQUIRED --end_f_6-- END OF CYCLIC NUMBER OF THE 6TH INPUT FILE
+      ;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; example:   48 (if last file: example_ts.48.nc)
+      ;
+      ; default:   -1  
+      ;***************************************************
+      if (.not. isvar("end_f_6"))then  
+      
+          
+         end_f_6 = -1 
+	 
+	 
+      end if       	  	 
+      ;***************************************************
+      ; OPTIONAL --name_legend_6-- 6TH LEGEND ITEM
       ;
       ; if no_files > 5: name of 6th item in extra legend
@@ -726,204 +1214,14 @@
 	 
 	 
-      end if 	 
-      ;***************************************************
-      ; REQUIRED IF no_files > 6 --file_7-- 7th INPUT FILE
-      ;
-      ; 7th input file produced by PALM; please declare path and name
-      ;
-      ; data type: string
-      ;
-      ; default:   "File in" 
-      ;***************************************************
-      if (.not. isvar("file_7"))then 
-      
-           
-         file_7 = "File in"
-	 
-	 
-      end if 	 
-      ;***************************************************
-      ; OPTIONAL --name_legend_7-- 7th LEGEND ITEM
-      ;
-      ; if no_files > 6: name of 7th item in extra legend
-      ;
-      ; data type: string
-      ;
-      ; default:   "File 7" 
-      ;***************************************************
-      if (.not. isvar("name_legend_7"))then 
-      
-           
-         name_legend_7 = "File 7"
-	 
-	 
-      end if 	 
-      ;***************************************************
-      ; REQUIRED IF no_files > 7 --file_8-- 8th INPUT FILE
-      ;
-      ; 8th input file produced by PALM; please declare path and name
-      ;
-      ; data type: string
-      ;
-      ; default:   "File in" 
-      ;***************************************************
-      if (.not. isvar("file_8"))then 
-      
-           
-         file_8 = "File in"
-	 
-	 
-      end if 	 
-      ;***************************************************
-      ; OPTIONAL --name_legend_8-- 8th LEGEND ITEM
-      ;
-      ; if no_files > 1: name of 8th item in extra legend
-      ;
-      ; data type: string
-      ;
-      ; default:   "File 8" 
-      ;***************************************************
-      if (.not. isvar("name_legend_8"))then   
-      
-         
-         name_legend_8 = "File 8"
-	 
-	 
-      end if 	 
-      ;***************************************************
-      ; REQUIRED IF no_files > 8 --file_9-- 9th INPUT FILE
-      ;
-      ; 9th input file produced by PALM; please declare path and name
-      ;
-      ; data type: string
-      ;
-      ; default:   "File in" 
-      ;***************************************************
-      if (.not. isvar("file_9"))then
-      
-            
-         file_9 = "File in"
-	 
-	 
-      end if 	 
-      ;***************************************************
-      ; OPTIONAL --name_legend_9-- 9th LEGEND ITEM
-      ;
-      ; if no_files > 8: name of 9th item in extra legend
-      ;
-      ; data type: string
-      ;
-      ; default:   "File 9" 
-      ;***************************************************
-      if (.not. isvar("name_legend_9"))then 
-      
-           
-         name_legend_9 = "File 9"
-	 
-	 
-      end if 	 
-      ;***************************************************
-      ; REQUIRED IF no_files > 9 --file_10-- 10th INPUT FILE
-      ;
-      ; 10th input file produced by PALM; please declare path and name
-      ;
-      ; data type: string
-      ;
-      ; default:   "File in" 
-      ;***************************************************
-      if (.not. isvar("file_10"))then
-      
-            
-         file_10 = "File in"
-	 
-	 
-      end if 	 
-      ;***************************************************
-      ; OPTIONAL --name_legend_10-- 10th LEGEND ITEM
-      ;
-      ; if no_files > 9: name of 10th item in extra legend
-      ;
-      ; data type: string
-      ;
-      ; default:   "File 10" 
-      ;***************************************************
-      if (.not. isvar("name_legend_10"))then  
-      
-          
-         name_legend_10 = "File 10"
-	 
-	 
-      end if 	 
-      ;***************************************************
-      ; REQUIRED IF no_files > 10 --file_11-- 11th INPUT FILE
-      ;
-      ; 11th input file produced by PALM; please declare path and name
-      ;
-      ; data type: string
-      ;
-      ; default:   "File in" 
-      ;***************************************************
-      if (.not. isvar("file_11"))then 
-      
-           
-         file_11 = "File in"
-	 
-	 
-      end if 	 
-      ;***************************************************
-      ; OPTIONAL --name_legend_11-- 11th LEGEND ITEM
-      ;
-      ; if no_files > 1: name of 11th item in extra legend
-      ;
-      ; data type: string
-      ;
-      ; default:   "File 11" 
-      ;***************************************************
-      if (.not. isvar("name_legend_11"))then 
-      
-           
-         name_legend_11 = "File 11"
-	 
-	 
-      end if 	 
-      ;***************************************************
-      ; REQUIRED IF no_files > 11 --file_12-- 12th INPUT FILE
-      ;
-      ; 12th input file produced by PALM; please declare path and name
-      ;
-      ; data type: string
-      ;
-      ; default:   "File in" 
-      ;***************************************************
-      if (.not. isvar("file_12"))then 
-      
-           
-         file_12 = "File in"
-	 
-	 
-      end if 	 
-      ;***************************************************
-      ; OPTIONAL --name_legend_12-- 12th LEGEND ITEM
-      ;
-      ; if no_files > 11: name of 12th item in extra legend
-      ;
-      ; data type: string
-      ;
-      ; default:   "File 12" 
-      ;***************************************************
-      if (.not. isvar("name_legend_12"))then 
-      
-           
-         name_legend_12 = "File 12"
-	 
-	 
-      end if 	 
+      end if 	  	 
       ;***************************************************
       ; OPTIONAL --start_time_step-- FIRST TIME STEP
       ;
-      ; first time step of plot; you don't have to specify a precise time value from the input file,
-      ; it will be rounded to the next existent time step
+      ; first time step of plot; there is no need to specify a precise time value from the input file,
+      ; 'start_time_step' is rounded to the next existent time step
       ;
       ; data type: double; dimension: [hour]
+      ;
+      ; example:   start_time_step = 0.5
       ;
       ; default:   -1.d (first available time step)
@@ -939,9 +1237,11 @@
       ; OPTIONAL --end_time_step-- LAST TIME STEP
       ;
-      ; last time step of plot; you don't have to specify a precise time value from the input file,
-      ; it will be rounded to the next existent time step
+      ; last time step of plot; there is no need to specify a precise time value from the input file,
+      ; 'end_time_step' is rounded to the next existent time step
       ;
       ; data type: double; dimension: [hour]
       ;
+      ; example:   end_time_step = 2.0
+      ;
       ; default:   -1.d (last available time step)
       ;***************************************************
@@ -949,8 +1249,80 @@
       
       	 
-         end_time_step = -1.d      
-	 
-	 
-      end if 	 
+         end_time_step = -1.d     
+	 
+	 
+      end if 
+      ;***************************************************
+      ; OPTIONAL --start_x-- STARTVALUE IN X-DIRECTION  
+      ;
+      ; if 3D data is used for profiles you can choose a startvalue in x-direction for horizontal averaging 
+      ;
+      ; data type: integer; dimension [grippoint]
+      ;
+      ; example: start_x = 0
+      ;
+      ; default:   0 (minimum of range)
+      ;***************************************************
+      if (.not. isvar("start_x"))then   
+      
+         
+         start_x = 0
+	 
+	 
+      end if
+      ;***************************************************
+      ; OPTIONAL --end_x-- ENDVALUE IN X-DIRECTION  
+      ;
+      ; if 3D data is used for profiles you can choose an endvalue in x-direction for horizontal averaging 
+      ;
+      ; data type: integer; dimension [grippoint]
+      ;
+      ; example: end_x = 200
+      ;
+      ; default:   -1 (maximum of range excluding ghostpoint)
+      ;***************************************************
+      if (.not. isvar("end_x"))then   
+      
+         
+         end_x = -1
+	 
+	 
+      end if
+      ;***************************************************
+      ; OPTIONAL --start_y-- STARTVALUE IN Y-DIRECTION  
+      ;
+      ; if 3D data is used for profiles you can choose a startvalue in y-direction for horizontal averaging 
+      ;
+      ; data type: integer; dimension [grippoint]
+      ;
+      ; example: start_y = 0
+      ;
+      ; default:   0 (minimum of range)
+      ;***************************************************
+      if (.not. isvar("start_y"))then   
+      
+         
+         start_y = 0
+	 
+	 
+      end if
+      ;***************************************************
+      ; OPTIONAL --end_y-- ENDVALUE IN Y-DIRECTION  
+      ;
+      ; if 3D data is used for profiles you can choose an endvalue in y-direction for horizontal averaging 
+      ;
+      ; data type: integer; dimension [grippoint]
+      ;
+      ; example: end_y = 200
+      ;
+      ; default:   -1 (maximum of range excluding ghostpoint)
+      ;***************************************************
+      if (.not. isvar("end_y"))then   
+      
+         
+         end_y = -1
+	 
+	 
+      end if	 
       ;***************************************************
       ; OPTIONAL --xs-- MINIMUM X-AXIS 
@@ -959,4 +1331,6 @@
       ;
       ; data type: float; dimension of variable
+      ;
+      ; example: xs = 300. (e.g. if var=",pt")
       ;
       ; default:   -1. (minimum of range)
@@ -976,4 +1350,6 @@
       ; data type: float; dimension of variable
       ;
+      ; example: xe = 302. (e.g. if var=",pt")
+      ;
       ; default:   -1. (maximum of range)
       ;***************************************************
@@ -992,4 +1368,6 @@
       ; data type: double; dimension: [meter]
       ;
+      ; example: min_z = 0.0
+      ;
       ; default:   -1.d (related to the minimum of z-axis in input file)
       ;***************************************************
@@ -1008,4 +1386,6 @@
       ; data type: double; dimension: [meter]
       ;
+      ; example: max_z = 1000.0
+      ;
       ; default:   -1.d (related to the maximum of z-axis in input file)
       ;***************************************************
@@ -1018,32 +1398,36 @@
       end if 	 
       ;***************************************************
-      ; OPTIONAL --logy-- LOGARITHMIC SCALE 
-      ;
-      ; logarithmic scale for y-axis will be switched on [=1] or off [=0]
-      ;
-      ; data type: integer
+      ; OPTIONAL --log_z-- LOGARITHMIC SCALE OF Z-AXIS 
+      ;
+      ; logarithmic scale for z-axis is switched on [=1] or off [=0]
+      ;
+      ; data type: integer
+      ;
+      ; example: log_z = 0
       ;
       ; default:   0
       ;***************************************************
-      if (.not. isvar("logy"))then 
+      if (.not. isvar("log_z"))then 
       
            
-         logy = 0
-	 
-	 
-      end if 	 
-      ;***************************************************
-      ; OPTIONAL --norm-- NORMALISE Y-AXIS 
-      ;
-      ; value for normalising the y-axis
+         log_z = 0
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --norm_z-- NORMALISING Z-AXIS 
+      ;
+      ; value for normalising the z-axis
       ;
       ; data type: float
       ;
-      ; default:   1 (no normalising)
-      ;***************************************************
-      if (.not. isvar("norm"))then 
+      ; example: norm_z = 1.
+      ;
+      ; default:   1. (no normalising)
+      ;***************************************************
+      if (.not. isvar("norm_z"))then 
       
            
-         norm = 1
+         norm_z = 1.
 	 
 	 
@@ -1052,9 +1436,11 @@
       ; OPTIONAL --over-- OVERLAYING
       ;
-      ; predefined overlaying of standard variables will be switched on [=1] or off [=0];
+      ; predefined overlaying of standard variables is switched on [=1] or off [=0];
       ; this feature cannot be used with statistic regions
       ;
       ; data type: integer
       ;
+      ; example: over = 0
+      ;
       ; default:   0 
       ;***************************************************
@@ -1072,4 +1458,6 @@
       ;
       ; data type: integer
+      ;
+      ; example: combine = 0
       ;
       ; default:   0
@@ -1089,4 +1477,6 @@
       ; data type: integer
       ;
+      ; example: number_comb = 2
+      ;
       ; default:   -1
       ;***************************************************
@@ -1101,8 +1491,9 @@
       ; REQUIRED IF combine=1 --c_var-- VARIABLES FOR COMBINING 
       ;
-      ; names of variables; please inidcate them with one comma before and after each variable;
-      ; e.g.: var=",u,v,w," (the windcomponents u, v and w will be combined)
-      ;
-      ; data type: string
+      ; names of variables; inidcate them with one comma before and after each variable;
+      ;
+      ; data type: string
+      ;
+      ; example: c_var = ",u,v,"
       ;
       ; default:   "c_variables"
@@ -1122,4 +1513,6 @@
       ; data type: integer
       ;
+      ; example: black = 0
+      ;
       ; default:   0
       ;***************************************************
@@ -1138,4 +1531,6 @@
       ; data type: integer
       ;
+      ; example: dash = 0
+      ;
       ; default:   0
       ;***************************************************
@@ -1144,4 +1539,40 @@
        
          dash = 0      
+	 
+	 
+      end if
+      ;***************************************************
+      ; OPTIONAL --font_size-- FONT SIZE OF STRINGS 
+      ;
+      ; font size can be changed to fit to the current plot
+      ;
+      ; data type: float
+      ;
+      ; example: font_size = 0.02
+      ;
+      ; default:   0.02 
+      ;***************************************************
+      if(.not. isvar("font_size"))then
+      
+      	 
+         font_size = 0.02
+	 
+	 
+      end if 
+      ;***************************************************
+      ; OPTIONAL --font_size_legend-- FONT SIZE OF LEGEND STRINGS 
+      ;
+      ; font size of the legend can be changed to fit to the current plot
+      ;
+      ; data type: float
+      ;
+      ; example: font_size_legend = 0.2
+      ;
+      ; default:   0.2 
+      ;***************************************************
+      if(.not. isvar("font_size_legend"))then
+      
+      	 
+         font_size_legend = 0.2
 	 
 	 
@@ -1160,23 +1591,66 @@
       ; REQUIRED --file_1-- INPUT FILE
       ;
-      ; input file produced by PALM; please declare path and name
-      ;
-      ; data type: string
+      ; input file produced by PALM; if there is more than one file for all timesteps of a job chain, 
+      ; 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'); 
+      ; otherwise declare path and full file name
+      ;
+      ; data type: string
+      ;
+      ; example: file_1 = "/path_to_file/file_sp"      if you use more than one cycle number
+      ;          file_1 = "/path_to_file/file_sp.4.nc" if you use one file (e.g. with cycle number 4)
       ;
       ; default:   "File in" 
       ;***************************************************
-      if (.not. isvar("file_1"))then  
+      if(.not. isvar("file_1"))then
+
+
+         file_1 = "File in" 
+	 
+	 
+      end if
+      ;***************************************************
+      ; REQUIRED if more than one file of a job chain --start_f-- START OF CYCLIC NUMBER
+      ;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; example:   start_f = 3 (if first file: example_ts.3.nc)
+      ;
+      ; default:   -1  
+      ;***************************************************
+      if (.not. isvar("start_f"))then  
       
           
-         file_1 = "File in"
-	 
-	 
-      end if 	 
+         start_f = -1
+	 
+	 
+      end if 
+      ;***************************************************
+      ; REQUIRED if more than one file of a job chain --end_f-- END OF CYCLIC NUMBER
+      ;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; example:   end_f = 48 (if last file: example_ts.48.nc)
+      ;
+      ; default:   -1  
+      ;***************************************************
+      if (.not. isvar("end_f"))then  
+      
+          
+         end_f = -1
+	 
+	 
+      end if
       ;***************************************************
       ; OPTIONAL --format_out-- OUTPUT FORMAT
       ;
-      ; supported file formats: x11, pdf, ps, eps, epsi or ncgm 
-      ;
-      ; data type: string
+      ; format of the output file; supported file formats: x11, pdf, ps, eps, epsi or ncgm 
+      ;
+      ; data type: string
+      ;
+      ; example: format_out = "pdf"
       ;
       ; default:   "x11" 
@@ -1192,7 +1666,9 @@
       ; OPTIONAL --file_out-- OUTPUT FILE
       ;
-      ; please declare path and name 
-      ;
-      ; data type: string
+      ; path and name of the output file
+      ;
+      ; data type: string
+      ;
+      ; example: file_out = "/home/path_to_output/test_sp"
       ;
       ; default:   "~/test_sp" 
@@ -1206,9 +1682,11 @@
       end if 	 
       ;***************************************************
-      ; OPTIONAL --no_columns-- NUMBER OF ROWS
+      ; OPTIONAL --no_columns-- NUMBER OF COLUMNS
       ;
       ; number of plots in one row 
       ;
       ; data type: integer
+      ; 
+      ; example: no_columns = 1
       ;
       ; default:   1
@@ -1222,16 +1700,18 @@
       end if 	 
       ;***************************************************
-      ; OPTIONAL --no_lines-- NUMBER OF COLUMNS
+      ; OPTIONAL --no_rows-- NUMBER OF ROWS
       ;
       ; number of plots in one column 
       ;
       ; data type: integer
+      ; 
+      ; example: no_rows = 2
       ;
       ; default:   2 
       ;***************************************************
-      if (.not. isvar("no_lines"))then
-      
-      	 
-         no_lines = 2
+      if (.not. isvar("no_rows"))then
+      
+      	 
+         no_rows = 2
 	 
 	 
@@ -1240,10 +1720,11 @@
       ; OPTIONAL --var-- OUTPUT VARIABLES
       ;
-      ; names of output variables; please inidcate them with one comma before and after each variable;
-      ; e.g.: var=",u,v,w," (the windcomponents u, v and w will be plotted)
+      ; names of output variables; inidcate them with one comma before and after each variable
       ;
       ; data type: string 
-      ;
-      ; default:   "all" (all available variables will be plotted)
+      ; 
+      ; example: var = ",u,v,w"
+      ;
+      ; default:   "all" (all available variables are plotted)
       ;***************************************************
       if (.not. isvar("var"))then
@@ -1257,11 +1738,12 @@
       ; OPTIONAL --height_level-- HEIGHT LEVELS 
       ;
-      ; defines if all heights or selected heights will be output; a 1D array with up to 10 elements
-      ; from 0 to 9 must be indicated, e.g.: height_level=(/0,3,7/) (level 0, 3 and 7 as in input file
-      ; will be output)
+      ; defines if all levels or selected levels are output; a 1D array with up to 100 elements
+      ; from 0 to 99 must be indicated
       ;
       ; data type: integer array
       ;
-      ; default:   (/-1/) (all levels will be output)
+      ; example: height_level=(/0,3,7/)
+      ;
+      ; default:   (/-1/) (all levels are output)
       ;***************************************************
       if (.not. isvar("height_level"))then
@@ -1275,7 +1757,9 @@
       ; OPTIONAL --sort-- TYPE OF SORTING 
       ;
-      ; defines if all heights [="height"] or all timesteps [="time"] will be merged in one plot
-      ;
-      ; data type: string
+      ; defines if all heights [="height"] or all timesteps [="time"] are merged in one plot
+      ;
+      ; data type: string
+      ;
+      ; example: sort = "height"
       ;
       ; default:   "height" 
@@ -1291,9 +1775,11 @@
       ; OPTIONAL --start_time_step-- FIRST TIME STEP
       ;
-      ; first time step of plot; you don't have to specify a precise time value from the input file,
-      ; it will be rounded to the next existent time step
+      ; first time step of plot; there is no need to specify a precise time value from the input file,
+      ; 'start_time_step' is rounded to the next existent time step
       ;
       ; data type: double; dimension: [hour]
       ;
+      ; example:   start_time_step = 0.5 
+      ;
       ; default:   -1.d (first available time step)
       ;***************************************************
@@ -1308,9 +1794,11 @@
       ; OPTIONAL --end_time_step-- LAST TIME STEP
       ;
-      ; last time step of plot; you don't have to specify a precise time value from the input file,
-      ; it will be rounded to the next existent time step
+      ; last time step of plot; there is no need to specify a precise time value from the input file,
+      ; 'end_time_step' is rounded to the next existent time step
       ;
       ; data type: double; dimension: [hour]
       ;
+      ; example:   end_time_step = 2.0
+      ;
       ; default:   -1.d (last available time step)
       ;***************************************************
@@ -1328,4 +1816,6 @@
       ;
       ; data type: integer
+      ;
+      ; example: black = 0
       ;
       ; default:   0
@@ -1345,4 +1835,6 @@
       ; data type: integer
       ;
+      ; example: dash = 0
+      ;
       ; default:   0
       ;***************************************************
@@ -1355,37 +1847,41 @@
       end if 
       ;***************************************************
-      ; OPTIONAL --logx-- LOGARITHMIC SCALE X-AXIS
-      ;
-      ; logarithmic scale for x-axis will be switched on [=1] or off [=0]
-      ;
-      ; data type: integer
+      ; OPTIONAL --log_x-- LOGARITHMIC SCALE X-AXIS
+      ;
+      ; logarithmic scale for x-axis is switched on [=1] or off [=0]
+      ;
+      ; data type: integer
+      ;
+      ; example: log_x = 1
       ;
       ; default:   1
       ;***************************************************
-      if (.not. isvar("logx"))then   
+      if (.not. isvar("log_x"))then   
       
          
-         logx = 1
+         log_x = 1
 	 
 	 
       end if	 
       ;***************************************************
-      ; OPTIONAL --logy-- LOGARITHMIC SCALE Y-AXIS 
-      ;
-      ; logarithmic scale for y-axis will be switched on [=1] or off [=0]
-      ;
-      ; data type: integer
+      ; OPTIONAL --log_y-- LOGARITHMIC SCALE Y-AXIS 
+      ;
+      ; logarithmic scale for y-axis is switched on [=1] or off [=0]
+      ;
+      ; data type: integer
+      ;
+      ; example: log_y = 1
       ;
       ; default:   1
       ;***************************************************
-      if (.not. isvar("logy"))then   
+      if (.not. isvar("log_y"))then   
       
          
-         logy = 1
-	 
-	 
-      end if 	 
-      ;***************************************************
-      ; OPTIONAL --normx-- NORMALISE X-AXIS 
+         log_y = 1
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --norm_x-- NORMALISING X-AXIS 
       ;
       ; value for normalising the x-axis
@@ -1393,15 +1889,35 @@
       ; data type: float
       ;
+      ; example: norm_x = 1
+      ;
       ; default:   1. (no normalising)
       ;***************************************************
-      if (.not. isvar("normx"))then   
+      if (.not. isvar("norm_x"))then   
       
          
-         normx = 1.
-	 
-	 
-      end if 	 
-      ;***************************************************
-      ; OPTIONAL --normy-- NORMALISE Y-AXIS 
+         norm_x = 1.
+	 
+	 
+      end if 
+      ;***************************************************
+      ; OPTIONAL --norm_height-- NORMALISING X-AXIS WITH HEIGHT
+      ;
+      ; normalising the x-axis with the height of each spectra is switched on [=1] or off [=0]
+      ;
+      ; data type: integer
+      ;
+      ; example: norm_height = 0
+      ;
+      ; default:   0 (no normalising)
+      ;***************************************************
+      if (.not. isvar("norm_height"))then   
+      
+         
+         norm_height = 0
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --norm_y-- NORMALISE Y-AXIS 
       ;
       ; value for normalising the y-axis
@@ -1409,13 +1925,72 @@
       ; data type: float
       ;
+      ; example: norm_y = 1.
+      ;
       ; default:   1. (no normalising)
       ;***************************************************
-      if (.not. isvar("normy"))then     
+      if (.not. isvar("norm_y"))then     
       
        
-         normy = 1.
-	 
-	 
-      end if 	 
+         norm_y = 1.
+	 
+	 
+      end if
+      ;***************************************************
+      ; OPTIONAL --unit_x--unit_y-- UNITS OF X-, Y-AXES
+      ;
+      ; 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 
+      ; 
+      ; data type: string, 
+      ;
+      ; example: unit_x = "100/m"
+      ;
+      ; default:   " " 
+      ;***************************************************
+      if(.not. isvar("unit_x"))then      
+      	 
+         unit_x = " "	 
+	 
+      end if
+      if(.not. isvar("unit_y"))then      
+      	 
+         unit_y = " "	 
+	 
+      end if 
+      ;***************************************************
+      ; OPTIONAL --font_size-- FONT SIZE OF STRINGS 
+      ;
+      ; font size can be changed to fit to the current plot
+      ;
+      ; data type: float
+      ;
+      ; example: font_size = 0.02
+      ;
+      ; default:   0.02 
+      ;***************************************************
+      if(.not. isvar("font_size"))then
+      
+      	 
+         font_size = 0.02
+	 
+	 
+      end if 
+      ;***************************************************
+      ; OPTIONAL --font_size_legend-- FONT SIZE OF LEGEND STRINGS 
+      ;
+      ; font size of the legend can be changed to fit to the current plot
+      ;
+      ; data type: float
+      ;
+      ; example: font_size_legend = 0.2
+      ;
+      ; default:   0.2 
+      ;***************************************************
+      if(.not. isvar("font_size_legend"))then
+      
+      	 
+         font_size_legend = 0.2
+	 
+	 
+      end if	 
       ;***************************************************
      
@@ -1431,23 +2006,66 @@
       ; REQUIRED --file_1-- INPUT FILE
       ;
-      ; input file produced by PALM; please declare path and name
-      ;
-      ; data type: string
+      ; input file produced by PALM; if there is more than one file for all timesteps of a job chain, 
+      ; 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'); 
+      ; otherwise declare path and full file name
+      ;
+      ; data type: string
+      ;
+      ; example: file_1 = "/path_to_file/file_ts"      if you use more than one cycle number
+      ;          file_1 = "/path_to_file/file_ts.4.nc" if you use one file (e.g. with cycle number 4)
       ;
       ; default:   "File in" 
       ;***************************************************
-      if (.not. isvar("file_1"))then  
+      if(.not. isvar("file_1"))then
+
+
+         file_1 = "File in" 
+	 
+	 
+      end if
+      ;***************************************************
+      ; REQUIRED if more than one file of a job chain --start_f-- START OF CYCLIC NUMBER
+      ;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; example:   start_f = 3 (if first file: example_ts.3.nc)
+      ;
+      ; default:   -1  
+      ;***************************************************
+      if (.not. isvar("start_f"))then  
       
           
-         file_1 = "File in"
-	 
-	 
-      end if 	 
+         start_f = -1
+	 
+	 
+      end if 
+      ;***************************************************
+      ; REQUIRED if more than one file of a job chain --end_f-- END OF CYCLIC NUMBER
+      ;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; example:   end_f = 48 (if last file: example_ts.48.nc)
+      ;
+      ; default:   -1  
+      ;***************************************************
+      if (.not. isvar("end_f"))then  
+      
+          
+         end_f = -1
+	 
+	 
+      end if 
       ;***************************************************
       ; OPTIONAL --format_out-- OUTPUT FORMAT
       ;
-      ; supported file formats: x11, pdf, ps, eps, epsi or ncgm 
-      ;
-      ; data type: string
+      ; format of the output file; supported file formats: x11, pdf, ps, eps, epsi or ncgm 
+      ;
+      ; data type: string
+      ;
+      ; example: format_out = "pdf"
       ;
       ; default:   "x11" 
@@ -1463,7 +2081,9 @@
       ; OPTIONAL --file_out-- OUTPUT FILE
       ;
-      ; please declare path and name 
-      ;
-      ; data type: string
+      ; path and name of the output file
+      ;
+      ; data type: string
+      ;
+      ; example: file_out = "/home/path_to_output/test_ts"
       ;
       ; default:   "~/test_ts" 
@@ -1477,9 +2097,11 @@
       end if 	 
       ;***************************************************
-      ; OPTIONAL --no_columns-- NUMBER OF ROWS
+      ; OPTIONAL --no_columns-- NUMBER OF COLUMNS
       ;
       ; number of plots in one row 
       ;
       ; data type: integer
+      ; 
+      ; example: no_columns = 1
       ;
       ; default:   1
@@ -1493,16 +2115,18 @@
       end if 	 
       ;***************************************************
-      ; OPTIONAL --no_lines-- NUMBER OF COLUMNS
+      ; OPTIONAL --no_rows-- NUMBER OF ROWS
       ;
       ; number of plots in one column 
       ;
       ; data type: integer
+      ; 
+      ; example: no_rows = 2
       ;
       ; default:   2 
       ;***************************************************
-      if (.not. isvar("no_lines"))then
-      
-      	 
-         no_lines = 2
+      if (.not. isvar("no_rows"))then
+      
+      	 
+         no_rows = 2
 	 
 	 
@@ -1511,10 +2135,11 @@
       ; OPTIONAL --var-- OUTPUT VARIABLES
       ;
-      ; names of output variables; please inidcate them with one comma before and after each variable;
-      ; e.g.: var=",u,v,w," (the windcomponents u, v and w will be plotted)
+      ; names of output variables; inidcate them with one comma before and after each variable
       ;
       ; data type: string 
-      ;
-      ; default:   "all" (all available variables will be plotted)
+      ; 
+      ; example: var = ",u,v,w"
+      ;
+      ; default:   "all" (all available variables are plotted)
       ;***************************************************
       if (.not. isvar("var"))then
@@ -1528,9 +2153,11 @@
       ; OPTIONAL --start_time_step-- FIRST TIME STEP
       ;
-      ; first time step of plot; you don't have to specify a precise time value from the input file,
-      ; it will be rounded to the next existent time step
+      ; first time step of plot; there is no need to specify a precise time value from the input file,
+      ; 'start_time_step' is rounded to the next existent time step
       ;
       ; data type: double; dimension: [hour]
       ;
+      ; example:   start_time_step = 0.5 
+      ;
       ; default:   -1.d (first available time step)
       ;***************************************************
@@ -1545,9 +2172,11 @@
       ; OPTIONAL --end_time_step-- LAST TIME STEP
       ;
-      ; last time step of plot; you don't have to specify a precise time value from the input file,
-      ; it will be rounded to the next existent time step
+      ; last time step of plot; there is no need to specify a precise time value from the input file,
+      ; 'end_time_step' is rounded to the next existent time step
       ;
       ; data type: double; dimension: [hour]
       ;
+      ; example:   end_time_step = 2.0
+      ;
       ; default:   -1.d (last available time step)
       ;***************************************************
@@ -1562,9 +2191,11 @@
       ; OPTIONAL --over-- OVERLAYING
       ;
-      ; predefined overlaying of standard variables will be switched on [=1] or off [=0];
+      ; predefined overlaying of standard variables are switched on [=1] or off [=0];
       ; this feature cannot be used with statistic regions
       ;
       ; data type: integer
       ;
+      ; example: over = 0
+      ;
       ; default:   0 
       ;***************************************************
@@ -1575,5 +2206,59 @@
 	 
 	 
-      end if 
+      end if
+      ;***************************************************
+      ; OPTIONAL --font_size-- FONT SIZE OF STRINGS 
+      ;
+      ; font size can be changed to fit to the current plot
+      ;
+      ; data type: float
+      ;
+      ; example: font_size = 0.07
+      ;
+      ; default:   0.07 
+      ;***************************************************
+      if(.not. isvar("font_size"))then
+      
+      	 
+         font_size = 0.07
+	 
+	 
+      end if 
+      ;***************************************************
+      ; OPTIONAL --norm_t-- NORMALISING X-AXIS OF TIMESERIES PLOTS (T-AXIS)
+      ;
+      ; normalising the x-axis with the given value; the unit can explicitly set; by default no normalising and unit is set to [s]
+      ;
+      ; data type: float
+      ;
+      ; example: norm_t = 3600
+      ;
+      ; default:   1. 
+      ;***************************************************
+      if(.not. isvar("normt"))then
+      
+      	 
+         norm_t = 1.
+	 
+	 
+      end if
+      ;***************************************************
+      ; OPTIONAL --unit_t-- UNIT OF X-AXIS OF TIMESERIES PLOTS (T-AXIS)
+      ;
+      ; unit of the x-axis can be set; by default unit is set to [s]
+      ;
+      ; data type: string
+      ;
+      ; example: unit_t = "h"
+      ;
+      ; default:   " " 
+      ;***************************************************
+      if(.not. isvar("unitt"))then
+      
+      	 
+         unit_t = " "
+	 
+	 
+      end if
       ;***************************************************
 
Index: /palm/trunk/SCRIPTS/NCL/profiles.ncl
===================================================================
--- /palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 217)
+++ /palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 218)
@@ -33,31 +33,48 @@
    ;***************************************************
 
-   if (no_files .LT. 1 .OR. no_files .GT. 12) then
-      print(" ")
-      print("Please assign 'no_files' between 1 and 12")  
+   if (no_files .LT. 1 .OR. no_files .GT. 6) then
+      print(" ")
+      print("Assign 'no_files' between 1 and 6")  
       print(" ")
       exit
    end if
-
-   file_in = new(no_files,string)
+   
+   file_in   = new(no_files,string)
+   file_in_1 = new(no_files,logical)
+   start_f   = new(no_files,integer)
+   end_f = new(no_files,integer)
    
    if (file_1 .EQ. "File in") then
       print(" ")
-      print("Please provide 1st input file 'file_1=' in 'ncl_preferences.ncl'")
+      print("Declare 1st input file 'file_1=' in 'ncl_preferences.ncl' or prompt")
       print(" ")
       exit 
    else
       file_in(0) = file_1   
-   end if
-   if (.not. isfilepresent(file_in(0))) then
-      print(" ")
-      print("Your 1st input file: '"+file_in+"' does not exist")
-      print(" ")
+   end if      
+   file_in_1(0) = False
+   if (isStrSubset(file_in(0), ".nc"))then
+      start_f_1 = -2
+      end_f_1 = -2 
+      file_in_1(0) = True     
+   end if  
+   if (start_f_1 .EQ. -1)then
+      print(" ")
+      print("'start_f_1' must be one of the cyclic numbers (at least 0) of your input file(s)")
+      print(" ")  
       exit
-   end if
-   
+   end if 
+   if (end_f_1 .EQ. -1)then
+      print(" ")
+      print("'end_f_1' must be one of the cyclic numbers (at least 0) of your input file(s)")
+      print(" ")  
+      exit
+   end if            
+   start_f(0) = start_f_1 
+   end_f(0) = end_f_1    
+      
    if (prof3d .EQ. -1)then
       print(" ")
-      print("Please set 'prof3d' to 0 or 1")
+      print("Set 'prof3d' to 0 or 1")
       print(" ")
       exit
@@ -74,33 +91,61 @@
       if (file_2 .EQ. "File in") then
          print(" ")
-         print("Please provide 2nd input file 'file_2=' in 'ncl_preferences.ncl'")
+         print("Declare 2nd input file 'file_2=' in 'ncl_preferences.ncl' or prompt")
          print(" ")
          exit 
       else
          file_in(1) = file_2   
+      end if      
+      file_in_1(1) = False
+      if (isStrSubset(file_in(1), ".nc"))then
+         start_f_1 = -2
+         end_f_1 = -2 
+         file_in_1(1) = True     
       end if
-      if (.not. isfilepresent(file_in(1))) then
-         print(" ")
-         print("Your 2nd input file: '"+file_in+"' does not exist")
-         print(" ")
+      if (start_f_2 .EQ. -1)then
+         print(" ")
+         print("'start_f_2' must be one of the cyclic numbers (at least 0) of your input file(s)")
+         print(" ")  
          exit
-      end if
-   end if
+      end if 
+      if (end_f_2 .EQ. -1)then
+         print(" ")
+         print("'end_f_2' must be one of the cyclic numbers (at least 0) of your input file(s)")
+         print(" ")  
+         exit
+      end if      
+      start_f(1) = start_f_2 
+      end_f(1) = end_f_2   
+   end if    
     
    if (no_files .GT. 2) then
       if (file_3 .EQ. "File in") then
          print(" ")
-         print("Please provide 3rd input file 'file_3=' in 'ncl_preferences.ncl'")
+         print("Declare 3rd input file 'file_3=' in 'ncl_preferences.ncl' or prompt")
          print(" ")
          exit 
       else
          file_in(2) = file_3   
+      end if      
+      file_in_1(2) = False
+      if (isStrSubset(file_in(2), ".nc"))then
+         start_f_1 = -2
+         end_f_1 = -2 
+         file_in_1(2) = True     
       end if
-      if (.not. isfilepresent(file_in(2))) then
-         print(" ")
-         print("Your 3rd input file: '"+file_in+"' does not exist")
-         print(" ")
+      if (start_f_3 .EQ. -1)then
+         print(" ")
+         print("'start_f_3' must be one of the cyclic numbers (at least 0) of your input file(s)")
+         print(" ")  
          exit
-      end if
+      end if 
+      if (end_f_3 .EQ. -1)then
+         print(" ")
+         print("'end_f_3' must be one of the cyclic numbers (at least 0) of your input file(s)")
+         print(" ")  
+         exit
+      end if      
+      start_f(2) = start_f_3 
+      end_f(2) = end_f_3  
    end if 
    
@@ -108,16 +153,30 @@
       if (file_4 .EQ. "File in") then
          print(" ")
-         print("Please provide 4th input file 'file_4=' in 'ncl_preferences.ncl'")
+         print("Declare 4th input file 'file_4=' in 'ncl_preferences.ncl' or prompt")
          print(" ")
          exit 
       else
          file_in(3) = file_4   
+      end if      
+      file_in_1(3) = False
+      if (isStrSubset(file_in(3), ".nc"))then
+         start_f_1 = -2
+         end_f_1 = -2 
+         file_in_1(3) = True     
       end if
-      if (.not. isfilepresent(file_in(3))) then
-         print(" ")
-         print("Your 4th input file: '"+file_in+"' does not exist")
-         print(" ")
+      if (start_f_4 .EQ. -1)then
+         print(" ")
+         print("'start_f_4' must be one of the cyclic numbers (at least 0) of your input file(s)")
+         print(" ")  
          exit
-      end if
+      end if 
+      if (end_f_4 .EQ. -1)then
+         print(" ")
+         print("'end_f_4' must be one of the cyclic numbers (at least 0) of your input file(s)")
+         print(" ")  
+         exit
+      end if      
+      start_f(3) = start_f_4 
+      end_f(3) = end_f_4 
    end if 
    
@@ -125,129 +184,63 @@
       if (file_5 .EQ. "File in") then
          print(" ")
-         print("Please provide 5th input file 'file_5=' in 'ncl_preferences.ncl'")
+         print("Declare 5th input file 'file_5=' in 'ncl_preferences.ncl' or prompt")
          print(" ")
          exit 
       else
          file_in(4) = file_5   
+      end if      
+      file_in_1(4) = False
+      if (isStrSubset(file_in(4), ".nc"))then
+         start_f_1 = -2
+         end_f_1 = -2 
+         file_in_1(4) = True     
       end if
-      if (.not. isfilepresent(file_in(4))) then
-         print(" ")
-         print("Your 5th input file: '"+file_in+"' does not exist")
-         print(" ")
+      if (start_f_5 .EQ. -1)then
+         print(" ")
+         print("'start_f_5' must be one of the cyclic numbers (at least 0) of your input file(s)")
+         print(" ")  
          exit
-      end if  
+      end if 
+      if (end_f_5 .EQ. -1)then
+         print(" ")
+         print("'end_f_5' must be one of the cyclic numbers (at least 0) of your input file(s)")
+         print(" ")  
+         exit
+      end if      
+      start_f(4) = start_f_5 
+      end_f(4) = end_f_5    
    end if 
+   
    if (no_files .GT. 5) then
       if (file_6 .EQ. "File in") then
          print(" ")
-         print("Please provide 6th input file 'file_6=' in 'ncl_preferences.ncl'")
+         print("Declare 6th input file 'file_6=' in 'ncl_preferences.ncl' or prompt")
          print(" ")
          exit 
       else
          file_in(5) = file_6   
+      end if      
+      file_in_1(5) = False
+      if (isStrSubset(file_in(5), ".nc"))then
+         start_f_1 = -2
+         end_f_1 = -2 
+         file_in_1(5) = True     
       end if
-      if (.not. isfilepresent(file_in(5))) then
-         print(" ")
-         print("Your 6th input file: '"+file_in+"' does not exist")
-         print(" ")
+      if (start_f_6 .EQ. -1)then
+         print(" ")
+         print("'start_f_6' must be one of the cyclic numbers (at least 0) of your input file(s)")
+         print(" ")  
          exit
-      end if   
+      end if 
+      if (end_f_6 .EQ. -1)then
+         print(" ")
+         print("'end_f_6' must be one of the cyclic numbers (at least 0) of your input file(s)")
+         print(" ")  
+         exit
+      end if      
+      start_f(5) = start_f_6 
+      end_f(5) = end_f_6    
    end if 
-   if (no_files .GT. 6) then
-      if (file_7 .EQ. "File in") then
-         print(" ")
-         print("Please provide 7th input file 'file_7=' in 'ncl_preferences.ncl'")
-         print(" ")
-         exit 
-      else
-         file_in(6) = file_7   
-      end if
-      if (.not. isfilepresent(file_in(6))) then
-         print(" ")
-         print("Your 7th input file: '"+file_in+"' does not exist")
-         print(" ")
-         exit
-      end if    
-   end if 
-   if (no_files .GT. 7) then
-      if (file_8 .EQ. "File in") then
-         print(" ")
-         print("Please provide 8th input file 'file_8=' in 'ncl_preferences.ncl'")
-         print(" ")
-         exit 
-      else
-         file_in(7) = file_8   
-      end if
-      if (.not. isfilepresent(file_in(7))) then
-         print(" ")
-         print("Your 8th input file: '"+file_in+"' does not exist")
-         print(" ")
-         exit
-      end if    
-   end if 
-   if (no_files .GT. 8) then
-      if (file_9 .EQ. "File in") then
-         print(" ")
-         print("Please provide 9th input file 'file_9=' in 'ncl_preferences.ncl'")
-         print(" ")
-         exit 
-      else
-         file_in(8) = file_9   
-      end if
-      if (.not. isfilepresent(file_in(8))) then
-         print(" ")
-         print("Your 9th input file: '"+file_in+"' does not exist")
-         print(" ")
-         exit
-      end if   
-   end if 
-   if (no_files .GT. 9) then
-      if (file_10 .EQ. "File in") then
-         print(" ")
-         print("Please provide 10th input file 'file_10=' in 'ncl_preferences.ncl'")
-         print(" ")
-         exit 
-      else
-         file_in(9) = file_10   
-      end if
-      if (.not. isfilepresent(file_in(9))) then
-         print(" ")
-         print("Your 10th input file: '"+file_in+"' does not exist")
-         print(" ")
-         exit
-      end if   
-   end if 
-   if (no_files .GT. 10) then
-      if (file_11 .EQ. "File in") then
-         print(" ")
-         print("Please provide 11th input file 'file_11=' in 'ncl_preferences.ncl'")
-         print(" ")
-         exit 
-      else
-         file_in(10) = file_11   
-      end if
-      if (.not. isfilepresent(file_in(10))) then
-         print(" ")
-         print("Your 11th input file: '"+file_in+"' does not exist")
-         print(" ")
-         exit
-      end if   
-   end if 
-   if (no_files .GT. 11) then
-      if (file_12 .EQ. "File in") then
-         print(" ")
-         print("Please provide 12th input file 'file_12=' in 'ncl_preferences.ncl'")
-         print(" ")
-         exit 
-      else
-         file_in(11) = file_12   
-      end if
-      if (.not. isfilepresent(file_in(11))) then
-         print(" ")
-         print("Your 12th input file: '"+file_in+"' does not exist")
-         print(" ")
-         exit
-      end if    
-   end if 
+
    
    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
@@ -285,5 +278,5 @@
    if (combine .EQ. 1 .AND. number_comb .EQ. -1) then
       print(" ") 
-      print("Please set 'number_comb' to 2 or 3 or combine to 0")
+      print("Set 'number_comb' to 2 or 3 or combine to 0")
       print(" ")
       exit
@@ -292,5 +285,5 @@
       if (number_comb .EQ. -1) then
          print(" ") 
-         print("Please set 'number_comb' to 2 or 3 or combine to 0")
+         print("Set 'number_comb' to 2 or 3 or combine to 0")
          print(" ")
          exit
@@ -298,5 +291,5 @@
       if (number_comb .NE. 2 .AND. number_comb .NE. 3) then
          print(" ") 
-         print("Please set 'number_comb' to 2 or 3 or combine to 0")
+         print("Set 'number_comb' to 2 or 3 or combine to 0")
          print(" ")
          exit
@@ -305,21 +298,21 @@
    if (combine .EQ. 1 .AND. c_var .EQ. "c_variables") then
       print(" ") 
-      print("Please select variables for overlaying ('c_var') or set combine to 0")
+      print("Select variables for overlaying ('c_var') or set combine to 0")
       print(" ")
       exit
    end if
 
-   if (logy .NE. 0 .AND. logy .NE. 1)then
-      print(" ")
-      print("'logy'= "+logy+" is invalid and set to 0")
-      print(" ")
-      logy = 0
+   if (log_z .NE. 0 .AND. log_z .NE. 1)then
+      print(" ")
+      print("'log_z'= "+log_z+" is invalid and set to 0")
+      print(" ")
+      log_z = 0
    end if    
   
-   if (norm .EQ. 0) then 
-      print(" ")
-      print("You cannot normalise with 0, 'norm' is set to 1")
-      print(" ")
-      norm = 1.0
+   if (norm_z .EQ. 0) then 
+      print(" ")
+      print("Normalising with 0 is not allowed, 'norm_z' is set to 1.0")
+      print(" ")
+      norm_z = 1.0
    end if
 
@@ -330,7 +323,54 @@
    do nof=0,no_files-1
 
-   f=addfile( file_in(nof),"r")
+   files=new(end_f(nof)-start_f(nof)+1,string)
+   if (file_in_1(nof))then
+      if (isfilepresent(file_in(nof)))then
+         files(0)=file_in
+      else
+         print(" ")
+         print("1st input file: '"+file_in+"' does not exist")
+         print(" ")
+         exit
+      end if
+   else
+      if (start_f(nof) .EQ. 0)then
+         if (isfilepresent(file_in(nof)+".nc"))then
+            files(0)=file_in(nof)+".nc"
+            do i=1,end_f(nof)
+   	    if (isfilepresent(file_in(nof)+"."+i+".nc"))then    
+               files(i)=file_in(nof)+"."+i+".nc"
+	    else
+	       print(" ")
+               print("Input file: '"+file_in(nof)+"."+i+".nc' does not exist")
+               print(" ")
+               exit  
+	    end if	    
+         end do         
+         else
+            print(" ")
+            print("Input file: '"+file_in(nof)+".nc' does not exist")
+            print(" ")
+            exit
+         end if
+      else
+         do i=start_f(nof),end_f(nof)
+            if (isfilepresent(file_in(nof)+"."+i+".nc"))then    
+               files(i-start_f(nof))=file_in(nof)+"."+i+".nc"
+   	    else
+	       print(" ")
+               print("Input file: '"+file_in(nof)+"."+i+".nc' does not exist")
+               print(" ")
+               exit  
+	    end if
+         end do
+      end if
+   end if
+
+   f=addfiles(files,"r")
+   f_att=addfile(files(0),"r")
+   ListSetType(f,"cat")
    
-   vNam = getfilevarnames(f) 
+   vNam = getfilevarnames(f_att) 
+
    if (nof .EQ. 0)then
       vNam0=vNam
@@ -364,5 +404,5 @@
    if (dim .EQ. 0) then
       print(" ")
-      print("There are no data on file")
+      print("There is no data on file")
       print(" ")
    end if
@@ -389,13 +429,13 @@
       end if
       if (vNam(varn) .EQ. "u" .OR. isStrSubset(vNam(varn), "u_"))then
-         z_u = f->$vNam(varn+1)$
+         z_u = f_att->$vNam(varn+1)$
          break
       else
          if (vNam(varn) .EQ. "v" .OR. isStrSubset(vNam(varn), "v_"))then  
-            z_u = f->$vNam(varn+1)$
+            z_u = f_att->$vNam(varn+1)$
             break
          else
             if(vNam(varn) .EQ. "pt" .OR. isStrSubset(vNam(varn), "pt_"))then
-               z_u = f->$vNam(varn+1)$
+               z_u = f_att->$vNam(varn+1)$
                break
             else
@@ -405,73 +445,73 @@
                else
                   if(vNam(varn) .EQ. "lpt" .OR. isStrSubset(vNam(varn), "lpt_"))then
-                     z_u = f->$vNam(varn+1)$ 
+                     z_u = f_att->$vNam(varn+1)$ 
                      break
                   else   
                      if(vNam(varn) .EQ. "q" .OR. isStrSubset(vNam(varn), "q_") )then
-                        z_u = f->$vNam(varn+1)$ 
+                        z_u = f_att->$vNam(varn+1)$ 
                         break
                      else
                         if(vNam(varn) .EQ. "qv" .OR. isStrSubset(vNam(varn), "qv_"))then
-                           z_u = f->$vNam(varn+1)$ 
+                           z_u = f_att->$vNam(varn+1)$ 
                            break
                         else
                            if(vNam(varn) .EQ. "ql" .OR. isStrSubset(vNam(varn), "ql_"))then
-                              z_u = f->$vNam(varn+1)$ 
+                              z_u = f_att->$vNam(varn+1)$ 
                               break
                            else
                               if(vNam(varn) .EQ. "rho" .OR. isStrSubset(vNam(varn), "rho_"))then
-                                 z_u = f->$vNam(varn+1)$ 
+                                 z_u = f_att->$vNam(varn+1)$ 
                                  break
                               else
                                  if(vNam(varn) .EQ. "s" .OR. isStrSubset(vNam(varn), "s_") )then
-                                    z_u = f->$vNam(varn+1)$ 
+                                    z_u = f_att->$vNam(varn+1)$ 
                                     break
                                  else
                                     if(vNam(varn) .EQ. "sa" .OR. isStrSubset(vNam(varn), "sa_"))then
-                                       z_u = f->$vNam(varn+1)$ 
+                                       z_u = f_att->$vNam(varn+1)$ 
                                        break
                                     else
                                        if(vNam(varn) .EQ. "e" .OR. isStrSubset(vNam(varn), "e_"))then
-                                          z_u = f->$vNam(varn+1)$ 
+                                          z_u = f_att->$vNam(varn+1)$ 
                                           break
                                        else
                                           if(vNam(varn) .EQ. "es" .OR. isStrSubset(vNam(varn), "es_"))then
-                                             z_u = f->$vNam(varn+1)$ 
+                                             z_u = f_att->$vNam(varn+1)$ 
                                              break
                                           else
                                              if(vNam(varn) .EQ. "km" .OR. isStrSubset(vNam(varn), "km_"))then
-                                                z_u = f->$vNam(varn+1)$ 
+                                                z_u = f_att->$vNam(varn+1)$ 
                                                 break
                                              else
                                                 if(vNam(varn) .EQ. "kh" .OR. isStrSubset(vNam(varn), "kh_"))then
-                                                   z_u = f->$vNam(varn+1)$ 
+                                                   z_u = f_att->$vNam(varn+1)$ 
                                                    break
                                                 else
                                                    if(vNam(varn) .EQ. "l" .OR. isStrSubset(vNam(varn), "l_"))then
-                                                      z_u = f->$vNam(varn+1)$ 
+                                                      z_u = f_att->$vNam(varn+1)$ 
                                                       break
                                                    else
                                                       if(vNam(varn) .EQ. "us2" .OR. isStrSubset(vNam(varn), "us2_"))then
-                                                         z_u = f->$vNam(varn+1)$ 
+                                                         z_u = f_att->$vNam(varn+1)$ 
                                                          break
                                                       else
                                                          if(vNam(varn) .EQ. "vs2" .OR. isStrSubset(vNam(varn), "vs2_") )then
-                                                            z_u = f->$vNam(varn+1)$ 
+                                                            z_u = f_att->$vNam(varn+1)$ 
                                                             break
                                                          else
                                                             if(vNam(varn) .EQ. "pts2" .OR. isStrSubset(vNam(varn), "pts2_"))then
-                                                               z_u = f->$vNam(varn+1)$ 
+                                                               z_u = f_att->$vNam(varn+1)$ 
                                                                break
                                                             else
                                                                if(vNam(varn) .EQ. "wsususodz" .OR. isStrSubset(vNam(varn), "wsususodz_"))then
-                                                                  z_u = f->$vNam(varn+1)$ 
+                                                                  z_u = f_att->$vNam(varn+1)$ 
                                                                   break
                                                                else
                                                                   if(vNam(varn) .EQ. "wspsodz" .OR. isStrSubset(vNam(varn), "wspsodz_"))then
-                                                                     z_u = f->$vNam(varn+1)$ 
+                                                                     z_u = f_att->$vNam(varn+1)$ 
                                                                      break
                                                                   else
                                                                      if(vNam(varn) .EQ. "wpeodz" .OR. isStrSubset(vNam(varn), "wpeodz_"))then
-                                                                        z_u = f->$vNam(varn+1)$
+                                                                        z_u = f_att->$vNam(varn+1)$
                                                                         break                                                                        
                                                                      end if
@@ -506,133 +546,133 @@
       end if 
       if (vNam(varn) .EQ. "w" .OR. isStrSubset(vNam(varn), "w_"))then
-         z_w = f->$vNam(varn+1)$
+         z_w = f_att->$vNam(varn+1)$
          break
       else
          if (vNam(varn) .EQ. "wpup" .OR. isStrSubset(vNam(varn), "wpup_"))then
-            z_w = f->$vNam(varn+1)$
+            z_w = f_att->$vNam(varn+1)$
             break
          else
             if(vNam(varn) .EQ. "wsus" .OR. isStrSubset(vNam(varn), "wsus_"))then
-               z_w = f->$vNam(varn+1)$
+               z_w = f_att->$vNam(varn+1)$
                break
             else
                if(vNam(varn) .EQ. "wu" .OR. isStrSubset(vNam(varn), "wu_"))then
-                  z_w = f->$vNam(varn+1)$ 
+                  z_w = f_att->$vNam(varn+1)$ 
                   break
                else
                   if(vNam(varn) .EQ. "wpvp" .OR. isStrSubset(vNam(varn), "wpvp_"))then
-                     z_w = f->$vNam(varn+1)$ 
+                     z_w = f_att->$vNam(varn+1)$ 
                      break
                   else   
                      if(vNam(varn) .EQ. "wsvs" .OR. isStrSubset(vNam(varn), "wsvs_"))then
-                        z_w = f->$vNam(varn+1)$ 
+                        z_w = f_att->$vNam(varn+1)$ 
                         break
                      else
                         if(vNam(varn) .EQ. "wv" .OR. isStrSubset(vNam(varn), "wv_"))then
-                           z_w = f->$vNam(varn+1)$ 
+                           z_w = f_att->$vNam(varn+1)$ 
                            break
                         else
                            if(vNam(varn) .EQ. "wptpp" .OR. isStrSubset(vNam(varn), "wptpp_"))then
-                              z_w = f->$vNam(varn+1)$ 
+                              z_w = f_att->$vNam(varn+1)$ 
                               break
                            else
                               if(vNam(varn) .EQ. "wspts" .OR. isStrSubset(vNam(varn), "wspts_"))then
-                                 z_w = f->$vNam(varn+1)$ 
+                                 z_w = f_att->$vNam(varn+1)$ 
                                  break
                               else
                                  if(vNam(varn) .EQ. "wpt" .OR. isStrSubset(vNam(varn), "wpz_"))then
-                                    z_w = f->$vNam(varn+1)$
+                                    z_w = f_att->$vNam(varn+1)$
                                     break
                                  else
                                     if(vNam(varn) .EQ. "wsptsBC" .OR. isStrSubset(vNam(varn), "wsptsBC_"))then
-                                       z_w = f->$vNam(varn+1)$ 
+                                       z_w = f_att->$vNam(varn+1)$ 
                                        break
                                     else
                                        if(vNam(varn) .EQ. "wptBC" .OR. isStrSubset(vNam(varn), "wptBC_"))then
-                                          z_w = f->$vNam(varn+1)$ 
+                                          z_w = f_att->$vNam(varn+1)$ 
                                           break
                                        else
                                           if(vNam(varn) .EQ. "wpvptp" .OR. isStrSubset(vNam(varn), "wpvptp_"))then
-                                             z_w = f->$vNam(varn+1)$ 
+                                             z_w = f_att->$vNam(varn+1)$ 
                                              break
                                           else
                                              if(vNam(varn) .EQ. "wsvpts" .OR. isStrSubset(vNam(varn), "wsvpts_"))then
-                                                z_w = f->$vNam(varn+1)$
+                                                z_w = f_att->$vNam(varn+1)$
                                                 break
                                              else
                                                 if(vNam(varn) .EQ. "wvpt" .OR. isStrSubset(vNam(varn), "wvpt_"))then
-                                                   z_w = f->$vNam(varn+1)$ 
+                                                   z_w = f_att->$vNam(varn+1)$ 
                                                    break
                                                 else
                                                    if(vNam(varn) .EQ. "wpqp" .OR. isStrSubset(vNam(varn), "wpqp_"))then
-                                                      z_w = f->$vNam(varn+1)$ 
+                                                      z_w = f_att->$vNam(varn+1)$ 
                                                       break
                                                    else
                                                       if(vNam(varn) .EQ. "wsqs" .OR. isStrSubset(vNam(varn), "wsqs_"))then
-                                                         z_w = f->$vNam(varn+1)$ 
+                                                         z_w = f_att->$vNam(varn+1)$ 
                                                          break
                                                       else
                                                          if(vNam(varn) .EQ. "wq" .OR. isStrSubset(vNam(varn), "wq_"))then
-                                                            z_w = f->$vNam(varn+1)$ 
+                                                            z_w = f_att->$vNam(varn+1)$ 
                                                             break
                                                          else
                                                             if(vNam(varn) .EQ. "wpqvp" .OR. isStrSubset(vNam(varn), "wpqvp_"))then
-                                                               z_w = f->$vNam(varn+1)$ 
+                                                               z_w = f_att->$vNam(varn+1)$ 
                                                                break
                                                             else
                                                                if(vNam(varn) .EQ. "wsqvs" .OR. isStrSubset(vNam(varn), "wsqvs_"))then
-                                                                  z_w = f->$vNam(varn+1)$ 
+                                                                  z_w = f_att->$vNam(varn+1)$ 
                                                                   break
                                                                else
                                                                   if(vNam(varn) .EQ. "wqv" .OR. isStrSubset(vNam(varn), "wqv_"))then
-                                                                     z_w = f->$vNam(varn+1)$ 
+                                                                     z_w = f_att->$vNam(varn+1)$ 
                                                                      break
                                                                   else
                                                                      if(vNam(varn) .EQ. "wpsp" .OR. isStrSubset(vNam(varn), "wpsp_"))then
-                                                                        z_w = f->$vNam(varn+1)$
+                                                                        z_w = f_att->$vNam(varn+1)$
                                                                         break 
                                                                      else
                                                                         if(vNam(varn) .EQ. "wsss" .OR. isStrSubset(vNam(varn), "wsss_"))then
-                                                                           z_w = f->$vNam(varn+1)$
+                                                                           z_w = f_att->$vNam(varn+1)$
                                                                            break 
                                                                         else
                                                                            if(vNam(varn) .EQ. "ws" .OR. isStrSubset(vNam(varn), "ws_"))then
-                                                                              z_w = f->$vNam(varn+1)$
+                                                                              z_w = f_att->$vNam(varn+1)$
                                                                               break 
                                                                            else
                                                                               if(vNam(varn) .EQ. "wpsap" .OR. isStrSubset(vNam(varn), "wpsap_"))then
-                                                                                 z_w = f->$vNam(varn+1)$
+                                                                                 z_w = f_att->$vNam(varn+1)$
                                                                                  break 
                                                                               else
                                                                                  if(vNam(varn) .EQ. "wssas" .OR. isStrSubset(vNam(varn), "wssas_") )then
-                                                                                    z_w = f->$vNam(varn+1)$
+                                                                                    z_w = f_att->$vNam(varn+1)$
                                                                                     break 
                                                                                  else
                                                                                     if(vNam(varn) .EQ. "wsa" .OR. isStrSubset(vNam(varn), "wsa_"))then
-                                                                                       z_w = f->$vNam(varn+1)$
+                                                                                       z_w = f_att->$vNam(varn+1)$
                                                                                        break 
                                                                                     else
                                                                                        if(vNam(varn) .EQ. "wses" .OR. isStrSubset(vNam(varn), "wses_"))then
-                                                                                          z_w = f->$vNam(varn+1)$
+                                                                                          z_w = f_att->$vNam(varn+1)$
                                                                                           break 
                                                                                        else
                                                                                           if(vNam(varn) .EQ. "ws2" .OR. isStrSubset(vNam(varn), "ws2_"))then
-                                                                                             z_w = f->$vNam(varn+1)$
+                                                                                             z_w = f_att->$vNam(varn+1)$
                                                                                              break 
                                                                                           else
                                                                                              if(vNam(varn) .EQ. "ws3" .OR. isStrSubset(vNam(varn), "ws3_"))then
-                                                                                                z_w = f->$vNam(varn+1)$
+                                                                                                z_w = f_att->$vNam(varn+1)$
                                                                                                 break 
                                                                                              else
                                                                                                 if(vNam(varn) .EQ. "Sw" .OR. isStrSubset(vNam(varn), "Sw_"))then
-                                                                                                   z_w = f->$vNam(varn+1)$
+                                                                                                   z_w = f_att->$vNam(varn+1)$
                                                                                                    break 
                                                                                                 else
                                                                                                    if(vNam(varn) .EQ. "ws2pts".OR. isStrSubset(vNam(varn), "ws2pts_") )then
-                                                                                                      z_w = f->$vNam(varn+1)$
+                                                                                                      z_w = f_att->$vNam(varn+1)$
                                                                                                       break 
                                                                                                    else
                                                                                                       if(vNam(varn) .EQ. "wspts2" .OR. isStrSubset(vNam(varn), "wspts2_"))then
-                                                                                                         z_w = f->$vNam(varn+1)$
+                                                                                                         z_w = f_att->$vNam(varn+1)$
                                                                                                          break                                            
                                                                                                       end if
@@ -685,5 +725,5 @@
          if (check)then
             co=co+1
-            z = f->$vNam(varn+1)$
+            z = f_att->$vNam(varn+1)$
 	    if (getvardims(z) .EQ. "zu")then
 	       z_u = z
@@ -718,12 +758,30 @@
       do varn = dim-1,0,1
          if (vNam(varn) .EQ. "zu_3d")then
-            z_u = f->zu_3d  
+            z_u = f_att->zu_3d  
             dimz  = dimsizes(z_u)         
          else 
             if (vNam(varn) .EQ. "zw_3d")then
-               z_w = f->zw_3d
+               z_w = f_att->zw_3d
                dimz  = dimsizes(z_w)
             end if
          end if
+	 if (vNam(varn) .EQ. "x")then
+	    x = f_att->x
+	    dimx=dimsizes(x)
+	 else
+	    if (vNam(varn) .EQ. "xu")then
+	       x = f_att->xu
+	       dimx=dimsizes(x)
+	    end if
+	 end if
+	 if (vNam(varn) .EQ. "y")then
+	    y = f_att->y
+	    dimy=dimsizes(y)
+	 else
+	    if (vNam(varn) .EQ. "yv")then
+	       y = f_att->yv
+	       dimy=dimsizes(y)
+	    end if
+	 end if
       end do
 
@@ -733,13 +791,16 @@
       print(" ")
       print("Program aborts - there are no z-variables available")
-      print("Please be sure if 'plot_3d' is set correctly")
+      print("Be sure if 'plot_3d' is set correctly")
       print(" ")
       exit
    end if
    
-   t_all = f->time
+   if (prof3d .EQ. 1)then
+      t_all = f[:]->time
+   else
+      t_all = f[:]->time(1:) 
+   end if
    nt    = dimsizes(t_all)
    delta_t=t_all(nt-1)/nt
-
 
    ; ****************************************************	
@@ -754,5 +815,5 @@
          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")
          print(" ")
-         print("Please select another 'start_time_step'")
+         print("Select another 'start_time_step'")
          print(" ")
          exit
@@ -766,5 +827,5 @@
    end if
 
-   do i=0,nt-1     
+   do i=0,nt-1    
       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
          st=i
@@ -776,5 +837,5 @@
       print("'start_time_step' = "+ start_time_step +"h is invalid")
       print(" ")
-      print("Please select another 'start_time_step'")
+      print("Select another 'start_time_step'")
       print(" ")
       exit
@@ -792,5 +853,5 @@
          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")
          print(" ")
-         print("Please select another 'end_time_step'")  
+         print("Select another 'end_time_step'")  
          print(" ")
          exit
@@ -800,5 +861,5 @@
          print("'end_time_step' = "+ end_time_step +"h is lower than 'start_time_step' = "+start_time_step+"h")
          print(" ")
-         print("Please select another 'start_time_step' or 'end_time_step'")
+         print("Select another 'start_time_step' or 'end_time_step'")
          print(" ")
          exit
@@ -816,5 +877,5 @@
       print("'end_time_step' = "+ end_time_step +"h is invalid")
       print(" ")
-      print("Please select another 'end_time_step'")
+      print("Select another 'end_time_step'")
       print(" ")
       exit
@@ -838,5 +899,5 @@
    do p=start_time_step,end_time_step
       if (t_all(p)/3600 .LT. 1) then
-         legend_label(p-start_time_step)=decimalPlaces(t_all(p)/3600,2,True)
+         legend_label(p-start_time_step)=decimalPlaces(t_all(p)/3600,3,True)
       else
          legend_label(p-start_time_step)=decimalPlaces(t_all(p)/3600,0,True)
@@ -872,21 +933,23 @@
    res@pmLegendWidthF          = 0.12
    res@pmLegendHeightF         = 0.04*(end_time_step-start_time_step+1)
-   res@lgLabelFontHeightF     = .02
+   res@lgLabelFontHeightF     = font_size
    res@lgTitleString      = "Time [h]"
-   res@lgTitleFontHeightF = 0.02   
-   res@txFontHeightF      = 0.02
-   res@tiXAxisFontHeightF = 0.02
-   res@tiYAxisFontHeightF = 0.02
+   res@lgTitleFontHeightF = font_size   
+   res@txFontHeightF      = font_size
+   res@tiXAxisFontHeightF = font_size
+   res@tiYAxisFontHeightF = font_size
+   res@tmXBLabelFontHeightF = font_size
+   res@tmYLLabelFontHeightF = font_size
    res@tiXAxisString      = " " 
    if ( black .eq. 0 ) then  
       res@xyLineColors = ispan(2,237,235/np)
    end if
-   if (norm .EQ. 1)then
+   if (norm_z .EQ. 1)then
       res@tiYAxisString      = "Height [m]"
    else   
-      res@tiYAxisString      = "Height / "+norm+" [m]"
+      res@tiYAxisString      = "Height / "+norm_z+" [m]"
    end if
     
-   if (logy .EQ. 1) then
+   if (log_z .EQ. 1) then
       res@trYLog = True 
    end if
@@ -902,10 +965,13 @@
       end if       
    end if 
+   
+   res@tmXBMinorPerMajor = 4
+   res@tmYLMinorPerMajor = 4
 
    resP                        = True
    resP@txFont                 = "helvetica"
-   resP@txString               = f@title
+   resP@txString               = f_att@title
    resP@txFuncCode             = "~"
-   resP@txFontHeightF          = 0.014
+   resP@txFontHeightF          = 0.015
 
    ; ***************************************************
@@ -928,5 +994,5 @@
    ; *************************************************** 
 
-   if (logy .EQ. 1)then
+   if (log_z .EQ. 1)then
       if (min_z .EQ. -1)then
          if (isvar("z_u"))then
@@ -1016,6 +1082,6 @@
    end if
 
-   min_z=min_z/norm
-   max_z=max_z/norm
+   min_z=min_z/norm_z
+   max_z=max_z/norm_z
 
    ; ***************************************************
@@ -1030,5 +1096,5 @@
    end do  
    
-   if (logy .EQ. 1) then
+   if (log_z .EQ. 1) then
       data   = new((/dim,(end_time_step-start_time_step)+1,dimz-1/),float) 
       data_0 = new((/(end_time_step-start_time_step)+1,dimz-1/),float)
@@ -1252,5 +1318,74 @@
       maxiwpeodz =-1.E27
    end if
- 
+
+   if (prof3d .EQ. 1)then
+
+   if (end_x .EQ. -1) then 
+      end_x=dimx-2
+   end if
+   if (end_y .EQ. -1)then
+      end_y=dimy-2
+   end if
+   if (start_x .LT. 0)then
+      print(" ")
+      print("'start_x' is lower than 0 and set to 0")
+      print(" ")
+      start_x=0
+   end if
+   if (start_x .GT. dimx-1)then
+      print(" ")
+      print("'start_x' is greater than available x-range and set to maximum of x-range (excluding ghostpoint)")
+      print(" ")
+      start_x=dimx-2
+   end if
+   if (end_x .EQ. dimx-1)then
+      print(" ")
+      print("'end_x' = "+end_x+" and includes the ghostpoint")
+      print(" ")
+   end if
+   if (end_x .GT. dimx-1)then
+      print(" ")
+      print("'end_x' = "+end_x+" is greater than available x-range and set to maximum of x-range (excluding ghostpoint)")
+      print(" ")
+      end_x=dimx-2
+   end if
+   if (end_x .LT. start_x)then
+      print(" ")
+      print("'end_x' = "+end_x+" is lower than 'start_x' = "+start_x+" and set to maximum of x-range (excluding ghostpoint)")
+      print(" ")
+      end_x=dimx-2
+   end if
+   if (start_y .LT. 0)then
+      print(" ")
+      print("'start_y' is lower than 0 and set to 0")
+      print(" ")
+      start_y=0
+   end if
+   if (start_y .GT. dimy-1)then
+      print(" ")
+      print("'start_y' is greater than available y-range and set to maximum of y-range (excluding ghostpoint)")
+      print(" ")
+      start_x=dimy-2
+   end if
+   if (end_y .EQ. dimy-1)then
+      print(" ")
+      print("'end_y' = "+end_y+" and includes the ghostpoint")
+      print(" ")
+   end if
+   if (end_y .GT. dimy-1)then
+      print(" ")
+      print("'end_y' = "+end_y+" is greater than available y-range and set to maximum of y-range (excluding ghostpoint)")
+      print(" ")
+      end_x=dimy-2
+   end if
+   if (end_y .LT. start_y)then
+      print(" ")
+      print("'end_y' = "+end_y+" is lower than 'start_y' = "+start_y+" and set to maximum of y-range (excluding ghostpoint)")
+      print(" ")
+      end_y=dimy-2
+   end if
+   
+   end if
+  
    n_o=0
    count_var=0
@@ -1278,6 +1413,7 @@
          if (com) then      
             if (prof3d .EQ. 0) then
-               temp = f->$vNam(varn)$
-               if (logy .EQ. 1) then
+               temp = f[:]->$vNam(varn)$(1:,:)
+	       temp_att = f_att->$vNam(varn)$ 
+               if (log_z .EQ. 1) then
                   data(varn,:,:) = temp(start_time_step:end_time_step,1:dimz-1)
                else
@@ -1285,9 +1421,11 @@
                end if
             else
-               if (logy .EQ. 1) then
+               if (log_z .EQ. 1) then
                   do i=1,dimz-1
                      do j=start_time_step,end_time_step
-                        temp= f->$vNam(varn)$(j,i,:,:)
-                        data(varn,j-start_time_step,i-1) = dim_avg_Wrap(dim_avg_Wrap(temp(:,:)))
+                        temp= f[:]->$vNam(varn)$
+			temp_att = f_att->$vNam(varn)$ 
+			data_temp = temp(j,i,start_y:end_y,start_x:end_x)
+			data(varn,j-start_time_step,i-1) = dim_avg_Wrap(dim_avg_Wrap(data_temp))
                      end do
                   end do
@@ -1295,6 +1433,8 @@
                   do i=0,dimz-1
                      do j=start_time_step,end_time_step
-                        temp= f->$vNam(varn)$(j,i,:,:)
-                        data(varn,j-start_time_step,i) = dim_avg_Wrap(dim_avg_Wrap(temp(:,:)))
+                        temp= f[:]->$vNam(varn)$
+			temp_att = f_att->$vNam(varn)$ 
+			data_temp = temp(j,i,start_y:end_y,start_x:end_x)
+                        data(varn,j-start_time_step,i) = dim_avg_Wrap(dim_avg_Wrap(data_temp))
                      end do
                   end do
@@ -1304,8 +1444,8 @@
                print(" ")
             end if                 
-            unit(varn) = temp@units
+            unit(varn) = temp_att@units
             if (n_o .GT. number_comb-1) then
                print(" ")
-               print("Please set 'number_comb' to the number of overlaying variables ('c_var' = "+c_var+")")
+               print("Set 'number_comb' to the number of overlaying variables ('c_var' = "+c_var+")")
                print(" ")
                exit
@@ -1318,5 +1458,4 @@
 
       if(check) then
-
          if (isStrSubset(vNam(varn),"_0" ))then
             print(" ")
@@ -1329,11 +1468,14 @@
 
          if (prof3d .EQ. 0) then
-            temp = f->$vNam(varn)$
+            temp = f[:]->$vNam(varn)$(1:,:)
+	    temp_att = f_att->$vNam(varn)$ 
          else
-             if (logy .EQ. 1) then
+             if (log_z .EQ. 1) then
                do i=1,dimz-1
                   do j=start_time_step,end_time_step
-                     temp= f->$vNam(varn)$(j,i,:,:)
-                     data(varn,j-start_time_step,i-1) = dim_avg_Wrap(dim_avg_Wrap(temp(:,:)))
+                     temp= f[:]->$vNam(varn)$(j,i,start_y:end_y,start_x:end_x)
+		     temp_att = f_att->$vNam(varn)$ 
+		     data_temp = temp(j,i,start_y:end_y,start_x:end_x)
+                     data(varn,j-start_time_step,i-1) = dim_avg_Wrap(dim_avg_Wrap(data_temp))
                   end do
                end do
@@ -1341,6 +1483,10 @@
                do i=0,dimz-1
                   do j=start_time_step,end_time_step
-                     temp= f->$vNam(varn)$(j,i,:,:)
-                     data(varn,j-start_time_step,i) = dim_avg_Wrap(dim_avg_Wrap(temp(:,:)))
+                     temp= f[:]->$vNam(varn)$;(j,i,start_y:end_y,start_x:end_x)
+		     temp_att = f_att->$vNam(varn)$ 
+		     data_temp = temp(j,i,start_y:end_y,start_x:end_x)
+		     data_temp!0 = "t"
+		     data_temp!1 = "z"
+                     data(varn,j-start_time_step,i) = dim_avg_Wrap(dim_avg_Wrap(data_temp))
                   end do
                end do
@@ -1349,24 +1495,24 @@
             print("Variable '"+vNam(varn)+"' is read")
             print(" ")
-            unit(varn) = temp@units
-            a=getvaratts(temp)
+            unit(varn) = temp_att@units
+            a=getvardims(temp_att)
             b=dimsizes(a)
          end if
-    
+
          if (prof3d .EQ. 0) then
-            if (logy .EQ. 1) then
-               z = f->$vNam(varn+1)$(1:dimz-1) 
-               unit(varn) = temp@units
+            if (log_z .EQ. 1) then
+               z = f_att->$vNam(varn+1)$(1:dimz-1) 
+               unit(varn) = temp_att@units
                data(varn,:,:) = temp(start_time_step:end_time_step,1:dimz-1) 
             else
-               z = f->$vNam(varn+1)$ 
-               unit(varn) = temp@units
+               z = f_att->$vNam(varn+1)$ 
+               unit(varn) = temp_att@units
                data(varn,:,:) = temp(start_time_step:end_time_step,:) 
             end if
          else 
-            do i=0,b-1            
+            do i=0,b-1           
                if (isStrSubset( a(i),"zu_3d" ))then
                   z_v(varn,:) = z_u
-                  if (logy .EQ. 1) then
+                  if (log_z .EQ. 1) then
                      z = z_v(varn,1:dimz-1)
                   else
@@ -1376,5 +1522,5 @@
                   if (isStrSubset( a(i),"zw_3d" ))then
                      z_v(varn,:) = z_w
-                     if (logy .EQ. 1) then
+                     if (log_z .EQ. 1) then
                         z = z_v(varn,1:dimz-1)
                      else
@@ -1390,13 +1536,14 @@
          end if
          if (nof .EQ. 0) then
-            z_(n,:)=z/norm
+            z_(n,:)=z/norm_z
             z    = z_(n,:)
          else
-            z=z/norm
+            z=z/norm_z
          end if
     
          if (over .EQ. 0) then  
             res@gsnLeftString      = vNam(varn)
-            res@gsnRightString     = unit(varn)
+	    res@tiXAxisString      = "["+unit(varn)+"]"
+            res@gsnRightString     = " "
             res@trYMinF            = min_z
             res@trYMaxF            = max_z 
@@ -1422,5 +1569,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "                 
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniu
@@ -1444,5 +1592,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "                  
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniv
@@ -1466,5 +1615,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then
                      res@trXMinF            = miniw
@@ -1489,5 +1639,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = minipt
@@ -1511,5 +1662,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = minivpt
@@ -1533,5 +1685,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = minilpt
@@ -1556,5 +1709,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = minilq
@@ -1578,5 +1732,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = minilqv
@@ -1600,5 +1755,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniql
@@ -1623,5 +1779,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = minie
@@ -1645,5 +1802,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = minies
@@ -1668,5 +1826,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = minikm
@@ -1690,5 +1849,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = minikh
@@ -1713,5 +1873,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwpup
@@ -1735,5 +1896,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwsus
@@ -1757,5 +1919,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwu
@@ -1780,5 +1943,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwpvp
@@ -1802,5 +1966,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwsvs
@@ -1824,5 +1989,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwv
@@ -1847,5 +2013,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwpptp
@@ -1869,5 +2036,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwspts
@@ -1891,5 +2059,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwpt
@@ -1914,5 +2083,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwsptsBC
@@ -1936,5 +2106,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwptBC
@@ -1959,5 +2130,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwpvptp
@@ -1981,5 +2153,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwsvpts
@@ -2003,5 +2176,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwvpt
@@ -2026,5 +2200,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwpqp
@@ -2048,5 +2223,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwsqs
@@ -2070,5 +2246,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwq
@@ -2093,5 +2270,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwpqvp
@@ -2115,5 +2293,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwsqvs
@@ -2137,5 +2316,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwqv
@@ -2160,5 +2340,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwpsp
@@ -2182,5 +2363,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwsss
@@ -2204,5 +2386,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniws
@@ -2227,5 +2410,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwpsap
@@ -2249,5 +2433,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwssas
@@ -2271,5 +2456,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwsa
@@ -2294,5 +2480,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = minius2
@@ -2316,5 +2503,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = minivs2
@@ -2338,5 +2526,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniws2
@@ -2361,5 +2550,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwsususodz
@@ -2383,5 +2573,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwspsodz
@@ -2405,5 +2596,6 @@
                else
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
                      res@trXMinF            = miniwpeodz
@@ -2437,7 +2629,10 @@
    if (no_files .GT. 1) then
       delete(vNam)
-   end if
+      delete(files)
+   end if
+   
    end do
-
+   ;#########ENDE DO LOOP FOR no_files GT 1#############
+   
    if (count_var .EQ. 0) then
       print(" ")
@@ -2449,6 +2644,6 @@
    
    if (no_files .GT. 1) then 
-      multi_legend=new(12,string)
-      string_len=new(12,integer)
+      multi_legend=new(6,string)
+      string_len=new(6,integer)
       multi_dash=new(no_files,string)
       multi_legend(0)="  "+name_legend_1
@@ -2464,16 +2659,4 @@
       multi_legend(5)="  "+name_legend_6 
       string_len(5)=strlen(multi_legend(5))
-      multi_legend(6)="  "+name_legend_7
-      string_len(6)=strlen(multi_legend(6)) 
-      multi_legend(7)="  "+name_legend_8
-      string_len(7)=strlen(multi_legend(7))
-      multi_legend(8)="  "+name_legend_9
-      string_len(8)=strlen(multi_legend(8)) 
-      multi_legend(9)="  "+name_legend_10
-      string_len(9)=strlen(multi_legend(9))
-      multi_legend(10)="  "+name_legend_11 
-      string_len(10)=strlen(multi_legend(10))
-      multi_legend(11)="  "+name_legend_12 
-      string_len(11)=strlen(multi_legend(11))
       do ml=1,no_files
          multi_dash(ml-1)=ml-1
@@ -2497,5 +2680,5 @@
          lgMonoDashIndex          = False
          lgres@lgLabelFont        = "helvetica"    
-         lgres@lgLabelFontHeightF = .2            
+         lgres@lgLabelFontHeightF = font_size_legend            
          lgres@vpWidthF           = max(string_len)*0.012           
          lgres@vpHeightF          = 0.04*no_files          
@@ -2518,5 +2701,5 @@
    if (count_var .EQ. 0) then
       print(" ")
-      print("Please select a variable 'var=' or use the default value")
+      print("Select a variable 'var=' or use the default value")
       print(" ")
       print("Your selection '"+var+"' does not exist on the input file")
@@ -2598,5 +2781,5 @@
 
             if (prof3d .EQ. 0) then
-               if (logy .EQ. 1) then
+               if (log_z .EQ. 1) then
                   z = f->$vNam(varn+1)$(1:dimz-1) 
                else
@@ -2607,5 +2790,5 @@
                   if (isStrSubset( a(i),"zu_3d" ))then
                      z_v(varn,:) = z_u
-                     if (logy .EQ. 1) then
+                     if (log_z .EQ. 1) then
                         z = z_v(varn,1:dimz-1)
                      else
@@ -2615,5 +2798,5 @@
                      if (isStrSubset( a(i),"zw_3d" ))then
                         z_v(varn,:) = z_w
-                        if (logy .EQ. 1) then
+                        if (log_z .EQ. 1) then
                            z = z_v(varn,1:dimz-1)
                         else
@@ -2625,8 +2808,9 @@
             end if
 
-            z=z/norm
+            z=z/norm_z
 
             res@gsnLeftString      = vNam(varn)
-            res@gsnRightString     = unit(varn)
+	    res@tiXAxisString      = "["+unit(varn)+"]"
+            res@gsnRightString     = " "
             res@trYMinF            = min_z
             res@trYMaxF            = max_z  
@@ -2646,5 +2830,6 @@
                if (u .EQ. 0) then
                   res@gsnLeftString      = "u, v and w"
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then
                      res@trXMinF = min((/miniu,miniv,miniw/))
@@ -2666,5 +2851,5 @@
                   lgMonoDashIndex          = False
                   lgres@lgLabelFont        = "helvetica"    
-                  lgres@lgLabelFontHeightF = .1            
+                  lgres@lgLabelFontHeightF = font_size_legend            
                   lgres@vpWidthF           = 0.12           
                   lgres@vpHeightF          = 0.1          
@@ -2689,5 +2874,6 @@
                if (pt .EQ. 0) then
                   res@gsnLeftString      = "pt, vpt and lpt"
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then
                      res@trXMinF = min((/minipt,minivpt,minilpt/))
@@ -2710,5 +2896,5 @@
                   lgMonoDashIndex          = False
                   lgres@lgLabelFont        = "helvetica"    
-                  lgres@lgLabelFontHeightF = .1            
+                  lgres@lgLabelFontHeightF = font_size_legend           
                   lgres@vpWidthF           = 0.12           
                   lgres@vpHeightF          = 0.1          
@@ -2732,5 +2918,6 @@
                if (q .EQ. 0) then
                   res@gsnLeftString      = "q, qv and ql"
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then
                      res@trXMinF = min((/miniq,miniqv,miniql/))
@@ -2753,5 +2940,5 @@
                   lgMonoDashIndex          = False
                   lgres@lgLabelFont        = "helvetica"    
-                  lgres@lgLabelFontHeightF = .1            
+                  lgres@lgLabelFontHeightF = font_size_legend            
                   lgres@vpWidthF           = 0.12           
                   lgres@vpHeightF          = 0.1          
@@ -2776,5 +2963,6 @@
                if (e .EQ. 0) then
                   res@gsnLeftString      = "e and es"
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then
                      res@trXMinF = min((/minie,minies/))
@@ -2797,5 +2985,5 @@
                   lgMonoDashIndex          = False
                   lgres@lgLabelFont        = "helvetica"    
-                  lgres@lgLabelFontHeightF = .1            
+                  lgres@lgLabelFontHeightF = font_size_legend           
                   lgres@vpWidthF           = 0.12           
                   lgres@vpHeightF          = 0.1          
@@ -2819,5 +3007,6 @@
                if (km .EQ. 0) then
                   res@gsnLeftString      = "km and kh"
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then
                      res@trXMinF = min((/minikm,minikh/))
@@ -2840,5 +3029,5 @@
                   lgMonoDashIndex          = False
                   lgres@lgLabelFont        = "helvetica"    
-                  lgres@lgLabelFontHeightF = .1            
+                  lgres@lgLabelFontHeightF = font_size_legend           
                   lgres@vpWidthF           = 0.12           
                   lgres@vpHeightF          = 0.1          
@@ -2863,5 +3052,6 @@
                if (wpup .EQ. 0) then
                   res@gsnLeftString      = "wpup, wsus and wu"
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then
                      res@trXMinF = min((/miniwpup,miniwsus,miniwu/))
@@ -2884,5 +3074,5 @@
                   lgMonoDashIndex          = False
                   lgres@lgLabelFont        = "helvetica"    
-                  lgres@lgLabelFontHeightF = .1            
+                  lgres@lgLabelFontHeightF = font_size_legend            
                   lgres@vpWidthF           = 0.12           
                   lgres@vpHeightF          = 0.1          
@@ -2906,5 +3096,6 @@
                if (wpvp .EQ. 0) then
                   res@gsnLeftString      = "wpvp, wsus and wv"
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then
                      res@trXMinF = min((/miniwpvp,miniwsvs,miniwv/))
@@ -2927,5 +3118,5 @@
                   lgMonoDashIndex          = False
                   lgres@lgLabelFont        = "helvetica"    
-                  lgres@lgLabelFontHeightF = .1            
+                  lgres@lgLabelFontHeightF = font_size_legend            
                   lgres@vpWidthF           = 0.12           
                   lgres@vpHeightF          = 0.1          
@@ -2949,5 +3140,6 @@
                if (wpptp .EQ. 0) then
                   res@gsnLeftString      = "wpptp, wspts and wv"
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then
                      res@trXMinF = min((/miniwpptp,miniwspts,miniwpt/))
@@ -2970,5 +3162,5 @@
                   lgMonoDashIndex          = False
                   lgres@lgLabelFont        = "helvetica"    
-                  lgres@lgLabelFontHeightF = .1            
+                  lgres@lgLabelFontHeightF = font_size_legend            
                   lgres@vpWidthF           = 0.12           
                   lgres@vpHeightF          = 0.1          
@@ -2992,5 +3184,6 @@
                if (wsptsBC .EQ. 0) then
                   res@gsnLeftString      = "wsptsBC and wptBC"
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then
                      res@trXMinF = min((/miniwsptsBC,miniwptBC/))
@@ -3013,5 +3206,5 @@
                   lgMonoDashIndex          = False
                   lgres@lgLabelFont        = "helvetica"    
-                  lgres@lgLabelFontHeightF = .1            
+                  lgres@lgLabelFontHeightF = font_size_legend            
                   lgres@vpWidthF           = 0.12           
                   lgres@vpHeightF          = 0.1          
@@ -3035,5 +3228,6 @@
                if (wpvptp .EQ. 0) then
                   res@gsnLeftString      = "wpvptp, wsvpts and wv"
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then
                      res@trXMinF = min((/miniwpvptp,miniwsvpts,miniwvpt/))
@@ -3056,5 +3250,5 @@
                   lgMonoDashIndex          = False
                   lgres@lgLabelFont        = "helvetica"    
-                  lgres@lgLabelFontHeightF = .1            
+                  lgres@lgLabelFontHeightF = font_size_legend            
                   lgres@vpWidthF           = 0.12           
                   lgres@vpHeightF          = 0.1          
@@ -3078,5 +3272,6 @@
                if (wpqp .EQ. 0) then 
                   res@gsnLeftString      = "wpqp, wsqs and wq"
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then
                      res@trXMinF = min((/miniwpqp,miniwsqs,miniwq/))
@@ -3099,5 +3294,5 @@
                   lgMonoDashIndex          = False
                   lgres@lgLabelFont        = "helvetica"    
-                  lgres@lgLabelFontHeightF = .1            
+                  lgres@lgLabelFontHeightF = font_size_legend           
                   lgres@vpWidthF           = 0.12           
                   lgres@vpHeightF          = 0.1          
@@ -3121,5 +3316,6 @@
                if (wpqvp .EQ. 0) then
                   res@gsnLeftString      = "wpqvp, wsqvs and wqv"
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then
                      res@trXMinF = min((/miniwpqp,miniwsqvs,miniwqv/))
@@ -3142,5 +3338,5 @@
                   lgMonoDashIndex          = False
                   lgres@lgLabelFont        = "helvetica"    
-                  lgres@lgLabelFontHeightF = .1            
+                  lgres@lgLabelFontHeightF = font_size_legend            
                   lgres@vpWidthF           = 0.12           
                   lgres@vpHeightF          = 0.1          
@@ -3164,5 +3360,6 @@
                if (wpsp .EQ. 0) then
                   res@gsnLeftString      = "wpsp, wsss and ws"
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then
                      res@trXMinF = min((/miniwpsp,miniwsss,miniws/))
@@ -3185,5 +3382,5 @@
                   lgMonoDashIndex          = False
                   lgres@lgLabelFont        = "helvetica"    
-                  lgres@lgLabelFontHeightF = .1            
+                  lgres@lgLabelFontHeightF = font_size_legend            
                   lgres@vpWidthF           = 0.12           
                   lgres@vpHeightF          = 0.1          
@@ -3207,5 +3404,6 @@
                if (wpsap .EQ. 0) then
                   res@gsnLeftString      = "wpsap, wssas and wsa"
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then
                      res@trXMinF = min((/miniwpsap,miniwssas,miniwsa/))
@@ -3228,5 +3426,5 @@
                   lgMonoDashIndex          = False
                   lgres@lgLabelFont        = "helvetica"    
-                  lgres@lgLabelFontHeightF = .1            
+                  lgres@lgLabelFontHeightF = font_size_legend            
                   lgres@vpWidthF           = 0.12           
                   lgres@vpHeightF          = 0.1          
@@ -3251,5 +3449,6 @@
                if (us2 .EQ. 0) then
                   res@gsnLeftString      = "us2, vs2 and ws2"
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then
                      res@trXMinF = min((/minius2,minivs2,miniws2/))
@@ -3272,5 +3471,5 @@
                   lgMonoDashIndex          = False
                   lgres@lgLabelFont        = "helvetica"    
-                  lgres@lgLabelFontHeightF = .1            
+                  lgres@lgLabelFontHeightF = font_size_legend            
                   lgres@vpWidthF           = 0.12           
                   lgres@vpHeightF          = 0.1          
@@ -3295,5 +3494,6 @@
                if (wsususodz .EQ. 0) then 
                   res@gsnLeftString      = "wsususodz, wspsodz and ws2"
-                  res@gsnRightString     = unit(varn)
+		  res@tiXAxisString      = "["+unit(varn)+"]"
+                  res@gsnRightString     = " "
                   if (xs .EQ. -1) then
                      res@trXMinF = min((/miniwsususodz,miniwspsodz,miniwpeodz/))
@@ -3316,5 +3516,5 @@
                   lgMonoDashIndex          = False
                   lgres@lgLabelFont        = "helvetica"    
-                  lgres@lgLabelFontHeightF = .1            
+                  lgres@lgLabelFontHeightF = font_size_legend            
                   lgres@vpWidthF           = 0.12           
                   lgres@vpHeightF          = 0.1          
@@ -3369,5 +3569,5 @@
             
             if (prof3d .EQ. 0) then
-               if (logy .EQ. 1) then
+               if (log_z .EQ. 1) then
                   z = f->$vNam(varn+1)$(1:dimz-1) 
                else
@@ -3378,5 +3578,5 @@
                   if (isStrSubset( a(i),"zu_3d" ))then
                      z_v(varn,:) = z_u
-                     if (logy .EQ. 1) then
+                     if (log_z .EQ. 1) then
                         z = z_v(varn,1:dimz-1)
                      else
@@ -3386,5 +3586,5 @@
                      if (isStrSubset( a(i),"zw_3d" ))then
                         z_v(varn,:) = z_w
-                        if (logy .EQ. 1) then
+                        if (log_z .EQ. 1) then
                            z = z_v(varn,1:dimz-1)
                         else
@@ -3396,5 +3596,5 @@
             end if
 
-            z=z/norm
+            z=z/norm_z
 	    
 	    com_var_avail(n_o)=vNam(varn)
@@ -3412,5 +3612,6 @@
                      res@xyDashPattern  = 0
                      res@gsnLeftString  = "Combined Plot of "+c_var
-                     res@gsnRightString = unit(varn)
+		     res@tiXAxisString      = "["+unit(varn)+"]"
+                     res@gsnRightString     = " "
                      if (xs .EQ. -1) then 
                         res@trXMinF = min(mini)
@@ -3472,5 +3673,5 @@
       lgres@lgDashIndexes      = (/0,1,2/)
       lgres@lgLabelFont        = "helvetica"    
-      lgres@lgLabelFontHeightF = .1            
+      lgres@lgLabelFontHeightF = font_size_legend           
       lgres@vpWidthF           = 0.12           
       lgres@vpHeightF          = 0.1           
@@ -3498,9 +3699,9 @@
       gsn_panel(wks,plot_,(/n,1/),resP)
    else    
-      do i = 0,n-1, no_lines*no_columns
-         if( (i+no_lines*no_columns) .gt. (n-1)) then
-            gsn_panel(wks,plot_(i:n-1),(/no_lines,no_columns/),resP)
+      do i = 0,n-1, no_rows*no_columns
+         if( (i+no_rows*no_columns) .gt. (n-1)) then
+            gsn_panel(wks,plot_(i:n-1),(/no_rows,no_columns/),resP)
          else
-           gsn_panel(wks,plot_(i:i+no_lines*no_columns-1),(/no_lines,no_columns/),resP)
+           gsn_panel(wks,plot_(i:i+no_rows*no_columns-1),(/no_rows,no_columns/),resP)
          end if
       end do
Index: /palm/trunk/SCRIPTS/NCL/spectra.ncl
===================================================================
--- /palm/trunk/SCRIPTS/NCL/spectra.ncl	(revision 217)
+++ /palm/trunk/SCRIPTS/NCL/spectra.ncl	(revision 218)
@@ -26,5 +26,5 @@
    end if
 end if
-   
+
 begin
 
@@ -35,5 +35,5 @@
    if (file_1 .EQ. "File in") then
       print(" ")
-      print("Please provide 1st input file 'file_1=' in 'ncl_preferences.ncl'")
+      print("Declare input file 'file_1=' in 'ncl_preferences.ncl' or prompt")
       print(" ")
       exit 
@@ -41,10 +41,4 @@
       file_in = file_1   
    end if
-   if (.not. isfilepresent(file_in)) then
-      print(" ")
-      print("1st input file: '"+file_in+"' does not exist")
-      print(" ")
-      exit
-   end if 
 
    if (format_out .NE. "x11" .AND. format_out .NE. "pdf" .AND. format_out .NE. "eps" .AND. format_out .NE. "ps" .AND. format_out .NE. "epsi" .AND. format_out .NE. "ncgm")then
@@ -55,29 +49,29 @@
    end if 
    
-   if (logx .NE. 0 .AND. logx .NE. 1)then
-      print(" ")
-      print("'logx'= "+logx+" is invalid and set to 1")
-      print(" ")
-      logx = 1
+   if (log_x .NE. 0 .AND. log_x .NE. 1)then
+      print(" ")
+      print("'log_x'= "+log_x+" is invalid and set to 1")
+      print(" ")
+      log_x = 1
    end if  
    
-   if (logy .NE. 0 .AND. logy .NE. 1)then
-      print(" ")
-      print("'logy'= "+logy+" is invalid and set to 1")
-      print(" ")
-      logy = 1
+   if (log_y .NE. 0 .AND. log_y .NE. 1)then
+      print(" ")
+      print("'log_y'= "+log_y+" is invalid and set to 1")
+      print(" ")
+      log_y = 1
    end if    
   
-   if (normy .EQ. 0.) then 
-      print(" ")
-      print("You cannot normalise the y-axis with 0, 'normy' is set to 1.0")
-      print(" ")
-      normy = 1.0
-   end if
-   if (normx .EQ. 0.) then 
-      print(" ")
-      print("You cannot normalise the x-axis with 0, 'normx' is set to 1.0")
-      print(" ")
-      normx= 1.0
+   if (norm_y .EQ. 0.) then 
+      print(" ")
+      print("Normalising with 0 is not allowed, 'norm_y' is set to 1.0")
+      print(" ")
+      norm_y = 1.0
+   end if
+   if (norm_x .EQ. 0.) then 
+      print(" ")
+      print("Normalising with 0 is not allowed, 'norm_x' is set to 1.0")
+      print(" ")
+      norm_x= 1.0
    end if
    
@@ -106,8 +100,75 @@
    ; open input file
    ;***************************************************
-
-   f=addfile(file_in,"r")
-   
-   vNam = getfilevarnames(f) 
+   
+   file_in_1 = False
+   if (isStrSubset(file_in, ".nc"))then
+      start_f = -2
+      end_f = -2 
+      file_in_1 = True     
+   end if
+
+   if (start_f .EQ. -1)then
+      print(" ")
+      print("'start_f' must be one of the cyclic numbers (at least 0) of your input file(s)")
+      print(" ")  
+      exit
+   end if 
+   if (end_f .EQ. -1)then
+      print(" ")
+      print("'end_f' must be one of the cyclic numbers (at least 0) of your input file(s)")
+      print(" ")  
+      exit
+   end if 
+
+   files=new(end_f-start_f+1,string)
+   
+   if (file_in_1)then
+      if (isfilepresent(file_in))then
+         files(0)=file_in
+      else
+         print(" ")
+         print("1st input file: '"+file_in+"' does not exist")
+         print(" ")
+         exit
+      end if
+   else   
+      if (start_f .EQ. 0)then
+         if (isfilepresent(file_in+".nc"))then
+            files(0)=file_in+".nc"
+            do i=1,end_f
+	       if (isfilepresent(file_in+"."+i+".nc"))then    
+                  files(i)=file_in+"."+i+".nc"
+	       else
+	          print(" ")
+                  print("Input file: '"+file_in+"."+i+".nc' does not exist")
+                  print(" ")
+                  exit  
+	       end if	    
+            end do         
+         else
+            print(" ")
+            print("Input file: '"+file_in+".nc' does not exist")
+            print(" ")
+            exit
+         end if
+      else
+         do i=start_f,end_f
+            if (isfilepresent(file_in+"."+i+".nc"))then    
+               files(i-start_f)=file_in+"."+i+".nc"
+	    else
+	       print(" ")
+               print("Input file: '"+file_in+"."+i+".nc' does not exist")
+               print(" ")
+               exit  
+	    end if
+         end do
+      end if
+   end if
+
+   f=addfiles(files,"r")
+   f_att=addfile(files(0),"r")
+   ListSetType(f,"cat")
+   
+   vNam = getfilevarnames(f_att) 
    print(" ")
    print("Variables in input file:")
@@ -115,13 +176,13 @@
    print(" ")
    dim = dimsizes(vNam)
-   vDim = getfiledimsizes(f) 
+   vDim = getfiledimsizes(f_att) 
  
-   t_all = f->time
+   t_all = f[:]->time
    nt    = dimsizes(t_all)
    delta_t=t_all(nt-1)/nt
    
-   k_x=f->k_x
+   k_x=f_att->k_x
    dimx=dimsizes(k_x)
-   k_y=f->k_y
+   k_y=f_att->k_y
    dimy=dimsizes(k_y)
    
@@ -131,5 +192,5 @@
    do i=0,dim-1
       if (vNam(i) .EQ. "zu_sp")then
-         zu=f->zu_sp	 
+         zu=f_att->zu_sp	 
 	 if (height_level(0) .EQ. -1)then
 	    dimz=dimsizes(zu)
@@ -150,5 +211,5 @@
       else 
          if (vNam(i) .EQ. "zw_sp")then
-	    zw=f->zw_sp
+	    zw=f_att->zw_sp
 	    if (height_level(0) .EQ. -1)then              
                dimz=dimsizes(zw)
@@ -182,5 +243,5 @@
          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")
          print(" ")
-         print("Please select another 'start_time_step'")
+         print("Select another 'start_time_step'")
          print(" ")
          exit
@@ -204,5 +265,5 @@
       print("'start_time_step' = "+ start_time_step +"h is invalid")
       print(" ")
-      print("Please select another 'start_time_step'")
+      print("Select another 'start_time_step'")
       print(" ")
       exit
@@ -220,5 +281,5 @@
          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")
          print(" ")
-         print("Please select another 'end_time_step'")  
+         print("Select another 'end_time_step'")  
          print(" ")
          exit
@@ -228,5 +289,5 @@
          print("'end_time_step' = "+ end_time_step +"h is lower than 'start_time_step' = "+start_time_step+"h")
          print(" ")
-         print("Please select another 'start_time_step' or 'end_time_step'")
+         print("Select another 'start_time_step' or 'end_time_step'")
          print(" ")
          exit
@@ -245,5 +306,5 @@
       print("'end_time_step' = "+ end_time_step +"h is invalid")
       print(" ")
-      print("Please select another 'end_time_step'")
+      print("Select another 'end_time_step'")
       print(" ")
       exit
@@ -281,26 +342,22 @@
    res@lgLabelFont             = "helvetica"
    res@tmLabelAutoStride       = True
-   res@pmLegendDisplayMode     = "Always"
-   res@pmLegendSide            = "Top"
-   res@pmLegendParallelPosF    = 1.2
-   res@pmLegendOrthogonalPosF  = -1.0
-   res@pmLegendWidthF          = 0.12
-   if (sort .EQ. "time")then
-      res@pmLegendHeightF         = 0.04*(end_time_step-start_time_step+1)
-   else
-      res@pmLegendHeightF         = 0.04*dimz
-   end if
-   res@lgLabelFontHeightF     = .025 
-   res@lgTitleFontHeightF     = .025
-   res@txFontHeightF      = 0.025
-   res@tiXAxisFontHeightF = 0.025
-   res@tiYAxisFontHeightF = 0.025
-   
-   if (logx .EQ. 1) then
+   
+   res@lgLabelFontHeightF     = font_size_legend 
+   res@lgTitleFontHeightF     = font_size
+   res@txFontHeightF      = font_size
+   res@tiXAxisFontHeightF = font_size
+   res@tiYAxisFontHeightF = font_size
+   res@tmXBLabelFontHeightF = font_size
+   res@tmYLLabelFontHeightF = font_size
+   
+   res@tmXBMinorPerMajor = 4
+   res@tmYLMinorPerMajor = 4
+   
+   if (log_x .EQ. 1) then
       res@trXLog = True 
    else
       res@trXLog = False 
    end if
-   if (logy .EQ. 1)then
+   if (log_y .EQ. 1)then
       res@trYLog = True 
    else  
@@ -326,5 +383,5 @@
       plot  = new(dim*dimt,graphic)
       np=dimz
-      res@lgTitleString = "Height [m]"  
+      
       do p=0,dimz-1
          if (height_level(0) .EQ. -1)then
@@ -340,8 +397,8 @@
    if (black .eq. 0 ) then 
       if (np .EQ. 1)then
-         res@xyLineColors = 237
+         color = 237
       else   
          step=round(235/(np-1),3) 
-         res@xyLineColors = ispan(2,237,step)
+         color = ispan(2,237,step)
       end if
    end if
@@ -352,6 +409,4 @@
    wks=gsn_open_wks(format_out,file_out)
    gsn_define_colormap(wks,"rainbow+white") 
-
-   temp=new((/dimt,dimz,dimx/),float)
 
    n=0
@@ -369,17 +424,20 @@
 
       if(check) then 
-      
-         temp = f->$vNam(varn)$(start_time_step:end_time_step,0:dimz-1,:)
-	    
-         a=getvardims(temp)
+
+         temp = f[:]->$vNam(varn)$
+	 data = temp(start_time_step:end_time_step,0:dimz-1,:)
+
+         temp_att = f_att->$vNam(varn)$
+         a=getvardims(temp_att)
          b=dimsizes(a)
 
          if (height_level(0) .NE. -1)then
 	    do te=0,dimz-1
-	       temp(:,te,:) = f->$vNam(varn)$(start_time_step:end_time_step,height_level(te),:)	       
+	    print(height_level(te))
+	       data(:,te,:) = temp(start_time_step:end_time_step,height_level(te),:)	       
 	    end do
 	 end if
 
-         temp=temp/(normy*normx)  ;SMOOTHING: #temp=smth9(temp/norm, 0.50, -0.25, False)#
+         data=data/(norm_y*norm_x)  ;SMOOTHING: #temp=smth9(temp/norm, 0.50, -0.25, False)#
             
          do i=0,b-1            
@@ -402,29 +460,58 @@
             end if
          end do  
-
+	 
+         min_x=new(dimz,double)
+	 max_x=new(dimz,double)
+	 min_y=new(dimz,float)
+	 max_y=new(dimz,float)
+	 plot_h  = new(dimz,graphic)
+	 
          if (isStrSubset(vNam(varn),"x"))then
-            x_axis = f->k_x
-	    x_axis = x_axis/normx
-	    if (normx .NE. 1.)then
-               res@tiXAxisString = "k_x / "+normx
+	    x_axis = new((/dimz,dimx/),double)
+	    do q=0,dimz-1
+               x_axis(q,:) = f_att->k_x
+	       x_axis = x_axis/norm_x
+	    end do
+	    if (norm_x .NE. 1.)then
+               res@tiXAxisString = "k~B~x~N~ ["+unit_x+"]"
 	    else
-	       res@tiXAxisString = "k_x" 
+	       if (norm_height .EQ. 1)then
+	          res@tiXAxisString = "k~B~x~N~ x z [1]"
+	       else
+	          res@tiXAxisString = "k~B~x~N~ [1/m]"
+	       end if
 	    end if
+	    dim_r=dimx
          else
-            x_axis = f->k_y 
-	    x_axis = x_axis/normx
-	    if (normx .NE. 1.)then
-               res@tiXAxisString = "k_y / "+normx
+	    x_axis=new((/dimz,dimy/),double)
+	    do q=0,dimz-1
+               x_axis(q,:) = f_att->k_y 
+	       x_axis = x_axis/norm_x
+	    end do
+	    if (norm_x .NE. 1.)then
+               res@tiXAxisString = "k~B~x~N~ ["+unit_x+"]"
 	    else
-	       res@tiXAxisString = "k_y" 
+	       if (norm_height .EQ. 1)then
+	          res@tiXAxisString = "k~B~x~N~ x z [1]"
+	       else
+	          res@tiXAxisString = "k~B~x~N~ [1/m]"
+	       end if 
 	    end if
+	    dim_r=dimy
          end if
         
          if (sort .EQ. "time")
+	    res@xyLineColors = color
+	    res@pmLegendDisplayMode     = "Always"
+            res@pmLegendSide            = "Top"
+            res@pmLegendParallelPosF    = 1.2
+            res@pmLegendOrthogonalPosF  = -1.0
+            res@pmLegendWidthF          = 0.12
+            res@pmLegendHeightF         = 0.04*(end_time_step-start_time_step+1)
             do p=dimz-1,0,1
-	       if (logy .EQ. 1)then  
+	       if (log_y .EQ. 1)then  
                   do q=0,dimt-1
-                     do r=0,dimsizes(x_axis)-1 
-                        if (temp(q,p,r) .EQ. 0)then
+                     do r=0,dim_r-1 
+                        if (data(q,p,r) .EQ. 0)then
                            st=p+start_time_step
                            print(" ")
@@ -436,15 +523,15 @@
                   end do
 	       end if
-               res@trXMinF = min(x_axis)
-               res@trXMaxF = max(x_axis)
                res@gsnLeftString      = vNam(varn)
-               res@gsnRightString     = "Height = "+z(p)+"m"
-               if (normy .NE. 1.)then
-                  res@tiYAxisString      = vNam(varn)+" / "+normy
-               else
-                  res@tiYAxisString      = vNam(varn)
-               end if
-               res@xyExplicitLegendLabels  = legend_label
-               plot(n)  = gsn_csm_xy(wks,x_axis,temp(:,p,:),res)
+               res@gsnRightString     = "Height = "+z(p)+"m"               
+               res@tiYAxisString      = "["+unit_y+"]"           
+               res@xyExplicitLegendLabels  = legend_label	       
+	       if (norm_height .EQ. 1)then
+	          data(:,p,:)=data(:,p,:)*doubletofloat(z(p))
+		  x_axis(p,:) = x_axis(p,:)*z(p)
+	       end if
+	       res@trXMinF = min(x_axis(p,:))
+               res@trXMaxF = max(x_axis(p,:))
+               plot(n)  = gsn_csm_xy(wks,x_axis(p,:),data(:,p,:),res)
                n=n+1
             end do
@@ -453,6 +540,6 @@
                do p=0,dimt-1 	       
                   do q=0,dimz-1
-                     do r=0,dimsizes(x_axis)-1 
-                        if (temp(p,q,r) .EQ. 0)then
+                     do r=0,dim_r-1 
+                        if (data(p,q,r) .EQ. 0)then
                            st=p+start_time_step
                            print(" ")
@@ -462,22 +549,71 @@
                         end if
                      end do
-                  end do
-                  res@trXMinF = min(x_axis)
-                  res@trXMaxF = max(x_axis)
-                  res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = "Time = "+legend_label(p)+"h"
-                  if (normy .NE. 1.)then
-                     res@tiYAxisString      = vNam(varn)+" / "+normy
-                  else
-                     res@tiYAxisString      = vNam(varn)
-                  end if
-                  res@xyExplicitLegendLabels  = legend_label_z
-                  plot(n)  = gsn_csm_xy(wks,x_axis,temp(p,:,:),res)
-                  n=n+1
+		     if (norm_height .EQ. 1 .AND. p .EQ. 0)then
+		        data(p,q,:) = data(p,q,:)*doubletofloat(legend_label_z(q))
+			x_axis(q,:) = x_axis(q,:)*doubletofloat(legend_label_z(q))
+		     end if
+	             max_y(q)=max(data(p,q,:))
+		     min_y(q)=min(data(p,q,:))
+		     min_x(q)=min(x_axis(q,:))
+		     max_x(q)=max(x_axis(q,:))                                    
+                  end do 
+		  do q=0,dimz-1
+		     res@xyLineColor = color(q)
+		     if (dash .EQ. 1)then
+		        res@xyDashPattern = q
+	             end if
+		     if (q .EQ. 0)then
+		        res@tiYAxisString      = "["+unit_y+"]"		        
+		        res@gsnLeftString      = vNam(varn)
+                        res@gsnRightString     = "Time = "+legend_label(p)+"h"
+		        res@trXMinF = min(min_x)
+                        res@trXMaxF = max(max_x)
+                        res@trYMinF = min(min_y)
+                        res@trYMaxF = max(max_y)
+			
+			plot_h(q)  = gsn_csm_xy(wks,x_axis(q,:),data(p,q,:),res)
+			
+			lgres = True
+			if (dash .EQ. 0)then
+                           lgres@lgMonoDashIndex = True
+			else
+                           lgres@lgDashIndexes   = ispan(0,dimz-1,1)
+			end if
+			if (black .EQ. 1)then
+			   lgres@lgMonoLineColors = True
+			else
+			   lgres@lgLineColors = color
+			end if
+			lgres@lgTitleString = "Height [m]"  
+                        lgres@lgLabelFont        = "helvetica"
+			lgres@lgLabelFontHeightF     = font_size_legend 
+                        lgres@lgTitleFontHeightF     = font_size      
+                        lgres@vpWidthF           = 0.12           
+                        lgres@vpHeightF          = font_size_legend/5*dimz           
+  
+                        lbid = gsn_create_legend(wks,dimz,legend_label_z,lgres)       
+
+                        amres = True
+                        amres@amParallelPosF   = 0.75		    
+                        amres@amOrthogonalPosF = 0.15            
+                        annoid1 = gsn_add_annotation(plot_h(q),lbid,amres)
+		     else
+		        plot_h(q)  = gsn_csm_xy(wks,x_axis(q,:),data(p,q,:),res) 
+			overlay(plot_h(0),plot_h(q))
+		     end if
+		  end do              
+		  plot(n)=plot_h(0)
+		  n=n+1
                end do
             end if
 	 end if
-         delete(temp)
+         delete(data)
+	 delete(temp)
          delete(x_axis)
+	 delete(min_x)
+	 delete(max_x)
+	 delete(min_y)
+	 delete(max_y)
+	 delete(plot_h)
       end if
    end do
@@ -497,16 +633,16 @@
    resP                        = True
    resP@txFont                 = "helvetica"
-   resP@txString               = f@title
+   resP@txString               = f_att@title
    resP@txFuncCode             = "~"
-   resP@txFontHeightF          = 0.014
+   resP@txFontHeightF          = 0.015
 
    if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then
       gsn_panel(wks,plot,(/n,1/),resP)
    else    
-      do i = 0,n-1, no_lines*no_columns
-         if( (i+no_lines*no_columns) .gt. (n-1)) then
-            gsn_panel(wks,plot(i:n-1),(/no_lines,no_columns/),resP)
+      do i = 0,n-1, no_rows*no_columns
+         if( (i+no_rows*no_columns) .gt. (n-1)) then
+            gsn_panel(wks,plot(i:n-1),(/no_rows,no_columns/),resP)
          else
-           gsn_panel(wks,plot(i:i+no_lines*no_columns-1),(/no_lines,no_columns/),resP)
+           gsn_panel(wks,plot(i:i+no_rows*no_columns-1),(/no_rows,no_columns/),resP)
          end if
       end do
Index: /palm/trunk/SCRIPTS/NCL/timeseries.ncl
===================================================================
--- /palm/trunk/SCRIPTS/NCL/timeseries.ncl	(revision 217)
+++ /palm/trunk/SCRIPTS/NCL/timeseries.ncl	(revision 218)
@@ -33,8 +33,8 @@
    ; set up default parameter values and strings
    ;***************************************************
-  
+   
    if (file_1 .EQ. "File in") then
       print(" ")
-      print("Please provide 1st input file 'file_1=' in 'ncl_preferences.ncl'")
+      print("Declare input file 'file_1=' in 'ncl_preferences.ncl' or prompt")
       print(" ")
       exit 
@@ -42,10 +42,4 @@
       file_in = file_1   
    end if
-   if (.not. isfilepresent(file_in)) then
-      print(" ")
-      print("1st input file: '"+file_in+"' does not exist")
-      print(" ")
-      exit
-   end if 
 
    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
@@ -61,5 +55,12 @@
       print(" ")
       over = 0
-   end if   
+   end if  
+   
+   if (norm_t .EQ. 0) then 
+      print(" ")
+      print("Normalising with 0 is not allowed, 'norm_t' is set to 1.0")
+      print(" ")
+      norm_t = 1.0
+   end if 
  
 
@@ -67,8 +68,76 @@
    ; open input file
    ;***************************************************
-
-   f  = addfile(file_in , "r" )
-
-   vNam  = getfilevarnames(f)
+   
+   file_in_1 = False
+   if (isStrSubset(file_in, ".nc"))then
+      start_f = -2
+      end_f = -2 
+      file_in_1 = True     
+   end if
+
+   if (start_f .EQ. -1)then
+      print(" ")
+      print("'start_f' must be one of the cyclic numbers (at least 0) of your input file(s)")
+      print(" ")  
+      exit
+   end if 
+   if (end_f .EQ. -1)then
+      print(" ")
+      print("'end_f' must be one of the cyclic numbers (at least 0) of your input file(s)")
+      print(" ")  
+      exit
+   end if 
+
+   files=new(end_f-start_f+1,string)
+
+   if (file_in_1)then
+      if (isfilepresent(file_in))then
+         files(0)=file_in
+      else
+         print(" ")
+         print("1st input file: '"+file_in+"' does not exist")
+         print(" ")
+         exit
+      end if
+   else   
+      if (start_f .EQ. 0)then
+         if (isfilepresent(file_in+".nc"))then
+            files(0)=file_in+".nc"
+            do i=1,end_f
+	       if (isfilepresent(file_in+"."+i+".nc"))then    
+                  files(i)=file_in+"."+i+".nc"
+	       else
+	          print(" ")
+                  print("Input file: '"+file_in+"."+i+".nc' does not exist")
+                  print(" ")
+                  exit  
+	       end if	    
+            end do         
+         else
+            print(" ")
+            print("Input file: '"+file_in+".nc' does not exist")
+            print(" ")
+            exit
+         end if
+      else
+         do i=start_f,end_f
+            if (isfilepresent(file_in+"."+i+".nc"))then    
+               files(i-start_f)=file_in+"."+i+".nc"
+	    else
+	       print(" ")
+               print("Input file: '"+file_in+"."+i+".nc' does not exist")
+               print(" ")
+               exit  
+	    end if
+         end do
+      end if
+   end if
+
+   f=addfiles(files,"r")
+   f_att=addfile(files(0),"r")
+   ListSetType(f,"cat")
+
+   vNam=getfilevarnames(f_att)
+
    print(" ")
    print("Variables in input file:")
@@ -82,8 +151,8 @@
    end if
 
-   t_all = f->time
+   t_all = f[:]->time
    nt  = dimsizes(t_all)
    delta_t=t_all(nt-1)/nt
-   
+
    ;****************************************************	
    ; start of time step and different types of mistakes that could be done
@@ -97,5 +166,5 @@
          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")
          print(" ")
-         print("Please select another 'start_time_step'")
+         print("Select another 'start_time_step'")
          print(" ")
          exit
@@ -105,5 +174,5 @@
          print("'start_time_step' = "+ start_time_step +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
          print(" ")
-         print("Please select another 'start_time_step'")
+         print("Select another 'start_time_step'")
          print(" ")
          exit
@@ -123,5 +192,5 @@
       print("'start_time_step' = "+ start_time_step +"h is invalid")
       print(" ")
-      print("Please select another 'start_time_step'")
+      print("Select another 'start_time_step'")
       print(" ")
       exit
@@ -139,5 +208,5 @@
          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")
          print(" ")
-         print("Please select another 'end_time_step'")
+         print("Select another 'end_time_step'")
          print(" ")
          exit
@@ -147,5 +216,5 @@
          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")
          print(" ")
-         print("Please select another 'end_time_step'")  
+         print("Select another 'end_time_step'")  
          print(" ")
          exit
@@ -155,5 +224,5 @@
          print("'end_time_step' = "+ end_time_step +"h is equal or lower than 'start_time_step' = "+start_time_step+"h")
          print(" ")
-         print("Please select another 'start_time_step' or 'end_time_step'")
+         print("Select another 'start_time_step' or 'end_time_step'")
          print(" ")
          exit
@@ -171,5 +240,5 @@
       print("'end_time_step' = "+ end_time_step +"h is invalid")
       print(" ")
-      print("Please select another 'end_time_step'")
+      print("Select another 'end_time_step'")
       print(" ")
       exit
@@ -186,6 +255,5 @@
    print(" ")
 
-   t = f->time(start_time_step:end_time_step)
-
+   t = t_all(start_time_step:end_time_step)/norm_t
   
    ; ***************************************************
@@ -210,11 +278,14 @@
    res@xyLineColors            = (/237/) 
    
-   res@lgLabelFontHeightF     = .02 
+   res@lgLabelFontHeightF     = 0.02
 
    resP                        = True
    resP@txFont                 = "helvetica"
-   resP@txString               = f@title+" time series "
+   resP@txString               = f_att@title+" time series "
    resP@txFuncCode             = "~" 
    resP@txFontHeightF          = 0.015
+
+   res@tmXBMinorPerMajor = 4
+   res@tmYLMinorPerMajor = 4
 
    res@vpWidthF=4
@@ -290,6 +361,7 @@
          count_var=count_var+1
 
-         data_all = f ->$vNam(varn)$ 
-         unit(varn) = data_all@units
+         data_all = f[:]->$vNam(varn)$ 
+	 data_att = f_att->$vNam(varn)$
+         unit(varn) = data_att@units
                 
          data(varn,:)=data_all(start_time_step:end_time_step)
@@ -303,6 +375,6 @@
                if (mini(varn) .EQ. maxi(varn)) then
                   if (min(data(varn,:)) .EQ. 0)then
-                     mini(varn)= mini(varn)-1.
-                     maxi(varn)= maxi(varn)+1.
+                     mini(varn)= mini(varn)-0.1
+                     maxi(varn)= maxi(varn)+0.1
                   end if
                   if (min(data(varn,:)) .LT. 0)then
@@ -322,6 +394,6 @@
                if (mini(varn) .EQ. maxi(varn)) then
                   if (min(data(varn,:)) .EQ. 0)then
-                     mini(varn)= mini(varn)-1.
-                     maxi(varn)= maxi(varn)+1.
+                     mini(varn)= mini(varn)-0.1
+                     maxi(varn)= maxi(varn)+0.1
                   end if
                   if (min(data(varn,:)) .LT. 0)then
@@ -341,6 +413,6 @@
                if (mini(varn) .EQ. maxi(varn)) then
                   if (mini(varn) .EQ. 0)then
-                     mini(varn)= mini(varn)-1.
-                     maxi(varn)= maxi(varn)+1.
+                     mini(varn)= mini(varn)-0.1
+                     maxi(varn)= maxi(varn)+0.1
                   end if
                   if (mini(varn) .LT. 0)then
@@ -360,6 +432,6 @@
                if (mini(varn) .EQ. maxi(varn)) then
                   if (min(data(varn,:)) .EQ. 0)then
-                     mini(varn)= mini(varn)-1.
-                     maxi(varn)= maxi(varn)+1.
+                     mini(varn)= mini(varn)-0.1
+                     maxi(varn)= maxi(varn)+0.1
                   end if
                   if (min(data(varn,:)) .LT. 0)then
@@ -379,6 +451,6 @@
                if (mini(varn) .EQ. maxi(varn)) then
                   if (min(data(varn,:)) .EQ. 0)then
-                     mini(varn)= mini(varn)-1.
-                     maxi(varn)= maxi(varn)+1.
+                     mini(varn)= mini(varn)-0.1
+                     maxi(varn)= maxi(varn)+0.1
                   end if
                   if (min(data(varn,:)) .LT. 0)then
@@ -398,6 +470,6 @@
                if (mini(varn) .EQ. maxi(varn)) then
                   if (min(data(varn,:)) .EQ. 0)then
-                     mini(varn)= mini(varn)-1.
-                     maxi(varn)= maxi(varn)+1.
+                     mini(varn)= mini(varn)-0.1
+                     maxi(varn)= maxi(varn)+0.1
                   end if
                   if (min(data(varn,:)) .LT. 0)then
@@ -417,6 +489,6 @@
                if (mini(varn) .EQ. maxi(varn)) then
                   if (min(data(varn,:)) .EQ. 0)then
-                     mini(varn)= mini(varn)-1.
-                     maxi(varn)= maxi(varn)+1.
+                     mini(varn)= mini(varn)-0.1
+                     maxi(varn)= maxi(varn)+0.1
                   end if
                   if (min(data(varn,:)) .LT. 0)then
@@ -459,5 +531,5 @@
       if(check) then
 
-        if (isStrSubset(vNam(varn),"_0" ))then
+        if (isStrSubset(vNam(varn),"_0 " ))then
             print(" ")
             print("If you have Outputs of statistic regions you cannot overlay variables; 'over' is set to 0")
@@ -470,9 +542,13 @@
             res@gsnLeftString       = "overlayed plot"
             res@gsnRightString      = unit(varn)
-            res@tiXAxisString        = " time [s] "
-            res@tiYAxisString        = " " 
-            res@tiXAxisFontHeightF   = 0.07
-            res@txFontHeightF        = 0.07
-            res@tiYAxisFontHeightF   = 0.07            
+	    if (norm_t .NE. 1.)then
+               res@tiXAxisString        = "t ["+unit_t+"]"
+	    else
+	       res@tiXAxisString        = "t [s]"
+	    end if
+	    res@tiYAxisString = " "
+            res@tiXAxisFontHeightF   = font_size
+            res@txFontHeightF        = font_size
+            res@tiYAxisFontHeightF   = font_size            
 
             if (vNam(varn) .EQ. "E")
@@ -1105,6 +1181,6 @@
                if (min(data(varn,:)) .EQ. max(data(varn,:))) then
                   if (min(data(varn,:)) .EQ. 0)then
-                     res@trYMaxF = min(data(varn,:))-1.
-                     res@trYMinF = max(data(varn,:))+1.
+                     res@trYMaxF = min(data(varn,:))-0.1
+                     res@trYMinF = max(data(varn,:))+0.1
                   end if
                   if (min(data(varn,:)) .LT. 0)then
@@ -1128,15 +1204,21 @@
             res@gsnLeftString       = vNam(varn)
             res@gsnRightString      = unit(varn)
-            res@tiXAxisString        = " time [s] "
-            res@tiYAxisString        = " " 
-            res@tiXAxisFontHeightF   = 0.07
-            res@txFontHeightF        = 0.07
-            res@tiYAxisFontHeightF   = 0.07
+	    if (norm_t .NE. 1.)then
+               res@tiXAxisString        = "t ["+unit_t+"]"
+	    else
+	       res@tiXAxisString        = "t [s]"
+	    end if
+	    res@tiYAxisString = " "
+            res@tiXAxisFontHeightF   = font_size
+            res@txFontHeightF        = font_size
+            res@tiYAxisFontHeightF   = font_size
+	    res@tmXBLabelFontHeightF = font_size
+            res@tmYLLabelFontHeightF = font_size
             res@trYMaxF        = min(data(varn,:))
             res@trYMinF        = max(data(varn,:)) 
             if (min(data(varn,:)) .EQ. max(data(varn,:))) then
                if (min(data(varn,:)) .EQ. 0)then
-                     res@trYMaxF = min(data(varn,:))-1.
-                     res@trYMinF = max(data(varn,:))+1.
+                     res@trYMaxF = min(data(varn,:))-0.1
+                     res@trYMinF = max(data(varn,:))+0.1
                   end if
                   if (min(data(varn,:)) .LT. 0)then
@@ -1162,9 +1244,9 @@
       gsn_panel(wks_ps,plot_ps(1:n),(/n,1/),resP)
    else
-      do np = 1,n,no_lines*no_columns    
-         if ( np + no_lines*no_columns .gt. n) then   
-            gsn_panel(wks_ps, plot_ps(np:n),(/no_lines,no_columns/),resP)
+      do np = 1,n,no_rows*no_columns    
+         if ( np + no_rows*no_columns .gt. n) then   
+            gsn_panel(wks_ps, plot_ps(np:n),(/no_rows,no_columns/),resP)
          else
-            gsn_panel(wks_ps, plot_ps(np:np+no_lines*no_columns-1),(/no_lines,no_columns/),resP)
+            gsn_panel(wks_ps, plot_ps(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),resP)
          end if
       end do
