Index: palm/trunk/SCRIPTS/NCL/cross_sections.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 250)
+++ palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 267)
@@ -1143,14 +1143,14 @@
       end if
       if (xyc .EQ. 1)then
-         cs_res@tiXAxisString = "x [gridpoints]"
-         cs_res@tiYAxisString = "y [gridpoints]"
+         cs_res@tiXAxisString = "x [m]"
+         cs_res@tiYAxisString = "y [m]"
       end if
       if (xzc .EQ. 1)then
-         cs_res@tiXAxisString = "x [gridpoints]"
-         cs_res@tiYAxisString = "z [gridpoints]"
+         cs_res@tiXAxisString = "x [m]"
+         cs_res@tiYAxisString = "z [m]"
       end if
       if (yzc .EQ. 1)then
-         cs_res@tiXAxisString = "y [gridpoints]"
-         cs_res@tiYAxisString = "z [gridpoints]"
+         cs_res@tiXAxisString = "y [m]"
+         cs_res@tiYAxisString = "z [m]"
       end if
    end if
@@ -1492,12 +1492,12 @@
                   
                   if ( sort .eq. "time" ) then
-                     if ( z_d(lo) .eq. -1)then
+                     if ( z_d(zs+lo) .eq. -1)then
 		        if (delta_z .EQ. -1) then
                            level = "-average"
 			else
-			   level = "=" + z_d(lo) + "m"
+			   level = "=" + z_d(zs+lo) + "m"
 			end if
                      else 
-                        level = "=" + z_d(lo) + "m"
+                        level = "=" + z_d(zs+lo) + "m"
                      end if
                      cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) +"h  z"+level		     
@@ -1519,12 +1519,12 @@
                  
                   if ( sort .eq. "layer" ) then
-		     if (z_d(li) .eq. -1) then
+		     if (z_d(zs+li) .eq. -1) then
 		        if (delta_z .EQ. -1) then
                            level = "-average"
 			else
-			   level = "=" + z_d(li) + "m"
+			   level = "=" + z_d(zs+li) + "m"
 			end if
                      else 
-                        level = "=" + z_d(li) + "m"
+                        level = "=" + z_d(zs+li) + "m"
                      end if 
                      cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h  z"+ level		
@@ -1555,8 +1555,8 @@
                
                   if ( sort .eq. "time" ) then
-                     if ( y_d(lo) .eq. -1 ) then
+                     if ( y_d(ys+lo) .eq. -1 ) then
                         level = "-average"
                      else 
-                        level = "=" + y_d(lo) + "m"
+                        level = "=" + y_d(ys+lo) + "m"
                      end if
                      cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "h  y"+ level
@@ -1578,8 +1578,8 @@
 
                   if ( sort .eq. "layer" ) then
-                     if ( y_d(li) .eq. -1 ) then
+                     if ( y_d(ys+li) .eq. -1 ) then
                         level = "-average"
                      else 
-                        level = "=" + y_d(li) + "m"
+                        level = "=" + y_d(ys+li) + "m"
                      end if
                      cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h  y"+ level
@@ -1610,8 +1610,8 @@
 
                   if ( sort .eq. "time" ) then
-                     if ( x_d(lo) .eq. -1 ) then
+                     if ( x_d(xs+lo) .eq. -1 ) then
                         level = "-average"
                      else 
-                        level = "=" + x_d(lo) + "m"
+                        level = "=" + x_d(xs+lo) + "m"
                      end if
                      cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(li)/3600,2,True) + "h  x"+ level
@@ -1633,8 +1633,8 @@
 
                   if ( sort .eq. "layer" ) then
-                     if ( x_d(li) .eq. -1 ) then
+                     if ( x_d(xs+li) .eq. -1 ) then
                         level = "-average"
                      else 
-                        level = "=" + x_d(li) + "m"
+                        level = "=" + x_d(xs+li) + "m"
                      end if
                      cs_res@gsnCenterString = "t=" + decimalPlaces(t_all(lo)/3600,2,True) + "h  x"+ level
@@ -1680,5 +1680,5 @@
          end do
       end if
-   else        
+   else       
       if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then
          gsn_panel(wks_ps,plot(0:(no_time*no_layer*no_var)-1),(/no_var,no_layer*no_time/),cs_resP)
@@ -1687,5 +1687,5 @@
          print(" ")
       else
-         do np = 0,no_layer*no_time*no_var-1,no_rows*no_columns   
+         do np = 0,no_layer*no_time*no_var-1,no_rows*no_columns  
             if ( np + no_rows*no_columns .gt. (no_layer*no_time*no_var)-1) then
                gsn_panel(wks_ps, plot(np:(no_layer*no_time*no_var)-1),(/no_rows,no_columns/),cs_resP)
Index: palm/trunk/SCRIPTS/NCL/ncl_preferences.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/ncl_preferences.ncl	(revision 250)
+++ palm/trunk/SCRIPTS/NCL/ncl_preferences.ncl	(revision 267)
@@ -30,5 +30,5 @@
 
 
-         file_1 = "File in" 
+         file_1 = "File in"
 	 
 	 
@@ -677,5 +677,5 @@
 
 
-         file_1 = "File in" 
+         file_1 = "File in"
 	 
 	 
@@ -717,20 +717,4 @@
 	 
       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
@@ -1267,5 +1251,5 @@
       
       	 
-         end_time_step = -1.d     
+         end_time_step = -1.d    
 	 
 	 
@@ -2038,5 +2022,5 @@
 
 
-         file_1 = "File in" 
+         file_1 = "File in"
 	 
 	 
@@ -2146,5 +2130,5 @@
       
       	 
-         no_rows = 2
+         no_rows = 1
 	 
 	 
@@ -2204,5 +2188,5 @@
          end_time_step = -1.d
 	 
-	 
+
       end if 	 
       ;***************************************************
Index: palm/trunk/SCRIPTS/NCL/profiles.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 250)
+++ palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 267)
@@ -73,18 +73,4 @@
    start_f(0) = start_f_1 
    end_f(0) = end_f_1    
-      
-   if (prof3d .EQ. -1)then
-      print(" ")
-      print("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
@@ -372,5 +358,5 @@
    
    vNam = getfilevarnames(f_att) 
-
+   
    if (nof .EQ. 0)then
       vNam0=vNam
@@ -407,4 +393,12 @@
       print(" ")
    end if
+   
+   prof3d = 0
+   do varn = dim-1,0,1
+      if ( isStrSubset( vNam(varn), "zu_3d") .OR. isStrSubset( vNam(varn), "zw_3d")) then
+         prof3d = 1
+	 break
+      end if
+   end do
 
    ;-----------------------------------------------------below steps only for first file -> nof=0
