Index: palm/trunk/SCRIPTS/NCL/cross_sections.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 174)
+++ palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 175)
@@ -11,12 +11,17 @@
    ; ***************************************************
 
-   if (isfilepresent(".ncl_preferences")) then
-      parameter = asciiread(".ncl_preferences",77,"string")
+   if (isfilepresent("~/.ncl_preferences")) then
+      parameter = asciiread("~/.ncl_preferences",129,"string")
       delete(parameter@_FillValue)
    else
-      print(" ")
-      print("'.ncl_preferences' is not existent")
-      print(" ")
-      exit
+      if (isfilepresent("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences")) then
+         parameter = asciiread("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences",129,"string")
+         delete(parameter@_FillValue)
+      else
+         print(" ")
+         print("'.ncl_preferences' is not present in '~/palm/current_version/trunk/SRIPTS/NCL/'")
+         print(" ")
+         exit
+      end if
    end if
 
@@ -25,21 +30,42 @@
    ; ***************************************************
    
-   if ( .not. isvar("file_in") ) then     		; path+name of input file      
-      if (parameter(7) .EQ. "input file") then
-         print(" ")
-         print("Please provide input file 'file_in = ' either in prompt or parameter_list")
+   if ( .not. isvar("file_1") ) then     		  
+      if (parameter(7) .EQ. "File in") then
+         print(" ")
+         print("Please provide 1st input file 'file_1=' either in prompt or parameter_list")
          print(" ")
          exit
       else
          file_in = parameter(7)
-      end if      
-   end if
-   if ( .not. isvar("format_out") ) then   		; format of output file 
+      end if   
+   else
+      file_in = file_1   
+   end if
+   if (.not. isfilepresent(file_in)) then
+      print(" ")
+      print("Your 1st input file: '"+file_in+"' does not exist")
+      print(" ")
+      exit
+   end if 
+
+   if ( .not. isvar("format_out") ) then   		
       format_out = "x11"
       if (parameter(9) .NE. "x11") then
          format_out = parameter(9)  
+         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
+            print(" ")
+            print("Your 'format_out = "+format_out+"' is invalid and set to'x11'")
+            print(" ")
+         end if  
       end if 
-   end if
-   if ( .not. isvar("file_out") ) then    	 	; path+name of output file
+   else
+      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
+         print(" ")
+         print("Your 'format_out = "+format_out+"' is invalid and set to'x11'")
+         print(" ")
+      end if   
+   end if
+
+   if ( .not. isvar("file_out") ) then    	 	
       file_out = "test"
       if (parameter(11) .NE. "test") then
@@ -47,5 +73,5 @@
      end if     
    end if
-   if ( .not. isvar("no_columns") ) then    		; number of plots in one row
+   if ( .not. isvar("no_columns") ) then    		
       no_columns = 1
       if (parameter(17) .NE. "1") then
@@ -53,5 +79,5 @@
       end if
    end if
-   if ( .not. isvar("no_lines") ) then     		; number of plot-lines on one sheet
+   if ( .not. isvar("no_lines") ) then     		
       no_lines = 2
       if (parameter(19) .NE. "2") then
@@ -59,73 +85,145 @@
       end if
    end if 
-   if ( .not. isvar("sort") ) then   			; sort of plots
-      sort = "time"
-      if (parameter(51) .NE. "time") then
+
+   if ( .not. isvar("sort") ) then   			
+      sort = "layer"
+      if (parameter(51) .NE. "layer") then
          sort = parameter(51)  
+         if (sort .NE. "time") then
+            print(" ")
+            print("Your 'sort'= "+sort+" is invalid and set to 'layer'")
+            print(" ")
+            sort = "layer"  
+         end if
+      end if
+   else
+      if (sort .NE. "time" .OR. sort .NE. "layer")then
+         print(" ")
+         print("Your 'sort'= "+sort+" is invalid and set to 'layer'")
+         print(" ")
+         sort = "layer"    
       end if
    end if 
