Index: palm/trunk/SCRIPTS/NCL/.ncl_preferences
===================================================================
--- palm/trunk/SCRIPTS/NCL/.ncl_preferences	(revision 183)
+++ 	(revision )
@@ -1,129 +1,0 @@
-___Parameter list_______________________________________________________________________________________
-___Please write your values/strings(wihtout " ") below the corresponding parameter line_________________
-________________________________________________________________________________________________________
-___parameter name__________example____________________________________default value______________used by
-________________________________________________________________________________________________________
-
-___'file_1'________________[path/name.nc; i.e. ~/.../example.nc]______default = File in_________[ALL]
-File in
-___'format_out'____________[ncgm; ps; eps; epsi; pdf; x11]____________default = x11_____________[ALL]
-x11
-___'file_out'______________[path/name; i.e. ~/.../test]_______________default = test____________[ALL]
-test
-___start_time_step_________[0;1;...]__________________________________default = t(0)____________[ALL]
-t(0)
-___end_time_step___________[1;2;...]__________________________________default = t(end)__________[ALL]
-t(end)
-___no_columns______________[1;2;...]__________________________________default = 1_______________[ALL]
-1
-___no_lines________________[1;2;...]__________________________________default = 2_______________[ALL]
-2
-___'var'___________________[,E,dt,umax,;...]__________________________default = variables_______[ALL]
-variables
-___combine_________________[0] or [1]_________________________________default = 0_______________[PR]
-0
-___number_comb_____________[2] or [3]_________________________________default = 0_______________[PR]
-0
-___'c_var'_________________[,us2,vs2,ws2,;...]________________________default = c_variables_____[PR]
-c_variables
-___dash____________________[0] or [1]_________________________________default = 0_______________[PR+SP]
-0
-___black___________________[0] or [1]_________________________________default = 0_______________[PR+SP]
-0
-___min_z___________________[0;10;...]_________________________________default = 0_______________[PR]
-0
-___max_z___________________[100;1000;...]_____________________________default = max(z_u)________[PR] 
-max(z_u)
-___over____________________[0] or [1]_________________________________default = 0_______________[PR+TS]
-0
-___vector__________________[0] or [1]_________________________________default = 0_______________[CS]
-0
-___'vec1'__________________[,u,;,v,;...]______________________________default = vec1____________[CS]
-vec1
-___'vec2'__________________[,u,;,v,;...]______________________________default = vec2____________[CS]
-vec2
-__'plotvec'________________[,u,;,v,;...]______________________________default = plotvec_________[CS]
-plotvec
-___ref_mag_________________[0.1;0.02;...]_____________________________default = 0.05____________[CS]
-0.05
-___'mode'__________________[Fill], [Line] or [Both]___________________default = Fill____________[CS]
-Fill
-___'sort'__________________[time] or [layer]__________________________default = layer___________[CS+SP]
-layer
-___'fill_mode'_____________[AreaFill], [RasterFill] or [CellFill]_____default = AreaFill________[CS]
-AreaFill
-___shape___________________[0] or [1]_________________________________default = 1_______________[CS]
-1
-___xyc_____________________[0] or [1]_________________________________default = 0_______________[CS]
-0
-___xzc_____________________[0] or [1]_________________________________default = 0_______________[CS]
-0
-___yzc_____________________[0] or [1]_________________________________default = 0_______________[CS]
-0
-___xs______________________[0,1,...]__________________________________default = x0______________[CS+PR]
-x0
-___xe______________________[1;2;...]__________________________________default = xdim____________[CS+PR]
-xdim
-___ys______________________[0;1;...]__________________________________default = y0______________[CS]
-y0
-___ye______________________[1;2;...]__________________________________default = ydim____________[CS]
-ydim
-___zs______________________[0;1;...]__________________________________default = z0______________[CS]
-z0
-___ze______________________[1;2;...]__________________________________default = zdim____________[CS]
-zdim
-___prof3d__________________[0] or [1]_________________________________default = 0_______________[PR]
-0
-___logy____________________[0] or [1]_________________________________default = 0_______________[PR+SP]
-0
-___norm____________________[1;5.4;233;...]____________________________default = 1_______________[PR+SP]
-1
-___no_files________________[1;2,3;...]________________________________default = 1_______________[PR]
-1
-___'name_legend_1'_________[i.e. File 2]______________________________default = File 1__________[PR]
-File 1
-___'file_2'________________[path/name.nc; i.e. ~/.../example.2.nc]____default = File in_________[PR]
-File in
-___'name_legend_2'_________[i.e. File 2]______________________________default = File 2__________[PR]
-File 2
-___'file_3'________________[path/name.nc; i.e. ~/.../example.3.nc]____default = File in_________[PR]
-File in
-___'name_legend_3'_________[i.e. File 3]______________________________default = File 3__________[PR]
-File 3
-___'file_4'________________[path/name.nc; i.e. ~/.../example.4.nc]____default = File in_________[PR]
-File in
-___'name_legend_4'_________[i.e. File 4]______________________________default = File 4__________[PR]
-File 4
-___'file_5'________________[path/name.nc; i.e. ~/.../example.5.nc]____default = File in_________[PR]
-File in
-___'name_legend_5'_________[i.e. File 5]______________________________default = File 5__________[PR]
-File 5
-___'file_6'________________[path/name.nc; i.e. ~/.../example.6.nc]____default = File in_________[PR]
-File in
-___'name_legend_6'_________[i.e. File 6]______________________________default = File 6__________[PR]
-File 6
-___'file_7'________________[path/name.nc; i.e. ~/.../example.7.nc]____default = File in_________[PR]
-File in
-___'name_legend_7'_________[i.e. File 7]______________________________default = File 7__________[PR]
-File 7
-___'file_8'________________[path/name.nc; i.e. ~/.../example.8.nc]____default = File in_________[PR]
-File in
-___'name_legend_8'_________[i.e. File 8]______________________________default = File 8__________[PR]
-File 8
-___'file_9'________________[path/name.nc; i.e. ~/.../example.9.nc]____default = File in_________[PR]
-File in
-___'name_legend_9'_________[i.e. File 9]______________________________default = File 9__________[PR]
-File 9
-___'file_10'_______________[path/name.nc; i.e. ~/.../example.10.nc]___default = File in_________[PR]
-File in
-___'name_legend_10'________[i.e. File 10]_____________________________default = File 10_________[PR]
-File 10
-___'file_11'_______________[path/name.nc; i.e. ~/.../example.11.nc]___default = File in_________[PR]
-File in
-___'name_legend_11'________[i.e. File 11]_____________________________default = File 11_________[PR]
-File 11
-___'file_12'_______________[path/name.nc; i.e. ~/.../example.12.nc]___default = File in_________[PR]
-File in
-___'name_legend_12'________[i.e. File 12]_____________________________default = File 12_________[PR]
-File 12
-___end of file ".ncl_preferences"_______________________________________________________________________
Index: palm/trunk/SCRIPTS/NCL/Archive/.ncl_preferences
===================================================================
--- palm/trunk/SCRIPTS/NCL/Archive/.ncl_preferences	(revision 190)
+++ palm/trunk/SCRIPTS/NCL/Archive/.ncl_preferences	(revision 190)
@@ -0,0 +1,129 @@
+___Parameter list_______________________________________________________________________________________
+___Please write your values/strings(wihtout " ") below the corresponding parameter line_________________
+________________________________________________________________________________________________________
+___parameter name__________example____________________________________default value______________used by
+________________________________________________________________________________________________________
+
+___'file_1'________________[path/name.nc; i.e. ~/.../example.nc]______default = File in_________[ALL]
+File in
+___'format_out'____________[ncgm; ps; eps; epsi; pdf; x11]____________default = x11_____________[ALL]
+x11
+___'file_out'______________[path/name; i.e. ~/.../test]_______________default = test____________[ALL]
+test
+___start_time_step_________[0;1;...]__________________________________default = t(0)____________[ALL]
+t(0)
+___end_time_step___________[1;2;...]__________________________________default = t(end)__________[ALL]
+t(end)
+___no_columns______________[1;2;...]__________________________________default = 1_______________[ALL]
+1
+___no_lines________________[1;2;...]__________________________________default = 2_______________[ALL]
+2
+___'var'___________________[,E,dt,umax,;...]__________________________default = variables_______[ALL]
+variables
+___combine_________________[0] or [1]_________________________________default = 0_______________[PR]
+0
+___number_comb_____________[2] or [3]_________________________________default = 0_______________[PR]
+0
+___'c_var'_________________[,us2,vs2,ws2,;...]________________________default = c_variables_____[PR]
+c_variables
+___dash____________________[0] or [1]_________________________________default = 0_______________[PR+SP]
+0
+___black___________________[0] or [1]_________________________________default = 0_______________[PR+SP]
+0
+___min_z___________________[0;10;...]_________________________________default = 0_______________[PR]
+0
+___max_z___________________[100;1000;...]_____________________________default = max(z_u)________[PR] 
+max(z_u)
+___over____________________[0] or [1]_________________________________default = 0_______________[PR+TS]
+0
+___vector__________________[0] or [1]_________________________________default = 0_______________[CS]
+0
+___'vec1'__________________[,u,;,v,;...]______________________________default = vec1____________[CS]
+vec1
+___'vec2'__________________[,u,;,v,;...]______________________________default = vec2____________[CS]
+vec2
+__'plotvec'________________[,u,;,v,;...]______________________________default = plotvec_________[CS]
+plotvec
+___ref_mag_________________[0.1;0.02;...]_____________________________default = 0.05____________[CS]
+0.05
+___'mode'__________________[Fill], [Line] or [Both]___________________default = Fill____________[CS]
+Fill
+___'sort'__________________[time] or [layer]__________________________default = layer___________[CS+SP]
+layer
+___'fill_mode'_____________[AreaFill], [RasterFill] or [CellFill]_____default = AreaFill________[CS]
+AreaFill
+___shape___________________[0] or [1]_________________________________default = 1_______________[CS]
+1
+___xyc_____________________[0] or [1]_________________________________default = 0_______________[CS]
+0
+___xzc_____________________[0] or [1]_________________________________default = 0_______________[CS]
+0
+___yzc_____________________[0] or [1]_________________________________default = 0_______________[CS]
+0
+___xs______________________[0,1,...]__________________________________default = x0______________[CS+PR]
+x0
+___xe______________________[1;2;...]__________________________________default = xdim____________[CS+PR]
+xdim
+___ys______________________[0;1;...]__________________________________default = y0______________[CS]
+y0
+___ye______________________[1;2;...]__________________________________default = ydim____________[CS]
+ydim
+___zs______________________[0;1;...]__________________________________default = z0______________[CS]
+z0
+___ze______________________[1;2;...]__________________________________default = zdim____________[CS]
+zdim
+___prof3d__________________[0] or [1]_________________________________default = 0_______________[PR]
+0
+___logy____________________[0] or [1]_________________________________default = 0_______________[PR+SP]
+0
+___norm____________________[1;5.4;233;...]____________________________default = 1_______________[PR+SP]
+1
+___no_files________________[1;2,3;...]________________________________default = 1_______________[PR]
+1
+___'name_legend_1'_________[i.e. File 2]______________________________default = File 1__________[PR]
+File 1
+___'file_2'________________[path/name.nc; i.e. ~/.../example.2.nc]____default = File in_________[PR]
+File in
+___'name_legend_2'_________[i.e. File 2]______________________________default = File 2__________[PR]
+File 2
+___'file_3'________________[path/name.nc; i.e. ~/.../example.3.nc]____default = File in_________[PR]
+File in
+___'name_legend_3'_________[i.e. File 3]______________________________default = File 3__________[PR]
+File 3
+___'file_4'________________[path/name.nc; i.e. ~/.../example.4.nc]____default = File in_________[PR]
+File in
+___'name_legend_4'_________[i.e. File 4]______________________________default = File 4__________[PR]
+File 4
+___'file_5'________________[path/name.nc; i.e. ~/.../example.5.nc]____default = File in_________[PR]
+File in
+___'name_legend_5'_________[i.e. File 5]______________________________default = File 5__________[PR]
+File 5
+___'file_6'________________[path/name.nc; i.e. ~/.../example.6.nc]____default = File in_________[PR]
+File in
+___'name_legend_6'_________[i.e. File 6]______________________________default = File 6__________[PR]
+File 6
+___'file_7'________________[path/name.nc; i.e. ~/.../example.7.nc]____default = File in_________[PR]
+File in
+___'name_legend_7'_________[i.e. File 7]______________________________default = File 7__________[PR]
+File 7
+___'file_8'________________[path/name.nc; i.e. ~/.../example.8.nc]____default = File in_________[PR]
+File in
+___'name_legend_8'_________[i.e. File 8]______________________________default = File 8__________[PR]
+File 8
+___'file_9'________________[path/name.nc; i.e. ~/.../example.9.nc]____default = File in_________[PR]
+File in
+___'name_legend_9'_________[i.e. File 9]______________________________default = File 9__________[PR]
+File 9
+___'file_10'_______________[path/name.nc; i.e. ~/.../example.10.nc]___default = File in_________[PR]
+File in
+___'name_legend_10'________[i.e. File 10]_____________________________default = File 10_________[PR]
+File 10
+___'file_11'_______________[path/name.nc; i.e. ~/.../example.11.nc]___default = File in_________[PR]
+File in
+___'name_legend_11'________[i.e. File 11]_____________________________default = File 11_________[PR]
+File 11
+___'file_12'_______________[path/name.nc; i.e. ~/.../example.12.nc]___default = File in_________[PR]
+File in
+___'name_legend_12'________[i.e. File 12]_____________________________default = File 12_________[PR]
+File 12
+___end of file ".ncl_preferences"_______________________________________________________________________
Index: palm/trunk/SCRIPTS/NCL/cross_sections.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 183)
+++ palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 190)
@@ -5,23 +5,30 @@
 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
 
+;***************************************************
+; load ncl_preferences.ncl
+;***************************************************
+   
+if (isfilepresent("~/ncl_preferences.ncl")) then
+   loadscript("~/ncl_preferences.ncl")
+else
+  if (isfilepresent("~/palm/current_version/trunk/SCRIPTS/NCL/ncl_preferences.ncl")) then
+     loadscript( "~/palm/current_version/trunk/SCRIPTS/NCL/ncl_preferences.ncl")
+  else
+      print(" ")
+      print("'ncl_preferences.ncl' does not exist in $home or $home/palm/current_version/trunk/SCRIPTS/NCL/")
+      print(" ")
+      exit
+   end if
+end if
+    
 begin
 
-   ; ***************************************************
-   ; read parameter_list
-   ; ***************************************************
-
-   if (isfilepresent("~/.ncl_preferences")) then
-      parameter = asciiread("~/.ncl_preferences",129,"string")
-      delete(parameter@_FillValue)
-   else
-      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
+   if (cross_sections .NE. 1 .OR. profiles .NE. 0 .OR. timeseries .NE. 0 .OR. spectra .NE. 0)then
+      print(" ")
+      print("Please specify the used script in 'ncl_preferences.ncl' (Line 7-10)")
+      print(" ")
+      print("Set 'cross_sections' equal 1 and the other variables equal 0")
+      print(" ")
+      exit
    end if
 
@@ -30,13 +37,9 @@
    ; ***************************************************
    
-   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   
+   if (file_1 .EQ. "File in") then
+      print(" ")
+      print("Please provide 1st input file 'file_1=' in 'ncl_preferences.ncl'")
+      print(" ")
+      exit 
    else
       file_in = file_1   
@@ -44,188 +47,65 @@
    if (.not. isfilepresent(file_in)) then
       print(" ")
