Index: palm/trunk/SCRIPTS/NCL/cross_sections.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 759)
+++ palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 769)
@@ -454,15 +454,9 @@
          st=i
          break
+      else
+         st=0
       end if
    end do
-   
-   if (.not. isvar("st"))then
-      print(" ")
-      print("'start_time_step' = "+ start_time_step +"h is invalid")
-      print(" ")
-      print("Select another 'start_time_step'")
-      print(" ")
-      exit
-   end if
+
         
    ; ****************************************************
@@ -506,15 +500,8 @@
          et=i
          break
+      else
+         et=0
       end if
    end do 
-   
-   if (.not. isvar("et"))then
-      print(" ")
-      print("'end_time_step' = "+ end_time_step +"h is invalid")
-      print(" ")
-      print("Select another 'end_time_step'")
-      print(" ")
-      exit
-   end if
   
    delete(start_time_step)
@@ -1421,4 +1408,5 @@
    n      = 0
    no_zu1 = 0
+   no_topo= 0
 
    ;****************************************************
@@ -1461,5 +1449,4 @@
       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.         \
@@ -1485,5 +1472,9 @@
          if (xyc .EQ. 1) then
 	    temp = f[:]->$vNam(varn)$
-	    data_att = f_att->$vNam(varn)$
+            if (vNam(varn) .eq. "zwwi" .or. vNam(varn) .eq. "zusi")
+	       dummy=0
+            else
+               data_att = f_att->$vNam(varn)$
+            end if
             if(vNam(varn) .eq. "lwps_xy" .or. vNam(varn) .eq. "pras_xy"     \
               .or. vNam(varn) .eq. "prrs_xy" .or. vNam(varn) .eq. "qsws_xy" \
@@ -1499,5 +1490,11 @@
               no_zu1=no_zu1+1
             else
-              data(varn,:,:,:,:)=temp(:,zs:ze,ys:ye,xs:xe) 
+              if (vNam(varn) .eq. "zwwi" .or. vNam(varn) .eq. "zusi")
+                  ;these variables depend on x and y
+                  data(varn,0,0,:,:)=doubletofloat(temp(ys:ye,xs:xe))
+                  no_topo=no_topo+1
+               else
+                  data(varn,:,:,:,:)=temp(:,zs:ze,ys:ye,xs:xe) 
+               end if
             end if
             delete(temp)	    	
@@ -1527,6 +1524,10 @@
                                                0:(ze-zs),0:(ye-ys),0:(xe-xs)))
 	 
-	 unit(varn) = data_att@units
-         delete(data_att)
+         if (vNam(varn) .eq. "zwwi" .or. vNam(varn) .eq. "zusi")
+	    unit(varn) = "meters"
+          else
+            unit(varn) = data_att@units
+            delete(data_att)
+          end if
 
       end if
@@ -1550,5 +1551,4 @@
       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.         \
@@ -1627,6 +1627,6 @@
       plot=new((/no_time*no_layer/),graphic)
    else
-      plot=new((/no_time*no_layer*no_var - no_time*(no_layer-1)*no_zu1/)\
-                                                                ,graphic)
+      plot=new((/no_time*no_layer*(no_var-no_topo) + no_topo - \
+                       no_time*(no_layer-1)*no_zu1/),graphic)
    end if
    dim_plot=dimsizes(plot)
@@ -1756,5 +1756,4 @@
       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.         \
@@ -1829,8 +1828,29 @@
                          loe = 0
                          level = "=" + zu1(0) + "m"
+                      else
+                         loe = laye
+                     end if
+
+                     if(vNam(varn) .eq. "zwwi"  .or. \
+                        vNam(varn) .eq. "zusi") then
+                         loe = 0
+                         los = 0
+                         lie  = 0
+                         lis = 0
+                         level = ""
+                      else
+                         lis = start_time_step
+                         lie = end_time_step
+                         los = lays
+                         loe = laye
                      end if
                     
-                     cs_res@gsnCenterString = "t=" + \
-                       decimalPlaces(t_all(li)/3600,2,True) +"h  z"+level
+                     if(vNam(varn) .eq. "zwwi"  .or. \
+                        vNam(varn) .eq. "zusi") then
+                         cs_res@gsnCenterString = ""
+                     else
+                         cs_res@gsnCenterString = "t=" + \
+                          decimalPlaces(t_all(li)/3600,2,True) +"h  z"+level
+                     end if
 
                      if (vector .EQ. 1 .AND. plotvec .EQ. "plotvec") then
