Index: palm/trunk/SCRIPTS/NCL/.ncl.config.default
===================================================================
--- palm/trunk/SCRIPTS/NCL/.ncl.config.default	(revision 419)
+++ palm/trunk/SCRIPTS/NCL/.ncl.config.default	(revision 513)
@@ -52,5 +52,5 @@
       end if
       ;***************************************************
-      ; REQUIRED if more than one file of a job chain 
+      ; OPTIONAL/REQUIRED if more than one file of a job chain 
       ;          --start_f-- START OF CYCLIC NUMBER
       ;
@@ -74,8 +74,10 @@
       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
+      ; OPTIONAL/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
@@ -94,5 +96,5 @@
       end if
       ;***************************************************
-      ; REQUIRED --xyc--xzc--yzc-- SELECTION of XY or XZ or YZ CROSS SECTIONS
+      ; OPTIONAL --xyc--xzc--yzc-- SELECTION of XY or XZ or YZ CROSS SECTIONS
       ;
       ; desired section has to be set to 1; 
@@ -217,5 +219,6 @@
       ; OPTIONAL --var-- OUTPUT VARIABLES
       ;
-      ; names of output variables; inidcate them with one comma before and after
+      ; names of output variables; inidcate them with one comma before 
+      ; and after
       ; each variable
       ;
@@ -276,5 +279,6 @@
       ; OPTIONAL --xs-- MINIMUM X-AXIS 
       ;
-      ; value for minimum of x-axis, selectable if there are NO preseted layers 
+      ; value for minimum of x-axis, selectable if there are 
+      ; NO preseted layers 
       ; for x (as for XY or XZ 2D-DATA);
       ; there is no need to specify a precise meter value from the input file, 
@@ -297,5 +301,6 @@
       ; OPTIONAL --xe-- MAXIMUM X-AXIS 
       ;
-      ; value for maximum of x-axis, selectable if there are NO preseted layers 
+      ; value for maximum of x-axis, selectable if there are 
+      ; NO preseted layers 
       ; for x (as for XY or XZ 2D-DATA);
       ; there is no need to specify a precise meter value from the input file, 
@@ -318,5 +323,6 @@
       ; OPTIONAL --ys-- MINIMUM Y-AXIS 
       ;
-      ; value for minimum of y-axis, selectable if there are NO preseted layers 
+      ; value for minimum of y-axis, selectable if there are 
+      ; NO preseted layers 
       ; for y (as for XY or YZ 2D-DATA);
       ; there is no need to specify a precise meter value from the input file, 
@@ -360,7 +366,9 @@
       ; OPTIONAL --zs-- MINIMUM Z-AXIS 
       ;
-      ; index for minimum of z-axis, selectable if there are NO preseted layers 
+      ; index for minimum of z-axis, selectable if there are 
+      ; NO preseted layers 
       ; for z (as for XZ or YZ 2D-DATA);
-      ; you cannot specify a meter value from the input file due to grid stretching  
+      ; you cannot specify a meter value from the input file due to 
+      ; grid stretching  
       ;
       ; data type: integer
@@ -380,7 +388,9 @@
       ; OPTIONAL --ze-- MAXIMUM Z-AXIS 
       ;
-      ; index for maximum of z-axis, selectable if there are NO preseted layers
+      ; index for maximum of z-axis, selectable if there are 
+      ; NO preseted layers
       ; for z (as for XZ or YZ 2D-DATA);
-      ; you cannot specify a meter value from the input file due to grid stretching  
+      ; you cannot specify a meter value from the input file due to 
+      ; grid stretching  
       ;
       ; data type: integer
@@ -510,5 +520,6 @@
       end if 
       ;***************************************************
-      ; OPTIONAL --axes_explicit-- EXPLICIT SETTINGS OF X- AND Y-AXES ARE SWITCHED ON
+      ; OPTIONAL --axes_explicit-- 
+      ;          EXPLICIT SETTINGS OF X- AND Y-AXES ARE SWITCHED ON
       ;
       ; to use several parameters to set up the axes, 'axes_explicit' 
@@ -576,5 +587,6 @@
       ;                              NORMALISE X-, Y- and Z-AXES
       ;