-      print("Your 1st input file: '"+file_in+"' does not exist")
+      print("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 
-   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
-         file_out = parameter(11)  
-     end if     
-   end if
-   if ( .not. isvar("no_columns") ) then    		
-      no_columns = 1
-      if (parameter(17) .NE. "1") then
-         no_columns = stringtointeger(parameter(17))  
-      end if
-   end if
-   if ( .not. isvar("no_lines") ) then     		
-      no_lines = 2
-      if (parameter(19) .NE. "2") then
-         no_lines = stringtointeger(parameter(19))  
-      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
+      print(" ")
+      print("'format_out = "+format_out+"' is invalid and set to'x11'")
+      print(" ")
+      format_out="x11"
+   end if
+
+   if (sort .NE. "layer" .AND. sort .NE. "time") then  
+      print(" ")
+      print("'sort'= "+sort+" is invalid and set to 'layer'")
+      print(" ")
+      sort = "layer"  
+   end if
+   
+   if (mode .NE. "Fill" .AND. mode .NE. "Line" .AND. mode .NE. "Both") then
+      print(" ")
+      print("'mode'= "+mode+" is invalid and set to 'Fill'")
+      print(" ")
+      mode = "Fill"
+   end if
+
+   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 = "AreaFill"
+   end if
+   
+   if (shape .NE. 0 .AND. shape .NE. 1) then
+      print(" ")
+      print("'shape'= "+shape+" is invalid and set to 1")
+      print(" ")
+      shape = 1
    end if 
-
-   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   			
-      mode = "Fill"
-      if (parameter(49) .NE. "Fill") then
-         mode = parameter(49)  
-         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
-         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 
-   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 (shape .NE. 0) then
-            print(" ")
-            print("Your 'shape'= "+shape+" is invalid and set to 1")
-            print(" ")
-            shape = 1
-         end if 
-      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   			
-      xyc = 0
-      if (parameter(57) .NE. "0") then
-         xyc = stringtointeger(parameter(57)) 
-         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   			
-      xzc = 0
-      if (parameter(59) .NE. "0") then
-         xzc = stringtointeger(parameter(59)) 
-         if (xzc .NE. 1) then
-            print(" ")
-            print("Your 'xzc'= "+xzc+" is invalid and set to 0")
-            print(" ")
-            xzc = 0
-         end if 
-      end if
-   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 (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
-
+   
+   if (xyc .NE. 0 .AND. xyc .NE. 1)then
+      print(" ")
+      print("'xyc'= "+xyc+" is invalid and set to 0")
+      print(" ")
+      xyc = 0  
+   end if
+   
+   if (xzc .NE. 0 .AND. xzc .NE. 1)then
+      print(" ")
+      print("'xzc'= "+xzc+" is invalid and set to 0")
+      print(" ")
+      xyc = 0  
+   end if
+   
+   if (yzc .NE. 0 .AND. yzc .NE. 1)then
+      print(" ")
+      print("'yzc'= "+yzc+" is invalid and set to 0")
+      print(" ")
+      xyc = 0  
+   end if
+   
    if (xyc .EQ. 0 .AND. xzc .EQ. 0 .AND. yzc .EQ. 0) then
       print(" ")
@@ -258,23 +138,12 @@
       end if
    end if
-   if ( .not. isvar("vector") ) then   		
-      vector = 0
-      if (parameter(39) .NE. "0") then
-         vector = stringtointeger(parameter(39)) 
-         if (stringtointeger(parameter(39)) .NE. 1) then
-            print(" ")
-            print("Please set 'vector' to 0 or 1")
-            print(" ")
-            exit
-         end if   
-      end if
-   end if
-   if ( .not. isvar("ref_mag") ) then   			
-      ref_mag = 0.05
-      if (parameter(47) .NE. "0.05") then
-         ref_mag = stringtofloat(parameter(47))   
-      end if
-   end if 
-
+
+   if (vector .NE. 0 .AND. vector .NE. 1) then
+      print(" ")
+      print("Please set 'vector' to 0 or 1")
+      print(" ")
+      exit
+   end if   
+ 
    ; ***************************************************
    ; open input file
@@ -285,5 +154,6 @@
    vNam  = getfilevarnames(f) 
    print(" ")
-   print("Variable on netCDF file: " + vNam)
+   print("Variables in input file:")
+   print("- "+ vNam)
    print(" ")
    dim   = dimsizes(vNam)
@@ -369,8 +239,4 @@
    cs_res                          = True
    cs_res@gsnYAxisIrregular2Linear = True  
-
-   if( shape .eq. 1 ) then          			
-      cs_res@gsnShape = True
-   end if
   
    cs_res@gsnDraw                 = False
@@ -381,13 +247,13 @@
    cs_res@gsnPaperHeight          = 11.69
    cs_res@gsnPaperMargin          = 0.79
-   cs_res@tmXBLabelFontHeightF   = .02
-   cs_res@tmYLLabelFontHeightF   = .02
-   cs_res@tiXAxisFontHeightF     = .02
-   cs_res@tiYAxisFontHeightF     = .02
+   cs_res@tmXBLabelFontHeightF   = .03
+   cs_res@tmYLLabelFontHeightF   = .03
+   cs_res@tiXAxisFontHeightF     = .03
+   cs_res@tiYAxisFontHeightF     = .03
    cs_res@tmXBMode                ="Automatic"
    cs_res@tmYLMode                ="Automatic"
-   cs_res@lgTitleFontHeightF     = .02 
-   cs_res@lgLabelFontHeightF     = .02
-   cs_res@txFontHeightF          = .02
+   cs_res@lgTitleFontHeightF     = .03 
+   cs_res@lgLabelFontHeightF     = .03
+   cs_res@txFontHeightF          = .03
    cs_res@cnLevelSelectionMode    = "ManualLevels"
 
@@ -428,25 +294,6 @@
    ; ****************************************************
 
-   if ( .not. isvar("start_time_step") ) then   	
-      start_time_step=t_all(0)/3600
-      if (parameter(13) .NE. "t(0)") then
-         if (stringtodouble(parameter(13)) .GT. t_all(nt-1)/3600)
-            print(" ")
-            print("'start_time_step' = "+ parameter(13) +"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(" ")
-            exit
-         end if
-         if (stringtofloat(parameter(13)) .LT. t_all(0)/3600)
-            print(" ")
-            print("'start_time_step' = "+ parameter(13) +"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(" ")
-            exit
-         end if
-         start_time_step=stringtodouble(parameter(13)) 
-      end if
+   if (start_time_step .EQ. -1.) then   	
+      start_time_step=t_all(0)/3600      
    else 
       if (start_time_step .GT. t_all(nt-1)/3600)
@@ -467,11 +314,19 @@
       end if
    end if
-   start_time_step = start_time_step*3600
    do i=0,nt-1     
-      if (start_time_step .GE. t_all(i)-delta_t/2 .AND. start_time_step .LT. t_all(i)+delta_t/2)then
+      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
          break
       end if
    end do
+   
+   if (.not. isvar("st"))then
+      print(" ")
+      print("'start_time_step' = "+ start_time_step +"h is invalid")
+      print(" ")
+      print("Please select another 'start_time_step'")
+      print(" ")
+      exit
+   end if
         
    ; ****************************************************
@@ -479,34 +334,7 @@
    ; ****************************************************
 
-   if ( .not. isvar("end_time_step") ) then     	
-      end_time_step = t_all(nt-1)/3600
-      if (parameter(15) .NE. "t(end)") then
-         if (stringtodouble(parameter(15)) .LT. t_all(0)/3600)
-            print(" ")
-            print("'end_time_step' = "+parameter(15)+ "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(" ")
-            exit
-         end if
-         if (stringtodouble(parameter(15)) .GT. t_all(nt-1)/3600)
-            print(" ")
-            print("'end_time_step' = "+ parameter(15) +"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(" ")
-            exit
-         end if
-         if (stringtodouble(parameter(15)) .LT. start_time_step/3600)
-            print(" ")
-            print("'end_time_step' = "+ parameter(15) +"h is lower than 'start_time_step' = "+parameter(13)+"h")
-            print(" ")
-            print("Please select another 'start_time_step' or 'end_time_step'")
-            print(" ")
-            exit
-         end if
-         end_time_step = stringtodouble(parameter(15))
-      end if    
-   else
+   if (end_time_step .EQ. -1.) then     	
+      end_time_step = t_all(nt-1)/3600  
+   else  
       if (end_time_step .LT. t_all(0)/3600)
          print(" ")
@@ -534,11 +362,19 @@
       end if
    end if
-   end_time_step = end_time_step*3600
    do i=0,nt-1     
-      if (end_time_step .GE. t_all(i)-delta_t/2 .AND. end_time_step .LT. t_all(i)+delta_t/2)then
+      if (end_time_step .GE. (t_all(i)-delta_t/2)/3600 .AND. end_time_step .LT. (t_all(i)+delta_t/2)/3600)then
          et=i
          break
       end if
    end do 
+   
+   if (.not. isvar("et"))then
+      print(" ")
+      print("'end_time_step' = "+ end_time_step +"h is invalid")
+      print(" ")
+      print("Please select another 'end_time_step'")
+      print(" ")
+      exit
+   end if
   
    delete(start_time_step)
@@ -559,25 +395,16 @@
 
    if (vector .EQ. 1) then
-      if ( .not. isvar("plotvec") ) then
-         plotvec = parameter(45)
-      end if
-      if ( .not. isvar("vec1") ) then
-         vec1 = parameter(41)
-         if (parameter(41) .EQ. "vec1") then
-            print(" ")
-            print("Please indicate Vector 1 ('vec1') for Vector-Plot")
-            print(" ")
-            exit
-         end if
-      end if
-      if ( .not. isvar("vec2") ) then
-         vec2 = parameter(43)
-         if (parameter(43) .EQ. "vec2") then
-            print(" ")
-            print("Please indicate Vector 2 ('vec2') for Vector-Plot")
-            print(" ")
-            exit
-         end if
-      end if             
+      if (vec1 .EQ. "component1") then
+         print(" ")
+         print("Please indicate Vector 1 ('vec1') for Vector-Plot or set 'vector' to 0")
+         print(" ")
+         exit
+      end if
+      if (vec2 .EQ. "component2") then
+         print(" ")
+         print("Please indicate Vector 2 ('vec2') for Vector-Plot or set 'vector' to 0")
+         print(" ")
+         exit
+      end if            
    end if 
 
@@ -592,5 +419,5 @@
    if (xyc .EQ. 1) then
       do varn=0,dim-1
-         if (vNam(varn) .eq. "xu"  .OR. vNam(varn) .eq. "x")then    
+         if (vNam(varn) .eq. "xu" .OR. vNam(varn) .eq. "x")then    
             x_d     = f->$vNam(varn)$
             xdim    = dimsizes(x_d)-1
@@ -703,39 +530,7 @@
    ; ****************************************************         
                     
-   if ( .not. isvar("xs") ) then     		
-      xs     = 0.0d
-      xstart = 0
-      if (parameter(63) .NE. "x0") then
-         if (delta_x .EQ. -1) then
-            print(" ") 
-            print("You cannot choose a start value for x, there are preseted layers for x")
-            print(" ")
-            xstart=0
-         else
-            if (stringtodouble(parameter(63)) .LT. 0-delta_x/2) then
-               print(" ")
-               print("range start for x-coordinate = "+parameter(63)+"m is lower than first value x = "+0+"m or xu = "+(0-delta_x/2)+"m")
-               print(" ")
-               exit
-            end if
-            if (xyc .EQ. 1 .OR. xzc .EQ. 1) then
-               if (stringtodouble(parameter(63)) .GE. xdim*delta_x) then
-                  print(" ")
-                  print("range start for x-coordinate = "+parameter(63)+"m is equal or greater than last value = "+xdim*delta_x+"m")
-                  print(" ")
-                  exit
-               end if 
-            else
-               if (stringtodouble(parameter(63)) .GT. xdim*delta_x) then
-                  print(" ")
-                  print("range start for x-coordinate = "+parameter(63)+"m is greater than last value = "+xdim*delta_x+"m")
-                  print(" ")
-                  exit
-               end if 
-            end if
-            xs = stringtodouble(parameter(63))
-         end if
-      end if
-   else
+   if (xs .EQ. -1.d) then     		
+      xs = x_d(0)
+   else 
       if (delta_x .EQ. -1) then
          print(" ") 
@@ -768,38 +563,6 @@
    end if 
 
-   if ( .not. isvar("ys") ) then    
-      ys = 0.0d
-      ystart = 0
-      if (parameter(67) .NE. "y0") then
-         if (delta_y .EQ. -1) then
-            print(" ") 
-            print("You cannot choose a start value for y, there are preseted layers for y")
-            print(" ")
-            ystart=0
-         else
-            if (stringtodouble(parameter(67)) .LT. 0-delta_y/2) then
-               print(" ")
-               print("range start for y-coordinate = "+parameter(67)+"m is lower than first value = "+0-delta_y/2+"m")
-               print(" ")
-               exit
-            end if
-            if (xyc .EQ. 1 .OR. yzc .EQ. 1) then
-               if (stringtodouble(parameter(67)) .GE. ydim*delta_y) then
-                  print(" ")
-                  print("range start for y-coordinate = "+parameter(67)+"m is equal or greater than last value = "+ydim*delta_y+"m")
-                  print(" ")
-                  exit
-               end if
-            else
-               if (stringtodouble(parameter(67)) .GT. ydim*delta_y) then
-                  print(" ")
-                  print("range start for y-coordinate = "+parameter(67)+"m is greater than last value = "+ydim*delta_y+"m")
-                  print(" ")
-                  exit
-               end if
-            end if
-            ys = stringtodouble(parameter(67))
-         end if
-      end if
+   if (ys .EQ. -1.d) then    
+      ys = y_d(0)
    else
       if (delta_y .EQ. -1) then
@@ -833,42 +596,6 @@
    end if
   
-   if ( .not. isvar("zs") ) then     			
+   if (zs .EQ. -1) then     			
       zs = 0
-      if (parameter(71) .NE. "z0") then
-         if (delta_z .EQ. -1) then
-            print(" ") 
-            print("You cannot choose a start value for z, there are preseted layers for z")
-            print(" ")
-         else
-            print(" ")
-            print("Please mind to indicate start and end ranges for the z-coordinate in")
-            print("indices not in 'meters'. Corresponding index and meter:")
-            print(" ")
-            print(" = "+z_d+" m")
-            print(" ") 
-            if (stringtointeger(parameter(71)) .LT. 0) then
-               print(" ")
-               print("range start for z-coordinate = "+parameter(71)+" is lower than first gridpoint = 0")
-               print(" ")
-               exit
-            end if
-            if (xzc .EQ. 1 .OR. yzc .EQ. 1) then
-               if (stringtointeger(parameter(71)) .GE. zdim) then
-                  print(" ")
-                  print("range start for z-coordinate = "+parameter(71)+" is equal or greater than last gridpoint = "+zdim)
-                  print(" ")
-                  exit
-               end if
-            else
-               if (stringtodouble(parameter(71)) .GT. zdim) then
-                  print(" ")
-                  print("range start for z-coordinate = "+parameter(71)+" is greater than last gridpoint = "+zdim)
-                  print(" ")
-                  exit
-               end if
-            end if
-            zs = stringtointeger(parameter(71))
-         end if
-      end if
    else
       if (delta_z .EQ. -1) then
@@ -901,50 +628,6 @@
    end if  
 
-   if ( .not. isvar("xe")) then    
-      xe   = xdim*delta_x
-      xend = xdim
-      if (parameter(65) .NE. "xdim") then
-         if (delta_x .EQ. -1) then
-            print(" ") 
-            print("You cannot choose an end value for x, there are preseted layers for x")
-            print(" ") 
-            xend=xdim           
-         else
-            if (stringtodouble(parameter(65)) .GT. xdim*delta_x) then
-               print(" ")
-               print("range end for x-coordinate = "+parameter(65)+"m is greater than last value = "+xdim*delta_x+"m")
-               print(" ") 
-               exit 
-            end if 
-            if (xyc .EQ. 1 .OR. xzc .EQ. 1) then
-               if (stringtodouble(parameter(65)) .LE. 0-delta_x/2)
-                  print(" ")
-                  print("range end for x-coordinate = "+parameter(65)+"m is equal or lower than first value = "+(0-delta_x/2)+"m")
-                  print(" ")
-                  exit
-               end if
-               if (stringtodouble(parameter(65)) .LE. xs) then
-                  print(" ")
-                  print("range end for x-coordinate = "+parameter(65)+"m is equal or lower than start range = "+xs+"m")
-                  print(" ")
-                  exit
-               end if
-            else
-               if (stringtodouble(parameter(65)) .LT. 0-delta_x/2)
-                  print(" ")
-                  print("range end for x-coordinate = "+parameter(65)+"m is lower than first value = "+(0-delta_x/2)+"m")
-                  print(" ")
-                  exit
-               end if
-               if (stringtodouble(parameter(65)) .LT. xs) then
-                  print(" ")
-                  print("range end for x-coordinate = "+parameter(65)+"m is lower than start range = "+xs+"m")
-                  print(" ")
-                  exit
-               end if
-            end if         
-            xe = stringtodouble(parameter(65)) 
-         end if 
-      end if
+   if (xe .EQ. -1) then    
+      xe = x_d(xdim)
    else
       if (delta_x .EQ. -1) then
@@ -973,5 +656,5 @@
                exit
             end if
-            if (stringtodouble(xe .EQ. xs+1)) then
+            if (xe .EQ. xs+1) then
                print(" ")
                print("range end for x-coordinate = "+xe+"m must be at least two more gridpoints greater than start range = "+xs+"m")
@@ -995,57 +678,7 @@
       end if               
    end if
-
-   if ( .not. isvar("ye")) then  
-      ye   = ydim*delta_y
-      yend = ydim
-      if (parameter(69) .NE. "ydim") then
-         if (delta_y .EQ. -1) then
-            print(" ") 
-            print("You cannot choose an end value for y, there are preseted layers for y")
-            print(" ")
-            yend=ydim
-         else
-            if (stringtodouble(parameter(69)) .GT. ydim*delta_y) then
-               print(" ")
-               print("range end for y-coordinate = "+parameter(69)+"m is greater than last value = "+ydim*delta_y+"m")
-               print(" ") 
-               exit 
-            end if 
-            if (xyc .EQ. 1 .OR. yzc .EQ. 1) then
-               if (stringtodouble(parameter(69)) .LE. 0-delta_y/2)
-                  print(" ")
-                  print("range end for y-coordinate = "+parameter(69)+"m is equal or lower than first value = "+(0-delta_y/2)+"m")
-                  print(" ")
-                  exit
-               end if
-               if (stringtodouble(parameter(69)) .LE. ys) then
-                  print(" ")
-                  print("range end for y-coordinate = "+parameter(69)+"m is equal or lower than start range = "+ys+"m")
-                  print(" ")
-                  exit
-               end if
-               if (stringtodouble(parameter(69)) .EQ. ys+1) then
-                  print(" ")
-                  print("range end for y-coordinate = "+parameter(69)+"m must be at least two more gridpoints greater than start range = "+ys+"m")
-                  print(" ")
-                  exit
-               end if 
-            else
-               if (stringtodouble(parameter(69)) .LT. 0-delta_y/2)
-                  print(" ")
-                  print("range end for y-coordinate = "+parameter(69)+"m is lower than first value = "+(0-delta_y/2)+"m")
-                  print(" ")
-                  exit
-               end if
-               if (stringtodouble(parameter(69)) .LT. ys) then
-                  print(" ")
-                  print("range end for y-coordinate = "+parameter(69)+"m is lower than start range = "+ys+"m")
-                  print(" ")
-                  exit
-               end if
-            end if         
-            ye = stringtodouble(parameter(69)) 
-         end if 
-      end if
+   
+   if (ye .EQ. -1) then  
+      ye = y_d(ydim)
    else
       if (delta_y .EQ. -1) then
@@ -1097,54 +730,6 @@
    end if 
  
-   if ( .not. isvar("ze")) then  
+   if (ze .EQ. -1) then  
       ze = zdim
-      if (parameter(73) .NE. "zdim") then
-         if (delta_z .EQ. -1) then
-            print(" ") 
-            print("You cannot choose an end value for z, there are preseted layers for z")
-            print(" ")           
-         else
-            if (stringtointeger(parameter(73)) .GT. zdim) then
-               print(" ")
-               print("range end for z-coordinate = "+parameter(73)+" is greater than last gridpoint = "+zdim)
-               print(" ") 
-               exit 
-            end if 
-         if (xzc .EQ. 1 .OR. yzc .EQ. 1) then
-            if (stringtointeger(parameter(73)) .LE. 0)
-               print(" ")
-               print("range end for z-coordinate = "+parameter(73)+" is equal or lower than first gridpoint = 0")
-               print(" ")
-               exit
-            end if
-            if (stringtointeger(parameter(73)) .LE. zs) then
-               print(" ")
-               print("range end for z-coordinate = "+parameter(73)+" is equal or lower than start range = "+zs)
-               print(" ")
-               exit
-            end if
-            if (stringtodouble(parameter(73)) .EQ. zs+1) then
-               print(" ")
-               print("range end for z-coordinate = "+parameter(73)+" must be at least two more gridpoints greater than start range = "+zs)
-               print(" ")
-               exit
-            end if
-         else
-            if (stringtointeger(parameter(73)) .LT. 0)
-               print(" ")
-               print("range end for z-coordinate = "+parameter(73)+" is lower than first gridpoint = 0")
-               print(" ")
-               exit
-            end if
-            if (stringtointeger(parameter(73)) .LT. zs) then
-               print(" ")
-               print("range end for z-coordinate = "+parameter(73)+" is lower than start range = "+zs)
-               print(" ")
-               exit
-            end if
-         end if         
-         ze = stringtointeger(parameter(73)) 
-      end if 
-      end if
    else
       if (delta_z .EQ. -1) then
@@ -1211,5 +796,5 @@
    end if
    if (delta_y .NE. -1) then
-      do i=0,xdim    
+      do i=0,ydim    
          if (ys .GT. y_d(i)-delta_y/2 .AND. ys .LE. y_d(i)+delta_y/2)then
             ystart=i
@@ -1217,5 +802,5 @@
          end if
       end do 
-      do i=0,xdim    
+      do i=0,ydim    
          if (ye .GT. y_d(i)-delta_y/2 .AND. ye .LE. y_d(i)+delta_y/2)then
             yend=i
@@ -1223,4 +808,9 @@
          end if
       end do 
+   end if
+   
+   if( shape .eq. 1 ) then 
+      cs_res@vpWidthF    = (xe-xs)/(ye-ys)        
+      cs_res@vpHeightF   = 1
    end if
    
@@ -1238,6 +828,6 @@
       if (xe .EQ. xs+1) then
          print(" ")
-         print("range end for x-coordinate="+parameter(65)+"m(=>value on file="+xe*delta_x+"m) must be at least two") 
-         print("more gridpoints(="+2*delta_x+"m) greater than start range="+parameter(63)+"m(=>value on file="+xs*delta_x+"m)")
+         print("range end for x-coordinate="+xe*delta_x+"m) must be at least two") 
+         print("more gridpoints(="+2*delta_x+"m) greater than start range="+xs*delta_x+"m)")
          print(" ")
          exit
@@ -1247,6 +837,6 @@
       if (ye .EQ. ys+1) then
          print(" ")
-         print("range end for y-coordinate="+parameter(69)+"m(=>value on file="+ye*delta_y+"m) must be at least two") 
-         print("more gridpoints(="+2*delta_y+"m) greater than start range="+parameter(67)+"m(=>value on file="+ys*delta_y+"m)")
+         print("range end for y-coordinate="+ye*delta_y+"m) must be at least two") 
+         print("more gridpoints(="+2*delta_y+"m) greater than start range="+ys*delta_y+"m)")
          print(" ")
          exit
@@ -1256,6 +846,6 @@
       if (ze .EQ. zs+1) then
          print(" ")
-         print("range end for x-coordinate="+parameter(73)+"(=> value on file="+ze+") must be at least two") 
-         print("more gridpoints greater than start range="+parameter(71)+"(=>value on file="+zs+")")
+         print("range end for x-coordinate="+ze+") must be at least two") 
+         print("more gridpoints greater than start range="+zs+")")
          print(" ")
          exit
@@ -1265,13 +855,13 @@
    if (xyc .EQ. 1) then
       no_layer = (ze-zs)+1
-      data = new((/dim,nt,zdim+1,(ye-ys)+1,(xe-xs)+1/),float)
+      data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float)
    end if
    if (xzc .EQ. 1) then
       no_layer = (ye-ys)+1
-      data = new((/dim,nt,(ze-zs)+1,ydim+1,(xe-xs)+1/),float)
+      data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float)
    end if
    if (yzc .EQ. 1) then
       no_layer = (xe-xs)+1
-      data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,xdim+1/),float)
+      data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float)
    end if
 
@@ -1299,9 +889,9 @@
       lis = start_time_step
       lie = end_time_step
-      los = lays 
-      loe = laye
+      los = 0
+      loe = laye-lays
    else
-      lis = lays
-      lie = laye
+      lis = 0
+      lie = laye-lays
       los = start_time_step 
       loe = end_time_step
@@ -1314,7 +904,5 @@
    n=0
 
-   do varn=dim-1,0,1  
-      
-      data_all = f->$vNam(varn)$ 
+   do varn=dim-1,0,1        
     
       if (vector .EQ. 1) then    
@@ -1328,9 +916,6 @@
          check = True
       end if  
-      if (  isvar("var") ) then  
-         check = isStrSubset( var,","+vNam(varn)+",")
-      end if  
-      if (parameter(21) .NE. "variables") then
-         var = parameter(21) 
+    
+      if (var .NE. "all") then
          check = isStrSubset( var,","+vNam(varn)+"," ) 
       end if  
@@ -1350,18 +935,17 @@
 
          if (xyc .EQ. 1) then
-            data(varn,:,:,:,:)=data_all(:,:,ys:ye,xs:xe) 
+            data(varn,:,:,:,:)=f->$vNam(varn)$(:,zs:ze,ys:ye,xs:xe) 	
          end if
          if ( xzc .eq. 1 ) then
-            data(varn,:,:,:,:)=data_all(:,zs:ze,:,xs:xe) 
+            data(varn,:,:,:,:)=f->$vNam(varn)$(:,zs:ze,ys:ye,xs:xe) 
          end if
          if ( yzc .eq. 1) then
-            data(varn,:,:,:,:)=data_all(:,zs:ze,ys:ye,:) 
-         end if
-
+            data(varn,:,:,:,:)=f->$vNam(varn)$(:,zs:ze,ys:ye,xs:xe) 
+         end if
          if (check_vec1) then
-            vect1=data_all
+            vect1=data(varn,:,:,:,:)
          end if
          if (check_vec2) then
-            vect2=data_all
+            vect2=data(varn,:,:,:,:)
          end if
 
@@ -1377,11 +961,36 @@
       end if
 
-      delete(data_all)
-
    end do
 
-   if (n .EQ. 0) then
-      print(" ")
-      print("The variables 'var=Â°"+var+"Â°' do not exist on your input file")
+   var_input=new(no_var,string)
+   numb=0
+   do varn=dim-1,0,1   
+    
+      if (vector .EQ. 1) then    
+         check_vec1 = isStrSubset( vec1,","+vNam(varn)+",")
+         check_vec2 = isStrSubset( vec2,","+vNam(varn)+",")
+      end if
+           
+      if ( vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "xu" .or. vNam(varn) .eq. "zu" .or. vNam(varn) .eq. "zwwi" .or. vNam(varn) .eq. "zusi" .or. vNam(varn) .eq. "time" .or. vNam(varn) .eq. "zu_3d" .or. vNam(varn) .eq. "zw_3d" .or. vNam(varn) .eq. "x".or. vNam(varn) .eq. "y" .or. vNam(varn) .eq. "zu_xy" .or. vNam(varn) .eq. "zw_xy" .or. vNam(varn) .eq. "zu1_xy" .or. vNam(varn) .eq. "ind_z_xy" .or. vNam(varn) .eq. "y_xz" .or. vNam(varn) .eq. "yv_xz" .or. vNam(varn) .eq. "ind_y_xz" .or. vNam(varn) .eq. "x_yz" .or. vNam(varn) .eq. "xu_yz" .or. vNam(varn) .eq. "ind_x_yz") then
+         check = False
+      else
+         check = True
+      end if  
+    
+      if (var .NE. "all") then
+         check = isStrSubset( var,","+vNam(varn)+"," ) 
+      end if  
+
+      if(check) then     
+         var_input(numb)=vNam(varn) 
+	 numb=numb+1     
+      end if
+      
+   end do
+
+   if (no_var .EQ. 0) then
+      print(" ")
+      print("The variables var='"+var+"' do not exist on your input file;")
+      print("be sure to have one comma berfore and after each variable")
       print(" ")
       exit
@@ -1391,5 +1000,7 @@
       if (v1 .EQ. 0)then
          print(" ")
-         print("Varible for vector-plot ('vec1') must be one of the varibles for plot ('var')")
+         print("Component 1 for the vector-plot ('vec1') must be one of the input varibles:")
+	 print("- "+var_input)
+	 print("be sure to have one comma berfore and after the variable")
          print(" ")
          exit
@@ -1398,5 +1009,7 @@
       if (v2 .EQ. 0)then
          print(" ")
-         print("Varible for vector-plot ('vec2') must be one of the varibles for plot ('var')")
+         print("Component 2 for the vector-plot ('vec2') must be one of the input varibles:")
+	 print("- "+var_input)
+	 print("be sure to have one comma berfore and after the variable")
          print(" ")
          exit
@@ -1423,5 +1036,5 @@
    ; ***************************************************
 
-   if (vector .EQ. 1 .AND. parameter(45) .EQ. "plotvec") then
+   if (vector .EQ. 1 .AND. plotvec .EQ. "plotvec") then
       do lo = los, loe           				
          do li = lis, lie
@@ -1441,6 +1054,4 @@
       end do
    end if
-
-   check = True
  
    do varn=dim-1,0,1 
@@ -1455,14 +1066,11 @@
          check = True
       end if   
-      if (  isvar("var") ) then  
-         check = isStrSubset( var,","+vNam(varn)+",")
-      end if
-      if (parameter(21) .NE. "variables") then
-         var = parameter(21) 
+  
+      if (var .NE. "all") then
          check = isStrSubset( var,","+vNam(varn)+"," ) 
       end if 
     
       if(check) then
-         print(vNam(varn))
+   
          space=(MaxVal(varn)-MinVal(varn))/24
   
@@ -1496,5 +1104,5 @@
                         level = "=" + data&z(lo) + "m"
                      end if
-                     cs_res@gsnCenterString = "t=" + data&t(li) +"s  z"+level
+                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) +"h  z"+level		     
                      plot(n) = gsn_csm_contour(wks_ps,data(varn,li,lo,:,:),cs_res) 
                      if (vector .EQ. 1 .AND. check_vecp) then
