Index: palm/trunk/SCRIPTS/NCL/profiles.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 320)
+++ palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 324)
@@ -324,13 +324,13 @@
             files(0)=file_in(nof)+".nc"
             do i=1,end_f(nof)
-   	    if (isfilepresent(file_in(nof)+"."+i+".nc"))then    
-               files(i)=file_in(nof)+"."+i+".nc"
-	    else
-	       print(" ")
-               print("Input file: '"+file_in(nof)+"."+i+".nc' does not exist")
-               print(" ")
-               exit  
-	    end if	    
-         end do         
+   	       if (isfilepresent(file_in(nof)+"."+i+".nc"))then    
+                  files(i)=file_in(nof)+"."+i+".nc"
+	       else
+	          print(" ")
+                  print("Input file: '"+file_in(nof)+"."+i+".nc' does not exist")
+                  print(" ")
+                  exit  
+	       end if	    
+            end do         
          else
             print(" ")
@@ -805,5 +805,9 @@
    end if
    
-   delta_t=t_all(nt-1)/nt
+   if (nt .EQ. 1)then
+      delta_t=t_all(nt-1)/nt
+   else
+      delta_t=(t_all(nt-1)-t_all(0))/(nt-1)
+   end if
 
    ; ****************************************************	
@@ -872,4 +876,6 @@
    do i=0,nt-1     
       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
+         print((t_all(i)-delta_t/2)/3600)
+	 print((t_all(i)+delta_t/2)/3600) 
          et=i
          break
@@ -883,5 +889,5 @@
       print(" ")
       exit
-   end if
+   end if   
 
    delete(start_time_step)
@@ -889,4 +895,7 @@
    delete(end_time_step)
    end_time_step=round(et,3)
+   
+   print(start_time_step)
+   print(end_time_step)
 
    print(" ")
@@ -1459,4 +1468,25 @@
                exit
             end if 
+	    if (abs(min(data(varn,:,:))) .GT. 10)then
+	       min_value = abs(0.01*min(data(varn,:,:)))
+	       max_value = abs(0.01*max(data(varn,:,:)))
+	    else
+	       if (abs(min(data(varn,:,:))) .LT. 0.01 .AND. abs(max(data(varn,:,:))) .GT. 0.01)then
+	          min_value = abs(0.1*max(data(varn,:,:)))
+	          max_value = abs(0.1*max(data(varn,:,:)))
+	       else
+	          if (abs(max(data(varn,:,:))) .LT. 0.01 .AND. abs(min(data(varn,:,:))) .GT. 0.01)then
+	             min_value = abs(0.1*min(data(varn,:,:)))
+	             max_value = abs(0.1*min(data(varn,:,:)))
+	          else
+	             min_value = abs(0.1*min(data(varn,:,:)))
+	             max_value = abs(0.1*max(data(varn,:,:)))
+	          end if
+	       end if
+	    end if 
+	    if (min(data(varn,:,:)) .EQ. 0 .AND. max(data(varn,:,:)) .EQ. 0)then
+	       min_value = 0.1
+	       max_value = 0.1
+	    end if
             mini(n_o)=min(data(varn,:,:))
             maxi(n_o)=max(data(varn,:,:)) 
@@ -1520,5 +1550,5 @@
                z = f_att->$vNam(varn+1)$ 
                unit(varn) = temp_att@units
-               data(varn,:,:) = temp(start_time_step:end_time_step,:) 
+               data(varn,:,:) = temp(start_time_step:end_time_step,:)
             end if
          else 
@@ -1550,4 +1580,26 @@
             z=z/norm_z
          end if