-      ; normalising the axes with the given value; units can explicitly be set; 
+      ; normalising the axes with the given value; 
+      ; units can explicitly be set; 
       ; by default no normalising is used and units are [meter]
       ;
@@ -680,5 +692,6 @@
       ; example: plotvec = ",u,w,"
       ;
-      ; default:   "plotvec" (no combining, the vector plot is created seperately) 
+      ; default:   "plotvec" (no combining, 
+      ;                       the vector plot is created seperately) 
       ;***************************************************
       if(.not. isvar("plotvec"))then
@@ -743,8 +756,10 @@
       end if 
       ;***************************************************
-      ; REQUIRED --start_f_1-- START OF CYCLIC NUMBER OF THE 1ST INPUT FILE
+      ; OPTIONAL/REQUIRED --start_f_1-- if more than one file of a job chain
+      ;                    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
+      ; declare the first cyclicnumber which contains timesteps 
+      ; you'd like to use
       ;
       ; data type: integer
@@ -763,8 +778,10 @@
       end if 
       ;***************************************************
-      ; REQUIRED --end_f_1-- END OF CYCLIC NUMBER OF THE 1ST INPUT FILE
+      ; OPTIONAL/REQUIRED --end_f_1--  if more than one file of a job chain
+      ;            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
+      ; declare the last cyclicnumber which contains timesteps 
+      ; you'd like to use
       ;
       ; data type: integer
@@ -926,5 +943,6 @@
       ; 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'); 
+      ; last cycle numbers are given with the parameters 
+      ; 'start_f' and 'end_f'); 
       ; otherwise declare path and full file name
       ;
@@ -946,8 +964,10 @@
       end if 
       ;***************************************************
-      ; REQUIRED --start_f_2-- START OF CYCLIC NUMBER OF THE 2ND INPUT FILE
+      ; OPTIONAL/REQUIRED --start_f_2-- if more than one file of a job chain
+      ;                       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
+      ; declare the first cyclicnumber which contains timesteps 
+      ; you'd like to use
       ;
       ; data type: integer
@@ -965,8 +985,10 @@
       end if 
       ;***************************************************
-      ; REQUIRED --end_f_2-- END OF CYCLIC NUMBER OF THE 2ND INPUT FILE
+      ; REQUIRED --end_f_2-- if more than one file of a job chain
+      ;                      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
+      ; declare the last cyclicnumber which contains timesteps 
+      ; you'd like to use
       ;
       ; data type: integer
@@ -1005,5 +1027,6 @@
       ; 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'); 
+      ; last cycle numbers are given with the parameters 
+      ; 'start_f' and 'end_f'); 
       ; otherwise declare path and full file name
       ;
@@ -1025,8 +1048,10 @@
       end if 
       ;***************************************************
-      ; REQUIRED --start_f_3-- START OF CYCLIC NUMBER OF THE 3RD INPUT FILE
+      ; OPTIONAL/REQUIRED --start_f_3-- if more than one file of a job chain
+      ;                        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
+      ; declare the first cyclicnumber which contains timesteps 
+      ; you'd like to use
       ;
       ; data type: integer
@@ -1044,7 +1069,9 @@
       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 
+      ; OPTIONAL/REQUIRED --end_f_3-- if more than one file of a job chain
+      ;                    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
       ;
@@ -1084,5 +1111,6 @@
       ; 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'); 
+      ; last cycle numbers are given with the parameters 
+      ; 'start_f' and 'end_f'); 
       ; otherwise declare path and full file name
       ;
@@ -1104,8 +1132,10 @@
       end if 
       ;***************************************************
-      ; REQUIRED --start_f_4-- START OF CYCLIC NUMBER OF THE 4TH INPUT FILE
+      ; OPTIONAL/REQUIRED --start_f_4-- if more than one file of a job chain
+      ;                          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
+      ; declare the first cyclicnumber which contains timesteps 
+      ; you'd like to use
       ;
       ; data type: integer
@@ -1123,8 +1153,10 @@
       end if 
       ;***************************************************
-      ; REQUIRED --end_f_4-- END OF CYCLIC NUMBER OF THE 4TH INPUT FILE
+      ; OPTIONAL/REQUIRED --end_f_4-- if more than one file of a job chain
+      ;                   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
+      ; declare the last cyclicnumber which contains timesteps 
+      ; you'd like to use
       ;
       ; data type: integer
