Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdydyn2d.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdydyn2d.F90	(revision 11209)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdydyn2d.F90	(revision 11210)
@@ -54,4 +54,6 @@
       LOGICAL, DIMENSION(4) :: llsend2, llrecv2, llsend3, llrecv3  ! indicate how communications are to be carried out
       
+      llsend2(:) = .false.   ;   llrecv2(:) = .false.
+      llsend3(:) = .false.   ;   llrecv3(:) = .false.
       DO ir = 1, 0, -1   ! treat rim 1 before rim 0
          IF( ir == 0 ) THEN   ;   llrim0 = .TRUE.
@@ -77,8 +79,9 @@
          ENDDO
          !
-         llsend2(:) = .false.
-         llrecv2(:) = .false.
-         llsend3(:) = .false.
-         llrecv3(:) = .false.
+         IF( nn_hls > 1 .AND. ir == 1 ) CYCLE   ! at least 2 halos will be corrected -> no need to correct rim 1 before rim 0
+         IF( nn_hls == 1 ) THEN
+            llsend2(:) = .false.   ;   llrecv2(:) = .false.
+            llsend3(:) = .false.   ;   llrecv3(:) = .false.
+         END IF
          DO ib_bdy=1, nb_bdy
             SELECT CASE( cn_dyn2d(ib_bdy) )
@@ -310,7 +313,7 @@
       LOGICAL, DIMENSION(4) :: llsend1, llrecv1  ! indicate how communications are to be carried out
       !!----------------------------------------------------------------------
+      llsend1(:) = .false.   ;   llrecv1(:) = .false.
       DO ir = 1, 0, -1   ! treat rim 1 before rim 0
-         llsend1(:) = .false.
-         llrecv1(:) = .false.
+         IF( nn_hls == 1 ) THEN   ;   llsend1(:) = .false.   ;   llrecv1(:) = .false.   ;   END IF
          IF( ir == 0 ) THEN   ;   llrim0 = .TRUE.
          ELSE                 ;   llrim0 = .FALSE.
@@ -321,4 +324,5 @@
             llrecv1(:) = llrecv1(:) .OR. lrecv_bdyint(ib_bdy,1,:,ir)   ! possibly every direction, T points
          END DO
+         IF( nn_hls > 1 .AND. ir == 1 ) CYCLE   ! at least 2 halos will be corrected -> no need to correct rim 1 before rim 0
          IF( ANY(llsend1) .OR. ANY(llrecv1) ) THEN   ! if need to send/recv in at least one direction
             CALL lbc_lnk( 'bdydyn2d', zssh(:,:,1), 'T',  1., kfillmode=jpfillnothing ,lsend=llsend1, lrecv=llrecv1 )
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdydyn3d.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdydyn3d.F90	(revision 11209)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdydyn3d.F90	(revision 11210)
@@ -47,4 +47,6 @@
 
       !!----------------------------------------------------------------------
+      llsend2(:) = .false.   ;   llrecv2(:) = .false.
+      llsend3(:) = .false.   ;   llrecv3(:) = .false.
       DO ir = 1, 0, -1   ! treat rim 1 before rim 0
          IF( ir == 0 ) THEN   ;   llrim0 = .TRUE.
@@ -69,8 +71,9 @@
          END DO
          !
-         llsend2(:) = .false.
-         llrecv2(:) = .false.
-         llsend3(:) = .false.
-         llrecv3(:) = .false.
+         IF( nn_hls > 1 .AND. ir == 1 ) CYCLE   ! at least 2 halos will be corrected -> no need to correct rim 1 before rim 0
+         IF( nn_hls == 1 ) THEN
+            llsend2(:) = .false.   ;   llrecv2(:) = .false.
+            llsend3(:) = .false.   ;   llrecv3(:) = .false.
+         END IF
          DO ib_bdy=1, nb_bdy
             SELECT CASE( cn_dyn3d(ib_bdy) )
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdyice.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdyice.F90	(revision 11209)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdyice.F90	(revision 11210)
@@ -66,4 +66,5 @@
       CALL ice_var_glo2eqv
       !
+      llsend1(:) = .false.   ;   llrecv1(:) = .false.
       DO ir = 1, 0, -1   ! treat rim 1 before rim 0
          IF( ir == 0 ) THEN   ;   llrim0 = .TRUE.