+	 
+	 if (abs(min(data(varn,:,:))) .GT. 10)then
+	    min_value = abs(0.01*min(data(varn,:,:)))
+	    max_value = abs(0.01*max(data(varn,:,:)))
+	 else
+	    if (abs(min(data(varn,:,:))) .LT. 0.01 .AND. abs(max(data(varn,:,:))) .GT. 0.01)then
+	       min_value = abs(0.1*max(data(varn,:,:)))
+	       max_value = abs(0.1*max(data(varn,:,:)))
+	    else
+	       if (abs(max(data(varn,:,:))) .LT. 0.01 .AND. abs(min(data(varn,:,:))) .GT. 0.01)then
+	          min_value = abs(0.1*min(data(varn,:,:)))
+	          max_value = abs(0.1*min(data(varn,:,:)))
+	       else
+	          min_value = abs(0.1*min(data(varn,:,:)))
+	          max_value = abs(0.1*max(data(varn,:,:)))
+	       end if
+	    end if
+	 end if 
+	 if (min(data(varn,:,:)) .EQ. 0 .AND. max(data(varn,:,:)) .EQ. 0)then
+	    min_value = 0.1
+	    max_value = 0.1
+	 end if
     
          if (over .EQ. 0) then  
@@ -1558,10 +1610,10 @@
             res@trYMaxF            = max_z 
             if (xs .EQ. -1) then 
-               res@trXMinF            = min(data(varn,:,:))
+               res@trXMinF            = min(data(varn,:,:))-min_value
             else 
                res@trXMinF            = xs
             end if
             if (xe .EQ. -1) then 
-               res@trXMaxF            = max(data(varn,:,:)) 
+               res@trXMaxF            = max(data(varn,:,:))+max_value 
             else 
                res@trXMaxF            = xe  
@@ -1571,6 +1623,6 @@
 
             if (vNam(varn) .EQ. "u") then 
-               miniu=min(data(varn,:,:))
-               maxiu=max(data(varn,:,:))
+               miniu=min(data(varn,:,:))-min_value
+               maxiu=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 0
@@ -1580,5 +1632,5 @@
 		  res@tiXAxisString      = "["+unit(varn)+"]"
                   res@gsnRightString     = " "                 
-                  if (xs .EQ. -1) then 
+                  if (xs .EQ. -1) then  
                      res@trXMinF            = miniu
                   else 
@@ -1594,6 +1646,6 @@
             end if
             if (vNam(varn) .EQ. "v") then
-               miniv=min(data(varn,:,:))
-               maxiv=max(data(varn,:,:))
+               miniv=min(data(varn,:,:))-min_value
+               maxiv=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyMonoDashPattern = True
@@ -1604,5 +1656,5 @@
 		  res@tiXAxisString      = "["+unit(varn)+"]"
                   res@gsnRightString     = " "                  
-                  if (xs .EQ. -1) then 
+                  if (xs .EQ. -1) then
                      res@trXMinF            = miniv
                   else 
@@ -1610,5 +1662,5 @@
                   end if
                   if (xe .EQ. -1) then
-                     res@trXMaxF            = maxiv 
+                     res@trXMaxF            = maxiv
                   else 
                      res@trXMaxF            = xe  
@@ -1618,6 +1670,6 @@
             end if
             if (vNam(varn) .EQ. "w") then
-               miniw=min(data(varn,:,:))
-               maxiw=max(data(varn,:,:))
+               miniw=min(data(varn,:,:))-min_value
+               maxiw=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern = 2
@@ -1633,5 +1685,5 @@
                   end if
                   if (xe .EQ. -1) then
-                     res@trXMaxF            = maxiw 
+                     res@trXMaxF            = maxiw
                   else 
                      res@trXMaxF            = xe  
@@ -1642,6 +1694,6 @@
 
             if (vNam(varn) .EQ. "pt") then
-               minipt=min(data(varn,:,:))
-               maxipt=max(data(varn,:,:))
+               minipt=min(data(varn,:,:))-min_value
+               maxipt=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 0
@@ -1656,5 +1708,5 @@
                      res@trXMinF            = xs
                   end if
-                  if (xe .EQ. -1) then        
+                  if (xe .EQ. -1) then       
                      res@trXMaxF            = maxipt 
                   else 
@@ -1665,6 +1717,6 @@
             end if
             if (vNam(varn) .EQ. "vpt") then
-               minivpt=min(data(varn,:,:))
-               maxivpt=max(data(varn,:,:))
+               minivpt=min(data(varn,:,:))-min_value
+               maxivpt=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 1
@@ -1675,9 +1727,9 @@
                   res@gsnRightString     = " "
                   if (xs .EQ. -1) then 