@@ -1163,5 +1195,6 @@
       ; 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'); 
+      ; last cycle numbers are given with the parameters 
+      ; 'start_f' and 'end_f'); 
       ; otherwise declare path and full file name
       ;
@@ -1183,8 +1216,10 @@
       end if 
       ;***************************************************
-      ; REQUIRED --start_f_5-- START OF CYCLIC NUMBER OF THE 5TH INPUT FILE
+      ; OPTIONAL/REQUIRED --start_f_5-- if more than one file of a job chain
+      ;                     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
+      ; declare the first cyclicnumber which contains timesteps 
+      ; you'd like to use
       ;
       ; data type: integer
@@ -1202,8 +1237,10 @@
       end if 
       ;***************************************************
-      ; REQUIRED --end_f_5-- END OF CYCLIC NUMBER OF THE 5TH INPUT FILE
+      ; OPTIONAL/REQUIRED --end_f_5-- if more than one file of a job chain
+      ;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
+      ; declare the last cyclicnumber which contains timesteps 
+      ; you'd like to use
       ;
       ; data type: integer
@@ -1242,5 +1279,6 @@
       ; 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'); 
+      ; last cycle numbers are given with the parameters 
+      ; 'start_f' and 'end_f'); 
       ; otherwise declare path and full file name
       ;
@@ -1262,8 +1300,10 @@
       end if 
       ;***************************************************
-      ; REQUIRED --start_f_6-- START OF CYCLIC NUMBER OF THE 6TH INPUT FILE
+      ; OPTIONAL/REQUIRED --start_f_6-- if more than one file of a job chain
+      ;                     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
+      ; declare the first cyclicnumber which contains timesteps 
+      ; you'd like to use
       ;
       ; data type: integer
@@ -1281,8 +1321,10 @@
       end if 
       ;***************************************************
-      ; REQUIRED --end_f_6-- END OF CYCLIC NUMBER OF THE 6TH INPUT FILE
+      ; OPTIONAL/REQUIRED --end_f_6-- if more than one file of a job chain
+      ; 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
+      ; declare the last cyclicnumber which contains timesteps 
+      ; you'd like to use
       ;
       ; data type: integer
@@ -1564,5 +1606,6 @@
       ; OPTIONAL --over-- OVERLAYING
       ;
-      ; predefined overlaying of standard variables is 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
       ;
@@ -1725,5 +1768,6 @@
       ; 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'); 
+      ; last cycle numbers are given with the parameters 
+      ; 'start_f' and 'end_f'); 
       ; otherwise declare path and full file name
       ;
@@ -1745,9 +1789,10 @@
       end if
       ;***************************************************
-      ; REQUIRED if more than one file of a job chain 
+      ; OPTIONAL/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
+      ; declare the first cyclicnumber which contains timesteps 
+      ; you'd like to use
       ;
       ; data type: integer
@@ -1766,9 +1811,10 @@
       end if 
       ;***************************************************
-      ; REQUIRED if more than one file of a job chain 
+      ; OPTIONAL/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
+      ; declare the last cyclicnumber which contains timesteps 
+      ; you'd like to use
       ;
       ; data type: integer
@@ -2036,5 +2082,5 @@
       ; data type: float
       ;
-      ; example: norm_x = 1
+      ; example: norm_x = 1.
       ;
       ; default:   1. (no normalising)
@@ -2087,5 +2133,6 @@
       ; 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 
+      ; 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, 
@@ -2157,5 +2204,6 @@
       ; 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'); 
+      ; last cycle numbers are given with the parameters 
+      ; 'start_f' and 'end_f'); 
       ; otherwise declare path and full file name
       ;
@@ -2177,9 +2225,10 @@
       end if
       ;***************************************************
-      ; REQUIRED if more than one file of a job chain 
+      ; OPTIONAL/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
+      ; declare the first cyclicnumber which contains timesteps 
+      ; you'd like to use
       ;
       ; data type: integer
@@ -2198,9 +2247,10 @@
       end if 
       ;***************************************************
