Index: palm/trunk/SCRIPTS/NCL/profiles.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 731)
+++ 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  