@@ -81,7 +82,7 @@
          END DO
          !
-         ! Update bdy points
-         llsend1(:) = .false.
-         llrecv1(:) = .false.
+         ! Update bdy points        
+         IF( nn_hls > 1 .AND. ir == 1 ) CYCLE   ! at least 2 halos will be corrected -> no need to correct rim 1 before rim 0
+         IF( nn_hls == 1 ) THEN   ;   llsend1(:) = .false.   ;   llrecv1(:) = .false.   ;   END IF
          DO jbdy = 1, nb_bdy
             IF( cn_ice(jbdy) == 'frs' ) THEN
@@ -316,4 +317,6 @@
       IF( ln_timing )   CALL timing_start('bdy_ice_dyn')
       !
+      llsend2(:) = .false.   ;   llrecv2(:) = .false.
+      llsend3(:) = .false.   ;   llrecv3(:) = .false.
       DO ir = 1, 0, -1
          DO jbdy = 1, nb_bdy
@@ -404,5 +407,6 @@
          SELECT CASE ( cd_type )        
          CASE ( 'U' ) 
-            llsend2(:) = .false.   ;   llrecv2(:) = .false.
+         IF( nn_hls > 1 .AND. ir == 1 ) CYCLE   ! at least 2 halos will be corrected -> no need to correct rim 1 before rim 0
+         IF( nn_hls == 1 ) THEN   ;   llsend2(:) = .false.   ;   llrecv2(:) = .false.   ;   END IF
             DO jbdy = 1, nb_bdy
                IF( cn_ice(jbdy) == 'frs' .AND. nn_ice_dta(jbdy) /= 0 ) THEN
@@ -417,5 +421,6 @@
             END IF
          CASE ( 'V' )
-            llsend3(:) = .false.   ;   llrecv3(:) = .false.
+         IF( nn_hls > 1 .AND. ir == 1 ) CYCLE   ! at least 2 halos will be corrected -> no need to correct rim 1 before rim 0
+         IF( nn_hls == 1 ) THEN   ;   llsend3(:) = .false.   ;   llrecv3(:) = .false.   ;   END IF
             DO jbdy = 1, nb_bdy
                IF( cn_ice(jbdy) == 'frs' .AND. nn_ice_dta(jbdy) /= 0 ) THEN
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdytra.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdytra.F90	(revision 11209)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdytra.F90	(revision 11210)
@@ -55,5 +55,5 @@
       !!----------------------------------------------------------------------
       igrd = 1 
-
+      llsend1(:) = .false.  ;   llrecv1(:) = .false.
       DO ir = 1, 0, -1   ! treat rim 1 before rim 0
          IF( ir == 0 ) THEN   ;   llrim0 = .TRUE.
@@ -85,6 +85,6 @@
          END DO
          !
-         llsend1(:) = .false.
-         llrecv1(:) = .false.
+         IF( nn_hls > 1 .AND. ir == 1 ) CYCLE   ! at least 2 halos will be corrected -> no need to correct rim 1 before rim 0
+         IF( nn_hls == 1 ) THEN   ;   llsend1(:) = .false.   ;   llrecv1(:) = .false.   ;   END IF
          DO ib_bdy=1, nb_bdy
             SELECT CASE( TRIM(cn_tra(ib_bdy)) )
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/TOP/trcbdy.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/TOP/trcbdy.F90	(revision 11209)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/TOP/trcbdy.F90	(revision 11210)
@@ -56,5 +56,5 @@
       !
       igrd = 1 
-      !
+      llsend1(:) = .false.  ;   llrecv1(:) = .false.
       DO ir = 1, 0, -1   ! treat rim 1 before rim 0
          IF( ir == 0 ) THEN   ;   llrim0 = .TRUE.
@@ -82,6 +82,6 @@
          END DO
          !
-         llsend1(:) = .false.
-         llrecv1(:) = .false.
+         IF( nn_hls > 1 .AND. ir == 1 ) CYCLE   ! at least 2 halos will be corrected -> no need to correct rim 1 before rim 0
+         IF( nn_hls == 1 ) THEN   ;   llsend1(:) = .false.   ;   llrecv1(:) = .false.   ;   END IF
          DO ib_bdy=1, nb_bdy
             SELECT CASE( TRIM(cn_tra(ib_bdy)) )