@@ -1514,10 +1122,10 @@
                  
                   if ( sort .eq. "layer" ) then
-                     if ( data&z(li) .eq. -1 ) then
+		     if ( data&z(li) .eq. -1 ) then
                         level = "-average"
                      else 
                         level = "=" + data&z(li) + "m"
-                     end if
-                     cs_res@gsnCenterString = "t=" + data&t(lo) + "s  z"+ level
+                     end if 
+                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h  z"+ level		
                      plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,li,:,:),cs_res)
                      if (vector .EQ. 1 .AND. check_vecp) then
@@ -1548,10 +1156,10 @@
                
                   if ( sort .eq. "time" ) then
-                     if ( data&z(lo) .eq. -1 ) then
+                     if ( data&y(lo) .eq. -1 ) then
                         level = "-average"
                      else 
                         level = "=" + data&y(lo) + "m"
                      end if
-                     cs_res@gsnCenterString = "t=" + data&t(li) + "s  y"+ level
+                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "s  y"+ level
                      plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,lo,:),cs_res)
                      if (vector .EQ. 1 .AND. check_vecp) then
@@ -1571,10 +1179,10 @@
 
                   if ( sort .eq. "layer" ) then
-                     if ( data&z(li) .eq. -1 ) then
+                     if ( data&y(li) .eq. -1 ) then
                         level = "-average"
                      else 
                         level = "=" + data&y(li) + "m"
                      end if
-                     cs_res@gsnCenterString = "t=" + data&t(lo) + "s  y"+ level
+                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "s  y"+ level
                      plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,li,:),cs_res)
                      if (vector .EQ. 1 .AND. check_vecp) then
@@ -1605,10 +1213,10 @@
 
                   if ( sort .eq. "time" ) then
-                     if ( data&z(lo) .eq. -1 ) then
+                     if ( data&x(lo) .eq. -1 ) then
                         level = "-average"
                      else 
-                        level = "=" + data&z(lo) + "m"
+                        level = "=" + data&x(lo) + "m"
                      end if
-                     cs_res@gsnCenterString = "t=" + data&t(li) + "s  x"+ level
+                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "s  x"+ level
                      plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,:,lo),cs_res)
     	             if (vector .EQ. 1 .AND. check_vecp) then
@@ -1628,10 +1236,10 @@
 
                   if ( sort .eq. "layer" ) then
-                     if ( data&z(li) .eq. -1 ) then
+                     if ( data&x(li) .eq. -1 ) then
                         level = "-average"
                      else 
-                        level = "=" + data&z(li) + "m"
+                        level = "=" + data&x(li) + "m"
                      end if
-                     cs_res@gsnCenterString = "t=" + data&t(lo) + "s  x"+ level
+                     cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "s  x"+ level
                      plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,:,li),cs_res)
                      if (vector .EQ. 1 .AND. check_vecp)then
@@ -1660,5 +1268,5 @@
    ; ***************************************************
 
-   if (vector .EQ. 1 .AND. parameter(45) .EQ. "plotvec")then 
+   if (vector .EQ. 1 .AND. plotvec .EQ. "plotvec")then 
       if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then
          gsn_panel(wks_ps,plot(0:(no_time*no_layer*(no_var+1))-1),(/no_var+1,no_layer*no_time/),cs_resP)
Index: palm/trunk/SCRIPTS/NCL/ncl_preferences.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/ncl_preferences.ncl	(revision 190)
+++ palm/trunk/SCRIPTS/NCL/ncl_preferences.ncl	(revision 190)
@@ -0,0 +1,1593 @@
+begin
+
+;*********************************************************
+; Please specify the used script by setting it to 1:
+;********************************************************* 
+  
+   cross_sections = 0
+   profiles       = 0
+   timeseries     = 0
+   spectra        = 0
+   
+;*********************************************************
+
+   ;******************************************************
+   ; parameters used by CROSS_SECTIONS
+   ;******************************************************
+   
+   if (cross_sections .EQ. 1)then
+   
+      ;***************************************************
+      ; REQUIRED --file_1-- INPUT FILE
+      ;
+      ; input file produced by PALM; please declare path and name
+      ;
+      ; data type: string
+      ;
+      ; default:   "File in" 
+      ;***************************************************
+      if(.not. isvar("file_1"))then
+      
+      
+         file_1 = "File in" 
+	 
+       
+      end if
+      ;***************************************************
+      ; REQUIRED --xyc, xzc, yzc-- SECTION of XY or XZ or YZ
+      ;
+      ; desired section has to be set to 1; e.g.: xyc=1, xzc=0 and yzc=0 for xy-section
+      ;
+      ; data type: integer
+      ;
+      ; default:   0
+      ;***************************************************
+      if(.not. isvar("xyc"))then      
+       
+         xyc = 0
+	
+      end if
+      if (.not. isvar("xzc"))then
+      
+	 xzc = 0
+	
+      end if
+      if (.not. isvar("yzc"))then
+      
+	 yzc = 0
+	 	 
+      end if	 	 
+      ;***************************************************
+      ; OPTIONAL --format_out-- OUTPUT FORMAT
+      ;
+      ; supported file formats: x11, pdf, ps, eps, epsi or ncgm 
+      ;
+      ; data type: string
+      ;
+      ; default:   "x11" 
+      ;***************************************************
+      if(.not. isvar("format_out"))then	 
+      
+      
+         format_out = "x11"
+	 
+	 
+      end if 
+      ;***************************************************
+      ; OPTIONAL --file_out-- OUTPUT FILE
+      ;
+      ; please declare path and name 
+      ;
+      ; data type: string
+      ;
+      ; default:   "~/test" 
+      ;***************************************************
+      if(.not. isvar("file_out"))then	 
+      
+      
+         file_out = "~/test_cs"
+	 
+	 
+      end if	 
+      ;***************************************************
+      ; OPTIONAL --no_columns-- NUMBER OF ROWS
+      ;
+      ; number of plots in one row 
+      ;
+      ; data type: integer
+      ;
+      ; default:   1
+      ;***************************************************
+      if(.not. isvar("no_columns"))then	 
+      
+      
+         no_columns = 1
+	 
+	 
+      end if	 
+      ;***************************************************
+      ; OPTIONAL --no_lines-- NUMBER OF COLUMNS
+      ;
+      ; number of plots in one column 
+      ;
+      ; data type: integer
+      ;
+      ; default:   2 
+      ;***************************************************
+      if(.not. isvar("no_lines"))then	 
+      
+      
+         no_lines = 2
+	 
+	 
+      end if	 
+      ;***************************************************
+      ; OPTIONAL --sort-- TYPE OF SORTING 
+      ;
+      ; sequence of plots; sorting either by time step [="time"] or by layer/height [="layer"]
+      ;
+      ; data type: string
+      ;
+      ; default:   "layer" 
+      ;***************************************************
+      if(.not. isvar("sort"))then	 
+      
+      
+         sort = "layer"
+	 
+	 
+      end if	 
+      ;***************************************************
+      ; 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)
+      ;
+      ; data type: string 
+      ;
+      ; default:   "all" (all available variables will be plotted)
+      ;***************************************************
+      if(.not. isvar("var"))then
+      
+      	 
+         var = "all"
+	 
+	 
+      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
+      ;
+      ; data type: double; dimension: [hour]
+      ;
+      ; default:   -1.d (first available time step)
+      ;***************************************************
+      if(.not. isvar("start_time_step"))then
+      
+      	 
+         start_time_step = -1.d
+	 
+	 
+      end if	 
+      ;***************************************************
+      ; 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
+      ;
+      ; data type: double; dimension: [hour]
+      ;
+      ; default:   -1.d (last available time step)
+      ;***************************************************
+      if(.not. isvar("end_time_step"))then	 
+      
+      
+         end_time_step = -1.d
+	 
+	 
+      end if	 
+      ;***************************************************
+      ; OPTIONAL --xs-- MINIMUM X-AXIS 
+      ;
+      ; 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
+      ;
+      ; data type: double; dimension: [meter]
+      ;
+      ; default:   -1.d (minimum of range)
+      ;***************************************************
+      if(.not. isvar("xs"))then      
+      
+      
+         xs = -1.d
+	 
+	 
+      end if	 
+      ;***************************************************
+      ; OPTIONAL --xe-- MAXIMUM X-AXIS 
+      ;
+      ; 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
+      ;
+      ; data type: double; dimension: [meter] 
+      ;
+      ; default:   -1.d (maximum of range)
+      ;***************************************************
+      if(.not. isvar("xe"))then      
+      
+      
+         xe = -1.d
+	 
+	 
+      end if	 
+      ;***************************************************
+      ; OPTIONAL --ys-- MINIMUM Y-AXIS 
+      ;
+      ; 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
+      ;
+      ; data type: double; dimension: [meter]
+      ;
+      ; default:   -1.d (minimum of range)
+      ;***************************************************
+      if(.not. isvar("ys"))then      
+      
+      
+         ys = -1.d
+	 
+	 
+      end if	 
+      ;***************************************************
+      ; OPTIONAL --ye-- MAXIMUM Y-AXIS 
+      ;
+      ; 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 
+      ;
+      ; data type: double; dimension: [meter]
+      ;
+      ; default:   -1.d (maximum of range)
+      ;***************************************************
+      if(.not. isvar("ye"))then   
+      
+         
+         ye = -1.d
+	 
+	 
+      end if	 
+      ;***************************************************
+      ; OPTIONAL --zs-- MINIMUM Z-AXIS 
+      ;
+      ; value for minimum of z-axis, selectable if there are NO preseted layers for z (as for XZ 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 
+      ;
+      ; data type: integer
+      ;
+      ; default:   -1 (minimum of range)
+      ;***************************************************
+      if(.not. isvar("zs"))then      
+      
+      
+         zs = -1
+	 
+	 
+      end if	 
+      ;***************************************************
+      ; OPTIONAL --ze-- MAXIMUM Z-AXIS 
+      ;
+      ; value for maximum of z-axis, selectable if there are NO preseted layers for z (as for XZ 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 
+      ;
+      ; data type: integer
+      ;
+      ; default:   -1 (maximum of range)
+      ;***************************************************
+      if(.not. isvar("ze"))then
+      
+            
+         ze = -1
+	 
+	 
+      end if	 
+      ;***************************************************
+      ; OPTIONAL --mode-- TYPE OF PLOT 
+      ;
+      ; isoline plots [="Line"], contour plots [="Fill"] or both [="Both"] can be choosen 
+      ;
+      ; data type: string
+      ;
+      ; default:   "Fill" 
+      ;***************************************************
+      if(.not. isvar("mode"))then	 
+      
+      
+         mode = "Fill"
+	 
+	 
+      end if	 
+      ;***************************************************
+      ; OPTIONAL --fill_mode-- TYPE OF FILLING 
+      ;
+      ; area fill [="AreaFill"], raster fill [="RasterFill"] or cell fill [="CellFill"] can be choosen 
+      ;
+      ; data type: string
+      ;
+      ; default:   "AreaFill" 
+      ;***************************************************
+      if(.not. isvar("fill_mode"))then	 
+      
+      
+         fill_mode = "AreaFill"
+	 
+	 
+      end if	 
+      ;***************************************************
+      ; OPTIONAL --shape-- ASPECT RATIO 
+      ;
+      ; aspect ratio of axis is kept [=1] or  not[=0]
+      ;
+      ; data type: integer
+      ;
+      ; default:   1 
+      ;***************************************************
+      if(.not. isvar("shape"))then
+      
+      	 
+         shape = 1
+	 
+	 
+      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
+	 
+	 
+      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"	 
+	 
+      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 
+      ;
+      ; length of the reference vector in a vector plot
+      ;
+      ; data type: float
+      ;
+      ; default:   0.05 
+      ;***************************************************
+      if(.not. isvar("ref_mag"))then
+      
+      	 
+         ref_mag = 0.05 
+	 
+	 
+      end if      	 
+      ;***************************************************
+     
+   end if 
+
+   ;******************************************************
+   ; parameters used by PROFILES
+   ;******************************************************
+   
+   if (profiles .EQ. 1)then
+   
+      ;***************************************************
+      ; REQUIRED --file_1-- INPUT FILE
+      ;
+      ; input file produced by PALM; please declare path and name
+      ;
+      ; data type: string
+      ;
+      ; default:   "File in" 
+      ;***************************************************
+      if (.not. isvar("file_1"))then
+      
+      
+         file_1 = "File in"
+	 
+	 
+      end if
+      ;***************************************************
+      ; REQUIRED --prof3d-- 3D OR PROFILE DATA 
+      ;
+      ; must be switched on [=1] if 3D data are used or switched off [=0] if profile data are used for profiles
+      ;
+      ; data type: integer
+      ;
+      ; default:   -1 
+      ;***************************************************
+      if (.not. isvar("prof3d"))then  
+      
+          
+         prof3d = -1
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --format_out-- OUTPUT FORMAT
+      ;
+      ; supported file formats: x11, pdf, ps, eps, epsi or ncgm 
+      ;
+      ; data type: string
+      ;
+      ; default:   "x11" 
+      ;***************************************************
+      if (.not. isvar("format_out"))then	 
+      
+      
+         format_out = "x11"
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --file_out-- OUTPUT FILE
+      ;
+      ; please declare path and name 
+      ;
+      ; data type: string
+      ;
+      ; default:   "~/test" 
+      ;***************************************************
+      if (.not. isvar("file_out"))then	
+      
+       
+         file_out = "~/test_pr"
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --no_columns-- NUMBER OF ROWS
+      ;
+      ; number of plots in one row 
+      ;
+      ; data type: integer
+      ;
+      ; default:   1
+      ;***************************************************
+      if (.not. isvar("no_columns"))then	 
+      
+      
+         no_columns = 1
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --no_lines-- NUMBER OF COLUMNS
+      ;
+      ; number of plots in one column 
+      ;
+      ; data type: integer
+      ;
+      ; default:   2 
+      ;***************************************************
+      if (.not. isvar("no_lines"))then	
+      
+       
+         no_lines = 2
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; 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)
+      ;
+      ; data type: string 
+      ;
+      ; default:   "all" (all available variables will be plotted)
+      ;***************************************************
+      if (.not. isvar("var"))then
+      
+      	 
+         var = "all"
+	 
+	 
+      end if    
+      ;***************************************************
+      ; 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;
+      ; 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
+      ;
+      ; data type: integer
+      ;
+      ; default:   1 
+      ;***************************************************
+      if (.not. isvar("no_files"))then
+      
+      	 
+         no_files = 1
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --name_legend_1-- 1st LEGEND ITEM
+      ;
+      ; if no_files > 1: name of 1st item in extra legend
+      ;
+      ; data type: string
+      ;
+      ; default:   "File 1" 
+      ;***************************************************
+      if (.not. isvar("name_legend_1"))then 
+      
+           
+         name_legend_1 = "File 1"
+	 
+	 
+      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
+      ;
+      ; default:   "File in" 
+      ;***************************************************
+      if (.not. isvar("file_2"))then  
+      
+          
+         file_2 = "File in"
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --name_legend_2-- 2nd LEGEND ITEM
+      ;
+      ; if no_files > 1: name of 2nd item in extra legend
+      ;
+      ; data type: string
+      ;
+      ; default:   "File 2" 
+      ;***************************************************
+      if (.not. isvar("name_legend_2"))then   
+      
+         
+         name_legend_2 = "File 2"
+	 
+	 
+      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
+      ;
+      ; default:   "File in" 
+      ;***************************************************
+      if (.not. isvar("file_3"))then    
+      
+        
+         file_3 = "File in"
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --name_legend_3-- 3rd LEGEND ITEM
+      ;
+      ; if no_files > 2: name of 3rd item in extra legend
+      ;
+      ; data type: string
+      ;
+      ; default:   "File 3" 
+      ;***************************************************
+      if (.not. isvar("name_legend_3"))then 
+      
+           
+         name_legend_3 = "File 3"
+	 
+	 
+      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
+      ;
+      ; default:   "File in" 
+      ;***************************************************
+      if (.not. isvar("file_4"))then
+      
+            
+         file_4 = "File in"
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --name_legend_4-- 4th LEGEND ITEM
+      ;
+      ; if no_files > 3: name of 4th item in extra legend
+      ;
+      ; data type: string
+      ;
+      ; default:   "File 4" 
+      ;***************************************************
+      if (.not. isvar("name_legend_4"))then    
+      
+        
+         name_legend_4 = "File 4"
+	 
+	 
+      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
+      ;
+      ; default:   "File in" 
+      ;***************************************************
+      if (.not. isvar("file_5"))then 
+      
+           
+         file_5 = "File in"
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --name_legend_5-- 5th LEGEND ITEM
+      ;
+      ; if no_files > 4: name of 5th item in extra legend
+      ;
+      ; data type: string
+      ;
+      ; default:   "File 5" 
+      ;***************************************************
+      if (.not. isvar("name_legend_5"))then 
+      
+           
+         name_legend_5 = "File 5"
+	 
+	 
+      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
+      ;
+      ; default:   "File in" 
+      ;***************************************************
+      if (.not. isvar("file_6"))then   
+      
+         
+         file_6 = "File in"
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --name_legend_6-- 6th LEGEND ITEM
+      ;
+      ; if no_files > 5: name of 6th item in extra legend
+      ;
+      ; data type: string
+      ;
+      ; default:   "File 6" 
+      ;***************************************************
+      if (.not. isvar("name_legend_6"))then 
+      
+           
+         name_legend_6 = "File 6"
+	 
+	 
+      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 	 
+      ;***************************************************
+      ; 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
+      ;
+      ; data type: double; dimension: [hour]
+      ;
+      ; default:   -1.d (first available time step)
+      ;***************************************************
+      if (.not. isvar("start_time_step"))then	
+      
+       
+         start_time_step = -1.d
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; 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
+      ;
+      ; data type: double; dimension: [hour]
+      ;
+      ; default:   -1.d (last available time step)
+      ;***************************************************
+      if (.not. isvar("end_time_step"))then
+      
+      	 
+         end_time_step = -1.d      
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --xs-- MINIMUM X-AXIS 
+      ;
+      ; value for minimum of x-axis
+      ;
+      ; data type: float; dimension of variable
+      ;
+      ; default:   -1. (minimum of range)
+      ;***************************************************
+      if (.not. isvar("xs"))then   
+      
+         
+         xs = -1.
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --xe-- MAXIMUM X-AXIS 
+      ;
+      ; value for maximum of x-axis
+      ;
+      ; data type: float; dimension of variable
+      ;
+      ; default:   -1. (maximum of range)
+      ;***************************************************
+      if (.not. isvar("xe"))then  
+      
+          
+         xe = -1.
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --min_z-- MINIMUM Z-AXIS 
+      ;
+      ; value for minimum height of z-axis
+      ;
+      ; data type: double; dimension: [meter]
+      ;
+      ; default:   -1.d (related to the minimum of z-axis in input file)
+      ;***************************************************
+      if (.not. isvar("min_z"))then   
+      
+         
+         min_z = -1.d
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --max_z-- MAXIMUM Z-AXIS 
+      ;
+      ; value for maximum height of z-axis
+      ;
+      ; data type: double; dimension: [meter]
+      ;
+      ; default:   -1.d (related to the maximum of z-axis in input file)
+      ;***************************************************
+      if (.not. isvar("max_z"))then   
+      
+         
+         max_z = -1.d
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --logy-- LOGARITHMIC SCALE 
+      ;
+      ; logarithmic scale for y-axis will be switched on [=1] or off [=0]
+      ;
+      ; data type: integer
+      ;
+      ; default:   0
+      ;***************************************************
+      if (.not. isvar("logy"))then 
+      
+           
+         logy = 0
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --norm-- NORMALISE Y-AXIS 
+      ;
+      ; value for normalising the y-axis
+      ;
+      ; data type: float
+      ;
+      ; default:   1 (no normalising)
+      ;***************************************************
+      if (.not. isvar("norm"))then 
+      
+           
+         norm = 1
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --over-- OVERLAYING
+      ;
+      ; predefined overlaying of standard variables will be switched on [=1] or off [=0];
+      ; this feature cannot be used with statistic regions
+      ;
+      ; data type: integer
+      ;
+      ; default:   0 
+      ;***************************************************
+      if (.not. isvar("over"))then
+      
+      	 
+         over = 0
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --combine-- COMBINING 
+      ;
+      ; combining of two or three individual variables is possible and switched on [=1] or off[=0]
+      ;
+      ; data type: integer
+      ;
+      ; default:   0
+      ;***************************************************
+      if (.not. isvar("combine"))then  
+      
+          
+         combine = 0
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; REQUIRED IF combine=1 --number_comb-- NUMBER FOR COMBINING 
+      ;
+      ; number of variables for combining; 2 or 3 is valid 
+      ;
+      ; data type: integer
+      ;
+      ; default:   -1
+      ;***************************************************
+      if (.not. isvar("number_comb"))then 
+      
+           
+         number_comb = -1
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; 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
+      ;
+      ; default:   "c_variables"
+      ;***************************************************
+      if (.not. isvar("c_var"))then 
+      
+           
+         c_var = "c_variables"
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --black-- BLACK OR COLOR LINES
+      ;
+      ; colored [=0] or black and white [=1] plots
+      ;
+      ; data type: integer
+      ;
+      ; default:   0
+      ;***************************************************
+      if (.not. isvar("black"))then 
+      
+           
+         black = 0
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --dash-- DASHED LINES 
+      ;
+      ; use of different line patterns [=1] or continous lines [=0] for different time steps
+      ;
+      ; data type: integer
+      ;
+      ; default:   0
+      ;***************************************************
+      if (.not. isvar("dash"))then     
+      
+       
+         dash = 0      
+	 
+	 
+      end if 	 
+      ;***************************************************
+       
+   end if
+   
+   ;******************************************************
+   ; parameters used by SPECTRA
+   ;******************************************************
+   
+   if (spectra .EQ. 1) then
+   
+      ;***************************************************
+      ; REQUIRED --file_1-- INPUT FILE
+      ;
+      ; input file produced by PALM; please declare path and name
+      ;
+      ; data type: string
+      ;
+      ; default:   "File in" 
+      ;***************************************************
+      if (.not. isvar("file_1"))then  
+      
+          
+         file_1 = "File in"
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --format_out-- OUTPUT FORMAT
+      ;
+      ; supported file formats: x11, pdf, ps, eps, epsi or ncgm 
+      ;
+      ; data type: string
+      ;
+      ; default:   "x11" 
+      ;***************************************************
+      if (.not. isvar("format_out"))then	
+      
+       
+         format_out = "x11"
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --file_out-- OUTPUT FILE
+      ;
+      ; please declare path and name 
+      ;
+      ; data type: string
+      ;
+      ; default:   "~/test" 
+      ;***************************************************
+      if (.not. isvar("file_out"))then	
+      
+       
+         file_out = "~/test_sp"
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --no_columns-- NUMBER OF ROWS
+      ;
+      ; number of plots in one row 
+      ;
+      ; data type: integer
+      ;
+      ; default:   1
+      ;***************************************************
+      if (.not. isvar("no_columns"))then	 
+      
+      
+         no_columns = 1
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --no_lines-- NUMBER OF COLUMNS
+      ;
+      ; number of plots in one column 
+      ;
+      ; data type: integer
+      ;
+      ; default:   2 
+      ;***************************************************
+      if (.not. isvar("no_lines"))then
+      
+      	 
+         no_lines = 2
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; 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)
+      ;
+      ; data type: string 
+      ;
+      ; default:   "all" (all available variables will be plotted)
+      ;***************************************************
+      if (.not. isvar("var"))then
+      
+      	 
+         var = "all"
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; 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)
+      ;
+      ; data type: integer array
+      ;
+      ; default:   (/-1/) (all levels will be output)
+      ;***************************************************
+      if (.not. isvar("height_level"))then
+      
+      	 
+         height_level = (/-1/)
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --sort-- TYPE OF SORTING 
+      ;
+      ; defines if all heights [="height"] or all timesteps [="time"] will be merged in one plot
+      ;
+      ; data type: string
+      ;
+      ; default:   "height" 
+      ;***************************************************
+      if (.not. isvar("sort"))then
+      
+      	 
+         sort = "height"
+	 
+	 
+      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
+      ;
+      ; data type: double; dimension: [hour]
+      ;
+      ; default:   -1.d (first available time step)
+      ;***************************************************
+      if (.not. isvar("start_time_step"))then
+      
+      	 
+         start_time_step = -1.d
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; 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
+      ;
+      ; data type: double; dimension: [hour]
+      ;
+      ; default:   -1.d (last available time step)
+      ;***************************************************
+      if (.not. isvar("end_time_step"))then
+      
+      	 
+         end_time_step = -1.d
+	 
+	 
+      end if    
+      ;***************************************************
+      ; OPTIONAL --black-- BLACK OR COLOR LINES
+      ;
+      ; colored [=0] or black and white [=1] plots
+      ;
+      ; data type: integer
+      ;
+      ; default:   0
+      ;***************************************************
+      if (.not. isvar("black"))then 
+      
+           
+         black = 0
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --dash-- DASHED LINES 
+      ;
+      ; use of different line patterns [=1] or continous lines [=0]
+      ;
+      ; data type: integer
+      ;
+      ; default:   0
+      ;***************************************************
+      if (.not. isvar("dash"))then   
+      
+         
+         dash = 0
+	 
+	 
+      end if 
+      ;***************************************************
+      ; OPTIONAL --logx-- LOGARITHMIC SCALE X-AXIS
+      ;
+      ; logarithmic scale for x-axis will be switched on [=1] or off [=0]
+      ;
+      ; data type: integer
+      ;
+      ; default:   1
+      ;***************************************************
+      if (.not. isvar("logx"))then   
+      
+         
+         logx = 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
+      ;
+      ; default:   1
+      ;***************************************************
+      if (.not. isvar("logy"))then   
+      
+         
+         logy = 1
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --normx-- NORMALISE X-AXIS 
+      ;
+      ; value for normalising the x-axis
+      ;
+      ; data type: float
+      ;
+      ; default:   1. (no normalising)
+      ;***************************************************
+      if (.not. isvar("normx"))then   
+      
+         
+         normx = 1.
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --normy-- NORMALISE Y-AXIS 
+      ;
+      ; value for normalising the y-axis
+      ;
+      ; data type: float
+      ;
+      ; default:   1. (no normalising)
+      ;***************************************************
+      if (.not. isvar("normy"))then     
+      
+       
+         normy = 1.
+	 
+	 
+      end if 	 
+      ;***************************************************
+     
+   end if
+   
+   
+   ;******************************************************
+   ; parameters used by TIMESERIES
+   ;******************************************************
+
+   if (timeseries .EQ. 1) then
+   
+      ;***************************************************
+      ; REQUIRED --file_1-- INPUT FILE
+      ;
+      ; input file produced by PALM; please declare path and name
+      ;
+      ; data type: string
+      ;
+      ; default:   "File in" 
+      ;***************************************************
+      if (.not. isvar("file_1"))then  
+      
+          
+         file_1 = "File in"
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --format_out-- OUTPUT FORMAT
+      ;
+      ; supported file formats: x11, pdf, ps, eps, epsi or ncgm 
+      ;
+      ; data type: string
+      ;
+      ; default:   "x11" 
+      ;***************************************************
+      if (.not. isvar("format_out"))then	 
+      
+      
+         format_out = "x11"
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --file_out-- OUTPUT FILE
+      ;
+      ; please declare path and name 
+      ;
+      ; data type: string
+      ;
+      ; default:   "~/test" 
+      ;***************************************************
+      if (.not. isvar("file_out"))then	
+      
+       
+         file_out = "~/test_ts"
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --no_columns-- NUMBER OF ROWS
+      ;
+      ; number of plots in one row 
+      ;
+      ; data type: integer
+      ;
+      ; default:   1
+      ;***************************************************
+      if (.not. isvar("no_columns"))then	
+      
+       
+         no_columns = 1
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --no_lines-- NUMBER OF COLUMNS
+      ;
+      ; number of plots in one column 
+      ;
+      ; data type: integer
+      ;
+      ; default:   2 
+      ;***************************************************
+      if (.not. isvar("no_lines"))then
+      
+      	 
+         no_lines = 2
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; 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)
+      ;
+      ; data type: string 
+      ;
+      ; default:   "all" (all available variables will be plotted)
+      ;***************************************************
+      if (.not. isvar("var"))then
+      
+      	 
+         var = "all"
+	 
+	 
+      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
+      ;
+      ; data type: double; dimension: [hour]
+      ;
+      ; default:   -1.d (first available time step)
+      ;***************************************************
+      if (.not. isvar("start_time_step"))then
+      
+      	 
+         start_time_step = -1.d
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; 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
+      ;
+      ; data type: double; dimension: [hour]
+      ;
+      ; default:   -1.d (last available time step)
+      ;***************************************************
+      if (.not. isvar("end_time_step"))then
+      
+      	 
+         end_time_step = -1.d
+	 
+	 
+      end if 	 
+      ;***************************************************
+      ; OPTIONAL --over-- OVERLAYING
+      ;
+      ; predefined overlaying of standard variables will be switched on [=1] or off [=0];
+      ; this feature cannot be used with statistic regions
+      ;
+      ; data type: integer
+      ;
+      ; default:   0 
+      ;***************************************************
+      if (.not. isvar("over"))then
+      
+      	 
+         over = 0
+	 
+	 
+      end if 
+      ;***************************************************
+
+   end if
+
+	 
+;*********************************************************	 
+   
+end
Index: palm/trunk/SCRIPTS/NCL/profiles.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 183)
+++ palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 190)
@@ -2,61 +2,51 @@
 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