-                     res@trXMinF            = minivpt
-                  else 
-                     res@trXMinF            = xs
-                  end if
-                  if (xe .EQ. -1) then        
+                     res@trXMinF            = minivpt 
+                  else 
+                     res@trXMinF            = xs
+                  end if
+                  if (xe .EQ. -1) then       
                      res@trXMaxF            = maxivpt 
                   else 
@@ -1688,6 +1740,6 @@
             end if
             if (vNam(varn) .EQ. "lpt") then
-               minilpt=min(data(varn,:,:))
-               maxilpt=max(data(varn,:,:))
+               minilpt=min(data(varn,:,:))-min_value
+               maxilpt=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 2
@@ -1703,5 +1755,5 @@
                   end if
                   if (xe .EQ. -1) then        
-                     res@trXMaxF            = maxilpt 
+                     res@trXMaxF            = maxilpt
                   else 
                      res@trXMaxF            = xe  
@@ -1712,6 +1764,6 @@
 
             if (vNam(varn) .EQ. "q") then
-               miniq=min(data(varn,:,:))
-               maxiq=max(data(varn,:,:))
+               miniq=min(data(varn,:,:))-min_value
+               maxiq=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 0
@@ -1727,5 +1779,5 @@
                   end if
                   if (xe .EQ. -1) then        
-                     res@trXMaxF            = maxilq 
+                     res@trXMaxF            = maxilq
                   else 
                      res@trXMaxF            = xe  
@@ -1735,6 +1787,6 @@
             end if
             if (vNam(varn) .EQ. "qv") then
-               miniqv=min(data(varn,:,:))
-               maxiqv=max(data(varn,:,:))
+               miniqv=min(data(varn,:,:))-min_value
+               maxiqv=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then 
                   res@xyDashPattern  = 1
@@ -1749,5 +1801,5 @@
                      res@trXMinF            = xs
                   end if
-                  if (xe .EQ. -1) then        
+                  if (xe .EQ. -1) then         
                      res@trXMaxF            = maxilqv 
                   else 
@@ -1758,6 +1810,6 @@
             end if
             if (vNam(varn) .EQ. "ql") then
-               miniql=min(data(varn,:,:))
-               maxiql=max(data(varn,:,:))
+               miniql=min(data(varn,:,:))-min_value
+               maxiql=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 2
@@ -1772,5 +1824,5 @@
                      res@trXMinF            = xs
                   end if
-                  if (xe .EQ. -1) then        
+                  if (xe .EQ. -1) then       
                      res@trXMaxF            = maxiql 
                   else 
@@ -1782,6 +1834,6 @@
 
             if (vNam(varn) .EQ. "e") then
-               minie=min(data(varn,:,:))
-               maxie=max(data(varn,:,:))
+               minie=min(data(varn,:,:))-min_value
+               maxie=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 0
@@ -1796,5 +1848,5 @@
                      res@trXMinF            = xs
                   end if
-                  if (xe .EQ. -1) then        
+                  if (xe .EQ. -1) then       
                      res@trXMaxF            = maxie 
                   else 
@@ -1805,6 +1857,6 @@
             end if
             if (vNam(varn) .EQ. "es") then
-               minies=min(data(varn,:,:))
-               maxies=max(data(varn,:,:))
+               minies=min(data(varn,:,:))-min_value
+               maxies=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 1
@@ -1814,5 +1866,5 @@
 		  res@tiXAxisString      = "["+unit(varn)+"]"
                   res@gsnRightString     = " "
-                  if (xs .EQ. -1) then 
+                  if (xs .EQ. -1) then
                      res@trXMinF            = minies
                   else 
@@ -1820,5 +1872,5 @@
                   end if
                   if (xe .EQ. -1) then        
-                     res@trXMaxF            = maxies 
+                     res@trXMaxF            = maxies
                   else 
                      res@trXMaxF            = xe  
@@ -1829,6 +1881,6 @@
 
             if (vNam(varn) .EQ. "km") then
-               minikm=min(data(varn,:,:))
-               maxikm=max(data(varn,:,:))
+               minikm=min(data(varn,:,:))-min_value
+               maxikm=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 0
@@ -1838,10 +1890,10 @@
 		  res@tiXAxisString      = "["+unit(varn)+"]"
                   res@gsnRightString     = " "
