Index: NEMO/trunk/src/OCE/BDY/bdyini.F90
===================================================================
--- NEMO/trunk/src/OCE/BDY/bdyini.F90	(revision 10628)
+++ NEMO/trunk/src/OCE/BDY/bdyini.F90	(revision 10629)
@@ -941,5 +941,5 @@
                      ii = idx_bdy(ib_bdy)%nbi(icount,igrd)
                      ij = idx_bdy(ib_bdy)%nbj(icount,igrd)
-                     if((com_east .ne. 1) .and. (ii == nlci) .and. (nbondi .le. 0)) then
+                     if((com_east .ne. 1) .and. (ii == (nlci-1)) .and. (nbondi .le. 0)) then
                         com_east = 1
                      elseif((com_west .ne. 1) .and. (ii == 2) .and. (nbondi .ge. 0) .and. (nbondi .ne. 2)) then
@@ -948,5 +948,5 @@
                      if((com_south .ne. 1) .and. (ij == 2) .and. (nbondj .ge. 0) .and. (nbondj .ne. 2)) then
                         com_south = 1
-                     elseif((com_north .ne. 1) .and. (ij == nlcj) .and. (nbondj .le. 0)) then
+                     elseif((com_north .ne. 1) .and. (ij == (nlcj-1)) .and. (nbondj .le. 0)) then
                         com_north = 1
                      endif 
@@ -960,5 +960,5 @@
                        & nbrdta(ib,igrd,ib_bdy) == ir  ) THEN
                        ii = nbidta(ib,igrd,ib_bdy)- iw_b(1)+2
-                       if((com_west_b .ne. 1) .and. (ii == (nlcit(nowe+1)))) then
+                       if((com_west_b .ne. 1) .and. (ii == (nlcit(nowe+1)-1))) then
                           ij = nbjdta(ib,igrd,ib_bdy) - is_b(1)+2
                           if((ij == 2) .and. (nbondj == 0 .or. nbondj == 1)) then
@@ -989,5 +989,5 @@
                        & nbrdta(ib,igrd,ib_bdy) == ir  ) THEN
                        ii = nbidta(ib,igrd,ib_bdy)- iw_b(1)+2
-                       if((com_west_b .ne. 1) .and. (ii == (nlcit(nowe+1)))) then
+                       if((com_west_b .ne. 1) .and. (ii == (nlcit(nowe+1)-1))) then
                           ij = nbjdta(ib,igrd,ib_bdy) - is_b(1)+2
                           if((ij == 2) .and. (nbondj == 0 .or. nbondj == 1)) then
@@ -1030,5 +1030,5 @@
                        & nbrdta(ib,igrd,ib_bdy) == ir  ) THEN
                        ij = nbjdta(ib,igrd,ib_bdy)- is_b(3)+2
-                       if((com_south_b .ne. 1) .and. (ij == (nlcjt(noso+1)))) then
+                       if((com_south_b .ne. 1) .and. (ij == (nlcjt(noso+1)-1))) then
                           com_south_b = 1
                        endif 
@@ -1052,5 +1052,5 @@
                        & nbrdta(ib,igrd,ib_bdy) == ir  ) THEN
                        ij = nbjdta(ib,igrd,ib_bdy)- is_b(3)+2
-                       if((com_south_b .ne. 1) .and. (ij == (nlcjt(noso+1)))) then
+                       if((com_south_b .ne. 1) .and. (ij == (nlcjt(noso+1)-1))) then
                           com_south_b = 1
                        endif 
Index: NEMO/trunk/src/OCE/LBC/mpp_bdy_generic.h90
===================================================================
--- NEMO/trunk/src/OCE/LBC/mpp_bdy_generic.h90	(revision 10628)
+++ NEMO/trunk/src/OCE/LBC/mpp_bdy_generic.h90	(revision 10629)
@@ -140,16 +140,28 @@
          CASE ( -1 )
             CALL mppsend( 2, zt3we(1,1,1,1,1,1), imigr, noea, ml_req1 )
-            CALL mpprecv( 1, zt3ew(1,1,1,1,1,2), imigr, noea )
-            IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err)
          CASE ( 0 )
             CALL mppsend( 1, zt3ew(1,1,1,1,1,1), imigr, nowe, ml_req1 )
             CALL mppsend( 2, zt3we(1,1,1,1,1,1), imigr, noea, ml_req2 )
+         CASE ( 1 )
+            CALL mppsend( 1, zt3ew(1,1,1,1,1,1), imigr, nowe, ml_req1 )
+         END SELECT
+         !
+         SELECT CASE ( nbondi_bdy_b(IBD_IN(jf)) )
+         CASE ( -1 )
+            CALL mpprecv( 1, zt3ew(1,1,1,1,1,2), imigr, noea )
+         CASE ( 0 )
             CALL mpprecv( 1, zt3ew(1,1,1,1,1,2), imigr, noea )
             CALL mpprecv( 2, zt3we(1,1,1,1,1,2), imigr, nowe )
+         CASE ( 1 )
+            CALL mpprecv( 2, zt3we(1,1,1,1,1,2), imigr, nowe )
+         END SELECT
+         !
+         SELECT CASE ( nbondi_bdy(IBD_IN(jf)) )
+         CASE ( -1 )
+            IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err)
+         CASE ( 0 )
             IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err)
             IF(l_isend) CALL mpi_wait(ml_req2, ml_stat, ml_err)
          CASE ( 1 )
-            CALL mppsend( 1, zt3ew(1,1,1,1,1,1), imigr, nowe, ml_req1 )
-            CALL mpprecv( 2, zt3we(1,1,1,1,1,2), imigr, nowe )
             IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err)
          END SELECT
@@ -230,16 +242,28 @@
          CASE ( -1 )
             CALL mppsend( 4, zt3sn(1,1,1,1,1,1), imigr, nono, ml_req1 )
-            CALL mpprecv( 3, zt3ns(1,1,1,1,1,2), imigr, nono )
-            IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err)
          CASE ( 0 )
             CALL mppsend( 3, zt3ns(1,1,1,1,1,1), imigr, noso, ml_req1 )
             CALL mppsend( 4, zt3sn(1,1,1,1,1,1), imigr, nono, ml_req2 )
+         CASE ( 1 )
+            CALL mppsend( 3, zt3ns(1,1,1,1,1,1), imigr, noso, ml_req1 )
+         END SELECT
+         ! 
+         SELECT CASE ( nbondj_bdy_b(IBD_IN(jf)) )
+         CASE ( -1 )
+            CALL mpprecv( 3, zt3ns(1,1,1,1,1,2), imigr, nono )
+         CASE ( 0 )
             CALL mpprecv( 3, zt3ns(1,1,1,1,1,2), imigr, nono )
             CALL mpprecv( 4, zt3sn(1,1,1,1,1,2), imigr, noso )
+         CASE ( 1 )
+            CALL mpprecv( 4, zt3sn(1,1,1,1,1,2), imigr, noso )
+         END SELECT
+         ! 
+         SELECT CASE ( nbondj_bdy(IBD_IN(jf)) )
+         CASE ( -1 )
+            IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err)
+         CASE ( 0 )
             IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err)
             IF(l_isend) CALL mpi_wait(ml_req2, ml_stat, ml_err)
          CASE ( 1 )
-            CALL mppsend( 3, zt3ns(1,1,1,1,1,1), imigr, noso, ml_req1 )
-            CALL mpprecv( 4, zt3sn(1,1,1,1,1,2), imigr, noso )
             IF(l_isend) CALL mpi_wait(ml_req1, ml_stat, ml_err)
          END SELECT