+
+;***************************************************
+; load ncl_preferences.ncl
+;***************************************************
+   
+if (isfilepresent("~/ncl_preferences.ncl")) then
+   loadscript("~/ncl_preferences.ncl")
+else
+  if (isfilepresent("~/palm/current_version/trunk/SCRIPTS/NCL/ncl_preferences.ncl")) then
+     loadscript( "~/palm/current_version/trunk/SCRIPTS/NCL/ncl_preferences.ncl")
+  else
+      print(" ")
+      print("'ncl_preferences.ncl' does not exist in $home or $home/palm/current_version/trunk/SCRIPTS/NCL/")
+      print(" ")
+      exit
+   end if
+end if
+    
+begin
+
+   if (cross_sections .NE. 0 .OR. profiles .NE. 1 .OR. timeseries .NE. 0 .OR. spectra .NE. 0)then
+      print(" ")
+      print("Please specify the used script in 'ncl_preferences.ncl' (Line 7-10)")
+      print(" ")
+      print("Set 'profiles' equal 1 and the other variables equal 0")
+      print(" ")
+      exit
+   end if
  
-begin
-
-   ; ***************************************************
-   ; read parameter_list
-   ; ***************************************************
-
-   if (isfilepresent("~/.ncl_preferences")) then
-      parameter = asciiread("~/.ncl_preferences",129,"string")
-      delete(parameter@_FillValue)
-   else
-      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
- 
-   ; ***************************************************
-   ; set up default parameter values and strings if not assigned in prompt or parameter list
-   ; ***************************************************
-  
-   if ( .not. isvar("no_files") ) then 
-      no_files = 1  
-      if (parameter(81) .NE. "1") then
-         no_files = stringtointeger(parameter(81))
-         if (no_files .LT. 1 .OR. no_files .GT. 12) then
-            print(" ")
-            print("Please assign 'no_files' between 1 and 12")  
-            print(" ")
-            exit
-         end if
-      end if
-   else
-      if (no_files .LT. 1 .OR. no_files .GT. 12) then
-         print(" ")
-         print("Please assign 'no_files' between 1 and 12")  
-         print(" ")
-         exit
-      end if
+   ;***************************************************
+   ; set up default parameter values and strings 
+   ;***************************************************
+
+   if (no_files .LT. 1 .OR. no_files .GT. 12) then
+      print(" ")
+      print("Please assign 'no_files' between 1 and 12")  
+      print(" ")
+      exit
    end if
 
    file_in = new(no_files,string)
- 
-   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(0) = parameter(7)
-      end if   
+   
+   if (file_1 .EQ. "File in") then
+      print(" ")
+      print("Please provide 1st input file 'file_1=' in 'ncl_preferences.ncl'")
+      print(" ")
+      exit 
    else
       file_in(0) = file_1   
@@ -64,431 +54,279 @@
    if (.not. isfilepresent(file_in(0))) then
       print(" ")
-      print("Your 1st input file: '"+file_in(0)+"' does not exist")
+      print("Your 1st input file: '"+file_in+"' does not exist")
+      print(" ")
+      exit
+   end if
+   
+   if (prof3d .EQ. -1)then
+      print(" ")
+      print("Please set 'prof3d' to 0 or 1")
+      print(" ")
+      exit
+   else
+      if (prof3d .NE. 0 .AND. prof3d .NE. 1)then
+         print(" ")
+         print("'prof3d'= "+prof3d+" is invalid; set 'prof3d' to 0 or 1")
+         print(" ")
+         exit
+      end if
+   end if
+ 
+   if (no_files .GT. 1) then
+      if (file_2 .EQ. "File in") then
+         print(" ")
+         print("Please provide 2nd input file 'file_2=' in 'ncl_preferences.ncl'")
+         print(" ")
+         exit 
+      else
+         file_in(1) = file_2   
+      end if
+      if (.not. isfilepresent(file_in(1))) then
+         print(" ")
+         print("Your 2nd input file: '"+file_in+"' does not exist")
+         print(" ")
+         exit
+      end if
+   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(" ")
+         exit 
+      else
+         file_in(2) = file_3   
+      end if
+      if (.not. isfilepresent(file_in(2))) then
+         print(" ")
+         print("Your 3rd input file: '"+file_in+"' does not exist")
+         print(" ")
+         exit
+      end if
+   end if 
+   
+   if (no_files .GT. 3) then
+      if (file_4 .EQ. "File in") then
+         print(" ")
+         print("Please provide 4th input file 'file_4=' in 'ncl_preferences.ncl'")
+         print(" ")
+         exit 
+      else
+         file_in(3) = file_4   
+      end if
+      if (.not. isfilepresent(file_in(3))) then
+         print(" ")
+         print("Your 4th input file: '"+file_in+"' does not exist")
+         print(" ")
+         exit
+      end if
+   end if 
+   
+   if (no_files .GT. 4) then
+      if (file_5 .EQ. "File in") then
+         print(" ")
+         print("Please provide 5th input file 'file_5=' in 'ncl_preferences.ncl'")
+         print(" ")
+         exit 
+      else
+         file_in(4) = file_5   
+      end if
+      if (.not. isfilepresent(file_in(4))) then
+         print(" ")
+         print("Your 5th input file: '"+file_in+"' does not exist")
+         print(" ")
+         exit
+      end if  
+   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(" ")
+         exit 
+      else
+         file_in(5) = file_6   
+      end if
+      if (.not. isfilepresent(file_in(5))) then
+         print(" ")
+         print("Your 6th input file: '"+file_in+"' does not exist")
+         print(" ")
+         exit
+      end if   
+   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
+      print(" ")
+      print("'format_out = "+format_out+"' is invalid and set to'x11'")
+      print(" ")
+      format_out="x11"
+   end if  
+
+   if (over .NE. 0 .AND. over .NE. 1) then
+      print(" ")
+      print("'over'= "+over+" is invalid and set to 0")
+      print(" ")
+      over = 0
+   end if
+   if (no_files .GT. 1) then
+      over = 0
+      print(" ")
+      print("If you have more than one input file - you cannot overlay variables: over is set to 0")
+      print(" ")
+   end if
+   
+   if (combine .NE. 0 .AND. combine .NE. 1)then
+      print(" ")
+      print("Your 'combine'= "+combine+" is invalid and set to 0")
+      print(" ")
+      combine = 0
+   end if
+   if (no_files .GT. 1) then
+      combine = 0
+      print(" ")
+      print("If you have more than one input file you cannot combine variables: combine is set to 0")
+      print(" ")
+   end if   
+   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(" ")
       exit
    end if 
-
-   if (no_files .GT. 1) then
-      if (.not. isvar("file_2"))then
-         file_in(1) = parameter(85)
-         if (file_in(1) .EQ. "File in")
-            print(" ")
-            print("Please provide 2nd input file 'file_2=' either in prompt or parameter_list or change 'no_files' to 1")
-            print(" ")
-            exit
-         end if
-      else
-         file_in(1) = file_2
-      end if
-      if (.not. isfilepresent(file_in(1))) then
-         print(" ")
-         print("Your 2nd input file: '"+file_in(1)+"' does not exist")
+   if (combine .EQ. 1)then
+      if (number_comb .EQ. -1) then
+         print(" ") 
+         print("Please set 'number_comb' to 2 or 3 or combine to 0")
          print(" ")
          exit
       end if
-   end if 
-   if (no_files .GT. 2) then
-      if (.not. isvar("file_3"))then
-         file_in(2) = parameter(89)
-         if (file_in(2) .EQ. "File in")
-            print(" ")
-            print("Please provide 3rd input file 'file_3=' either in prompt or parameter_list or change 'no_files' to 2")
-            print(" ")
-            exit
-         end if
-      else
-         file_in(2) = file_3
-      end if
-      if (.not. isfilepresent(file_in(2))) then
-         print(" ")
-         print("Your 3rd input file: '"+file_in(2)+"' does not exist")
+      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(" ")
          exit
       end if