-                  if (xs .EQ. -1) then 
+                  if (xs .EQ. -1) then
                      res@trXMinF            = minikm
                   else 
                      res@trXMinF            = xs
                   end if
-                  if (xe .EQ. -1) then        
+                  if (xe .EQ. -1) then      
                      res@trXMaxF            = maxikm
                   else 
@@ -1852,6 +1904,6 @@
             end if
             if (vNam(varn) .EQ. "kh") then
-               minikh=min(data(varn,:,:))
-               maxikh=max(data(varn,:,:))
+               minikh=min(data(varn,:,:))-min_value
+               maxikh=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 1
@@ -1866,5 +1918,5 @@
                      res@trXMinF            = xs
                   end if
-                  if (xe .EQ. -1) then        
+                  if (xe .EQ. -1) then     
                      res@trXMaxF            = maxikh
                   else 
@@ -1876,6 +1928,6 @@
 
             if (vNam(varn) .EQ. "wpup") then
-               miniwpup=min(data(varn,:,:))
-               maxiwpup=max(data(varn,:,:))
+               miniwpup=min(data(varn,:,:))-min_value
+               maxiwpup=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 0
@@ -1890,5 +1942,5 @@
                      res@trXMinF            = xs
                   end if
-                  if (xe .EQ. -1) then        
+                  if (xe .EQ. -1) then
                      res@trXMaxF            = maxiwpup 
                   else 
@@ -1899,6 +1951,6 @@
             end if
             if (vNam(varn) .EQ. "wsus") then
-               miniwsus=min(data(varn,:,:))
-               maxiwsus=max(data(varn,:,:))
+               miniwsus=min(data(varn,:,:))-min_value
+               maxiwsus=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 1
@@ -1913,5 +1965,5 @@
                      res@trXMinF            = xs
                   end if
-                  if (xe .EQ. -1) then        
+                  if (xe .EQ. -1) then      
                      res@trXMaxF            = maxiwsus 
                   else 
@@ -1922,6 +1974,6 @@
             end if
             if (vNam(varn) .EQ. "wu") then
-               miniwu=min(data(varn,:,:))
-               maxiwu=max(data(varn,:,:))
+               miniwu=min(data(varn,:,:))-min_value
+               maxiwu=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 2 
@@ -1931,10 +1983,10 @@
 		  res@tiXAxisString      = "["+unit(varn)+"]"
                   res@gsnRightString     = " "
-                  if (xs .EQ. -1) then 
+                  if (xs .EQ. -1) then
                      res@trXMinF            = miniwu
                   else 
                      res@trXMinF            = xs
                   end if
-                  if (xe .EQ. -1) then        
+                  if (xe .EQ. -1) then 
                      res@trXMaxF            = maxiwu 
                   else 
@@ -1946,6 +1998,6 @@
 
             if (vNam(varn) .EQ. "wpvp") then
-               miniwpvp=min(data(varn,:,:))
-               maxiwpvp=max(data(varn,:,:))
+               miniwpvp=min(data(varn,:,:))-min_value
+               maxiwpvp=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 0
@@ -1960,5 +2012,5 @@
                      res@trXMinF            = xs
                   end if
-                  if (xe .EQ. -1) then        
+                  if (xe .EQ. -1) then     
                      res@trXMaxF            = maxiwpvp 
                   else 
@@ -1969,6 +2021,6 @@
             end if
             if (vNam(varn) .EQ. "wsvs") then
-               miniwsvs=min(data(varn,:,:))
-               maxiwsvs=max(data(varn,:,:))
+               miniwsvs=min(data(varn,:,:))-min_value
+               maxiwsvs=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 1
@@ -1978,10 +2030,10 @@
 		  res@tiXAxisString      = "["+unit(varn)+"]"
                   res@gsnRightString     = " "
-                  if (xs .EQ. -1) then 
+                  if (xs .EQ. -1) then
                      res@trXMinF            = miniwsvs
                   else 
                      res@trXMinF            = xs
                   end if
-                  if (xe .EQ. -1) then        
+                  if (xe .EQ. -1) then      
                      res@trXMaxF            = maxiwsvs 
                   else 