-      ; REQUIRED if more than one file of a job chain 
+      ; OPTIONAL/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
+      ; declare the last cyclicnumber which contains timesteps 
+      ; you'd like to use
       ;
       ; data type: integer
@@ -2353,5 +2403,6 @@
       ; OPTIONAL --over-- OVERLAYING
       ;
-      ; predefined overlaying of standard variables are 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
       ;
@@ -2390,5 +2441,6 @@
       ; OPTIONAL --norm_t-- NORMALISING X-AXIS OF TIMESERIES PLOTS (T-AXIS)
       ;
-      ; normalising the x-axis with the given value; the unit can explicitly set; 
+      ; normalising the x-axis with the given value; 
+      ; the unit can explicitly set; 
       ; by default no normalising and unit is set to [s]
       ;
@@ -2399,5 +2451,5 @@
       ; default:   1. 
       ;***************************************************
-      if(.not. isvar("normt"))then
+      if(.not. isvar("norm_t"))then
       
       	 
@@ -2417,5 +2469,5 @@
       ; default:   " " 
       ;***************************************************
-      if(.not. isvar("unitt"))then
+      if(.not. isvar("unit_t"))then
       
       	 
Index: palm/trunk/SCRIPTS/NCL/cross_sections.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 419)
+++ palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 513)
@@ -82,5 +82,5 @@
       shape = 1
    end if 
-   
+
    if (xyc .NE. 0 .AND. xyc .NE. 1)then
       print(" ")
@@ -1352,6 +1352,6 @@
    	 data!4 = "x"  
 
-         MinVal(varn) = min(data(varn,:,:,:,:))
-         MaxVal(varn) = max(data(varn,:,:,:,:))
+         MinVal(varn) = min(data(varn,start_time_step:end_time_step,0:(ze-zs),0:(ye-ys),0:(xe-xs)))
+         MaxVal(varn) = max(data(varn,start_time_step:end_time_step,0:(ze-zs),0:(ye-ys),0:(xe-xs)))
 	 
 	 unit(varn) = data_att@units
@@ -1623,5 +1623,5 @@
                  
                   if ( sort .eq. "layer" ) then
-		     if (z_d(zs+li) .eq. -1) then
+		     if (z_d(li) .eq. -1) then
 		        if (delta_z .EQ. -1) then
                            level = "-average"
@@ -1721,5 +1721,5 @@
 
                   if ( sort .eq. "time" ) then
-                     if ( x_d(xs+lo) .eq. -1 ) then
+                     if ( x_d(lo) .eq. -1 ) then
                         level = "-average"
                      else 
@@ -1744,5 +1744,5 @@
 
                   if ( sort .eq. "layer" ) then
-                     if ( x_d(xs+li) .eq. -1 ) then
+                     if ( x_d(li) .eq. -1 ) then
                         level = "-average"
                      else 
Index: palm/trunk/SCRIPTS/NCL/profiles.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 419)
+++ palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 513)
@@ -48,5 +48,5 @@
    file_in_1 = new(no_files,logical)
    start_f   = new(no_files,integer)
-   end_f = new(no_files,integer)
+   end_f     = new(no_files,integer)
    
    if (file_1 .EQ. "File in") then
@@ -433,4 +433,13 @@
       end if
 
+      if(comma .gt. dim)
+          print(" ")
+          print("The variables 'var="+var+"'" )
+          print("do not exist on your input file;")
+          print("be sure to have one comma before and after each variable")
+          print(" ")
+          exit
+      end if
+
       indices = new((/comma/),integer)
       comma   = 0
@@ -1571,5 +1580,5 @@
                   do i=1,dimz-1
                      do j=0,np-1
-                        temp= f[:]->$vNam(varn)$
+                        temp = f[:]->$vNam(varn)$
 			temp_att = f_att->$vNam(varn)$ 
 	                data_temp = temp(ti_in(j),i,start_y:end_y,start_x:end_x)
@@ -1580,5 +1589,5 @@
                   do i=0,dimz-1
                      do j=0,np-1
-                        temp= f[:]->$vNam(varn)$
+                        temp = f[:]->$vNam(varn)$
 			temp_att = f_att->$vNam(varn)$ 
 			data_temp = temp(ti_in(j),i,start_y:end_y,start_x:end_x)