-   end if 
-   if (no_files .GT. 3) then
-      if (.not. isvar("file_4"))then
-         file_in(3) = parameter(93)
-         if (file_in(3) .EQ. "File in")
-            print(" ")
-            print("Please provide 4th input file 'file_4=' either in prompt or parameter_list or change 'no_files' to 3")
-            print(" ")
-            exit
-         end if
-      else
-         file_in(3) = file_4
-      end if
-      if (.not. isfilepresent(file_in(3))) then
-         print(" ")
-         print("Your 4th input file: '"+file_in(3)+"' does not exist")
-         print(" ")
-         exit
-      end if 
-   end if 
-   if (no_files .GT. 4) then
-      if (.not. isvar("file_5"))then
-         file_in(4) = parameter(97)
-         if (file_in(4) .EQ. "File in")
-            print(" ")
-            print("Please provide 5th input file 'file_5=' either in prompt or parameter_list or change 'no_files' to 4")
-            print(" ")
-            exit
-         end if
-      else
-         file_in(4) = file_5
-      end if
-      if (.not. isfilepresent(file_in(4))) then
-         print(" ")
-         print("Your 5th input file: '"+file_in(4)+"' does not exist")
-         print(" ")
-         exit
-      end if
-   end if 
-   if (no_files .GT. 5) then
-      if (.not. isvar("file_6"))then
-         file_in(5) = parameter(101)
-         if (file_in(5) .EQ. "File in")
-            print(" ")
-            print("Please provide 6th input file 'file_6=' either in prompt or parameter_list or change 'no_files' to 5")
-            print(" ")
-            exit
-         end if
-      else
-         file_in(5) = file_6
-      end if
-      if (.not. isfilepresent(file_in(5))) then
-         print(" ")
-         print("Your 6th input file: '"+file_in(5)+"' does not exist")
-         print(" ")
-         exit
-      end if
-   end if 
-   if (no_files .GT. 6) then
-      if (.not. isvar("file_7"))then
-         file_in(6) = parameter(105)
-         if (file_in(6) .EQ. "File in")
-            print(" ")
-            print("Please provide 7th input file 'file_7=' either in prompt or parameter_list or change 'no_files' to 6")
-            print(" ")
-            exit
-         end if
-      else
-         file_in(6) = file_7
-      end if
-      if (.not. isfilepresent(file_in(6))) then
-         print(" ")
-         print("Your 7th input file: '"+file_in(6)+"' does not exist")
-         print(" ")
-         exit
-      end if
-   end if 
-   if (no_files .GT. 7) then
-      if (.not. isvar("file_8"))then
-         file_in(7) = parameter(109)
-         if (file_in(7) .EQ. "File in")
-            print(" ")
-            print("Please provide 8th input file 'file_8=' either in prompt or parameter_list or change 'no_files' to 7")
-            print(" ")
-            exit
-         end if
-      else
-         file_in(7) = file_8
-      end if
-      if (.not. isfilepresent(file_in(7))) then
-         print(" ")
-         print("Your 8th input file: '"+file_in(7)+"' does not exist")
-         print(" ")
-         exit
-      end if
-   end if 
-   if (no_files .GT. 8) then
-      if (.not. isvar("file_9"))then
-         file_in(8) = parameter(113)
-         if (file_in(8) .EQ. "File in")
-            print(" ")
-            print("Please provide 9th input file 'file_9=' either in prompt or parameter_list or change 'no_files' to 8")
-            print(" ")
-            exit
-         end if
-      else
-         file_in(8) = file_9
-      end if 
-      if (.not. isfilepresent(file_in(8))) then
-         print(" ")
-         print("Your 9th input file: '"+file_in(8)+"' does not exist")
-         print(" ")
-         exit
-      end if
-   end if 
-   if (no_files .GT. 9) then
-      if (.not. isvar("file_10"))then
-         file_in(9) = parameter(117)
-         if (file_in(9) .EQ. "File in")
-            print(" ")
-            print("Please provide 10th input file 'file_10=' either in prompt or parameter_list or change 'no_files' to 9")
-            print(" ")
-            exit
-         end if
-      else
-         file_in(9) = file_10
-      end if
-      if (.not. isfilepresent(file_in(9))) then
-         print(" ")
-         print("Your 10th input file: '"+file_in(9)+"' does not exist")
-         print(" ")
-         exit
-      end if
-   end if 
-   if (no_files .GT. 10) then
-      if (.not. isvar("file_11"))then
-         file_in(10) = parameter(121)
-         if (file_in(10) .EQ. "File in")
-            print(" ")
-            print("Please provide 11th input file 'file_11=' either in prompt or parameter_list or change 'no_files' to 10")
-            print(" ")
-            exit
-         end if
-      else
-         file_in(10) = file_11
-      end if
-      if (.not. isfilepresent(file_in(10))) then
-         print(" ")
-         print("Your 11th input file: '"+file_in(10)+"' does not exist")
-         print(" ")
-         exit
-      end if
-   end if 
-   if (no_files .GT. 11) then
-      if (.not. isvar("file_12"))then
-         file_in(11) = parameter(125)
-         if (file_in(11) .EQ. "File in")
-            print(" ")
-            print("Please provide 12th input file 'file_12=' either in prompt or parameter_list or change 'no_files' to 11")
-            print(" ")
-            exit
-         end if
-      else
-         file_in(11) = file_12
-      end if
-      if (.not. isfilepresent(file_in(11))) then
-         print(" ")
-         print("Your 12th input file: '"+file_in(11)+"' does not exist")
-         print(" ")
-         exit
-      end if
-   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" .OR. format_out .NE. "pdf" .OR. format_out .NE. "eps" .OR. format_out .NE. "ps" .OR. format_out .NE. "epsi" .OR. format_out .NE. "ncgm")then
-            print(" ")
-            print("Your 'format_out = "+format_out+"' is invalid and set to'x11'")
-            print(" ")
-         end if  
-      end if 
-   else
-      if (format_out .NE. "x11" .OR. format_out .NE. "pdf" .OR. format_out .NE. "eps" .OR. format_out .NE. "ps" .OR. format_out .NE. "epsi" .OR. 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_ts") then
-         file_out = parameter(11)  
-     end if     
-   end if
-   if ( .not. isvar("no_columns") ) then    		
-      no_columns = 1
-      if (parameter(17) .NE. "1") then
-         no_columns = stringtointeger(parameter(17))  
-      end if
-   end if
-   if ( .not. isvar("no_lines") ) then     		; number of plot-lines on one sheet
-      no_lines = 2
-      if (parameter(19) .NE. "2") then
-         no_lines = stringtointeger(parameter(19))  
-      end if
-   end if 
-   if ( .not. isvar("combine") ) then  		 	; color of lines
-      combine = 0
-      if (parameter(23) .NE. "0") then
-         combine = stringtointeger(parameter(23)) 
-         if (stringtointeger(parameter(23)) .NE. 1) then
-            print(" ")
-            print("Your 'combine'= "+combine+" is invalid and set to 0")
-            print(" ")
-            combine = 0
-         else
-            if (no_files .GT. 1) then
-               print(" ")
-               print("If you have more than one input file you cannot combine variables: combine is set to 0")
-               print(" ")
-               combine = 0
-            end if 
-         end if
-      end if
-   else
-      if (combine .NE. 0 .AND. combine .NE. 1)then
-         print(" ")
-         print("Your 'combine'= "+combine+" is invalid and set to 0")
-         print(" ")
-         combine = 0
-      end if
-      if (no_files .GT. 1) then
-         combine = 0
-         print(" ")
-         print("If you have more than one input file you cannot combine variables: combine is set to 0")
-         print(" ")
-      end if       
-   end if
-
-   if (combine .EQ. 1) then
-      if( .not. isvar("c_var") ) then
-         if (parameter(27) .EQ. "c_variables") then
-            print(" ") 
-            print("Please select variables for overlaying ('c_var')")
-            print(" ")
-            exit
-         else
-            c_var=parameter(27)
-         end if
-      end if
-   end if
-
-   if ( .not. isvar("black") ) then  		 	; color of lines
-      black = 0
-      if (parameter(31) .NE. "0") then
-         black = stringtointeger(parameter(31)) 
-         if (stringtointeger(parameter(31)) .NE. 1) then
-            print(" ")
-            print("Your 'black'= "+black+" is invalid and set to 0")
-            print(" ")
-            black = 0
-         end if
-      end if
-   else
-      if (black .NE. 0 .AND. black .NE. 1)then
-         print(" ")
-         print("Your 'black'= "+black+" is invalid and set to 0")
-         print(" ")
-         black = 0
-      end if
-   end if
-
-   if ( .not. isvar("dash") ) then   		 	
-      dash = 0
-      if (parameter(29) .NE. "0") then
-         dash = stringtointeger(parameter(29))
-         if (stringtointeger(parameter(29)) .NE. 1) then
-            print(" ")
-            print("Your 'dash'= "+dash+" is invalid and set to 0")
-            print(" ")
-            dash = 0
-         end if  
-      end if
-   else
-      if (dash .NE. 0 .AND. dash .NE. 1)then
-         print(" ")
-         print("Your 'dash'= "+dash+" is invalid and set to 0")
-         print(" ")
-         dash = 0
-      end if
-   end if
-
-   if ( .not. isvar("over") ) then     		        ; switches overlaying plots on
-      over = 0
-      if (stringtointeger(parameter(37)) .NE. 0) then
-         over = stringtointeger(parameter(37))
-         if (stringtointeger(parameter(37)) .NE. 1) then
-            print(" ")
-            print("Your 'over'= "+over+" is invalid and set to 0")
-            print(" ")
-            over = 0
-         else
-            if (no_files .GT. 1) then
-               over = 0
-               print(" ")
-               print("If you have more than one input file you cannot overlay variables: over is set to 0")
-               print(" ")
-            end if
-         end if   
-      end if
-   else
-      if (over .NE. 0 .AND. over .NE. 1)then
-         print(" ")
-         print("Your 'over'= "+over+" is invalid and set to 0")
-         print(" ")
-         over = 0
-      end if
-   end if
-
-   if (.not. isvar("prof3d"))then
-      prof3d = 0
-      if (stringtointeger(parameter(75)) .NE. 0) then
-         prof3d = stringtointeger(parameter(75))
-         if (stringtointeger(parameter(75)) .NE. 1) then
-            print(" ")
-            print("Please set 'prof3d' to 0 or 1")
-            print(" ")
-            exit
-         end if   
-      end if
-   else
-      if (prof3d .NE. 0 .AND. prof3d .NE. 1)then
-         print(" ")
-         print("Your 'prof3d'= "+prof3d+" is invalid; please set 'prof3d' to 0 or 1")
-         print(" ")
-         exit
-      end if
-   end if
-
-   if (.not. isvar("logy"))then
+   end if  
+   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(" ")
+      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 (stringtointeger(parameter(77)) .NE. 0) then
-         logy = stringtointeger(parameter(77))
-         if (stringtointeger(parameter(77)) .NE. 1) then
-            print(" ")
-            print("Your 'logy'= "+logy+" is invalid and set to 0")
-            print(" ")
-            logy = 0
-         end if   
-      end if
-   else
-      if (logy .NE. 0 .AND. logy .NE. 1)then
-         print(" ")
-         print("Your 'logy'= "+logy+" is invalid and set to 0")
-         print(" ")
-         logy = 0
-      end if    
-   end if
-
-   if ( .not. isvar("norm") ) then     		
+   end if    
+  
+   if (norm .EQ. 0) then 
+      print(" ")
+      print("You cannot normalise with 0, 'norm' is set to 1")
+      print(" ")
       norm = 1.0
-      if (parameter(79) .NE. "1") then
-         norm = stringtofloat(parameter(79)) 
-         if (stringtofloat(parameter(79)) .EQ. 0) then 
-            print(" ")
-            print("You cannot normalise with 0, 'norm' is set to 1")
-            print(" ")
-            norm = 1.0
-         end if
-      end if
-   else
-      if (norm .EQ. 0) then 
-         print(" ")
-         print("You cannot normalise with 0, 'norm' is set to 1")
-         print(" ")
-         norm = 1.0
-      end if
-   end if 
-
-   ; ***************************************************
+   end if
+
+   ;***************************************************
    ; open input file
-   ; ***************************************************
+   ;***************************************************
 
    do nof=0,no_files-1
@@ -503,5 +341,5 @@
       if (dim0 .NE. dim)then
          print(" ")
-         print("Your Input files does not contain the same variables")
+	 print("There are 'no_files'="+no_files+" input files but they do not contain the same variables")
          print(" ")
          exit
@@ -510,5 +348,5 @@
             if (vNam0(i) .NE. vNam(i))then
                print(" ")
-               print("Your Input files does not contain the same variables")
+               print("There are 'no_files'="+no_files+" input files but they do not contain the same variables")
                print(" ")
                exit
@@ -519,5 +357,6 @@
    nof=nof+1
    print(" ")
-   print("Variable in input file "+nof+": " + vNam)
+   print("Variables in input file "+nof+":")
+   print("- "+ vNam)
    print(" ")
    nof=nof-1
@@ -555,6 +394,5 @@
          break
       else
-         if (vNam(varn) .EQ. "v" .OR. isStrSubset(vNam(varn), "v_"))then
-  
+         if (vNam(varn) .EQ. "v" .OR. isStrSubset(vNam(varn), "v_"))then  
             z_u = f->$vNam(varn+1)$
             break
@@ -835,16 +673,6 @@
       varn=varn-1
    end do
-   if ( .not. isvar("z_u") ) then
-      zu = 0
-   else
-      zu = 1
-   end if
-   if ( .not. isvar("z_w") ) then
-      zw = 0
-   else 
-      zw = 1
-   end if
-
-   if (zu .EQ. 0 .AND. zw .EQ. 0) then
+   
+   if (.not. isvar("z_u") .AND. .not. isvar ("z_w")) then
       co=0
       do varn=0,dim-1      
@@ -852,17 +680,19 @@
             check = False
          else
-            if (.not. isvar("var")) then
-               check = True
-               if (parameter(21) .NE. "variables") then
-                  var=parameter(21)
-                  check = isStrSubset( var,","+vNam(varn)+"," )
-               end if
-            else          
+            check = True
+            if (var .NE. "all") then
                check = isStrSubset( var,","+vNam(varn)+"," )
-            end if
+            end if          
          end if
          if (check)then
             co=co+1
             z = f->$vNam(varn+1)$
+	    if (getvardims(z) .EQ. "zu")then
+	       z_u = z
+	    else
+	       if (getvardims(z) .EQ. "zw")then
+	          z_w = z
+	       end if
+	    end if
             dimz = dimsizes(z)
             break
@@ -871,5 +701,6 @@
       if (co .EQ. 0) then
          print(" ")
-         print("The variables 'var=Â°"+var+"Â°' do not exist on your input file")
+         print("The variables 'var="+var+"' do not exist on your input file;")
+	 print("be sure to have one comma berfore and after each variable")
          print(" ")
          exit
@@ -901,4 +732,12 @@
    end if
    
+   if(.not. isvar("z_u") .AND. .not. isvar("z_w"))then
+      print(" ")
+      print("Program aborts - there are no z-variables available")
+      print("Please be sure if 'plot_3d' is set correctly")
+      print(" ")
+      exit
+   end if
+   
    t_all = f->time
    nt    = dimsizes(t_all)
@@ -910,22 +749,6 @@
    ; ****************************************************
    
-   if ( .not. isvar("start_time_step") ) then   	
-      start_time_step=t_all(0)/3600
-      if (parameter(13) .NE. "t(0)") then
-         if (stringtodouble(parameter(13)) .GT. t_all(nt-1)/3600)then
-            print(" ")
-            print("'start_time_step' = "+ parameter(13) +"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(" ")
-            exit
-         end if
-         if (stringtofloat(parameter(13)) .LT. t_all(0)/3600)then
-            print(" ")
-            print("'start_time_step' = "+ parameter(13) +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")           
-            exit
-         end if
-         start_time_step=stringtodouble(parameter(13)) 
-      end if
+   if (start_time_step .EQ. -1.) then   	
+      start_time_step=t_all(0)/3600      
    else 
       if (start_time_step .GT. t_all(nt-1)/3600)then
@@ -940,16 +763,23 @@
          print(" ")
          print("'start_time_step' = "+ start_time_step +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")
-        
+         print(" ")
          exit
       end if
    end if
-   start_time_step = start_time_step*3600
 
    do i=0,nt-1     
-      if (start_time_step .GE. t_all(i)-delta_t/2 .AND. start_time_step .LT. t_all(i)+delta_t/2)then
+      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
          break
       end if
    end do
+   if (.not. isvar("st"))then
+      print(" ")
+      print("'start_time_step' = "+ start_time_step +"h is invalid")
+      print(" ")
+      print("Please select another 'start_time_step'")
+      print(" ")
+      exit
+   end if
    
    ; ****************************************************
@@ -957,25 +787,6 @@
    ; ****************************************************
 
-   if ( .not. isvar("end_time_step") ) then     	
-      end_time_step = t_all(nt-1)/3600
-      if (parameter(15) .NE. "t(end)") then
-         if (stringtodouble(parameter(15)) .GT. t_all(nt-1)/3600)then
-            print(" ")
-            print("'end_time_step' = "+ parameter(15) +"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(" ")
-            exit
-         end if
-         if (stringtodouble(parameter(15)) .LT. start_time_step/3600)then
-            print(" ")
-            print("'end_time_step' = "+ parameter(15) +"h is lower than 'start_time_step' = "+start_time_step/3600+"h")
-            print(" ")
-            print("Please select another 'start_time_step' or 'end_time_step'")
-            print(" ")
-            exit
-         end if
-         end_time_step = stringtodouble(parameter(15))
-      end if    
+   if (end_time_step .EQ. -1.) then     	
+      end_time_step = t_all(nt-1)/3600  
    else
       if (end_time_step .GT. t_all(nt-1)/3600)then
@@ -996,12 +807,19 @@
       end if
    end if
-   end_time_step = end_time_step*3600
 
    do i=0,nt-1     
-      if (end_time_step .GE. t_all(i)-delta_t/2 .AND. end_time_step .LT. t_all(i)+delta_t/2)then
+      if (end_time_step .GE. (t_all(i)-delta_t/2)/3600 .AND. end_time_step .LT. (t_all(i)+delta_t/2)/3600)then
          et=i
          break
       end if
    end do 
+   if (.not. isvar("et"))then
+      print(" ")
+      print("'end_time_step' = "+ end_time_step +"h is invalid")
+      print(" ")
+      print("Please select another 'end_time_step'")
+      print(" ")
+      exit
+   end if
 
    delete(start_time_step)
@@ -1056,5 +874,7 @@
    res@pmLegendWidthF          = 0.12
    res@pmLegendHeightF         = 0.04*(end_time_step-start_time_step+1)
-   res@lgLabelFontHeightF     = .02 
+   res@lgLabelFontHeightF     = .02
+   res@lgTitleString      = "Time [h]"
+   res@lgTitleFontHeightF = 0.02   
    res@txFontHeightF      = 0.02
    res@tiXAxisFontHeightF = 0.02
@@ -1074,5 +894,5 @@
    end if
 
-   if ( dash .eq. 0 ) then
+   if (dash .EQ. 0 ) then
       res@xyMonoDashPattern       = True 
    else
@@ -1082,5 +902,5 @@
          print("If you use more than one file, patterns for different timesteps cannot be used")
          print(" ") 
-      end if 
+      end if       
    end if 
 
@@ -1096,24 +916,5 @@
 
    if (combine .EQ. 1) then
-      if ( .not. isvar("number_comb") ) then        	
-         if (parameter(25) .EQ. "0") then
-            print(" ")
-            print("Please set 'number_comb' to 2 or 3 if you would like to overlay 2 or 3 variables in one plot")
-            print(" ")
-            exit
-         else
-            number_comb=stringtointeger(parameter(25))
-            plot_o = new(number_comb,graphic)   
-         end if
-      else
-         if(number_comb .EQ. 2 .OR. number_comb .EQ. 3) then
-            plot_o = new(number_comb,graphic)     
-         else
-            print(" ")
-            print("Please set 'number_comb' to 2 or 3 if you would like to overlay 2 or 3 variables in one plot")
-            print(" ")
-            exit 
-         end if    
-      end if
+      plot_o = new(number_comb,graphic)    
       label=new(number_comb,string)
       color_o=new(number_comb,integer)
@@ -1121,5 +922,5 @@
       maxi=new(number_comb,float)
    end if
-
+ 
    wks=gsn_open_wks(format_out,file_out)
    gsn_define_colormap(wks,"rainbow+white") 
@@ -1130,108 +931,86 @@
 
    if (logy .EQ. 1)then
-      if (.not. isvar("min_z"))then
+      if (min_z .EQ. -1)then
          if (isvar("z_u"))then
             min_z=z_u(1)
          else
             min_z=z_w(1)
+         end if       
+      else
+         if (isvar("z_w"))then
+            if (min_z .GE. max(z_w) ) then
+               print(" ")
+               print("Minimum of height ('min_z'="+min_z+") is greater than available heights (="+max(z_w)+")")
+               print(" ")
+               exit
+            end if	    
+	 else
+	    if (min_z .GE. max(z_u) ) then
+               print(" ")
+               print("Minimum of height ('min_z'="+min_z+") is greater than available heights (="+max(z_u)+")")
+               print(" ")
+               exit
+            end if 
+	 end if
+	 if (isvar("z_u"))then   
+            if (min_z .LT. z_u(1) ) then
+               print(" ")
+               print("Begin height 'min_z' at least at level k=1 (="+z_u(1)+"m) due to the logarithmic scale of the y-axis")
+               print(" ")
+               exit
+            end if
+	 else
+	    if (min_z .LT. z_w(1) ) then
+               print(" ")
+               print("Begin height 'min_z' at least at level k=1 (="+z_w(1)+"m) due to the logarithmic scale of the y-axis")
+               print(" ")
+               exit
+            end if   
          end if
-         if (stringtofloat(parameter(33)) .NE. z_u(1) .OR. stringtofloat(parameter(33)) .NE. z_w(1)) then
-            if (stringtofloat(parameter(33)) .EQ. 0) then
-               if (isvar("z_u"))then
-                  min_z=z_u(1)
-               else
-                  min_z=z_w(1)
-               end if  
-            else
-               if (stringtofloat(parameter(33)) .GE. max(z_u) ) then
-                  print(" ")
-                  print("Minimum of height ('min_z'="+stringtofloat(parameter(33))+") is greater than available heights (="+max(z_u)+")")
-                  print(" ")
-                  exit
-               end if
-               if (stringtofloat(parameter(33)) .LT. z_u(1)) then
-                  print(" ")
-                  print("Begin height 'min_z' at least at level k=1 (="+z_u(1)+"m) due to the logarithmic scale of the y-axis")
-                  print(" ")
-                  exit
-               end if 
-               min_z=stringtofloat(parameter(33))
-            end if
+      end if
+   else
+      if (isvar("z_u"))then
+         if (min_z .EQ. -1)then
+            min_z=z_u(0)
+         end if 
+      else
+         if (min_z .EQ. -1)then
+            min_z=z_w(0)
+         end if    
+      end if
+      if (isvar("z_w"))then
+         if (min_z .GE. max(z_w) ) then
+            print(" ")
+            print("Minimum of height ('min_z'="+min_z+") is greater than available heights (="+max(z_w)+")")
+            print(" ")
+            exit
          end if
       else
-         if (min_z .GE. max(z_u) ) then
+         if (min_z .EQ. -1)then
+            min_z=z_u(0)
+         end if
+	 if (min_z .GE. max(z_u) ) then
             print(" ")
             print("Minimum of height ('min_z'="+min_z+") is greater than available heights (="+max(z_u)+")")
             print(" ")
             exit
-         end if
-         if (min_z .LT. z_u(1) ) then
-            print(" ")
-            print("Begin height 'min_z' at least at level k=1 (="+z_u(1)+"m) due to the logarithmic scale of the y-axis")
-            print(" ")
-            exit
-         end if
-      end if
+         end if 
+      end if
+   end if
+   
+   if (isvar("z_w"))then
+      if (max_z .EQ. -1)then
+         max_z=max(z_w)
+      end if 
    else
-      if (.not. isvar("min_z"))then
-         min_z=0.0     
-         if (stringtofloat(parameter(33)) .NE. 0) then
-            if (stringtofloat(parameter(33)) .GE. max(z_u) ) then
-               print(" ")
-               print("Minimum of height ('min_z'="+stringtofloat(parameter(33))+") is greater than available heights (="+max(z_u)+")")
-               print(" ")
-               exit
-            end if
-            if (stringtofloat(parameter(33)) .LT. 0 ) then
-               print(" ")
-               print("Begin minimum of height 'min_z' with 0")
-               print(" ")
-               exit
-            end if 
-            min_z=stringtofloat(parameter(33))
-         end if
-      else
-         if (min_z .GE. max(z_u) ) then
-            print(" ")
-            print("Minimum of height ('min_z'="+min_z+") is greater than available heights (="+max(z_u)+")")
-            print(" ")
-            exit
-         end if
-         if (min_z .LT. 0 ) then
-            print(" ")
-            print("Begin minimum of height 'min_z' with 0")
-            print(" ")
-            exit
-         end if
-      end if
-   end if
-
-   if (.not. isvar("max_z"))then
-      max_z=max(z_u)
-      if ((parameter(35)) .NE. "max(z_u)") then
-         if (stringtofloat(parameter(35)) .GE. max(z_u) ) then
-            print(" ")
-            print("Maximum of height ('max_z'="+parameter(35)+") is greater than available heights (="+max(z_u)+")")
-            print(" ")
-            exit
-         end if
-         if (stringtofloat(parameter(35)) .LE. 0 ) then
-            print(" ")
-            print("Maximum of height 'max_z' should be at least 1")
-            print(" ")
-            exit
-         end if 
-         max_z=stringtofloat(parameter(35))
-      end if
-   else
-      if (max_z .GE. max(z_u) ) then
-         print(" ")
-         print("Maximum of height ('max_z'="+max_z+") is greater than available heights (="+max(z_u)+")")
-         print(" ")
-         exit
-      end if
-      if (max_z .LE. 0 ) then
-         print(" ")
-         print("Maximum of height 'max_z' should be at least 1")
+      if (max_z .EQ. -1)then
+         max_z=max(z_u)
+      end if    
+   end if
+   
+   if (isvar("z_w"))then
+      if (max_z .GT. max(z_w) ) then
+         print(" ")
+         print("Maximum of height ('max_z'="+max_z+") is greater than available heights (="+max(z_w)+")")
          print(" ")
          exit
@@ -1493,10 +1272,5 @@
       end if
 
-      if (.not. isvar("var")) then
-         if (parameter(21) .NE. "variables") then
-            var=parameter(21)
-            check = isStrSubset( var,","+vNam(varn)+"," )
-         end if
-      else          
+      if (var .NE. "all") then
          check = isStrSubset( var,","+vNam(varn)+"," )
       end if
@@ -1535,5 +1309,5 @@
             if (n_o .GT. number_comb-1) then
                print(" ")
-               print("Please set 'number_comb' to the right number of overlaying variables ('c_var')")
+               print("Please set 'number_comb' to the number of overlaying variables ('c_var' = "+c_var+")")
                print(" ")
                exit
@@ -1625,24 +1399,15 @@
     
          if (over .EQ. 0) then  
-            res@xyDashPattern      = nof
             res@gsnLeftString      = vNam(varn)
             res@gsnRightString     = unit(varn)
             res@trYMinF            = min_z
             res@trYMaxF            = max_z 
-            if (.not. isvar("xs")) then 
-               if (parameter(63) .NE. "x0") then
-                  res@trXMinF = stringtofloat(parameter(63))
-               else
-                  res@trXMinF            = min(data(varn,:,:))
-               end if
+            if (xs .EQ. -1) then 
+               res@trXMinF            = min(data(varn,:,:))
             else 
                res@trXMinF            = xs
             end if
-            if (.not. isvar("xe")) then 
-               if (parameter(65) .NE. "xdim") then
-                  res@trXMaxF = stringtofloat(parameter(65))
-               else
-                  res@trXMaxF            = max(data(varn,:,:)) 
-               end if
+            if (xe .EQ. -1) then 
+               res@trXMaxF            = max(data(varn,:,:)) 
             else 
                res@trXMaxF            = xe  
@@ -1660,19 +1425,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniu
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiu 
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniu
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiu 
                   else 
                      res@trXMaxF            = xe  
@@ -1690,19 +1447,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniv
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiv 
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniv
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then
+                     res@trXMaxF            = maxiv 
                   else 
                      res@trXMaxF            = xe  
@@ -1720,19 +1469,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniw
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiw 
-                     end if
+                  if (xs .EQ. -1) then
+                     res@trXMinF            = miniw
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then
+                     res@trXMaxF            = maxiw 
                   else 
                      res@trXMaxF            = xe  
@@ -1751,19 +1492,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = minipt
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxipt 
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = minipt
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxipt 
                   else 
                      res@trXMaxF            = xe  
@@ -1781,22 +1514,14 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = minivpt
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxivpt 
-                     end if
-                  else 
-                     res@trXMaxF            = xe  
-                  end if 
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = minivpt
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxivpt 
+                  else 
+                     res@trXMaxF            = xe  
+                  end if
                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
                end if 
@@ -1811,19 +1536,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = minilpt
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxilpt 
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = minilpt
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxilpt 
                   else 
                      res@trXMaxF            = xe  
@@ -1842,19 +1559,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = minilq
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxilq 
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = minilq
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxilq 
                   else 
                      res@trXMaxF            = xe  
@@ -1872,19 +1581,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = minilqv
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxilqv 
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = minilqv
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxilqv 
                   else 
                      res@trXMaxF            = xe  
@@ -1902,19 +1603,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniql
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiql 
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniql
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiql 
                   else 
                      res@trXMaxF            = xe  
@@ -1933,19 +1626,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = minie
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxie 
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = minie
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxie 
                   else 
                      res@trXMaxF            = xe  
@@ -1963,19 +1648,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = minies
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxies 
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = minies
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxies 
                   else 
                      res@trXMaxF            = xe  
@@ -1994,19 +1671,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = minikm
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxikm 
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = minikm
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxikm
                   else 
                      res@trXMaxF            = xe  
@@ -2024,19 +1693,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = minikh
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxikh 
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = minikh
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxikh
                   else 
                      res@trXMaxF            = xe  
@@ -2055,19 +1716,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwpup
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwpup 
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwpup
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwpup 
                   else 
                      res@trXMaxF            = xe  
@@ -2085,19 +1738,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwsus
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwsus 
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwsus
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwsus 
                   else 
                      res@trXMaxF            = xe  
@@ -2115,19 +1760,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwu
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwu 
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwu
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwu 
                   else 
                      res@trXMaxF            = xe  
@@ -2146,19 +1783,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwpvp
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwpvp 
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwpvp
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwpvp 
                   else 
                      res@trXMaxF            = xe  
@@ -2176,19 +1805,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwsvs
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwsvs 
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwsvs
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwsvs 
                   else 
                      res@trXMaxF            = xe  
@@ -2206,19 +1827,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwv
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwv
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwv
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwv 
                   else 
                      res@trXMaxF            = xe  
@@ -2237,19 +1850,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwpptp
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwpptp
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwpptp
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwpptp 
                   else 
                      res@trXMaxF            = xe  
@@ -2267,19 +1872,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwspts
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwspts
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwspts
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwspts 
                   else 
                      res@trXMaxF            = xe  
@@ -2297,19 +1894,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwpt
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwpt
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwpt
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwpt 
                   else 
                      res@trXMaxF            = xe  
@@ -2328,22 +1917,14 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwsptsBC
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwsptsBC
-                     end if
-                  else 
-                     res@trXMaxF            = xe  
-                  end if 
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwsptsBC
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwsptsBC 
+                  else 
+                     res@trXMaxF            = xe  
+                  end if
                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 
                end if 
@@ -2358,19 +1939,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwptBC
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwptBC
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwptBC
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwptBC 
                   else 
                      res@trXMaxF            = xe  
@@ -2389,22 +1962,14 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwpvptp
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwpvptp
-                     end if
-                  else 
-                     res@trXMaxF            = xe  
-                  end if 
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwpvptp
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwpvptp 
+                  else 
+                     res@trXMaxF            = xe  
+                  end if
                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 
                end if
@@ -2419,22 +1984,14 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwsvpts
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwsvpts
-                     end if
-                  else 
-                     res@trXMaxF            = xe  
-                  end if 
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwsvpts
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwsvpts 
+                  else 
+                     res@trXMaxF            = xe  
+                  end if
                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
                end if
@@ -2449,19 +2006,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwvpt
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwvpt
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwvpt
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwvpt 
                   else 
                      res@trXMaxF            = xe  
@@ -2480,19 +2029,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwpqp
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwpqp
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwpqp
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwpqp 
                   else 
                      res@trXMaxF            = xe  
@@ -2510,19 +2051,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwsqs
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwsqs
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwsqs
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwsqs 
                   else 
                      res@trXMaxF            = xe  
@@ -2540,22 +2073,14 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwq
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwq
-                     end if
-                  else 
-                     res@trXMaxF            = xe  
-                  end if 
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwq
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwq 
+                  else 
+                     res@trXMaxF            = xe  
+                  end if
                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 
                end if
@@ -2571,22 +2096,14 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwpqvp
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwpqvp
-                     end if
-                  else 
-                     res@trXMaxF            = xe  
-                  end if 
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwpqvp
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwpqvp 
+                  else 
+                     res@trXMaxF            = xe  
+                  end if
                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 
                end if 
@@ -2601,19 +2118,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwsqvs
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwsqvs
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwsqvs
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwsqvs 
                   else 
                      res@trXMaxF            = xe  
@@ -2631,19 +2140,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwqv
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwqv
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwqv
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwqv 
                   else 
                      res@trXMaxF            = xe  
@@ -2662,19 +2163,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwpsp
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwpsp
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwpsp
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwpsp 
                   else 
                      res@trXMaxF            = xe  
@@ -2692,19 +2185,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwsss
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwsss
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwsss
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwsss 
                   else 
                      res@trXMaxF            = xe  
@@ -2722,19 +2207,11 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniws
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiws
-                     end if
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniws
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiws 
                   else 
                      res@trXMaxF            = xe  
@@ -2753,22 +2230,14 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwpsap
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwpsap
-                     end if
-                  else 
-                     res@trXMaxF            = xe  
-                  end if 
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwpsap
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwpsap 
+                  else 
+                     res@trXMaxF            = xe  
+                  end if
                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 
                end if 
@@ -2783,22 +2252,14 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwssas
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwssas
-                     end if
-                  else 
-                     res@trXMaxF            = xe  
-                  end if 
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwssas
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwssas 
+                  else 
+                     res@trXMaxF            = xe  
+                  end if
                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
                end if
@@ -2813,22 +2274,14 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwsa
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwsa
-                     end if
-                  else 
-                     res@trXMaxF            = xe  
-                  end if 
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwsa
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwsa 
+                  else 
+                     res@trXMaxF            = xe  
+                  end if
                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 
                end if
@@ -2844,22 +2297,14 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = minius2
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxius2
-                     end if
-                  else 
-                     res@trXMaxF            = xe  
-                  end if 
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = minius2
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxius2 
+                  else 
+                     res@trXMaxF            = xe  
+                  end if
                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 
                end if 
@@ -2874,22 +2319,14 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = minivs2
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxivs2
-                     end if
-                  else 
-                     res@trXMaxF            = xe  
-                  end if 
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = minivs2
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxivs2 
+                  else 
+                     res@trXMaxF            = xe  
+                  end if
                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
                end if
@@ -2904,22 +2341,14 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniws2
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiws2
-                     end if
-                  else 
-                     res@trXMaxF            = xe  
-                  end if 
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniws2
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiws2 
+                  else 
+                     res@trXMaxF            = xe  
+                  end if
                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 
                end if
@@ -2935,22 +2364,14 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwsususodz
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwsususodz
-                     end if
-                  else 
-                     res@trXMaxF            = xe  
-                  end if 
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwsususodz
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwsususodz 
+                  else 
+                     res@trXMaxF            = xe  
+                  end if
                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 
                end if  
@@ -2965,22 +2386,14 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwspsodz
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwspsodz
-                     end if
-                  else 
-                     res@trXMaxF            = xe  
-                  end if 
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwspsodz
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwspsodz 
+                  else 
+                     res@trXMaxF            = xe  
+                  end if
                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res)
                end if 
@@ -2995,22 +2408,14 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF            = miniwpeodz
-                     end if
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF            = maxiwpeodz
-                     end if
-                  else 
-                     res@trXMaxF            = xe  
-                  end if 
+                  if (xs .EQ. -1) then 
+                     res@trXMinF            = miniwpeodz
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then        
+                     res@trXMaxF            = maxiwpeodz 
+                  else 
+                     res@trXMaxF            = xe  
+                  end if
                   plot(n) = gsn_csm_xy(wks,data(varn,:,:),z,res) 
                end if
@@ -3039,5 +2444,6 @@
    if (count_var .EQ. 0) then
       print(" ")
-      print("The variables 'var=Â°"+var+"Â°' do not exist on your input file")
+      print("The variables 'var="+var+"' do not exist on your input file;")
+      print("be sure to have one comma berfore and after each variable")
       print(" ")
       exit
@@ -3048,75 +2454,27 @@
       string_len=new(12,integer)
       multi_dash=new(no_files,string)
-      if (.not. isvar("name_legend_1")) 
-         multi_legend(0)="  "+parameter(83) 
-      else
-         multi_legend(0)="  "+name_legend_1
-      end if 
+      multi_legend(0)="  "+name_legend_1
       string_len(0)=strlen(multi_legend(0))
-      if (.not. isvar("name_legend_2")) 
-         multi_legend(1)="  "+parameter(87) 
-      else
-         multi_legend(1)="  "+name_legend_2
-      end if 
+      multi_legend(1)="  "+name_legend_2 
       string_len(1)=strlen(multi_legend(1))
-      if (.not. isvar("name_legend_3")) 
-         multi_legend(2)="  "+parameter(91) 
-      else
-         multi_legend(2)="  "+name_legend_3
-      end if 
+      multi_legend(2)="  "+name_legend_3
       string_len(2)=strlen(multi_legend(2))
-      if (.not. isvar("name_legend_4")) 
-         multi_legend(3)="  "+parameter(95) 
-      else
-         multi_legend(3)="  "+name_legend_4
-      end if 
+      multi_legend(3)="  "+name_legend_4 
       string_len(3)=strlen(multi_legend(3))
-      if (.not. isvar("name_legend_5")) 
-         multi_legend(4)="  "+parameter(99) 
-      else
-         multi_legend(4)="  "+name_legend_5
-      end if 
+      multi_legend(4)="  "+name_legend_5 
       string_len(4)=strlen(multi_legend(4))
-      if (.not. isvar("name_legend_6")) 
-         multi_legend(5)="  "+parameter(103) 
-      else
-         multi_legend(5)="  "+name_legend_6
-      end if 
+      multi_legend(5)="  "+name_legend_6 
       string_len(5)=strlen(multi_legend(5))
-      if (.not. isvar("name_legend_7")) 
-         multi_legend(6)="  "+parameter(107) 
-      else
-         multi_legend(6)="  "+name_legend_7
-      end if
+      multi_legend(6)="  "+name_legend_7
       string_len(6)=strlen(multi_legend(6)) 
-      if (.not. isvar("name_legend_8")) 
-         multi_legend(7)="  "+parameter(111) 
-      else
-         multi_legend(7)="  "+name_legend_8
-      end if 
+      multi_legend(7)="  "+name_legend_8
       string_len(7)=strlen(multi_legend(7))
-      if (.not. isvar("name_legend_9")) 
-         multi_legend(8)="  "+parameter(115) 
-      else
-         multi_legend(8)="  "+name_legend_9
-      end if
+      multi_legend(8)="  "+name_legend_9
       string_len(8)=strlen(multi_legend(8)) 
-      if (.not. isvar("name_legend_10")) 
-         multi_legend(9)="  "+parameter(119) 
-      else
-         multi_legend(9)="  "+name_legend_10
-      end if 
+      multi_legend(9)="  "+name_legend_10
       string_len(9)=strlen(multi_legend(9))
-      if (.not. isvar("name_legend_11")) 
-         multi_legend(10)="  "+parameter(123) 
-      else
-         multi_legend(10)="  "+name_legend_11
-      end if 
+      multi_legend(10)="  "+name_legend_11 
       string_len(10)=strlen(multi_legend(10))
-      if (.not. isvar("name_legend_12")) 
-         multi_legend(11)="  "+parameter(127) 
-      else
-         multi_legend(11)="  "+name_legend_12
-      end if 
+      multi_legend(11)="  "+name_legend_12 
       string_len(11)=strlen(multi_legend(11))
       do ml=1,no_files
@@ -3235,10 +2593,5 @@
          end if
 
-         if (.not. isvar("var")) then
-            if (parameter(21) .NE. "variables") then
-               var=parameter(21)
-               check = isStrSubset( var,","+vNam(varn)+"," )
-            end if
-         else          
+         if (var .NE. "all") then      
             check = isStrSubset( var,","+vNam(varn)+"," )
          end if      
@@ -3280,19 +2633,11 @@
             res@trYMinF            = min_z
             res@trYMaxF            = max_z  
-            if (.not. isvar("xs")) then 
-               if (parameter(63) .NE. "x0") then
-                  res@trXMinF = stringtofloat(parameter(63))
-               else
-                  res@trXMinF = min(data(varn,:,:))
-               end if
+            if (xs .EQ. -1) then 
+               res@trXMinF = min(data(varn,:,:))
             else 
                res@trXMinF = xs
             end if
-            if (.not. isvar("xe")) then 
-               if (parameter(65) .NE. "xdim") then
-                  res@trXMaxF = stringtofloat(parameter(65))
-               else
-                  res@trXMaxF = max(data(varn,:,:))
-            end if
+            if (xe .EQ. -1) then 
+               res@trXMaxF = max(data(varn,:,:))
             else 
                res@trXMaxF = xe  
@@ -3304,19 +2649,11 @@
                   res@gsnLeftString      = "u, v and w"
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF = min((/miniu,miniv,miniw/))
-                     end if
+                  if (xs .EQ. -1) then
+                     res@trXMinF = min((/miniu,miniv,miniw/))
                   else 
                      res@trXMinF = xs
                   end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF = max((/maxiu,maxiv,maxiw/))
-                     end if
+                  if (xe .EQ. -1) then
+                     res@trXMaxF = max((/maxiu,maxiv,maxiw/))
                   else 
                      res@trXMaxF = xe  
@@ -3355,19 +2692,11 @@
                   res@gsnLeftString      = "pt, vpt and lpt"
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF = min((/minipt,minivpt,minilpt/))
-                     end if
+                  if (xs .EQ. -1) then
+                     res@trXMinF = min((/minipt,minivpt,minilpt/))
                   else 
                      res@trXMinF = xs
                   end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF = max((/maxipt,maxivpt,maxilpt/))
-                     end if
+                  if (xe .EQ. -1) then
+                     res@trXMaxF = max((/maxipt,maxivpt,maxilpt/))
                   else 
                      res@trXMaxF = xe  
@@ -3406,22 +2735,14 @@
                   res@gsnLeftString      = "q, qv and ql"
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF = min((/miniq,miniqv,miniql/))
-                     end if
+                  if (xs .EQ. -1) then
+                     res@trXMinF = min((/miniq,miniqv,miniql/))
                   else 
                      res@trXMinF = xs
                   end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF = max((/maxiq,maxiqv,maxiql/))
-                     end if
+                  if (xe .EQ. -1) then
+                     res@trXMaxF = max((/maxiq,maxiqv,maxiql/))
                   else 
                      res@trXMaxF = xe  
-                  end if
+                  end if 
 
                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res) 
@@ -3458,23 +2779,15 @@
                   res@gsnLeftString      = "e and es"
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF = min((/minie,minies/))
-                     end if
+                  if (xs .EQ. -1) then
+                     res@trXMinF = min((/minie,minies/))
                   else 
                      res@trXMinF = xs
                   end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF = max((/maxie,maxies/))
-                     end if
+                  if (xe .EQ. -1) then
+                     res@trXMaxF = max((/maxie,maxies/))
                   else 
                      res@trXMaxF = xe  
-                  end if
-
+                  end if 
+		  
                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res) 
 
@@ -3509,22 +2822,14 @@
                   res@gsnLeftString      = "km and kh"
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF = min((/minikm,minikh/))
-                     end if
+                  if (xs .EQ. -1) then
+                     res@trXMinF = min((/minikm,minikh/))
                   else 
                      res@trXMinF = xs
                   end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF = max((/maxikm,maxikh/))
-                     end if
+                  if (xe .EQ. -1) then
+                     res@trXMaxF = max((/maxikm,maxikh/))
                   else 
                      res@trXMaxF = xe  
-                  end if
+                  end if 
 
                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res) 
@@ -3561,22 +2866,14 @@
                   res@gsnLeftString      = "wpup, wsus and wu"
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF = min((/miniwpup,miniwsus,miniwu/))
-                     end if
+                  if (xs .EQ. -1) then
+                     res@trXMinF = min((/miniwpup,miniwsus,miniwu/))
                   else 
                      res@trXMinF = xs
                   end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF = max((/maxiwpup,maxiwsus,maxiwu/))
-                     end if
+                  if (xe .EQ. -1) then
+                     res@trXMaxF = max((/maxiwpup,maxiwsus,maxiwu/))
                   else 
                      res@trXMaxF = xe  
-                  end if
+                  end if  
 
                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res) 