-   if ( .not. isvar("mode") ) then   			; pattern of contour plots
+
+   if ( .not. isvar("mode") ) then   			
       mode = "Fill"
       if (parameter(49) .NE. "Fill") then
          mode = parameter(49)  
-      end if
-   end if
-   if ( .not. isvar("fill_mode") ) then 		; pattern of filling 
+         if (mode .NE. "Line" .AND. mode .NE. "Both")then
+            print(" ")
+            print("Your 'mode'= "+mode+" is invalid and set to 'Fill'")
+            print(" ")
+            mode = "Fill"
+         end if
+      end if
+   else
+      if (mode .NE. "Line" .AND. mode .NE. "Both")then
+         print(" ")
+         print("Your 'mode'= "+mode+" is invalid and set to 'Fill'")
+         print(" ")
+         mode = "Fill"
+      end if   
+   end if
+
+   if ( .not. isvar("fill_mode") ) then 		
       fill_mode = "AreaFill"
       if (parameter(53) .NE. "AreaFill") then
-         mode = parameter(53)  
+         fill_mode = parameter(53)  
+         if (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 = "AreaFill"
+         end if
       end if 
-   end if
-   if ( .not. isvar("shape") ) then   			; keeping of aspect ratio
+   else
+      if (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 = "AreaFill"
+      end if
+   end if
+
+   if ( .not. isvar("shape") ) then   			
       shape = 1
       if (parameter(55) .NE. "1") then
          shape = stringtointeger(parameter(55)) 
-         if (stringtointeger(parameter(55)) .NE. 0) then
-            print(" ")
-            print("Please set 'shape' to 0 or 1")
-            print(" ")
-            exit
+         if (shape .NE. 0) then
+            print(" ")
+            print("Your 'shape'= "+shape+" is invalid and set to 1")
+            print(" ")
+            shape = 1
          end if 
-      end if  
-   end if  
-   if ( .not. isvar("var") ) then     			; set output of all variables
+      end if
+   else
+      if (shape .NE. 0) then
+         print(" ")
+         print("Your 'shape'= "+shape+" is invalid and set to 1")
+         print(" ")
+         shape = 1
+      end if      
+   end if 
+ 
+   if ( .not. isvar("var") ) then     			
       check = True
    end if
 
-   if ( .not. isvar("xyc") ) then   			; turn xy cross-section on or off
+   if ( .not. isvar("xyc") ) then   			
       xyc = 0
       if (parameter(57) .NE. "0") then
          xyc = stringtointeger(parameter(57)) 
-         if (stringtointeger(parameter(57)) .NE. 1) then
-            print(" ")
-            print("Please set 'xyc' to 0 or 1")
-            print(" ")
-            exit
+         if (xyc .NE. 1) then
+            print(" ")
+            print("Your 'xyc'= "+xyc+" is invalid and set to 0")
+            print(" ")
+            xyc = 0
          end if 
       end if
+   else
+      if (xyc .NE. 1) then
+         print(" ")
+         print("Your 'xyc'= "+xyc+" is invalid and set to 0")
+         print(" ")
+         xyc = 0
+      end if 
    end if 
-   if ( .not. isvar("xzc") ) then   			; turn xz cross-section on or off 
+   if ( .not. isvar("xzc") ) then   			
       xzc = 0
       if (parameter(59) .NE. "0") then
          xzc = stringtointeger(parameter(59)) 
-         if (stringtointeger(parameter(59)) .NE. 1) then
-            print(" ")
-            print("Please set 'xzc' to 0 or 1")
-            print(" ")
-            exit
+         if (xzc .NE. 1) then
+            print(" ")
+            print("Your 'xzc'= "+xzc+" is invalid and set to 0")
+            print(" ")
+            xzc = 0
          end if 
       end if
-   end if
-   if ( .not. isvar("yzc") ) then   			; turn yz cross-section on or off 
+   else
+      if (xzc .NE. 1) then
+         print(" ")
+         print("Your 'xzc'= "+xzc+" is invalid and set to 0")
+         print(" ")
+         xzc = 0
+      end if
+   end if
+   if ( .not. isvar("yzc") ) then   			
       yzc = 0
       if (parameter(61) .NE. "0") then
          yzc = stringtointeger(parameter(61)) 
-         if (stringtointeger(parameter(61)) .NE. 1) then
-            print(" ")
-            print("Please set 'yzc' to 0 or 1")
-            print(" ")
-            exit
+         if (yzc .NE. 1) then
+            print(" ")
+            print("Your 'yzc'= "+yzc+" is invalid and set to 0")
+            print(" ")
+            yzc = 0
          end if 
       end if
+   else
+      if (yzc .NE. 1) then
+         print(" ")
+         print("Your 'yzc'= "+yzc+" is invalid and set to 0")
+         print(" ")
+         yzc = 0
+      end if 
    end if
 
@@ -160,5 +258,5 @@
       end if
    end if
-   if ( .not. isvar("vector") ) then   			; sort of plots
+   if ( .not. isvar("vector") ) then   		
       vector = 0
       if (parameter(39) .NE. "0") then
@@ -172,5 +270,5 @@
       end if
    end if
-   if ( .not. isvar("ref_mag") ) then   			; sort of plots
+   if ( .not. isvar("ref_mag") ) then   			
       ref_mag = 0.05
       if (parameter(47) .NE. "0.05") then
@@ -272,5 +370,5 @@
    cs_res@gsnYAxisIrregular2Linear = True  
 
-   if( shape .eq. 1 ) then          			; keep the shape
+   if( shape .eq. 1 ) then          			
       cs_res@gsnShape = True
    end if
@@ -296,5 +394,5 @@
    cs_resP = True
    cs_resP@txString               = f@title
-   cs_resP@txFuncCode             = "~"         	; necessary for title
+   cs_resP@txFuncCode             = "~"         	
    cs_resP@txFontHeightF          = .02
    
@@ -304,5 +402,5 @@
       cs_res@gsnSpreadColors      = True
       cs_res@cnFillMode           = fill_mode
-      cs_res@lbOrientation        = "Vertical"  	; vertical label bar
+      cs_res@lbOrientation        = "Vertical"  	
       cs_res@cnLinesOn            = False	
       cs_res@cnLineLabelsOn       = False
@@ -313,5 +411,5 @@
       cs_res@gsnSpreadColors      = True
       cs_res@cnFillMode           = fill_mode
-      cs_res@lbOrientation        = "Vertical"  	; vertical label bar
+      cs_res@lbOrientation        = "Vertical"  
       cs_res@cnLinesOn            = True
       cs_res@cnLineLabelsOn       = True
@@ -450,6 +548,6 @@
 
    print(" ")
-   print("Output from "+t_all(start_time_step)/3600+"h = "+t_all(start_time_step)+"s => index = "+start_time_step)
-   print("       till "+t_all(end_time_step)/3600+"h = "+t_all(end_time_step)+"s => index = "+end_time_step)
+   print("Output of time steps from "+t_all(start_time_step)/3600+" h = "+t_all(start_time_step)+" s => index = "+start_time_step)
+   print("                     till "+t_all(end_time_step)/3600+" h = "+t_all(end_time_step)+" s => index = "+end_time_step)
    print(" ")
   
@@ -735,5 +833,5 @@
    end if
   
-   if ( .not. isvar("zs") ) then     			; start of z-coordinate range
+   if ( .not. isvar("zs") ) then     			
       zs = 0
       if (parameter(71) .NE. "z0") then
@@ -1283,9 +1381,7 @@
    end do
 
-   if (no_var .EQ. 0) then
+   if (n .EQ. 0) then
       print(" ")
-      print("Please select a variable 'var=' or use the default value")
-      print(" ")
-      print("Your selection '"+var+"' does not exist on the input file")
+      print("The variables 'var=Â°"+var+"Â°' do not exist on your input file")
       print(" ")
       exit