@@ -1894,8 +1914,29 @@
                          lie = 0
                          level = "=" + zu1(0) + "m"
+                     else
+                         lie = laye
                      end if
-                
-                     cs_res@gsnCenterString = "t=" + \
-                           decimalPlaces(t_all(lo)/3600,2,True) + "h  z"+ level
+
+                     if(vNam(varn) .eq. "zwwi"  .or. \
+                        vNam(varn) .eq. "zusi") then
+                         lie = 0
+                         lis = 0
+                         loe = 0
+                         los = 0
+                         level = ""
+                     else
+                         lis = lays
+                         lie = laye
+                         los = start_time_step 
+                         loe = end_time_step
+                     end if
+
+                     if(vNam(varn) .eq. "zwwi"  .or. \
+                        vNam(varn) .eq. "zusi") then
+                         cs_res@gsnCenterString = ""
+                     else
+                         cs_res@gsnCenterString = "t=" + \
+                          decimalPlaces(t_all(li)/3600,2,True) +"h  z"+level
+                     end if
 
                      if (vector .EQ. 1 .AND. plotvec .EQ. "plotvec") then
Index: palm/trunk/SCRIPTS/NCL/profiles.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 759)
+++ palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 769)
@@ -1048,14 +1048,8 @@
          st=i
          break
+      else
+         st=0
       end if
    end do
-   if (.not. isvar("st"))then
-      print(" ")
-      print("'start_time_step' = "+ start_time_step +"h is invalid")
-      print(" ")
-      print("Select another 'start_time_step'")
-      print(" ")
-      exit
-   end if
    
    ; ****************************************************
@@ -1092,15 +1086,9 @@
          et=i
          break
+       else
+         et=0
       end if
    end do 
-   if (.not. isvar("et"))then
-      print(" ")
-      print("'end_time_step' = "+ end_time_step +"h is invalid")
-      print(" ")
-      print("Select another 'end_time_step'")
-      print(" ")
-      exit
-   end if   
-
+  
    delete(start_time_step)
    start_time_step=round(st,3)
@@ -1121,7 +1109,7 @@
    end if
 