@@ -3612,23 +2909,15 @@
                   res@gsnLeftString      = "wpvp, wsus and wv"
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF = min((/miniwpvp,miniwsvs,miniwv/))
-                     end if
+                  if (xs .EQ. -1) then
+                     res@trXMinF = min((/miniwpvp,miniwsvs,miniwv/))
                   else 
                      res@trXMinF = xs
                   end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF = max((/maxiwpvp,maxiwsvs,maxiwv/))
-                     end if
+                  if (xe .EQ. -1) then
+                     res@trXMaxF = max((/maxiwpvp,maxiwsvs,maxiwv/))
                   else 
                      res@trXMaxF = xe  
                   end if
-
+		  
                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res) 
 
@@ -3663,22 +2952,14 @@
                   res@gsnLeftString      = "wpptp, wspts and wv"
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF = min((/miniwpptp,miniwspts,miniwpt/))
-                     end if
+                  if (xs .EQ. -1) then
+                     res@trXMinF = min((/miniwpptp,miniwspts,miniwpt/))
                   else 
                      res@trXMinF = xs
                   end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF = max((/maxiwpptp,maxiwspts,maxiwpt/))
-                     end if
+                  if (xe .EQ. -1) then
+                     res@trXMaxF = max((/maxiwpptp,maxiwspts,maxiwpt/))
                   else 
                      res@trXMaxF = xe  