@@ -1992,6 +2044,6 @@
             end if
             if (vNam(varn) .EQ. "wv") then
-               miniwv=min(data(varn,:,:))
-               maxiwv=max(data(varn,:,:))
+               miniwv=min(data(varn,:,:))-min_value
+               maxiwv=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 2 
@@ -2016,6 +2068,6 @@
 
             if (vNam(varn) .EQ. "wpptp") then
-               miniwpptp=min(data(varn,:,:))
-               maxiwpptp=max(data(varn,:,:))
+               miniwpptp=min(data(varn,:,:))-min_value
+               maxiwpptp=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 0
@@ -2039,6 +2091,6 @@
             end if
             if (vNam(varn) .EQ. "wspts") then
-               miniwspts=min(data(varn,:,:))
-               maxiwspts=max(data(varn,:,:))
+               miniwspts=min(data(varn,:,:))-min_value
+               maxiwspts=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 1
@@ -2062,6 +2114,6 @@
             end if
             if (vNam(varn) .EQ. "wpt") then
-               miniwpt=min(data(varn,:,:))
-               maxiwpt=max(data(varn,:,:))
+               miniwpt=min(data(varn,:,:))-min_value
+               maxiwpt=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 2 
@@ -2086,6 +2138,6 @@
 
             if (vNam(varn) .EQ. "wsptsBC") then
-               miniwsptsBC=min(data(varn,:,:))
-               maxiwsptsBC=max(data(varn,:,:))
+               miniwsptsBC=min(data(varn,:,:))-min_value
+               maxiwsptsBC=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 0
@@ -2109,6 +2161,6 @@
             end if             
             if (vNam(varn) .EQ. "wptBC") then
-               miniwptBC=min(data(varn,:,:))
-               maxiwptBC=max(data(varn,:,:))
+               miniwptBC=min(data(varn,:,:))-min_value
+               maxiwptBC=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 1
@@ -2133,6 +2185,6 @@
 
             if (vNam(varn) .EQ. "wpvptp") then
-               miniwpvptp=min(data(varn,:,:))
-               maxiwpvptp=max(data(varn,:,:))
+               miniwpvptp=min(data(varn,:,:))-min_value
+               maxiwpvptp=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 0
@@ -2156,6 +2208,6 @@
             end if
             if (vNam(varn) .EQ. "wsvpts") then
-               miniwsvpts=min(data(varn,:,:))
-               maxiwsvpts=max(data(varn,:,:))
+               miniwsvpts=min(data(varn,:,:))-min_value
+               maxiwsvpts=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 1
@@ -2179,6 +2231,6 @@
             end if
             if (vNam(varn) .EQ. "wvpt") then
-               miniwvpt=min(data(varn,:,:))
-               maxiwvpt=max(data(varn,:,:))
+               miniwvpt=min(data(varn,:,:))-min_value
+               maxiwvpt=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 2 
@@ -2203,6 +2255,6 @@
 
             if (vNam(varn) .EQ. "wpqp") then
-               miniwpqp=min(data(varn,:,:))
-               maxiwpqp=max(data(varn,:,:))
+               miniwpqp=min(data(varn,:,:))-min_value
+               maxiwpqp=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 0
@@ -2226,6 +2278,6 @@
             end if
             if (vNam(varn) .EQ. "wsqs") then
-               miniwsqs=min(data(varn,:,:))
-               maxiwsqs=max(data(varn,:,:))
+               miniwsqs=min(data(varn,:,:))-min_value
+               maxiwsqs=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 1
@@ -2249,6 +2301,6 @@
             end if
             if (vNam(varn) .EQ. "wq") then
-               miniwq=min(data(varn,:,:))
-               maxiwq=max(data(varn,:,:))
+               miniwq=min(data(varn,:,:))-min_value
+               maxiwq=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 2
@@ -2273,6 +2325,6 @@
 
             if (vNam(varn) .EQ. "wpqvp") then
-               miniwpqvp=min(data(varn,:,:))
-               maxiwpqvp=max(data(varn,:,:))
+               miniwpqvp=min(data(varn,:,:))-min_value
+               maxiwpqvp=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 0 
@@ -2296,6 +2348,6 @@
             end if
             if (vNam(varn) .EQ. "wsqvs") then