-   if (time_stride .GE. no_time) then
-      print(" ")
-      print("'time_stride' is greater equal than number of available "+\
+   if (time_stride .GT. no_time) then
+      print(" ")
+      print("'time_stride' is greater than number of available "+\
            "time steps,")
       print("=> 'time_stride' is set to 1")
@@ -2008,29 +1996,42 @@
          end if         
 
-	 if (abs(min(data(varn,:,min_z_int:max_z_int))) .GT. 10)then
-	    min_value = abs(0.001*min(data(varn,:,min_z_int:max_z_int)))
-	    max_value = abs(0.001*max(data(varn,:,min_z_int:max_z_int)))
-	 else
-	    if (abs(min(data(varn,:,min_z_int:max_z_int))) .LT. 0.01 .AND. \
-                abs(max(data(varn,:,min_z_int:max_z_int))) .GT. 0.01)then
-	       min_value = abs(0.1*max(data(varn,:,min_z_int:max_z_int)))
-	       max_value = abs(0.1*max(data(varn,:,min_z_int:max_z_int)))
-	    else
-	       if (abs(max(data(varn,:,min_z_int:max_z_int))) .LT. 0.01 .AND.\
-                   abs(min(data(varn,:,min_z_int:max_z_int))) .GT. 0.01)then
-	          min_value = abs(0.1*min(data(varn,:,min_z_int:max_z_int)))
-	          max_value = abs(0.1*min(data(varn,:,min_z_int:max_z_int)))
-	       else
-	          min_value = abs(0.1*min(data(varn,:,min_z_int:max_z_int)))
-	          max_value = abs(0.1*max(data(varn,:,min_z_int:max_z_int)))
-	       end if
-	    end if
-	 end if 
+
+         ;data can contain missing values in case of output of t=0h (inital profiles)
+         ;where no output is possible
+         n_not_ismissing = num(.not.ismissing(data(varn,:,:)))
+
+         if (n_not_ismissing .GT. 0 ) then    
+ 
+	   if (abs(min(data(varn,:,min_z_int:max_z_int))) .GT. 10)then
+	      min_value = abs(0.001*min(data(varn,:,min_z_int:max_z_int)))
+	      max_value = abs(0.001*max(data(varn,:,min_z_int:max_z_int)))
+	   else
+	      if (abs(min(data(varn,:,min_z_int:max_z_int))) .LT. 0.01 .AND. \
+                  abs(max(data(varn,:,min_z_int:max_z_int))) .GT. 0.01)then
+	         min_value = abs(0.1*max(data(varn,:,min_z_int:max_z_int)))
+	         max_value = abs(0.1*max(data(varn,:,min_z_int:max_z_int)))
+	      else
+	         if (abs(max(data(varn,:,min_z_int:max_z_int))) .LT. 0.01 .AND.\
+                     abs(min(data(varn,:,min_z_int:max_z_int))) .GT. 0.01)then
+	            min_value = abs(0.1*min(data(varn,:,min_z_int:max_z_int)))
+	            max_value = abs(0.1*min(data(varn,:,min_z_int:max_z_int)))
+	         else
+	            min_value = abs(0.1*min(data(varn,:,min_z_int:max_z_int)))
+	            max_value = abs(0.1*max(data(varn,:,min_z_int:max_z_int)))
+	         end if
+	      end if
+	   end if 
         
-	 if (min(data(varn,:,min_z_int:max_z_int)) .EQ. 0 .AND. \
-             max(data(varn,:,min_z_int:max_z_int)) .EQ. 0)then
-	    min_value = 0.1
-	    max_value = 0.1
-	 end if        
+	   if (min(data(varn,:,min_z_int:max_z_int)) .EQ. 0 .AND. \
+               max(data(varn,:,min_z_int:max_z_int)) .EQ. 0)then
+	      min_value = 0.1
+	      max_value = 0.1
+	   end if
+
+         else     
+           print(" ")
+           print(vNam(varn) + " contains only missing values")
+           print(" ")
+         end if   
 
          if (over .EQ. 0) then  
Index: palm/trunk/SCRIPTS/NCL/spectra.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/spectra.ncl	(revision 759)
+++ palm/trunk/SCRIPTS/NCL/spectra.ncl	(revision 769)
@@ -323,15 +323,8 @@
          st=i
          break
+      else
+         st=0
       end if
    end do
-   
-   if (.not. isvar("st"))then
-      print(" ")
-      print("'start_time_step' = "+ start_time_step +"h is invalid")
-      print(" ")
-      print("Select another 'start_time_step'")
-      print(" ")
-      exit
-   end if
    
    ;****************************************************
@@ -367,15 +360,8 @@
          et=i
          break
+       else
+         et=0
       end if
    end do 
-   
-   if (.not. isvar("et"))then
-      print(" ")
-      print("'end_time_step' = "+ end_time_step +"h is invalid")
-      print(" ")
-      print("Select another 'end_time_step'")
-      print(" ")
-      exit
-   end if
 
    delete(start_time_step)
Index: palm/trunk/SCRIPTS/NCL/timeseries.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/timeseries.ncl	(revision 759)
+++ palm/trunk/SCRIPTS/NCL/timeseries.ncl	(revision 769)
@@ -195,4 +195,12 @@
    delta_t = t_all(nt-1)/nt
 
+   if (nt .LE. 1) then
+      print(" ")
+      print("Input file contains only one time step -> " +\
+            "plot of timeseries is not possible ")
+      print(" ")
+      exit
+   end if
+
    ;****************************************************	
    ; start of time step and different types of mistakes that could be done
@@ -228,4 +236,6 @@
          st=i
          break
+       else
+         st=0
       end if
    end do
@@ -233,12 +243,6 @@
        start_time_step .LT. t_all(nt-1)) then
       st=nt-2   
-   end if
-   if (.not. isvar("st"))then
-      print(" ")
-      print("'start_time_step' = "+ start_time_step +"h is invalid")
-      print(" ")
-      print("Select another 'start_time_step'")
-      print(" ")
-      exit
+    else
+      st=0
    end if
       
@@ -286,15 +290,8 @@
          et=i
          break
+       else
+         et=0
       end if
    end do 
-   
-   if (.not. isvar("et"))then
-      print(" ")
-      print("'end_time_step' = "+ end_time_step +"h is invalid")
-      print(" ")
-      print("Select another 'end_time_step'")
-      print(" ")
-      exit
-   end if
  
    delete(start_time_step)