-                  end if
+                  end if 
 
                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res) 
@@ -3714,22 +2995,14 @@
                   res@gsnLeftString      = "wsptsBC and wptBC"
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF = min((/miniwsptsBC,miniwptBC/))
-                     end if
+                  if (xs .EQ. -1) then
+                     res@trXMinF = min((/miniwsptsBC,miniwptBC/))
                   else 
                      res@trXMinF = xs
                   end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF = max((/maxiwsptsBC,maxiwptBC/))
-                     end if
+                  if (xe .EQ. -1) then
+                     res@trXMaxF = max((/maxiwsptsBC,maxiwptBC/))
                   else 
                      res@trXMaxF = xe  
-                  end if
+                  end if 
 
                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res) 
@@ -3765,23 +3038,15 @@
                   res@gsnLeftString      = "wpvptp, wsvpts and wv"
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF = min((/miniwpvptp,miniwsvpts,miniwvpt/))
-                     end if
+                  if (xs .EQ. -1) then
+                     res@trXMinF = min((/miniwpvptp,miniwsvpts,miniwvpt/))
                   else 
                      res@trXMinF = xs
                   end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF = max((/maxiwpvptp,maxiwsvpts,maxiwvpt/))
-                     end if
+                  if (xe .EQ. -1) then
+                     res@trXMaxF = max((/maxiwpvptp,maxiwsvpts,maxiwvpt/))
                   else 
                      res@trXMaxF = xe  
-                  end if
-
+                  end if 
+		  
                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res) 
 
@@ -3816,23 +3081,15 @@
                   res@gsnLeftString      = "wpqp, wsqs and wq"
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF = min((/miniwpqp,miniwsqs,miniwq/))
-                     end if
+                  if (xs .EQ. -1) then
+                     res@trXMinF = min((/miniwpqp,miniwsqs,miniwq/))
                   else 
                      res@trXMinF = xs
                   end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF = max((/maxiwpqp,maxiwsqs,maxiwq/))
-                     end if
+                  if (xe .EQ. -1) then
+                     res@trXMaxF = max((/maxiwpqp,maxiwsqs,maxiwq/))
                   else 
                      res@trXMaxF = xe  
-                  end if
-
+                  end if  
+		  
                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res) 
 
@@ -3867,23 +3124,15 @@
                   res@gsnLeftString      = "wpqvp, wsqvs and wqv"
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF = min((/miniwpqp,miniwsqvs,miniwqv/))
-                     end if
+                  if (xs .EQ. -1) then
+                     res@trXMinF = min((/miniwpqp,miniwsqvs,miniwqv/))
                   else 
                      res@trXMinF = xs
                   end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF = max((/maxiwpqp,maxiwsqvs,maxiwqv/))
-                     end if
+                  if (xe .EQ. -1) then
+                     res@trXMaxF = max((/maxiwpqp,maxiwsqvs,maxiwqv/))
                   else 
                      res@trXMaxF = xe  
-                  end if
-
+                  end if 
+		  
                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res) 
 
@@ -3918,22 +3167,14 @@
                   res@gsnLeftString      = "wpsp, wsss and ws"
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF = min((/miniwpsp,miniwsss,miniws/))
-                     end if
+                  if (xs .EQ. -1) then
+                     res@trXMinF = min((/miniwpsp,miniwsss,miniws/))
                   else 
                      res@trXMinF = xs
                   end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF = max((/maxiwpsp,maxiwsss,maxiws/))
-                     end if
+                  if (xe .EQ. -1) then
+                     res@trXMaxF = max((/maxiwpsp,maxiwsss,maxiws/))
                   else 
                      res@trXMaxF = xe  
-                  end if
+                  end if 
 
                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res) 
@@ -3969,22 +3210,14 @@
                   res@gsnLeftString      = "wpsap, wssas and wsa"
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF = min((/miniwpsap,miniwssas,miniwsa/))
-                     end if
+                  if (xs .EQ. -1) then
+                     res@trXMinF = min((/miniwpsap,miniwssas,miniwsa/))
                   else 
                      res@trXMinF = xs
                   end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF = max((/maxiwpsap,maxiwssas,maxiwsa/))
-                     end if
+                  if (xe .EQ. -1) then
+                     res@trXMaxF = max((/maxiwpsap,maxiwssas,maxiwsa/))
                   else 
                      res@trXMaxF = xe  
-                  end if
+                  end if 
 
                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res) 
@@ -4021,23 +3254,15 @@
                   res@gsnLeftString      = "us2, vs2 and ws2"
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF = min((/minius2,minivs2,miniws2/))
-                     end if
+                  if (xs .EQ. -1) then
+                     res@trXMinF = min((/minius2,minivs2,miniws2/))
                   else 
                      res@trXMinF = xs
                   end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF = max((/maxius2,maxivs2,maxiws2/))
-                     end if
-                  else 
+                  if (xe .EQ. -1) then
+                     res@trXMaxF = max((/maxius2,maxivs2,maxiws2/))
+		  else 
                      res@trXMaxF = xe  
-                  end if
-
+                  end if 
+		  
                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res) 
 
@@ -4073,23 +3298,15 @@
                   res@gsnLeftString      = "wsususodz, wspsodz and ws2"
                   res@gsnRightString     = unit(varn)
-                  if (.not. isvar("xs")) then 
-                     if (parameter(63) .NE. "x0") then
-                        res@trXMinF = stringtofloat(parameter(63))
-                     else
-                        res@trXMinF = min((/miniwsususodz,miniwspsodz,miniwpeodz/))
-                     end if
+                  if (xs .EQ. -1) then
+                     res@trXMinF = min((/miniwsususodz,miniwspsodz,miniwpeodz/))
                   else 
                      res@trXMinF = xs
                   end if
-                  if (.not. isvar("xe")) then 
-                     if (parameter(65) .NE. "xdim") then
-                        res@trXMaxF = stringtofloat(parameter(65))
-                     else
-                        res@trXMaxF = max((/maxiwsususodz,maxiwspsodz,maxiwpeodz/))
-                     end if
+                  if (xe .EQ. -1) then
+                     res@trXMaxF = max((/maxiwsususodz,maxiwspsodz,maxiwpeodz/))
                   else 
                      res@trXMaxF = xe  
-                  end if
-
+                  end if 
+		  
                   plot(n) =  gsn_csm_xy(wks,data(varn,:,:),z,res) 
 
@@ -4126,5 +3343,7 @@
          end if
       end do 
-   end if     
+   end if 
+   
+   com_var_avail=new(count_var,string)    
 
    if (combine .EQ. 1) then
@@ -4145,10 +3364,5 @@
          end if
 
-         if (.not. isvar("var")) then
-            if (parameter(21) .NE. "variables") then
-               var=parameter(21)                
-               check = isStrSubset( var,","+vNam(varn)+"," )
-            end if
-         else          
+         if (var .NE. "all") then         
             check = isStrSubset( var,","+vNam(varn)+"," )
          end if      
@@ -4185,5 +3399,7 @@
 
             z=z/norm
-           
+	    
+	    com_var_avail(n_o)=vNam(varn)
+	    
             com=isStrSubset( c_var,","+vNam(varn)+"," )
         
@@ -4199,19 +3415,11 @@
                      res@gsnLeftString  = "Combined Plot of "+c_var
                      res@gsnRightString = unit(varn)
-                     if (.not. isvar("xs")) then 
-                        if (parameter(63) .NE. "x0") then
-                           res@trXMinF = stringtofloat(parameter(63))
-                        else
-                           res@trXMinF = min(mini)
-                        end if
+                     if (xs .EQ. -1) then 
+                        res@trXMinF = min(mini)
                      else 
                         res@trXMinF = xs
                      end if
-                     if (.not. isvar("xe")) then 
-                        if (parameter(65) .NE. "xdim") then
-                           res@trXMaxF = stringtofloat(parameter(65))
-                        else
-                           res@trXMaxF = max(maxi)
-                        end if
+                     if (xe .EQ. -1) then 
+                        res@trXMaxF = max(maxi)
                      else 
                         res@trXMaxF = xe  
@@ -4234,13 +3442,11 @@
             overlay(plot_o(0),plot_o(1))
          else
-            if (.not. isvar("var") .AND. parameter(21) .EQ. "variables") then
-               print(" ")
-               print("'c_var'(= "+c_var+") is not conform with existing variables on the input file")
-               print(" ")
-            else
-               print(" ")
-               print("'c_var'(= "+c_var+") must include two variables of the general plots ('var' = "+var+")")
-               print(" ")
-            end if
+            print(" ")
+	    print("combining is not possible,")
+            print("'c_var'(= "+c_var+") must include two variables of the general plots = ")
+	    print("- "+com_var_avail)
+	    print("be sure to have one comma berfore and after the variable")
+            print(" ")
+            exit  
          end if 
       end if
@@ -4250,13 +3456,11 @@
             overlay(plot_o(0),plot_o(2))
          else
-            if (.not. isvar("var") .AND. parameter(21) .EQ. "variables") then
-               print(" ")
-               print("'c_var'(= "+c_var+") is not conform with existing variables on the input file")
-               print(" ")
-            else
-               print(" ")
-               print("'c_var'(= "+c_var+") must include three variables of the general plots ('var' = "+var+")")
-               print(" ")
-            end if
+            print(" ")
+	    print("combining is not possible,")
+            print("'c_var'(= "+c_var+") must include three variables of the general plots = ")
+	    print("- "+com_var_avail)
+	    print("be sure to have one comma berfore and after the variable")
+            print(" ")
+            exit
          end if 
       end if
Index: palm/trunk/SCRIPTS/NCL/spectra.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/spectra.ncl	(revision 183)
+++ palm/trunk/SCRIPTS/NCL/spectra.ncl	(revision 190)
@@ -2,35 +2,42 @@
 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
- 
+
+;***************************************************
+; load ncl_preferences.ncl
+;***************************************************
+   
+if (isfilepresent("~/ncl_preferences.ncl")) then
+   loadscript("~/ncl_preferences.ncl")
+else
+  if (isfilepresent("~/palm/current_version/trunk/SCRIPTS/NCL/ncl_preferences.ncl")) then
+     loadscript( "~/palm/current_version/trunk/SCRIPTS/NCL/ncl_preferences.ncl")
+  else
+      print(" ")
+      print("'ncl_preferences.ncl' does not exist in $home or $home/palm/current_version/trunk/SCRIPTS/NCL/")
+      print(" ")
+      exit
+   end if
+end if
+   
 begin
-
-   ; ***************************************************
-   ; read parameter_list
-   ; ***************************************************
-
-   if (isfilepresent("~/.ncl_preferences")) then
-      parameter = asciiread("~/.ncl_preferences",129,"string")
-      delete(parameter@_FillValue)
-   else
-      if (isfilepresent("~/palm/current_version/trunk/SCRIPTS/NCL/.ncl_preferences")) then
-         parameter = asciiread("~/palm/current_version/trunk/SCRIPTS/NCL/.ncl_preferences",129,"string")
-         delete(parameter@_FillValue)
-      else
-         print(" ")
-         print("'.ncl_preferences' does not exist in '~/palm/current_version/trunk/SCRIPTS/NCL/'")
-         print(" ")
-         exit
-      end if
-   end if
-
-   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   
+      
+   if (cross_sections .NE. 0 .OR. profiles .NE. 0 .OR. timeseries .NE. 0 .OR. spectra .NE. 1)then
+      print(" ")
+      print("Please specify the used script in 'ncl_preferences.ncl' (Line 7-10)")
+      print(" ")
+      print("Set 'spectra' equal 1 and the other variables equal 0")
+      print(" ")
+      exit
+   end if 
+
+   ;***************************************************
+   ; 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(" ")
+      exit 
    else
       file_in = file_1   
@@ -38,144 +45,67 @@
    if (.not. isfilepresent(file_in)) then
       print(" ")
-      print("Your 1st input file: '"+file_in+"' does not exist")
+      print("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 
-   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_ts") then
-         file_out = parameter(11)  
-     end if     
-   end if
-   if ( .not. isvar("no_columns") ) then    	
-      no_columns = 1
-      if (parameter(17) .NE. "1") then
-         no_columns = stringtointeger(parameter(17))  
-      end if
-   end if
-   if ( .not. isvar("no_lines") ) then     		
-      no_lines = 2
-      if (parameter(19) .NE. "2") then
-         no_lines = stringtointeger(parameter(19))  
-      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
+      print(" ")
+      print("'format_out = "+format_out+"' is invalid and set to'x11'")
+      print(" ")
+      format_out="x11"
    end if 
-
-   if (.not. isvar("logy"))then
-      logy = 0
-      if (stringtointeger(parameter(77)) .NE. 0) then
-         logy = stringtointeger(parameter(77))
-         if (stringtointeger(parameter(77)) .NE. 1) then
-            print(" ")
-            print("Your 'logy'= "+logy+" is invalid and set to 0")
-            print(" ")
-            logy = 0
-         end if   
-      end if
-   else
-      if (logy .NE. 0 .AND. logy .NE. 1)then
-         print(" ")
-         print("Your 'logy'= "+logy+" is invalid and set to 0")
-         print(" ")
-         logy = 0
-      end if    
-   end if
-
-   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("black") ) then  		 	
+   
+   if (logx .NE. 0 .AND. logx .NE. 1)then
+      print(" ")
+      print("'logx'= "+logx+" is invalid and set to 1")
+      print(" ")
+      logx = 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
+   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
+   end if
+   
+   if (sort .NE. "height" .AND. sort .NE. "time") then  
+      print(" ")
+      print("'sort'= "+sort+" is invalid and set to 'height'")
+      print(" ")
+      sort = "height"  
+   end if
+   
+   if (black .NE. 0 .AND. black .NE. 1)then
+      print(" ")
+      print("'black'= "+black+" is invalid and set to 0")
+      print(" ")
       black = 0
-      if (parameter(31) .NE. "0") then
-         black = stringtointeger(parameter(31)) 
-         if (stringtointeger(parameter(31)) .NE. 1) then
-            print(" ")
-            print("Your 'black'= "+black+" is invalid and set to 0")
-            print(" ")
-            black = 0
-         end if
-      end if
-   else
-      if (black .NE. 0 .AND. black .NE. 1)then
-         print(" ")
-         print("Your 'black'= "+black+" is invalid and set to 0")
-         print(" ")
-         black = 0
-      end if
-   end if
-   if ( .not. isvar("dash") ) then   		 	
+   end if
+ 
+   if (dash .NE. 0 .AND. dash .NE. 1)then
+      print(" ")
+      print("'dash'= "+dash+" is invalid and set to 0")
+      print(" ")
       dash = 0
-      if (parameter(29) .NE. "0") then
-         dash = stringtointeger(parameter(29))
-         if (stringtointeger(parameter(29)) .NE. 1) then
-            print(" ")
-            print("Your 'dash'= "+dash+" is invalid and set to 0")
-            print(" ")
-            dash = 0
-         end if  
-      end if
-   else
-      if (dash .NE. 0 .AND. dash .NE. 1)then
-         print(" ")
-         print("Your 'dash'= "+dash+" is invalid and set to 0")
-         print(" ")
-         dash = 0
-      end if
-   end if
-
-   if ( .not. isvar("norm") ) then     		
-      norm = 1.0
-      if (parameter(79) .NE. "1") then
-         norm = stringtofloat(parameter(79)) 
-         if (stringtofloat(parameter(79)) .EQ. 0) then 
-            print(" ")
-            print("You cannot normalise with 0, 'norm' is set to 1")
-            print(" ")
-            norm = 1.0
-         end if
-      end if
-   else
-      if (norm .EQ. 0) then 
-         print(" ")
-         print("You cannot normalise with 0, 'norm' is set to 1")
-         print(" ")
-         norm = 1.0
-      end if
-   end if 
+   end if
+
+   ;***************************************************
+   ; open input file
+   ;***************************************************
 
    f=addfile(file_in,"r")
@@ -183,5 +113,6 @@
    vNam = getfilevarnames(f) 
    print(" ")
-   print("Variable in input file: " + vNam)
+   print("Variables in input file:")
+   print("- "+ vNam)
    print(" ")
    dim = dimsizes(vNam)
@@ -192,41 +123,61 @@
    delta_t=t_all(nt-1)/nt
    
+   k_x=f->k_x
+   dimx=dimsizes(k_x)
+   k_y=f->k_y
+   dimy=dimsizes(k_y)
+   
+   
+   dim_level=dimsizes(height_level)
+
    do i=0,dim-1
       if (vNam(i) .EQ. "zu_sp")then
-         zu=f->zu_sp
-         z=zu
-         dimz=dimsizes(zu)
+         zu=f->zu_sp	 
+	 if (height_level(0) .EQ. -1)then
+	    dimz=dimsizes(zu)
+	 else
+	    if (dim_level .GT. dimsizes(zu))then
+               print(" ")
+               print("'height_level' has more elements than available height levels in input file (= "+dimz+")")
+               print(" ")
+               exit
+	    else
+	       zuh=new(dim_level,double)
+	       do le=0,dim_level-1
+	          zuh(le)=zu(height_level(le))
+	       end do
+	       dimz=dim_level
+            end if   
+	 end if	 
       else 
          if (vNam(i) .EQ. "zw_sp")then
