Index: trunk/NEMO/OPA_SRC/DOM/domzgr.F90
===================================================================
--- trunk/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 3)
+++ trunk/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 30)
@@ -338,5 +338,5 @@
                DO jj = 1, jpjdta
                   DO ji = 1, jpidta
-                     IF( gdepw(jk) < zdta(ji,jj) .AND. zdta(ji,jj) <= gdepw(jk+1) )   idta(ji,jj) = jk
+                     IF( gdept(jk) < zdta(ji,jj) .AND. zdta(ji,jj) <= gdept(jk+1) )   idta(ji,jj) = jk
                   END DO
                END DO
@@ -346,16 +346,24 @@
          ! set boundary conditions (caution, idta on the global domain: use of jperio, not nperio)
          IF( jperio == 1 .OR. jperio == 4 .OR. jperio == 6 ) THEN
-            idta( : , 1 ) = -1                ;      zdta( : , 1 ) = -1.e0
-            idta( : ,jpj) =  0                ;      zdta( : ,jpj) =  0.e0
+            idta( :    , 1    ) = -1                ;      zdta( :    , 1    ) = -1.e0
+            idta( :    ,jpjdta) =  0                ;      zdta( :    ,jpjdta) =  0.e0
          ELSEIF( jperio == 2 ) THEN
-            idta( : , 1 ) = idta( : ,  3  )   ;      zdta( : , 1 ) = zdta( : ,  3  )
-            idta( : ,jpj) = 0                 ;      zdta( : ,jpj) =  0.e0
-            idta( 1 , : ) = 0                 ;      zdta( 1 , : ) =  0.e0
-            idta(jpi, : ) = 0                 ;      zdta(jpi, : ) =  0.e0
+            idta( :    , 1    ) = idta( : ,  3  )   ;      zdta( :    , 1    ) = zdta( : ,  3  )
+            idta( :    ,jpjdta) = 0                 ;      zdta( :    ,jpjdta) =  0.e0
+            idta( 1    , :    ) = 0                 ;      zdta( 1    , :    ) =  0.e0
+            idta(jpidta, :    ) = 0                 ;      zdta(jpidta, :    ) =  0.e0
          ELSE
-            idta( : , 1 ) = 0                 ;      zdta( : , 1 ) =  0.e0
-            idta( : ,jpj) = 0                 ;      zdta( : ,jpj) =  0.e0
-            idta( 1 , : ) = 0                 ;      zdta( 1 , : ) =  0.e0
-            idta(jpi, : ) = 0                 ;      zdta(jpi, : ) =  0.e0
+            idta( :    , 1    ) = 0                 ;      zdta( :    , 1    ) =  0.e0
+            idta( :    ,jpjdta) = 0                 ;      zdta( :    ,jpjdta) =  0.e0
+            idta( 1    , :    ) = 0                 ;      zdta( 1    , :    ) =  0.e0
+            idta(jpidta, :    ) = 0                 ;      zdta(jpidta, :    ) =  0.e0
+         ENDIF
+
+         !  EEL R5 configuration with east and west open boundaries.
+         !  Two rows of zeroes are needed at the south and north for OBCs
+          
+         IF( cp_cfg == "eel" .AND. jp_cfg == 5 ) THEN
+            idta( : , 2      ) = 0                 ;      zdta( : , 2      ) =  0.e0
+!!CT            idta( : ,jpjdta-1) = 0                 ;      zdta( : ,jpjdta-1) =  0.e0
          ENDIF
 
@@ -611,9 +619,9 @@
          IF(lwp) WRITE(numout,*)'    ',icompt,' ocean grid points suppressed'
       ENDIF
-#if defined key_mpp
-      zbathy(:,:) = FLOAT( mbathy(:,:) )
-      CALL lbc_lnk( zbathy, 'T', 1. )
-      mbathy(:,:) = INT( zbathy(:,:) )
-#endif
+      IF( lk_mpp ) THEN
+         zbathy(:,:) = FLOAT( mbathy(:,:) )
+         CALL lbc_lnk( zbathy, 'T', 1. )
+         mbathy(:,:) = INT( zbathy(:,:) )
+      ENDIF
 
       ! 3.2 East-west cyclic boundary conditions
@@ -622,15 +630,15 @@
          IF(lwp) WRITE(numout,*) ' mbathy set to 0 along east and west',   &
             ' boundary: nperio = ', nperio
-#if defined key_mpp
-         IF( nbondi == -1 .OR. nbondi == 2 ) THEN
-            IF( jperio /= 1 )   mbathy(1,:) = 0
-         ENDIF
-         IF( nbondi == 1 .OR. nbondi == 2 ) THEN
-            IF( jperio /= 1 )   mbathy(nlci,:) = 0
-         ENDIF
-#else
-         mbathy( 1 ,:) = 0
-         mbathy(jpi,:) = 0
-#endif
+         IF( lk_mpp ) THEN
+            IF( nbondi == -1 .OR. nbondi == 2 ) THEN
+               IF( jperio /= 1 )   mbathy(1,:) = 0
+            ENDIF
+            IF( nbondi == 1 .OR. nbondi == 2 ) THEN
+               IF( jperio /= 1 )   mbathy(nlci,:) = 0
+            ENDIF
+         ELSE
+            mbathy( 1 ,:) = 0
+            mbathy(jpi,:) = 0
+         ENDIF
       ELSEIF( nperio == 1 .OR. nperio == 4 .OR. nperio ==  6 ) THEN
          IF(lwp) WRITE(numout,*)' east-west cyclic boundary conditions',   &
@@ -656,11 +664,11 @@
 
          !  Boundary condition on mbathy
-#   if ! defined key_mpp
-         !!bug ???  y reflechir!
-         !   ... mono- or macro-tasking: T-point, >0, 2D array, no slab
-         zbathy(:,:) = FLOAT( mbathy(:,:) )
-         CALL lbc_lnk( zbathy, 'T', 1. )
-         mbathy(:,:) = INT( zbathy(:,:) )
-#   endif
+         IF( .NOT.lk_mpp ) THEN 
+            !!bug ???  y reflechir!
+            !   ... mono- or macro-tasking: T-point, >0, 2D array, no slab
+            zbathy(:,:) = FLOAT( mbathy(:,:) )
+            CALL lbc_lnk( zbathy, 'T', 1. )
+            mbathy(:,:) = INT( zbathy(:,:) )
+         ENDIF
 
       ENDIF
