Index: palm/trunk/SCRIPTS/NCL/cross_sections.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 194)
+++ palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 195)
@@ -172,48 +172,54 @@
    end do
    if (.not. check_3d) then
-      if (xyc .EQ. 1 .AND. .not. checkxy) then
-         print(" ")
-         print("Your input file doesn't have values for xy cross-sections")
-         if (checkxz)then
-            print("Select another input file or xz cross-sections")
+      if (xyc .EQ. 1)then
+         if (.not. checkxy) then
+            print(" ")
+            print("Your input file doesn't have values for xy cross-sections")
+            if (checkxz)then
+               print("Select another input file or xz cross-sections")
+            else
+               print("Select another input file or yz cross-sections")
+            end if
+            print(" ")
+            exit
          else
-            print("Select another input file or yz cross-sections")
-         end if
-         print(" ")
-         exit
-      else
-         print(" ")
-         print("Your input file contains xy data")
-         print(" ") 
-      end if
-      if (xzc .EQ. 1 .AND. .not. checkxz) then
-         print(" ")
-         print("Your input file doesn't have values for xz cross-sections")
-         if (checkxy)then
-            print("Select another input file or xy cross-sections")
+            print(" ")
+            print("Your input file contains xy data")
+            print(" ") 
+	 end if
+      end if
+      if (xzc .EQ. 1)then
+         if (.not. checkxz) then
+            print(" ")
+            print("Your input file doesn't have values for xz cross-sections")
+            if (checkxy)then
+               print("Select another input file or xy cross-sections")
+            else
+               print("Select another input file or yz cross-sections")
+            end if
+            print(" ")
+            exit
          else
-            print("Select another input file or yz cross-sections")
-         end if
-         print(" ")
-         exit
-      else
-         print(" ")
-         print("Your input file contains xz data")
-         print(" ")
-      end if
-      if (yzc .EQ. 1 .AND. .not. checkyz) then
-         print(" ")
-         print("Your input file doesn't have values for yz cross-sections")
-         if (checkxy)then
-            print("Select another input file or xy cross-sections")
+            print(" ")
+            print("Your input file contains xz data")
+            print(" ")
+	 end if
+      end if
+      if (yzc .EQ. 1)then
+         if (.not. checkyz) then
+            print(" ")
+            print("Your input file doesn't have values for yz cross-sections")
+            if (checkxy)then
+               print("Select another input file or xy cross-sections")
+            else
+               print("Select another input file or xz cross-sections")
+            end if
+            print(" ")
+            exit
          else
-            print("Select another input file or xz cross-sections")
-         end if
-         print(" ")
-         exit
-      else
-         print(" ")
-         print("Your input file contains yz data")
-         print(" ")
+            print(" ")
+            print("Your input file contains yz data")
+            print(" ")
+	 end if
       end if
    else
@@ -523,5 +529,5 @@
       end do
    end if
-   
+ 
    ; ****************************************************
    ; set up ranges of x-, y- and z-coordinates
@@ -530,4 +536,10 @@
    if (xs .EQ. -1.d) then     		
       xs = x_d(0)
+      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
+      end if
    else 
       if (delta_x .EQ. -1) then
@@ -563,4 +575,10 @@
    if (ys .EQ. -1.d) then    
       ys = y_d(0)
+      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
+      end if
    else
       if (delta_y .EQ. -1) then
@@ -596,4 +614,9 @@
    if (zs .EQ. -1) then     			
       zs = 0
+      if (delta_z .EQ. -1) then
+         print(" ") 
+         print("You cannot choose a start value for z, there are preseted layers for z")
+         print(" ")
+      end if
    else
       if (delta_z .EQ. -1) then
@@ -628,4 +651,10 @@
    if (xe .EQ. -1) then    
       xe = x_d(xdim)
+      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
+      end if
    else
       if (delta_x .EQ. -1) then
@@ -679,4 +708,10 @@
    if (ye .EQ. -1) then  
       ye = y_d(ydim)
+      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
+      end if
    else
       if (delta_y .EQ. -1) then
@@ -730,4 +765,10 @@
    if (ze .EQ. -1) then  
       ze = zdim
+      if (delta_z .EQ. -1) then
+         print(" ") 
+         print("You cannot choose an end value for z, there are preseted layers for z")
+         print(" ")
+         ze = zdim
+      end if
    else
       if (delta_z .EQ. -1) then
@@ -809,6 +850,16 @@
    
    if( shape .eq. 1 ) then 
-      cs_res@vpWidthF    = (xe-xs)/(ye-ys)        
-      cs_res@vpHeightF   = 1
+      if (xyc .EQ. 1)then
+         cs_res@vpWidthF    = (xe-xs)/(ye-ys)        
+         cs_res@vpHeightF   = 1
+      end if
+      if (xzc .EQ. 1)then
+         cs_res@vpWidthF    = (xe-xs)/(delta_x*(ze-zs))        
+         cs_res@vpHeightF   = 1
+      end if
+      if (yzc .EQ. 1)then
+         cs_res@vpWidthF    = (ye-ys)/(delta_y*(ze-zs))        
+         cs_res@vpHeightF   = 1
+      end if
    end if
    