-            zw=f->zw_sp
-            z=zw
-            dimz=dimsizes(zw)
+	    zw=f->zw_sp
+	    if (height_level(0) .EQ. -1)then              
+               dimz=dimsizes(zw)
+	    else
+	       if (dim_level .GT. dimsizes(zw))then
+                  print(" ")
+                  print("'height_level' has more elements than available height levels in input file (= "+dimz+")")
+                  print(" ")
+                  exit
+	       else
+	          zwh=new(dim_level,double)
+	          do le=0,dim_level-1
+	             zwh(le)=zw(height_level(le))
+	          end do
+	          dimz=dim_level
+               end if   
+	    end if
          end if
       end if
    end do
-   
-   ; ****************************************************	
+
+   ;****************************************************	
    ; start of time step and different types of mistakes that could be done
-   ; ****************************************************
-   
-   if ( .not. isvar("start_time_step") ) then   	
+   ;****************************************************
+   
+   if (start_time_step .EQ. -1.d) then   	
       start_time_step=t_all(0)/3600
-      if (parameter(13) .NE. "t(0)") then
-         if (stringtodouble(parameter(13)) .GT. t_all(nt-1)/3600)then
-            print(" ")
-            print("'start_time_step' = "+ parameter(13) +"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(" ")
-            exit
-         end if
-         if (stringtofloat(parameter(13)) .LT. t_all(0)/3600)then
-            print(" ")
-            print("'start_time_step' = "+ parameter(13) +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h")           
-            exit
-         end if
-         start_time_step=stringtodouble(parameter(13)) 
-      end if
-   else 
+   else
       if (start_time_step .GT. t_all(nt-1)/3600)then
          print(" ")
@@ -243,8 +194,7 @@
       end if
    end if
-   start_time_step = start_time_step*3600
 
    do i=0,nt-1     
-      if (start_time_step .GE. t_all(i)-delta_t/2 .AND. start_time_step .LT. t_all(i)+delta_t/2)then
+      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
          break
@@ -252,29 +202,19 @@
    end do
    
-   ; ****************************************************
+   if (.not. isvar("st"))then
+      print(" ")
+      print("'start_time_step' = "+ start_time_step +"h is invalid")
+      print(" ")
+      print("Please select another 'start_time_step'")
+      print(" ")
+      exit
+   end if
+   
+   ;****************************************************
    ; end of time step and different types of mistakes that could be done
-   ; ****************************************************
-
-   if ( .not. isvar("end_time_step") ) then     	
+   ;****************************************************
+
+   if (end_time_step .EQ. -1.d) then     	
       end_time_step = t_all(nt-1)/3600
-      if (parameter(15) .NE. "t(end)") then
-         if (stringtodouble(parameter(15)) .GT. t_all(nt-1)/3600)then
-            print(" ")
-            print("'end_time_step' = "+ parameter(15) +"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(" ")
-            exit
-         end if
-         if (stringtodouble(parameter(15)) .LT. start_time_step/3600)then
-            print(" ")
-            print("'end_time_step' = "+ parameter(15) +"h is lower than 'start_time_step' = "+start_time_step/3600+"h")
-            print(" ")
-            print("Please select another 'start_time_step' or 'end_time_step'")
-            print(" ")
-            exit
-         end if
-         end_time_step = stringtodouble(parameter(15))
-      end if    
    else
       if (end_time_step .GT. t_all(nt-1)/3600)then
@@ -295,12 +235,20 @@
       end if
    end if
-   end_time_step = end_time_step*3600
 
    do i=0,nt-1     
-      if (end_time_step .GE. t_all(i)-delta_t/2 .AND. end_time_step .LT. t_all(i)+delta_t/2)then
+      if (end_time_step .GE. (t_all(i)-delta_t/2)/3600 .AND. end_time_step .LT. (t_all(i)+delta_t/2)/3600)then
          et=i
          break
       end if
    end do 
+   
+   if (.not. isvar("et"))then
+      print(" ")
+      print("'end_time_step' = "+ end_time_step +"h is invalid")
+      print(" ")
+      print("Please select another 'end_time_step'")
+      print(" ")
+      exit
+   end if
 
    delete(start_time_step)
@@ -316,7 +264,7 @@
    dimt = end_time_step-start_time_step+1
  
-   ; ***************************************************
+   ;***************************************************
    ; set up recourses
-   ; ***************************************************
+   ;***************************************************
      
    res = True
@@ -337,5 +285,5 @@
    res@pmLegendDisplayMode     = "Always"
    res@pmLegendSide            = "Top"
-   res@pmLegendParallelPosF    = 1.15
+   res@pmLegendParallelPosF    = 1.2
    res@pmLegendOrthogonalPosF  = -1.0
    res@pmLegendWidthF          = 0.12
@@ -345,15 +293,18 @@
       res@pmLegendHeightF         = 0.04*dimz
    end if
-   res@lgLabelFontHeightF     = .02 
-   res@lgTitleFontHeightF     = .02
-   res@txFontHeightF      = 0.02
-   res@tiXAxisFontHeightF = 0.02
-   res@tiYAxisFontHeightF = 0.02
-   
-   if (logy .EQ. 1) then
+   res@lgLabelFontHeightF     = .025 
+   res@lgTitleFontHeightF     = .025
+   res@txFontHeightF      = 0.025
+   res@tiXAxisFontHeightF = 0.025
+   res@tiYAxisFontHeightF = 0.025
+   
+   if (logx .EQ. 1) then
       res@trXLog = True 
+   else
+      res@trXLog = False 
+   end if
+   if (logy .EQ. 1)then
       res@trYLog = True 
-   else 
-      res@trXLog = False 
+   else  
       res@trYLog = False
    end if
@@ -379,18 +330,26 @@
       res@lgTitleString = "Height [m]"  
       do p=0,dimz-1
-         legend_label_zu(p)=round(zu(p),3)
-         legend_label_zw(p)=round(zw(p),3)
+         if (height_level(0) .EQ. -1)then
+            legend_label_zu(p)=round(zu(p),3)
+            legend_label_zw(p)=round(zw(p),3)
+	 else
+	    legend_label_zu(p)=round(zuh(p),3)
+	    legend_label_zw(p)=round(zwh(p),3)
+	 end if
       end do
    end if
-
-   if ( black .eq. 0 ) then  
-      res@xyLineColors = ispan(2,237,235/np)
+   
+   step=round(235/(np-1),3)
+   if (black .eq. 0 ) then  
+      res@xyLineColors = ispan(2,237,step)
    end if
    if ( dash .eq. 0 ) then
-      res@xyMonoDashPattern       = True 
+      res@xyMonoDashPattern = True 
    end if
 
    wks=gsn_open_wks(format_out,file_out)
    gsn_define_colormap(wks,"rainbow+white") 
+
+   temp=new((/dimt,dimz,dimx/),float)
 
    n=0
@@ -403,57 +362,82 @@
       end if
 
-      if (.not. isvar("var")) then
-         if (parameter(21) .NE. "variables") then
-            var=parameter(21)
-            check = isStrSubset( var,","+vNam(varn)+"," )
-         end if
-      else          
+      if (var .NE. "all") then
          check = isStrSubset( var,","+vNam(varn)+"," )
       end if
 
-      if(check) then
-
+      if(check) then 
+      
          temp = f->$vNam(varn)$(start_time_step:end_time_step,0:dimz-1,:)
-
-         temp=temp/norm  ;SMOOTHING: #temp=smth9(temp/norm, 0.50, -0.25, False)#
-   
+	    
          a=getvardims(temp)
-         b=dimsizes(a)            
+         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),:)	       
+	    end do
+	 end if
+
+         temp=temp/(normy*normx)  ;SMOOTHING: #temp=smth9(temp/norm, 0.50, -0.25, False)#
+            
          do i=0,b-1            
             if (isStrSubset( a(i),"zu_sp" ))then
                legend_label_z=legend_label_zu
+	       if (height_level(0) .NE. -1)then
+	          z=zuh
+	       else
+	          z=zu
+	       end if
             else
                if (isStrSubset( a(i),"zw_sp" ))then
-                  legend_label_z=legend_label_zw     
+                  legend_label_z=legend_label_zw 
+		  if (height_level(0) .NE. -1)then
+	             z=zwh
+	          else
+	             z=zw
+	          end if   
                end if
             end if
          end do  
+
          if (isStrSubset(vNam(varn),"x"))then
             x_axis = f->k_x
-            res@tiXAxisString = "k_x"
+	    x_axis = x_axis/normx
+	    if (normx .NE. 1.)then
+               res@tiXAxisString = "k_x / "+normx
+	    else
+	       res@tiXAxisString = "k_x" 
+	    end if
          else
             x_axis = f->k_y 
-            res@tiXAxisString = "k_y"
+	    x_axis = x_axis/normx
+	    if (normx .NE. 1.)then
+               res@tiXAxisString = "k_y / "+normx
+	    else
+	       res@tiXAxisString = "k_y" 
+	    end if
          end if
         
          if (sort .EQ. "time")
-            do p=dimz-1,0,1  
-               do q=0,dimt-1
-                  do r=0,dimsizes(x_axis)-1 
-                     if (temp(q,p,r) .EQ. 0)then
-                        st=p+start_time_step
-                        print(" ")
-                        print("'"+vNam(varn)+"("+st+","+q+","+r+")' is equal 0; Logarithmic scale for y-axis cannot be used")
-                        print(" ")
-                        res@trYLog = False
-                     end if
+            do p=dimz-1,0,1
+	       if (logy .EQ. 1)then  
+                  do q=0,dimt-1
+                     do r=0,dimsizes(x_axis)-1 
+                        if (temp(q,p,r) .EQ. 0)then
+                           st=p+start_time_step
+                           print(" ")
+                           print("'"+vNam(varn)+"("+st+","+q+","+r+")' is equal 0; Logarithmic scale for y-axis and height "+z(p)+" cannot be used")
+                           print(" ")
+                           res@trYLog = False
+                        end if
+                     end do
                   end do
-               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 (norm .NE. 1)then
-                  res@tiYAxisString      = vNam(varn)+" / "+norm
+               if (normy .NE. 1.)then
+                  res@tiYAxisString      = vNam(varn)+" / "+normy
                else
                   res@tiYAxisString      = vNam(varn)
@@ -464,6 +448,6 @@
             end do
          else
-            if (sort .EQ. "layer")
-               do p=dimt-1,0,1 
+            if (sort .EQ. "height")
+               do p=0,dimt-1 	       
                   do q=0,dimz-1
                      do r=0,dimsizes(x_axis)-1 
@@ -471,5 +455,5 @@
                            st=p+start_time_step
                            print(" ")
-                           print("'"+vNam(varn)+"("+st+","+q+","+r+")' is equal 0; Logarithmic scale for y-axis cannot be used")
+                           print("'"+vNam(varn)+"("+st+","+q+","+r+")' is equal 0; Logarithmic scale for y-axis and time "+legend_label(p)+" cannot be used")
                            print(" ")
                            res@trYLog = False
@@ -481,6 +465,6 @@
                   res@gsnLeftString      = vNam(varn)
                   res@gsnRightString     = "Time = "+legend_label(p)+"h"
-                  if (norm .NE. 1)then
-                     res@tiYAxisString      = vNam(varn)+" / "+norm
+                  if (normy .NE. 1.)then
+                     res@tiYAxisString      = vNam(varn)+" / "+normy
                   else
                      res@tiYAxisString      = vNam(varn)
@@ -490,11 +474,6 @@
                   n=n+1
                end do
-            else
-               print(" ")
-               print("Please choose 'sort' either equal 'time' or 'height'")
-               print(" ")
-               exit
             end if
-         end if
+	 end if
          delete(temp)
          delete(x_axis)
@@ -504,5 +483,6 @@
    if (n .EQ. 0) then
       print(" ")
-      print("The variables 'var=Â°"+var+"Â°' do not exist on your input file")
+      print("The variables 'var="+var+"' do not exist on your input file;")
+      print("be sure to have one comma berfore and after each variable")
       print(" ")
       exit
Index: palm/trunk/SCRIPTS/NCL/timeseries.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/timeseries.ncl	(revision 183)
+++ palm/trunk/SCRIPTS/NCL/timeseries.ncl	(revision 190)
@@ -1,41 +1,44 @@
-load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl"
+6load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl"
 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
-
+ 
+;***************************************************
+; load ncl_preferences.ncl
+;***************************************************
+   
+if (isfilepresent("~/ncl_preferences.ncl")) then
+   loadscript("~/ncl_preferences.ncl")
+else
+  if (isfilepresent("~/palm/current_version/trunk/SCRIPTS/NCL/ncl_preferences.ncl")) then
+     loadscript( "~/palm/current_version/trunk/SCRIPTS/NCL/ncl_preferences.ncl")
+  else
+      print(" ")
+      print("'ncl_preferences.ncl' does not exist in $home or $home/palm/current_version/trunk/SCRIPTS/NCL/")
+      print(" ")
+      exit
+   end if
+end if
+   
 begin
- 
-   ; ***************************************************
-   ; read parameter_list
-   ; ***************************************************
-   
-   if (isfilepresent("~/.ncl_preferences")) then
-      parameter = asciiread("~/.ncl_preferences",129,"string")
-      delete(parameter@_FillValue)
-   else
-      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
+      
+   if (cross_sections .NE. 0 .OR. profiles .NE. 0 .OR. timeseries .NE. 1 .OR. spectra .NE. 0)then
+      print(" ")
+      print("Please specify the used script in 'ncl_preferences.ncl' (Line 7-10)")
+      print(" ")
+      print("Set 'timeseries' equal 1 and the other variables equal 0")
+      print(" ")
+      exit
    end if
 
-   ; ***************************************************
-   ; set up default parameter values and strings if not assigned in prompt or parameter list
-   ; ***************************************************
+   ;***************************************************
+   ; set up default parameter values and strings
+   ;***************************************************
   
-   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   
+   if (file_1 .EQ. "File in") then
+      print(" ")
+      print("Please provide 1st input file 'file_1=' in 'ncl_preferences.ncl'")
+      print(" ")
+      exit 
    else
       file_in = file_1   
@@ -43,75 +46,27 @@
    if (.not. isfilepresent(file_in)) then
       print(" ")
-      print("Your 1st input file: '"+file_in+"' does not exist")
+      print("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 
-   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    	 	; path+name of output file
-      file_out = "test"
-      if (parameter(11) .NE. "test") then
-         file_out = parameter(11)  
-      end if     
-   end if
-
-   if ( .not. isvar("no_columns") ) then    		; number of plots in one row
-      no_columns = 1
-      if (parameter(17) .NE. "1") then
-         no_columns = stringtointeger(parameter(17))  
-      end if
-   end if
-
-   if ( .not. isvar("no_lines") ) then     		; number of plot-lines on one sheet
-      no_lines = 2
-      if (parameter(19) .NE. "2") then
-         no_lines = stringtointeger(parameter(19))  
-      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
+      print(" ")
+      print("'format_out = "+format_out+"' is invalid and set to'x11'")
+      print(" ")
+      format_out="x11"
    end if  
 
-   if ( .not. isvar("var") ) then   			; variable name
-      check = True
-   end if
-
-   if ( .not. isvar("over") ) then     		        ; switches overlaying plots on
+   if (over .NE. 0 .AND. over .NE. 1) then
+      print(" ")
+      print("'over'= "+over+" is invalid and set to 0")
+      print(" ")
       over = 0
-      if (stringtointeger(parameter(37)) .NE. 0) then
-         over = stringtointeger(parameter(37))
-         if (stringtointeger(parameter(37)) .NE. 1) then
-            print(" ")
-            print("Your 'over'= "+over+" is invalid and set to 0")
-            print(" ")
-            over = 0
-         end if   
-      end if
-   else
-      if (over .NE. 0 .AND. over .NE. 1)then
-         print(" ")
-         print("Your 'over'= "+over+" is invalid and set to 0")
-         print(" ")
-         over = 0
-      end if
-   end if
-
-   ; ***************************************************
+   end if   
+ 
+
+   ;***************************************************
    ; open input file
-   ; ***************************************************
+   ;***************************************************
 
    f  = addfile(file_in , "r" )
@@ -119,5 +74,6 @@
    vNam  = getfilevarnames(f)
    print(" ")
-   print("Variable on netCDF file: " + vNam)
+   print("Variables in input file:")
+   print("- "+ vNam)
    print(" ")
    dim = dimsizes(vNam)
@@ -131,30 +87,11 @@
    nt  = dimsizes(t_all)
    delta_t=t_all(nt-1)/nt
-
-   ; ****************************************************	
+   
+   ;****************************************************	
    ; start of time step and different types of mistakes that could be done
-   ; ****************************************************
-
-   if ( .not. isvar("start_time_step") ) then   	
-      start_time_step=t_all(0)/3600
-      if (parameter(13) .NE. "t(0)") then
-         if (stringtodouble(parameter(13)) .GE. t_all(nt-1)/3600)
-            print(" ")
-            print("'start_time_step' = "+ parameter(13) +"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(" ")
-            exit
-         end if
-         if (stringtofloat(parameter(13)) .LT. t_all(0)/3600)
-            print(" ")
-            print("'start_time_step' = "+ parameter(13) +"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(" ")
-            exit
-         end if
-         start_time_step=stringtodouble(parameter(13)) 
-      end if
+   ;****************************************************
+
+   if (start_time_step .EQ. -1.) then   	
+      start_time_step=t_all(0)/3600      
    else 
       if (start_time_step .GE. t_all(nt-1)/3600)
@@ -175,7 +112,6 @@
       end if
    end if
-   start_time_step = start_time_step*3600
    do i=0,nt-2     
-      if (start_time_step .GE. t_all(i)-delta_t/2 .AND. start_time_step .LT. t_all(i)+delta_t/2)then
+      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
          break
@@ -185,38 +121,19 @@
       st=nt-2   
    end if
-      
-   ; ****************************************************
+   if (.not. isvar("st"))then
+      print(" ")
+      print("'start_time_step' = "+ start_time_step +"h is invalid")
+      print(" ")
+      print("Please select another 'start_time_step'")
+      print(" ")
+      exit
+   end if
+      
+   ;****************************************************
    ; end of time step and different types of mistakes that could be done
-   ; ****************************************************
-
-   if ( .not. isvar("end_time_step") ) then     	
-      end_time_step = t_all(nt-1)/3600
-      if (parameter(15) .NE. "t(end)") then
-         if (stringtodouble(parameter(15)) .LE. t_all(0)/3600)
-            print(" ")
-            print("'end_time_step' = "+parameter(15)+ "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(" ")
-            exit
-         end if
-         if (stringtodouble(parameter(15)) .GT. t_all(nt-1)/3600)
-            print(" ")
-            print("'end_time_step' = "+ parameter(15) +"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(" ")
-            exit
-         end if
-         if (stringtodouble(parameter(15)) .LE. start_time_step/3600)
-            print(" ")
-            print("'end_time_step' = "+ parameter(15) +"h is equal or lower than 'start_time_step' = "+parameter(13)+"h")
-            print(" ")
-            print("Please select another 'start_time_step' or 'end_time_step'")
-            print(" ")
-            exit
-         end if
-         end_time_step = stringtodouble(parameter(15))
-      end if    
+   ;****************************************************
+
+   if (end_time_step .EQ. -1.) then     	
+      end_time_step = t_all(nt-1)/3600  
    else
       if (end_time_step .LE. t_all(0)/3600)
@@ -245,11 +162,19 @@
       end if
    end if
-   end_time_step = end_time_step*3600
    do i=0,nt-1     
-      if (end_time_step .GE. t_all(i)-delta_t/2 .AND. end_time_step .LT. t_all(i)+delta_t/2)then
+      if (end_time_step .GE. (t_all(i)-delta_t/2)/3600 .AND. end_time_step .LT. (t_all(i)+delta_t/2)/3600)then
          et=i
          break
       end if
    end do 
+   
+   if (.not. isvar("et"))then
+      print(" ")
+      print("'end_time_step' = "+ end_time_step +"h is invalid")
+      print(" ")
+      print("Please select another 'end_time_step'")
+      print(" ")
+      exit
+   end if
  
    delete(start_time_step)
@@ -358,9 +283,6 @@
          check = True
       end if 
-      if( isvar("var") ) then     		
-         check = isStrSubset( var,","+vNam(varn)+"," )
-      end if
-      if (parameter(21) .NE. "variables") then
-         var = parameter(21) 
+  
+      if (var .NE. "all") then
          check = isStrSubset( var,","+vNam(varn)+"," )
       end if 
@@ -519,5 +441,6 @@
    if (count_var .EQ. 0) then
       print(" ")
-      print("The variables 'var=Â°"+var+"Â°' do not exist on your input file")
+      print("The variables 'var="+var+"' do not exist on your input file;")
+      print("be sure to have one comma berfore and after each variable")
       print(" ")
       exit
@@ -531,9 +454,6 @@
          check = True
       end if     
-      if( isvar("var") ) then     		
-         check = isStrSubset( var,","+vNam(varn)+"," )
-      end if
-      if (parameter(21) .NE. "variables") then
-         var = parameter(21) 
+    
+      if (var .NE. "all") then
          check = isStrSubset( var,","+vNam(varn)+"," ) 
       end if 
@@ -709,9 +629,6 @@
          check = True
       end if    
-      if( isvar("var") ) then     		
-         check = isStrSubset( var,","+vNam(varn)+"," )
-      end if
-      if (parameter(21) .NE. "variables") then
-         var = parameter(21) 
+  
+      if (var.NE. "all") then
          check = isStrSubset( var,","+vNam(varn)+"," ) 
       end if 