-               miniwsqvs=min(data(varn,:,:))
-               maxiwsqvs=max(data(varn,:,:))
+               miniwsqvs=min(data(varn,:,:))-min_value
+               maxiwsqvs=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 1
@@ -2319,6 +2371,6 @@
             end if
             if (vNam(varn) .EQ. "wqv") then
-               miniwqv=min(data(varn,:,:))
-               maxiwqv=max(data(varn,:,:))
+               miniwqv=min(data(varn,:,:))-min_value
+               maxiwqv=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 2
@@ -2343,6 +2395,6 @@
 
             if (vNam(varn) .EQ. "wpsp") then
-               miniwpsp=min(data(varn,:,:))
-               maxiwpsp=max(data(varn,:,:))
+               miniwpsp=min(data(varn,:,:))-min_value
+               maxiwpsp=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 0
@@ -2366,6 +2418,6 @@
             end if 
             if (vNam(varn) .EQ. "wsss") then
-               miniwsss=min(data(varn,:,:))
-               maxiwsss=max(data(varn,:,:))
+               miniwsss=min(data(varn,:,:))-min_value
+               maxiwsss=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 1 
@@ -2389,6 +2441,6 @@
             end if
             if (vNam(varn) .EQ. "ws") then
-               miniws=min(data(varn,:,:))
-               maxiws=max(data(varn,:,:))
+               miniws=min(data(varn,:,:))-min_value
+               maxiws=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 2
@@ -2413,6 +2465,6 @@
 
             if (vNam(varn) .EQ. "wpsap") then
-               miniwpsap=min(data(varn,:,:))
-               maxiwpsap=max(data(varn,:,:))
+               miniwpsap=min(data(varn,:,:))-min_value
+               maxiwpsap=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 0
@@ -2436,6 +2488,6 @@
             end if
             if (vNam(varn) .EQ. "wssas") then
-               miniwssas=min(data(varn,:,:))
-               maxiwssas=max(data(varn,:,:))
+               miniwssas=min(data(varn,:,:))-min_value
+               maxiwssas=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 1
@@ -2459,6 +2511,6 @@
             end if
             if (vNam(varn) .EQ. "wsa") then
-               miniwsa=min(data(varn,:,:))
-               maxiwsa=max(data(varn,:,:))
+               miniwsa=min(data(varn,:,:))-min_value
+               maxiwsa=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 2
@@ -2483,6 +2535,6 @@
 
             if (vNam(varn) .EQ. "us2") then
-               minius2=min(data(varn,:,:))
-               maxius2=max(data(varn,:,:))
+               minius2=min(data(varn,:,:))-min_value
+               maxius2=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 0
@@ -2506,6 +2558,6 @@
             end if
             if (vNam(varn) .EQ. "vs2") then
-               minivs2=min(data(varn,:,:))
-               maxivs2=max(data(varn,:,:))
+               minivs2=min(data(varn,:,:))-min_value
+               maxivs2=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 1
@@ -2529,6 +2581,6 @@
             end if
             if (vNam(varn) .EQ. "ws2") then
-               miniws2=min(data(varn,:,:))
-               maxiws2=max(data(varn,:,:))
+               miniws2=min(data(varn,:,:))-min_value
+               maxiws2=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 2 
@@ -2553,6 +2605,6 @@
 
             if (vNam(varn) .EQ. "wsususodz") then
-               miniwsususodz=min(data(varn,:,:))
-               maxiwsususodz=max(data(varn,:,:))
+               miniwsususodz=min(data(varn,:,:))-min_value
+               maxiwsususodz=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 0
@@ -2576,6 +2628,6 @@
             end if
             if (vNam(varn) .EQ. "wspsodz") then
-               miniwspsodz=min(data(varn,:,:))
-               maxiwspsodz=max(data(varn,:,:))
+               miniwspsodz=min(data(varn,:,:))-min_value
+               maxiwspsodz=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 1
@@ -2599,6 +2651,6 @@
             end if
             if (vNam(varn) .EQ. "wpeodz") then
