Index: branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/compute_sections.f90
===================================================================
--- branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/compute_sections.f90	(revision 2948)
+++ branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/compute_sections.f90	(revision 2949)
@@ -51,5 +51,4 @@
         nmesh                    ! number of cells in processor domain
      INTEGER :: itest , jtest    ! dummy integer
-     REAL(wp),SAVE :: zdistmesh  ! Taller cell of the mesh in ocean in degrees
      REAL(wp)      :: &
         zdistEst   , zdistNorth , zdistWest , zdistSouth ,  &! temporary scalars
@@ -105,23 +104,4 @@
      EstPoint    = POINT_SECTION( -1, -1 ) ; WestPoint   = POINT_SECTION( -1, -1 )
 
-     IF( jsec == 1 )THEN
-        !Find the taller cell of the mesh in ocean (used in compsec), 
-        !unit= degrees 
-        zdistmesh=0.
-        DO jj=2,jpj
-           DO ji=2,jpi
-              IF( zdistmesh .LT. &
-                 (e1t(ji,jj)/(cos(gphit(ji,jj))*110000))  ) THEN
-                 zdistmesh = e1t(ji,jj)/(cos(gphit(ji,jj))*110000)
-              ENDIF
-           ENDDO
-        ENDDO
-    
-     ENDIF
-
-     !debug
-     WRITE(cltmp,'(A10,f10.3)')'zdistmesh = ',zdistmesh
-     CALL write_debug(jsec,cltmp)
-
      !===========================================================!    
      !I. Find which cells of the mesh the section is  crossing  !
@@ -157,51 +137,46 @@
            zdeltaj= gphif(ji,jj-1) - gphif(ji-1,jj-1) !zdeltaj=[AD]
            
-           IF( ABS(zdeltai) .LE. 2.*zdistmesh .OR.  & 
-               ABS(zdeltaj) .LE. 2.*zdistmesh )THEN           
-  
-              !intersection section/[AB]=?
-              coordTemp     = intersec(sec,coord_a,coord_b)     !compute intersection 
- 
-              IF( coordTemp%lon .NE. -9999 )THEN
-                 IF( nb_inmesh+1 .GT. nb_point_max )THEN
-                    PRINT*,"WARNING diadct: nb_point_max needs to be greater than ", nb_inmesh
-                 ELSE    
-                    nb_inmesh=nb_inmesh+1              
-                    coordSec(nb_inmesh) = coordTemp    !store the intersection's coordinates
-
-                    !We need to know if the section crosses the overlapping band.
-
-                    !Fist we look if there is an intersection mesh/section 
-                    !just on the left of the overlapping band: 
-                    IF( coordTemp%lon .GT. glamf(1,1)-5  .AND. coordTemp%lon .LT. glamf(1,1) ) & 
-                       & ll_overlap_sec_left  = .TRUE.
-                    !And we look if there is an intersection mesh/section 
-                    !just on the right of the overlapping band:
-                    IF( coordTemp%lon .GT. glamf(jpi,1) .AND. coordTemp%lon .LT. glamf(1,1)+5 ) &
-                       & ll_overlap_sec_right = .TRUE.
-                 ENDIF
-              ENDIF
+           !intersection section/[AB]=?
+           coordTemp     = intersec(sec,coord_a,coord_b)     !compute intersection 
+ 
+           IF( coordTemp%lon .NE. -9999 )THEN
+              IF( nb_inmesh+1 .GT. nb_point_max )THEN
+                 PRINT*,"WARNING diadct: nb_point_max needs to be greater than ", nb_inmesh
+              ELSE    
+                 nb_inmesh=nb_inmesh+1              
+                 coordSec(nb_inmesh) = coordTemp    !store the intersection's coordinates
+
+                 !We need to know if the section crosses the overlapping band.
+
+                 !Fist we look if there is an intersection mesh/section 
+                 !just on the left of the overlapping band: 
+                 IF( coordTemp%lon .GT. glamf(1,1)-5  .AND. coordTemp%lon .LT. glamf(1,1) ) & 
+                    & ll_overlap_sec_left  = .TRUE.
+                 !And we look if there is an intersection mesh/section 
+                 !just on the right of the overlapping band:
+                 IF( coordTemp%lon .GT. glamf(jpi,1) .AND. coordTemp%lon .LT. glamf(1,1)+5 ) &
+                    & ll_overlap_sec_right = .TRUE.
+              ENDIF
+           ENDIF
               