-               miniwpeodz=min(data(varn,:,:))
-               maxiwpeodz=max(data(varn,:,:))
+               miniwpeodz=min(data(varn,:,:))-min_value
+               maxiwpeodz=max(data(varn,:,:))+max_value
                if (over .EQ. 1) then
                   res@xyDashPattern  = 2 
@@ -2622,4 +2674,5 @@
             end if 
          if (no_files .GT. 1) then
+	    print("nof="+nof+" und n="+n)
             multi_plot(nof,n)=plot(n) 
             max_nof(nof,n)=max(data(varn,:,:))
@@ -2635,4 +2688,5 @@
          end if
          delete(temp) 
+	 delete(temp_att)
       end if          
    end do
@@ -2680,5 +2734,6 @@
          res@gsnLeftString  = name(0,pl)
          res@gsnRightString = unit_(0,pl) 
-   
+         
+	 data_0(:,:) = min(min_nof(:,pl))
          plot0 = gsn_csm_xy(wks,data_0(:,:),z_(pl,:),res)
 
@@ -2691,11 +2746,11 @@
          lgres@lgLabelFont        = "helvetica"    
          lgres@lgLabelFontHeightF = font_size_legend            
-         lgres@vpWidthF           = max(string_len)*0.012           
-         lgres@vpHeightF          = 0.04*no_files          
+         lgres@vpWidthF           = max(string_len)*0.015           
+         lgres@vpHeightF          = 0.03*no_files          
          lgres@lgDashIndexes      = multi_dash(no_files-1:0)
          lbid = gsn_create_legend(wks,no_files,multi_legend(no_files-1:0),lgres)       
 
          amres = True
-         amres@amParallelPosF   = max(string_len)*0.01+0.78		    
+         amres@amParallelPosF   = max(string_len)*0.012+0.78		    
          amres@amOrthogonalPosF = -0.0315*no_files+0.431         
          annoid1 = gsn_add_annotation(plot0,lbid,amres) 
@@ -2819,4 +2874,26 @@
 
             z=z/norm_z
+	    
+	    if (abs(min(data(varn,:,:))) .GT. 10)then
+	       min_value = abs(0.01*min(data(varn,:,:)))
+	       max_value = abs(0.01*max(data(varn,:,:)))
+	    else
+	       if (abs(min(data(varn,:,:))) .LT. 0.01 .AND. abs(max(data(varn,:,:))) .GT. 0.01)then
+	          min_value = abs(0.1*max(data(varn,:,:)))
+	          max_value = abs(0.1*max(data(varn,:,:)))
+	       else
+	          if (abs(max(data(varn,:,:))) .LT. 0.01 .AND. abs(min(data(varn,:,:))) .GT. 0.01)then
+	             min_value = abs(0.1*min(data(varn,:,:)))
+	             max_value = abs(0.1*min(data(varn,:,:)))
+	          else
+	             min_value = abs(0.1*min(data(varn,:,:)))
+	             max_value = abs(0.1*max(data(varn,:,:)))
+	          end if
+	       end if
+	    end if 
+	    if (min(data(varn,:,:)) .EQ. 0 .AND. max(data(varn,:,:)) .EQ. 0)then
+	       min_value = 0.1
+	       max_value = 0.1
+	    end if
 
             res@gsnLeftString      = vNam(varn)
@@ -2828,10 +2905,10 @@
 
             if (xs .EQ. -1) then 
-               res@trXMinF = min(data(varn,:,:))
+               res@trXMinF = min(data(varn,:,:))-min_value
             else 
                res@trXMinF = xs
             end if
             if (xe .EQ. -1) then 
-               res@trXMaxF = max(data(varn,:,:))
+               res@trXMaxF = max(data(varn,:,:))+max_value
             else 
                res@trXMaxF = xe  
Index: palm/trunk/SCRIPTS/NCL/spectra.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/spectra.ncl	(revision 320)
+++ palm/trunk/SCRIPTS/NCL/spectra.ncl	(revision 324)
@@ -402,4 +402,6 @@
          color = ispan(2,237,step)
       end if
+   else
+      color = 2
    end if
    if ( dash .eq. 0 ) then