-              !intersection section/[AD]=?
-              coordTemp=intersec(sec,coord_a,coord_d)       !compute intersection
-              coordTemp%lon = coordTemp%lon !* zmask(ji,jj)-9999.*(1-zmask(ji,jj))
-              coordTemp%lat = coordTemp%lat !* zmask(ji,jj)-9999.*(1-zmask(ji,jj))
-
-              IF( coordTemp%lon .NE. -9999 )THEN
-                 IF( nb_inmesh+1 .GT. nb_point_max )THEN
-                    PRINT*, "WARNING diadct: nb_point_max needs to be greater than ", nb_inmesh
-                 ELSE  
-                    nb_inmesh=nb_inmesh+1
-                    coordSec(nb_inmesh)=coordTemp
+           !intersection section/[AD]=?
+           coordTemp=intersec(sec,coord_a,coord_d)       !compute intersection
+           coordTemp%lon = coordTemp%lon !* zmask(ji,jj)-9999.*(1-zmask(ji,jj))
+           coordTemp%lat = coordTemp%lat !* zmask(ji,jj)-9999.*(1-zmask(ji,jj))
+
+           IF( coordTemp%lon .NE. -9999 )THEN
+              IF( nb_inmesh+1 .GT. nb_point_max )THEN
+                 PRINT*, "WARNING diadct: nb_point_max needs to be greater than ", nb_inmesh
+              ELSE  
+                 nb_inmesh=nb_inmesh+1
+                 coordSec(nb_inmesh)=coordTemp
                    
-                    !We need to know if the section crosses the overlapping band:
-                    !same test as above 
-                    IF( coordTemp%lon .GE. glamf(1,1)-3  .AND. coordTemp%lon .LE. glamf(1,1) ) &
-                         & ll_overlap_sec_left  = .TRUE.
-                    IF( coordTemp%lon .GE. glamf(jpi,1) .AND. coordTemp%lon .LE. glamf(jpi,1)+3) & 
-                         & ll_overlap_sec_right = .TRUE. 
-                 ENDIF
-              ENDIF
- 
+                 !We need to know if the section crosses the overlapping band:
+                 !same test as above 
+                 IF( coordTemp%lon .GE. glamf(1,1)-3  .AND. coordTemp%lon .LE. glamf(1,1) ) &
+                      & ll_overlap_sec_left  = .TRUE.
+                 IF( coordTemp%lon .GE. glamf(jpi,1) .AND. coordTemp%lon .LE. glamf(jpi,1)+3) & 
+                      & ll_overlap_sec_right = .TRUE. 
+              ENDIF
            ENDIF
          
@@ -302,9 +277,9 @@
               zdistFirst = distance2(coord_t,coordFirst)
               zdistLast = distance2(coord_t,coordLast)
-              IF( zdistFirst .LT. zdistmesh .AND. zdistFirst .LT. zdistante )THEN
+              IF( zdistFirst .LT. zdistante )THEN
                  sec%listPoint(1) = POINT_SECTION(ji,jj)
                  zdistante=zdistFirst
               ENDIF
-              IF( zdistLast .LT. zdistmesh .AND. zdistLast .LT. zdistante2 )THEN
+              IF( zdistLast .LT. zdistante2 )THEN
                  endingPoint = POINT_SECTION(ji,jj)
                  zdistante2=zdistLast
@@ -478,7 +453,7 @@
               ! (test: ABS(coordTemp%lon - coordLast%lon).GT. 180)
               !
-              ! If on of this 4 lines  crosses the date line, we have to add 360° its 
-              ! extremities longitudes to compute the correct distance through the date line
-              ! and not around the Earth
+              ! If on of these lines crosses , we have to add 360° to the longitudes of the 
+              ! extremities to compute the distance through the date line
+              ! and not around the Earth.
        
               ! c.1 compute distWest: distance between west point and endingPoint
Index: branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/sections_tools.f90
===================================================================
--- branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/sections_tools.f90	(revision 2948)
+++ branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/sections_tools.f90	(revision 2949)
@@ -306,5 +306,5 @@
               zX = sec%coordSec(1)%lon
               zY = za2 * zX + zb2
-          ELSE IF ( za2 == 1.e20) THEN ! Case X=constante
+          ELSE IF ( za2 == 1.e20) THEN ! Case X=constant
               zX = coord_b%lon
               zY = za1 * zX + zb1
