Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/halo_mng.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/halo_mng.F90	(revision 12718)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/halo_mng.F90	(revision 12719)
@@ -27,5 +27,6 @@
    INTEGER :: jpimax_1, jpjmax_1
    INTEGER :: nlci_1, nlcj_1
-   INTEGER :: jplbi_1, jplbj_1
+   INTEGER :: nldi_1, nldj_1
+   INTEGER :: nlei_1, nlej_1
 CONTAINS
 
@@ -38,12 +39,12 @@
         nlcj_1 = nlcj
 
-        jplbi_1 = 1 
-        jplbj_1 = 1 
-        
-        jplbi = 1 
-        jplbj = 1 
+        nldi_1 = nldi
+        nldj_1 = nldj
 
-   		jpimax_1 = jpimax
-   		jpjmax_1 = jpjmax
+        nlei_1 = nlei
+        nlej_1 = nlej
+
+   	jpimax_1 = jpimax
+   	jpjmax_1 = jpjmax
 
    END SUBROUTINE halo_mng_init
@@ -54,15 +55,19 @@
 
         nn_hls = khls
-        jpi = jpi_1 + khls -1
-        jpj = jpj_1 + khls -1
 
-        nlci = nlci_1 + khls -1
-        nlcj = nlcj_1 + khls -1
+        jpi = jpi_1 + 2*khls -2
+        jpj = jpj_1 + 2*khls -2
+
+        nlci = nlci_1 + 2*khls -2
+        nlcj = nlcj_1 + 2*khls -2
         
-        jplbi = jplbi_1 - khls +1 
-        jplbj = jplbj_1 - khls +1 
-        
-        jpimax = jpimax_1 + khls -1
-        jpjmax = jpjmax_1 + khls -1
+        jpimax = jpimax_1 + 2*khls -2
+        jpjmax = jpjmax_1 + 2*khls -2
+
+        nldi = nldi_1 + khls - 1
+        nldj = nldj_1 + khls - 1
+
+        nlei = nlei_1 + khls - 1
+        nlej = nlej_1 + khls - 1
 
    END SUBROUTINE halo_mng_set
@@ -76,20 +81,18 @@
 		REAL(wp), POINTER, DIMENSION(:,:) :: zpta
 		INTEGER :: offset
-		INTEGER :: pta_size_i, pta_size_j, exp_size_i, exp_size_j
+		INTEGER :: pta_size_i, pta_size_j
 
 		pta_size_i = SIZE(pta,1)
 		pta_size_j = SIZE(pta,2)
-		exp_size_i = jpi - jplbi + 1
-		exp_size_j = jpj - jplbj + 1
 		
 		! check if the current size of pta is equal to the current expected dimension
-		IF (pta_size_i .ne. exp_size_i) THEN
-			ALLOCATE (zpta(jplbi:jpi, jplbj:jpj))
-			offset = (exp_size_i - pta_size_i) / 2 
+		IF (pta_size_i .ne. jpi) THEN
+			ALLOCATE (zpta(jpi, jpj))
+			offset = abs((jpi - pta_size_i) / 2) 
 
-			IF (pta_size_i .lt. exp_size_i) THEN
-				zpta (offset+jplbi : offset+pta_size_i+jplbi-1, offset+jplbj : offset+pta_size_j+jplbj-1) = pta
+			IF (pta_size_i .lt. jpi) THEN
+				zpta (offset+1 : offset+pta_size_i, offset+1 : offset+pta_size_j) = pta
 			ELSE
-				zpta = pta(jplbi : jpi, jplbj : jpj)
+				zpta = pta(offset+1 : offset+jpi, offset+1 : offset+jpj)
 			END IF
 			CALL lbc_lnk( 'halo_mng_resize_2D', zpta, cdna, psgn, pfillval=fillval)
@@ -108,20 +111,18 @@
 		REAL(wp), POINTER, DIMENSION(:,:,:) :: zpta
 		INTEGER :: offset
-		INTEGER :: pta_size_i, pta_size_j, exp_size_i, exp_size_j
+		INTEGER :: pta_size_i, pta_size_j
 
 		pta_size_i = SIZE(pta,1)
 		pta_size_j = SIZE(pta,2)
-		exp_size_i = jpi - jplbi + 1
-		exp_size_j = jpj - jplbj + 1
 		
 		! check if the current size of pta is equal to the current expected dimension
-		IF (pta_size_i .ne. exp_size_i) THEN
-			ALLOCATE (zpta(jplbi:jpi, jplbj:jpj, jpk))
-			offset = (exp_size_i - pta_size_i) / 2 
+		IF (pta_size_i .ne. jpi) THEN
+			ALLOCATE (zpta(jpi, jpj, jpk))
+			offset = abs((jpi - pta_size_i) / 2) 
 
-			IF (pta_size_i .lt. exp_size_i) THEN
-				zpta (offset+jplbi : offset+pta_size_i+jplbi-1, offset+jplbj : offset+pta_size_j+jplbj-1, :) = pta
+			IF (pta_size_i .lt. jpi) THEN
+				zpta (offset+1 : offset+pta_size_i, offset+1 : offset+pta_size_j, :) = pta
 			ELSE
-				zpta = pta(jplbi : jpi, jplbj : jpj, :)
+				zpta = pta(offset+1 : offset+jpi, offset+1 : offset+jpj, :)
 			END IF
 			CALL lbc_lnk( 'halo_mng_resize_3D', zpta, cdna, psgn, pfillval=fillval)
@@ -141,20 +142,18 @@
 		REAL(wp), POINTER, DIMENSION(:,:,:,:) :: zpta
 		INTEGER :: offset
-		INTEGER :: pta_size_i, pta_size_j, exp_size_i, exp_size_j
+		INTEGER :: pta_size_i, pta_size_j
 
 		pta_size_i = SIZE(pta,1)
 		pta_size_j = SIZE(pta,2)
-		exp_size_i = jpi - jplbi + 1
-		exp_size_j = jpj - jplbj + 1
 		
 		! check if the current size of pta is equal to the current expected dimension
-		IF (pta_size_i .ne. exp_size_i) THEN
-			ALLOCATE (zpta(jplbi:jpi, jplbj:jpj, jpk, jpt))
-			offset = (exp_size_i - pta_size_i) / 2 
+		IF (pta_size_i .ne. jpi) THEN
+			ALLOCATE (zpta(jpi, jpj, jpk, jpt))
+			offset = abs((jpi - pta_size_i) / 2) 
 
-			IF (pta_size_i .lt. exp_size_i) THEN
-				zpta (offset+jplbi : offset+pta_size_i+jplbi-1, offset+jplbj : offset+pta_size_j+jplbj-1, :, :) = pta
+			IF (pta_size_i .lt. jpi) THEN
+				zpta (offset+1 : offset+pta_size_i, offset+1 : offset+pta_size_j, :, :) = pta
 			ELSE
-				zpta = pta(jplbi : jpi, jplbj : jpj, :, :)
+				zpta = pta(offset+1 : offset+jpi, offset+1 : offset+jpj, :, :)
 			END IF
 			CALL lbc_lnk( 'halo_mng_resize_4D', zpta(:,:,:,fjpt), cdna, psgn, pfillval=fillval)
@@ -175,20 +174,18 @@
 		REAL(wp), POINTER, DIMENSION(:,:,:,:,:) :: zpta
 		INTEGER :: offset
-		INTEGER :: pta_size_i, pta_size_j, exp_size_i, exp_size_j
+		INTEGER :: pta_size_i, pta_size_j
 
 		pta_size_i = SIZE(pta,1)
 		pta_size_j = SIZE(pta,2)
-		exp_size_i = jpi - jplbi + 1
-		exp_size_j = jpj - jplbj + 1
 		
 		! check if the current size of pta is equal to the current expected dimension
-		IF (pta_size_i .ne. exp_size_i) THEN
-			ALLOCATE (zpta(jplbi:jpi, jplbj:jpj, jpk, kjpt, jpt))
-			offset = (exp_size_i - pta_size_i) / 2 
+		IF (pta_size_i .ne. jpi) THEN
+			ALLOCATE (zpta(jpi, jpj, jpk, kjpt, jpt))
+			offset = abs((jpi - pta_size_i) / 2) 
 
-			IF (pta_size_i .lt. exp_size_i) THEN
-				zpta (offset+jplbi : offset+pta_size_i+jplbi-1, offset+jplbj : offset+pta_size_j+jplbj-1, :, :, :) = pta
+			IF (pta_size_i .lt. jpi) THEN
+				zpta (offset+1 : offset+pta_size_i, offset+1 : offset+pta_size_j, :, :, :) = pta
 			ELSE
-				zpta = pta(jplbi : jpi, jplbj : jpj, :, :, :)
+				zpta = pta(offset+1 : offset+jpi, offset+1 : offset+jpj, :, :, :)
 			END IF
 			CALL lbc_lnk( 'halo_mng_resize_5D', zpta(:,:,:,:,fjpt), cdna, psgn, pfillval=fillval)
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/lbc_nfd_nogather_generic.h90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/lbc_nfd_nogather_generic.h90	(revision 12718)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/lbc_nfd_nogather_generic.h90	(revision 12719)
@@ -57,6 +57,6 @@
       !!
       !!----------------------------------------------------------------------
-      ARRAY_TYPE(1-nn_hls+1:,1-nn_hls+1:,:,:,:)
-      ARRAY2_TYPE(1-nn_hls+1:,:,:,:,:) 
+      ARRAY_TYPE(:,:,:,:,:)
+      ARRAY2_TYPE(:,:,:,:,:) 
       CHARACTER(len=1) , INTENT(in   ) ::   NAT_IN(:)   ! nature of array grid-points
       REAL(wp)         , INTENT(in   ) ::   SGN_IN(:)   ! sign used across the north fold boundary
@@ -91,32 +91,32 @@
             !
             CASE ( 'T' , 'W' )                         ! T-, W-point
-               IF ( nimpp - nn_hls+1 /= 1 ) THEN  ;  startloop = 1 - nn_hls + 1
-               ELSE                     ;   startloop = 2
+               IF ( nimpp /= 1 ) THEN  ;  startloop = 1 
+               ELSE                    ;  startloop = 1 + nn_hls
                ENDIF
                !
                DO jl = 1, ipl; DO jk = 1, ipk
                	  DO jj = 1, nn_hls
+               	     ijj = nlcj -jj +1
+                     DO ji = startloop, nlci
+                    	ijt = jpiglo - (ji + nimpp-nn_hls+1 ) - nfiimpp(isendto(1),jpnj) + 4
+                     	ARRAY_IN(ji,ijj,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(ijt,jj,jk,jl,jf)
+                     END DO
+                  END DO
+               END DO; END DO
+               IF( nimpp == 1 ) THEN
+                  DO jl = 1, ipl; DO jk = 1, ipk
+                     DO jj = 1, nn_hls
                	  	ijj = nlcj -jj +1
-                  	DO ji = startloop, nlci
-                    	ijt = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 4
-                     	ARRAY_IN(ji,ijj,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(ijt,jj,jk,jl,jf)
-                    END DO
-                  END DO
-               END DO; END DO
-               IF( nimpp - nn_hls+1 == 1 ) THEN
-                  DO jl = 1, ipl; DO jk = 1, ipk
-                  	DO jj = 1, nn_hls
-               	  		ijj = nlcj -jj +1
-               	  		DO ii = 1, nn_hls
-                     		   ARRAY_IN(1-ii+1,ijj,jk,jl,jf) = SGN_IN(jf) * ARRAY_IN(ii+2,nlcj-2*nn_hls+jj-1,jk,jl,jf)
-                   		END DO
-                   	END DO
+               	  	DO ii = 0, nn_hls-1
+                  	   ARRAY_IN(ii+1,ijj,jk,jl,jf) = SGN_IN(jf) * ARRAY_IN(2*nn_hls-ii+1,nlcj-2*nn_hls+jj-1,jk,jl,jf)
+                  	END DO
+                     END DO
                   END DO; END DO
                ENDIF              
                !
                IF ( .NOT. l_fast_exchanges ) THEN
-                  IF( nimpp - nn_hls +1 >= jpiglo/2+1 ) THEN
-                     startloop = 1 - nn_hls +1
-                ELSEIF( nimpp+nlci-1 >= jpiglo/2+1 .AND. nimpp - nn_hls +1 < jpiglo/2+1 ) THEN
+                  IF( nimpp >= jpiglo/2+1 ) THEN
+                     startloop = 1
+                  ELSEIF( nimpp+nlci-2*nn_hls+1 >= jpiglo/2+1 .AND. nimpp < jpiglo/2+1 ) THEN
                      startloop = jpiglo/2+1 - nimpp + nn_hls
                   ELSE
@@ -126,9 +126,9 @@
                      DO jl = 1, ipl; DO jk = 1, ipk
                         DO ji = startloop, nlci
-                           ijt  = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 4
-                           jia  = ji + nimpp - 1
+                           ijt  = jpiglo - (ji + nimpp -nn_hls+1)- nfiimpp(isendto(1),jpnj) + 4
+                           jia  = ji + nimpp -nn_hls
                            ijta = jpiglo - jia + 2
                            IF( ijta >= startloop+nimpp-1 .AND. ijta < jia ) THEN
-                              ARRAY_IN(ji,nlcj-nn_hls,jk,jl,jf) = SGN_IN(jf) * ARRAY_IN(ijta-nimpp+1,nlcj-nn_hls,jk,jl,jf)
+                              ARRAY_IN(ji,nlcj-nn_hls,jk,jl,jf) = SGN_IN(jf) * ARRAY_IN(ijta-nimpp+nn_hls,nlcj-nn_hls,jk,jl,jf)
                            ELSE
                               ARRAY_IN(ji,nlcj-nn_hls,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(ijt,nn_hls+1,jk,jl,jf)
@@ -139,5 +139,5 @@
                ENDIF
             CASE ( 'U' )                                     ! U-point
-               IF( nimpp + nlci - nn_hls /= jpiglo ) THEN
+               IF( nimpp + nlci - 2*nn_hls+1 /= jpiglo ) THEN
                   endloop = nlci
                ELSE
@@ -145,39 +145,39 @@
                ENDIF
                DO jl = 1, ipl; DO jk = 1, ipk
-				  DO jj = 1, nn_hls
-               	  	ijj = nlcj -jj +1
-                  	DO ji = 1-nn_hls+1, endloop
-                    	iju = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 3
-                     	ARRAY_IN(ji,ijj,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(iju,jj,jk,jl,jf)
-                  	END DO
-                  END DO
-               END DO; END DO
-               IF (nimpp - nn_hls+1 .eq. 1) THEN
-					DO jj = 1, nn_hls
-						ijj = nlcj -jj +1
-						DO ii = 1, nn_hls
-							ARRAY_IN(2-ii,ijj,:,:,jf) = SGN_IN(jf) * ARRAY_IN(ii+1,nlcj-2*nn_hls+jj-1,:,:,jf)
-						END DO
-                  	END DO
-               ENDIF
-               IF((nimpp + nlci - nn_hls) .eq. jpiglo) THEN
-                  	DO jj = 1, nn_hls
-               	  		ijj = nlcj -jj +1
-						DO ii = 1, nn_hls
-							ARRAY_IN(nlci-ii+1,ijj,:,:,jf) = SGN_IN(jf) * ARRAY_IN(nlci-2*nn_hls+ii,nlcj-2*nn_hls+jj-1,:,:,jf)
-						END DO
-					END DO
-               ENDIF
-               !
-               IF ( .NOT. l_fast_exchanges ) THEN
-                  IF( nimpp + nlci - nn_hls /= jpiglo ) THEN
+		  DO jj = 1, nn_hls
+        	     ijj = nlcj -jj +1
+                     DO ji = 1, endloop
+                        iju = jpiglo - (ji + nimpp -nn_hls+1)- nfiimpp(isendto(1),jpnj) + 3
+                        ARRAY_IN(ji,ijj,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(iju,jj,jk,jl,jf)
+                     END DO
+                  END DO
+               END DO; END DO
+               IF (nimpp .eq. 1) THEN
+		  DO jj = 1, nn_hls
+		     ijj = nlcj -jj +1
+		     DO ii = 0, nn_hls-1
+		 	ARRAY_IN(ii+1,ijj,:,:,jf) = SGN_IN(jf) * ARRAY_IN(2*nn_hls-ii,nlcj-2*nn_hls+jj-1,:,:,jf)
+		     END DO
+                  END DO
+               ENDIF
+               IF((nimpp + nlci - 2*nn_hls+1) .eq. jpiglo) THEN
+                  DO jj = 1, nn_hls
+               	     ijj = nlcj -jj +1
+			DO ii = 1, nn_hls
+		   	   ARRAY_IN(nlci-ii+1,ijj,:,:,jf) = SGN_IN(jf) * ARRAY_IN(nlci-2*nn_hls+ii,nlcj-2*nn_hls+jj-1,:,:,jf)
+			END DO
+		  END DO
+               ENDIF
+               !
+               IF ( .NOT. l_fast_exchanges ) THEN
+                  IF( nimpp + nlci - 2*nn_hls+1 /= jpiglo ) THEN
                      endloop = nlci
                   ELSE
                      endloop = nlci - nn_hls
                   ENDIF
-                  IF( nimpp - nn_hls+1 >= jpiglo/2 ) THEN
-                     startloop = 1- nn_hls + 1
-                     ELSEIF( ( nimpp+nlci-1 >= jpiglo/2 ) .AND. ( nimpp - nn_hls+1 < jpiglo/2 ) ) THEN
-                     startloop = jpiglo/2 - nimpp + nn_hls
+                  IF( nimpp >= jpiglo/2 ) THEN
+                     startloop = 1
+                  ELSEIF( ( nimpp + nlci - 2*nn_hls+1 >= jpiglo/2 ) .AND. ( nimpp < jpiglo/2 ) ) THEN
+                     startloop = jpiglo/2 - (nimpp -nn_hls+1) +1
                   ELSE
                      startloop = endloop + 1
@@ -186,9 +186,9 @@
                   DO jl = 1, ipl; DO jk = 1, ipk
                      DO ji = startloop, endloop
-                        iju = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 3
-                        jia = ji + nimpp - 1
+                        iju = jpiglo - (ji + nimpp -nn_hls+1) - nfiimpp(isendto(1),jpnj) + 3
+                        jia = ji + nimpp -nn_hls
                         ijua = jpiglo - jia + 1
                         IF( ijua >= startloop+nimpp-1 .AND. ijua < jia ) THEN
-                           ARRAY_IN(ji,nlcj-nn_hls,jk,jl,jf) = SGN_IN(jf) * ARRAY_IN(ijua-nimpp+1,nlcj-nn_hls,jk,jl,jf)
+                           ARRAY_IN(ji,nlcj-nn_hls,jk,jl,jf) = SGN_IN(jf) * ARRAY_IN(ijua-nimpp+nn_hls,nlcj-nn_hls,jk,jl,jf)
                         ELSE
                            ARRAY_IN(ji,nlcj-nn_hls,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(iju,nn_hls+1,jk,jl,jf)
@@ -200,16 +200,16 @@
                !
             CASE ( 'V' )                                     ! V-point
-               IF( nimpp - nn_hls+1 /= 1 ) THEN
-                 startloop = 1 - nn_hls + 1
+               IF( nimpp /= 1 ) THEN
+                 startloop = 1 
                ELSE
-                 startloop = 2
-               ENDIF
-               IF ( .NOT. l_fast_exchanges ) THEN
-                  DO jl = 1, ipl; DO jk = 1, ipk
-               	  	DO jj = 2, nn_hls+1
-               	  		ijj = nlcj -jj +1
+                 startloop = 1 + nn_hls
+               ENDIF
+               IF ( .NOT. l_fast_exchanges ) THEN
+                  DO jl = 1, ipl; DO jk = 1, ipk
+               	     DO jj = 2, nn_hls+1
+               	  	ijj = nlcj -jj +1
                      	DO ji = startloop, nlci
-                        	ijt=jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 4
-                        	ARRAY_IN(ji,ijj,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(ijt,jj,jk,jl,jf)
+                           ijt=jpiglo - (ji +nimpp -nn_hls+1)- nfiimpp(isendto(1),jpnj) + 4
+                           ARRAY_IN(ji,ijj,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(ijt,jj,jk,jl,jf)
                      	END DO
                     END DO
@@ -218,18 +218,18 @@
                DO jl = 1, ipl; DO jk = 1, ipk
                   DO ji = startloop, nlci
-                     ijt=jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 4
+                     ijt=jpiglo - (ji + nimpp -nn_hls+1)- nfiimpp(isendto(1),jpnj) + 4
                      ARRAY_IN(ji,nlcj,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(ijt,1,jk,jl,jf)
                   END DO
                END DO; END DO
-               IF (nimpp - nn_hls+1.eq. 1) THEN
-					DO jj = 1, nn_hls
-               			ijj = nlcj-jj+1
-               			DO ii = 1, nn_hls
-    	           			ARRAY_IN(1-ii+1,ijj,:,:,jf) = SGN_IN(jf) * ARRAY_IN(ii+2,nlcj-2*nn_hls+jj-1,:,:,jf)
-						END DO
-					END DO
+               IF (nimpp .eq. 1) THEN
+		  DO jj = 1, nn_hls
+               	     ijj = nlcj-jj+1
+               	     DO ii = 0, nn_hls-1
+                        ARRAY_IN(ii+1,ijj,:,:,jf) = SGN_IN(jf) * ARRAY_IN(2*nn_hls-ii+1,nlcj-2*nn_hls+jj-1,:,:,jf)
+		     END DO
+		  END DO
                ENDIF
             CASE ( 'F' )                                     ! F-point
-               IF( nimpp + nlci - nn_hls /= jpiglo ) THEN
+               IF( nimpp + nlci - 2*nn_hls+1 /= jpiglo ) THEN
                   endloop = nlci
                ELSE
@@ -238,9 +238,9 @@
                IF ( .NOT. l_fast_exchanges ) THEN
                   DO jl = 1, ipl; DO jk = 1, ipk
-               	  	DO jj = 2, nn_hls+1
-               	  		ijj = nlcj -jj +1
-                     	DO ji = 1 - nn_hls +1, endloop
-                        	iju = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 3
-                        	ARRAY_IN(ji,ijj,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(iju,jj,jk,jl,jf)
+               	     DO jj = 2, nn_hls+1
+               	  	ijj = nlcj -jj +1
+                     	DO ji = 1, endloop
+                           iju = jpiglo - (ji + nimpp -nn_hls+1) - nfiimpp(isendto(1),jpnj) + 3
+                           ARRAY_IN(ji,ijj,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(iju,jj,jk,jl,jf)
                      	END DO
                     END DO
@@ -248,34 +248,34 @@
                ENDIF
                DO jl = 1, ipl; DO jk = 1, ipk
-                  DO ji = 1- nn_hls +1, endloop
-                     iju = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 3
+                  DO ji = 1, endloop
+                     iju = jpiglo - (ji + nimpp -nn_hls+1) - nfiimpp(isendto(1),jpnj) + 3
                      ARRAY_IN(ji,nlcj,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(iju,1,jk,jl,jf)
                   END DO
                END DO; END DO
-		IF (nimpp - nn_hls+1.eq. 1) THEN               
-			DO ii = 1, nn_hls
-	                	ARRAY_IN(2-ii,nlcj,:,:,jf) = SGN_IN(jf) * ARRAY_IN(ii+1,nlcj-2*nn_hls-1,:,:,jf)
-			END DO
-			IF ( .NOT. l_fast_exchanges ) THEN
-				DO jj = 1, nn_hls
-               				ijj = nlcj -jj
-               				DO ii = 1, nn_hls
-                    			ARRAY_IN(2-ii,ijj,:,:,jf) = SGN_IN(jf) * ARRAY_IN(ii+1,nlcj-2*nn_hls+jj-1,:,:,jf)
-                 	   	   	END DO
-                  		END DO
-               		ENDIF
+		IF (nimpp .eq. 1) THEN               
+		   DO ii = 1, nn_hls
+	              ARRAY_IN(ii+1,nlcj,:,:,jf) = SGN_IN(jf) * ARRAY_IN(2*nn_hls-ii,nlcj-2*nn_hls-1,:,:,jf)
+		   END DO
+		   IF ( .NOT. l_fast_exchanges ) THEN
+		      DO jj = 1, nn_hls
+               	 	 ijj = nlcj -jj
+               		 DO ii = 1, nn_hls
+                    	    ARRAY_IN(2-ii,ijj,:,:,jf) = SGN_IN(jf) * ARRAY_IN(2*nn_hls-ii,nlcj-2*nn_hls+jj-1,:,:,jf)
+                 	 END DO
+                      END DO
+               	   ENDIF
 		ENDIF
-		IF((nimpp + nlci - nn_hls ) .eq. jpiglo) THEN
-               		DO ii = 1, nn_hls
-	                	ARRAY_IN(nlci-ii+1,nlcj,:,:,jf) = SGN_IN(jf) * ARRAY_IN(nlci-2*nn_hls+ii,nlcj-2*nn_hls-1,:,:,jf)
-			END DO
-			IF ( .NOT. l_fast_exchanges ) THEN
-				DO jj = 1, nn_hls
-               				ijj = nlcj -jj
-	               			DO ii = 1, nn_hls
-                    			ARRAY_IN(nlci-ii+1,ijj,:,:,jf) = SGN_IN(jf) * ARRAY_IN(nlci-2*nn_hls+ii,nlcj-2*nn_hls+jj-1,:,:,jf)
-                    			END DO
-                   		END DO
-               		ENDIF
+		IF((nimpp + nlci - 2*nn_hls+1 ) .eq. jpiglo) THEN
+                   DO ii = 1, nn_hls
+	              ARRAY_IN(nlci-ii+1,nlcj,:,:,jf) = SGN_IN(jf) * ARRAY_IN(nlci-2*nn_hls+ii,nlcj-2*nn_hls-1,:,:,jf)
+		   END DO
+		   IF ( .NOT. l_fast_exchanges ) THEN
+		      DO jj = 1, nn_hls
+               	         ijj = nlcj -jj
+	               	 DO ii = 1, nn_hls
+                    	    ARRAY_IN(nlci-ii+1,ijj,:,:,jf) = SGN_IN(jf) * ARRAY_IN(nlci-2*nn_hls+ii,nlcj-2*nn_hls+jj-1,:,:,jf)
+                     	 END DO
+                      END DO
+               	   ENDIF
                	ENDIF
                	!
@@ -290,5 +290,5 @@
  		     ijj = nlcj-jj+1
 		     DO ji = 1, nlci
-                     	ijt = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 3
+                     	ijt = jpiglo - ( ji + nimpp -nn_hls+1) - nfiimpp(isendto(1),jpnj) + 3
                      	ARRAY_IN(ji,ijj,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(ijt,jj,jk,jl,jf)
                      END DO
@@ -297,5 +297,5 @@
                !
             CASE ( 'U' )                                     ! U-point
-               IF( nimpp + nlci - nn_hls /= jpiglo ) THEN
+               IF( nimpp + nlci - 2*nn_hls+1 /= jpiglo ) THEN
                   endloop = nlci
                ELSE
@@ -306,10 +306,10 @@
  		     ijj = nlcj-jj+1
                      DO ji = 1, endloop
-                        iju = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 2
+                        iju = jpiglo- (ji + nimpp -nn_hls+1) - nfiimpp(isendto(1),jpnj) + 2
                         ARRAY_IN(ji,ijj,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(iju,jj,jk,jl,jf)
                      END DO
                   END DO
                END DO; END DO
-               IF((nimpp + nlci - nn_hls) .eq. jpiglo) THEN
+               IF(nimpp + nlci - 2*nn_hls+1 .eq. jpiglo) THEN
                   DO jl = 1, ipl; DO jk = 1, ipk
                      DO jj = 1, nn_hls
@@ -325,8 +325,8 @@
             CASE ( 'V' )                                     ! V-point
                DO jl = 1, ipl; DO jk = 1, ipk
-                  DO ji = 1, nlci
-		     DO jj = 1, nn_hls
-			ijj = nlcj -jj +1
-                        ijt = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 3
+		  DO jj = 1, nn_hls
+		     ijj = nlcj -jj +1
+                     DO ji = 1, nlci
+                        ijt = jpiglo - (ji + nimpp -nn_hls+1) - nfiimpp(isendto(1),jpnj) + 3
                         ARRAY_IN(ji,ijj,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(ijt,jj,jk,jl,jf)
                      END DO
@@ -335,7 +335,7 @@
 
                IF ( .NOT. l_fast_exchanges ) THEN
-                  IF( nimpp -nn_hls+1 >= jpiglo/2+1 ) THEN
-                     startloop = 1-nn_hls+1
-                  ELSEIF( nimpp+nlci-1 >= jpiglo/2+1 .AND. nimpp - nn_hls+1 < jpiglo/2+1 ) THEN
+                  IF( nimpp >= jpiglo/2+1 ) THEN
+                     startloop = 1
+                  ELSEIF( nimpp+nlci-2*nn_hls+1 >= jpiglo/2+1 .AND. nimpp < jpiglo/2+1 ) THEN
                      startloop = jpiglo/2+1 - nimpp + nn_hls
                   ELSE
@@ -345,5 +345,5 @@
                   DO jl = 1, ipl; DO jk = 1, ipk
                         DO ji = startloop, nlci
-                   	   ijt = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 3
+                   	   ijt = jpiglo - (ji + nimpp -nn_hls+1) - nfiimpp(isendto(1),jpnj) + 3
                            ARRAY_IN(ji,nlcj-nn_hls,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(ijt,nn_hls+1,jk,jl,jf)
                         END DO
@@ -353,5 +353,5 @@
                !
             CASE ( 'F' )                               ! F-point
-               IF( nimpp + nlci - nn_hls /= jpiglo ) THEN
+               IF( nimpp + nlci - 2*nn_hls+1 /= jpiglo ) THEN
                   endloop = nlci
                ELSE
@@ -362,10 +362,10 @@
 		    ijj = nlcj -jj +1
                     DO ji = 1, endloop
-                       iju = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 2
+                       iju = jpiglo - (ji + nimpp -nn_hls+1) - nfiimpp(isendto(1),jpnj) + 2
                        ARRAY_IN(ji,ijj ,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(iju,jj,jk,jl,jf)
                      END DO
                   END DO
                END DO; END DO
-               IF((nimpp + nlci - nn_hls) .eq. jpiglo) THEN
+               IF((nimpp + nlci - 2*nn_hls+1) .eq. jpiglo) THEN
                   DO jl = 1, ipl; DO jk = 1, ipk
                      DO jj = 1, nn_hls
@@ -380,12 +380,12 @@
                !
                IF ( .NOT. l_fast_exchanges ) THEN
-                  IF( nimpp + nlci - nn_hls /= jpiglo ) THEN
+                  IF( nimpp + nlci - 2*nn_hls+1 /= jpiglo ) THEN
                      endloop = nlci
                   ELSE
                      endloop = nlci - nn_hls
                   ENDIF
-                  IF( nimpp - nn_hls+1 >= jpiglo/2+1 ) THEN
-                     startloop = 1 - nn_hls+1
-                  ELSEIF( nimpp+nlci-1 >= jpiglo/2+1 .AND. nimpp - nn_hls+1 < jpiglo/2+1 ) THEN
+                  IF( nimpp >= jpiglo/2+1 ) THEN
+                     startloop = 1 
+                  ELSEIF( nimpp+nlci-2*nn_hls+1 >= jpiglo/2+1 .AND. nimpp < jpiglo/2+1 ) THEN
                      startloop = jpiglo/2+1 - nimpp + nn_hls
                   ELSE
@@ -395,5 +395,5 @@
                      DO jl = 1, ipl; DO jk = 1, ipk
                         DO ji = startloop, endloop
-                           iju = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 2
+                           iju = jpiglo - (ji + nimpp -nn_hls+1) - nfiimpp(isendto(1),jpnj) + 2
                            ARRAY_IN(ji,nlcj-nn_hls,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(iju,nn_hls+1,jk,jl,jf)
                         END DO
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/mpp_lnk_generic.h90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/mpp_lnk_generic.h90	(revision 12718)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/mpp_lnk_generic.h90	(revision 12719)
@@ -51,5 +51,5 @@
    SUBROUTINE ROUTINE_LNK( cdname, ptab, cd_nat, psgn      , kfillmode, pfillval, lsend, lrecv )
 #endif
-      ARRAY_TYPE(1-nn_hls+1:,1-nn_hls+1:,:,:,:)                                        ! array or pointer of arrays on which the boundary condition is applied
+      ARRAY_TYPE(:,:,:,:,:)                                        ! array or pointer of arrays on which the boundary condition is applied
       CHARACTER(len=*)              , INTENT(in   ) ::   cdname      ! name of the calling subroutine
       CHARACTER(len=1)              , INTENT(in   ) ::   NAT_IN(:)   ! nature of array grid-points
@@ -142,24 +142,23 @@
       ! -------------------------------------------------- !
       !
-
       ! Must exchange the whole column (from 1 to jpj) to get the corners if we have no south/north neighbourg
-      isize = nn_hls * ( jpj + nn_hls - 1 ) * ipk * ipl * ipf      
+      isize = nn_hls * jpj * ipk * ipl * ipf      
       !
       ! Allocate local temporary arrays to be sent/received. Fill arrays to be sent
-      IF( llsend_we )   ALLOCATE( zsnd_we(nn_hls,1-nn_hls+1:jpj,ipk,ipl,ipf) )
-      IF( llsend_ea )   ALLOCATE( zsnd_ea(nn_hls,1-nn_hls+1:jpj,ipk,ipl,ipf) )
-      IF( llrecv_we )   ALLOCATE( zrcv_we(nn_hls,1-nn_hls+1:jpj,ipk,ipl,ipf) )
-      IF( llrecv_ea )   ALLOCATE( zrcv_ea(nn_hls,1-nn_hls+1:jpj,ipk,ipl,ipf) )
+      IF( llsend_we )   ALLOCATE( zsnd_we(nn_hls,jpj,ipk,ipl,ipf) )
+      IF( llsend_ea )   ALLOCATE( zsnd_ea(nn_hls,jpj,ipk,ipl,ipf) )
+      IF( llrecv_we )   ALLOCATE( zrcv_we(nn_hls,jpj,ipk,ipl,ipf) )
+      IF( llrecv_ea )   ALLOCATE( zrcv_ea(nn_hls,jpj,ipk,ipl,ipf) )
       !
       IF( llsend_we ) THEN   ! copy western side of the inner mpi domain in local temporary array to be sent by MPI
-         ishift = 1
-         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1-nn_hls+1, jpj   ;   DO ji = 1, nn_hls
+         ishift = nn_hls
+         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
             zsnd_we(ji,jj,jk,jl,jf) = ARRAY_IN(ishift+ji,jj,jk,jl,jf)   ! nn_hls + 1 -> 2*nn_hls
          END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
       ENDIF
       !
-      IF( llsend_ea ) THEN   ! copy eastern side of the inner mpi domain in local temporary array to be sent by MPI
-         ishift = jpi -  2 * nn_hls
-         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1-nn_hls+1, jpj   ;   DO ji = 1, nn_hls
+      IF(llsend_ea  ) THEN   ! copy eastern side of the inner mpi domain in local temporary array to be sent by MPI
+         ishift = jpi - 2 * nn_hls
+         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
             zsnd_ea(ji,jj,jk,jl,jf) = ARRAY_IN(ishift+ji,jj,jk,jl,jf)   ! jpi - 2*nn_hls + 1 -> jpi - nn_hls
          END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
@@ -169,9 +168,9 @@
       !
       ! non-blocking send of the western/eastern side using local temporary arrays
-      IF( llsend_we )   CALL mppsend( 1, zsnd_we(1,1-nn_hls+1,1,1,1), isize, nowe, ireq_we )
-      IF( llsend_ea )   CALL mppsend( 2, zsnd_ea(1,1-nn_hls+1,1,1,1), isize, noea, ireq_ea )
+      IF( llsend_we )   CALL mppsend( 1, zsnd_we(1,1,1,1,1), isize, nowe, ireq_we )
+      IF( llsend_ea )   CALL mppsend( 2, zsnd_ea(1,1,1,1,1), isize, noea, ireq_ea )
       ! blocking receive of the western/eastern halo in local temporary arrays
-      IF( llrecv_we )   CALL mpprecv( 2, zrcv_we(1,1-nn_hls+1,1,1,1), isize, nowe )
-      IF( llrecv_ea )   CALL mpprecv( 1, zrcv_ea(1,1-nn_hls+1,1,1,1), isize, noea )
+      IF( llrecv_we )   CALL mpprecv( 2, zrcv_we(1,1,1,1,1), isize, nowe )
+      IF( llrecv_ea )   CALL mpprecv( 1, zrcv_ea(1,1,1,1,1), isize, noea )
       !
       IF( ln_timing ) CALL tic_tac(.FALSE.)
@@ -188,17 +187,17 @@
       CASE ( jpfillnothing )               ! no filling 
       CASE ( jpfillmpi   )                 ! use data received by MPI 
-         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1-nn_hls+1, jpj   ;   DO ji = 1, nn_hls
-            ARRAY_IN(ji-nn_hls+1,jj,jk,jl,jf) = zrcv_we(ji,jj,jk,jl,jf)   ! 1 -> nn_hls
+         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
+            ARRAY_IN(ji,jj,jk,jl,jf) = zrcv_we(ji,jj,jk,jl,jf)   ! 1 -> nn_hls
          END DO;   END DO   ;   END DO   ;   END DO   ;   END DO
       CASE ( jpfillperio )                 ! use east-weast periodicity
          ishift2 = jpi - 2 * nn_hls
-         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1-nn_hls+1, jpj   ;   DO ji = 1, nn_hls
-            ARRAY_IN(ji-nn_hls+1,jj,jk,jl,jf) = ARRAY_IN(ishift2+ji,jj,jk,jl,jf)
+         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
+            ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(ishift2+ji,jj,jk,jl,jf)
          END DO;   END DO   ;   END DO   ;   END DO   ;   END DO
       CASE ( jpfillcopy  )                 ! filling with inner domain values
          DO jf = 1, ipf                               ! number of arrays to be treated
             IF( .NOT. NAT_IN(jf) == 'F' ) THEN        ! do nothing for F point
-               DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1-nn_hls+1, jpj   ;   DO ji = 1, nn_hls
-                  ARRAY_IN(ji-nn_hls+1,jj,jk,jl,jf) = ARRAY_IN(1+ji,jj,jk,jl,jf)
+               DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
+                  ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(nn_hls+1,jj,jk,jl,jf)
                END DO   ;   END DO   ;   END DO   ;   END DO
             ENDIF
@@ -207,6 +206,6 @@
          DO jf = 1, ipf                               ! number of arrays to be treated
             IF( .NOT. NAT_IN(jf) == 'F' ) THEN        ! do nothing for F point
-               DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1-nn_hls+1, jpj   ;   DO ji = 1, nn_hls
-                  ARRAY_IN(ji-nn_hls+1,jj,jk,jl,jf) = zland
+               DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
+                  ARRAY_IN(ji,jj,jk,jl,jf) = zland
                END DO;   END DO   ;   END DO   ;   END DO
             ENDIF
@@ -220,19 +219,18 @@
       CASE ( jpfillnothing )               ! no filling 
       CASE ( jpfillmpi   )                 ! use data received by MPI 
-         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1-nn_hls+1, jpj   ;   DO ji = 1, nn_hls
+         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
             ARRAY_IN(ishift+ji,jj,jk,jl,jf) = zrcv_ea(ji,jj,jk,jl,jf)   ! jpi - nn_hls + 1 -> jpi
          END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
       CASE ( jpfillperio )                 ! use east-weast periodicity
-         ishift2 = 1
-         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1-nn_hls+1, jpj   ;   DO ji = 1, nn_hls
+         ishift2 = nn_hls
+         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
             ARRAY_IN(ishift+ji,jj,jk,jl,jf) = ARRAY_IN(ishift2+ji,jj,jk,jl,jf)
          END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
       CASE ( jpfillcopy  )                 ! filling with inner domain values
-		 ishift2 = jpi - 2*nn_hls
-         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1-nn_hls+1, jpj   ;   DO ji = 1, nn_hls
-            ARRAY_IN(ishift+ji,jj,jk,jl,jf) = ARRAY_IN(ishift2+ji,jj,jk,jl,jf)
+         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
+            ARRAY_IN(ishift+ji,jj,jk,jl,jf) = ARRAY_IN(ishift,jj,jk,jl,jf)
          END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
       CASE ( jpfillcst   )                 ! filling with constant value
-         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1-nn_hls+1, jpj   ;   DO ji = 1, nn_hls
+         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls
             ARRAY_IN(ishift+ji,jj,jk,jl,jf) = zland
          END DO;   END DO   ;   END DO   ;   END DO   ;   END DO
@@ -260,15 +258,15 @@
       ! ---------------------------------------------------- !
       !
-      IF( llsend_so )   ALLOCATE( zsnd_so(1-nn_hls+1:jpi,nn_hls,ipk,ipl,ipf) )
-      IF( llsend_no )   ALLOCATE( zsnd_no(1-nn_hls+1:jpi,nn_hls,ipk,ipl,ipf) )
-      IF( llrecv_so )   ALLOCATE( zrcv_so(1-nn_hls+1:jpi,nn_hls,ipk,ipl,ipf) )
-      IF( llrecv_no )   ALLOCATE( zrcv_no(1-nn_hls+1:jpi,nn_hls,ipk,ipl,ipf) )
-      !
-      isize = ( jpi + nn_hls - 1 ) * nn_hls * ipk * ipl * ipf      
+      IF( llsend_so )   ALLOCATE( zsnd_so(jpi,nn_hls,ipk,ipl,ipf) )
+      IF( llsend_no )   ALLOCATE( zsnd_no(jpi,nn_hls,ipk,ipl,ipf) )
+      IF( llrecv_so )   ALLOCATE( zrcv_so(jpi,nn_hls,ipk,ipl,ipf) )
+      IF( llrecv_no )   ALLOCATE( zrcv_no(jpi,nn_hls,ipk,ipl,ipf) )
+      !
+      isize = jpi * nn_hls * ipk * ipl * ipf      
 
       ! allocate local temporary arrays to be sent/received. Fill arrays to be sent
       IF( llsend_so ) THEN   ! copy sourhern side of the inner mpi domain in local temporary array to be sent by MPI
-         ishift = 1
-         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1-nn_hls+1, jpi
+         ishift = nn_hls
+         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
             zsnd_so(ji,jj,jk,jl,jf) = ARRAY_IN(ji,ishift+jj,jk,jl,jf)   ! nn_hls+1 -> 2*nn_hls
          END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
@@ -277,5 +275,5 @@
       IF( llsend_no ) THEN   ! copy eastern side of the inner mpi domain in local temporary array to be sent by MPI
          ishift = jpj - 2 * nn_hls
-         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1-nn_hls+1, jpi
+         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
             zsnd_no(ji,jj,jk,jl,jf) = ARRAY_IN(ji,ishift+jj,jk,jl,jf)   ! jpj-2*nn_hls+1 -> jpj-nn_hls
          END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
@@ -285,9 +283,9 @@
       !
       ! non-blocking send of the southern/northern side
-      IF( llsend_so )   CALL mppsend( 3, zsnd_so(1-nn_hls+1,1,1,1,1), isize, noso, ireq_so )
-      IF( llsend_no )   CALL mppsend( 4, zsnd_no(1-nn_hls+1,1,1,1,1), isize, nono, ireq_no )
+      IF( llsend_so )   CALL mppsend( 3, zsnd_so(1,1,1,1,1), isize, noso, ireq_so )
+      IF( llsend_no )   CALL mppsend( 4, zsnd_no(1,1,1,1,1), isize, nono, ireq_no )
       ! blocking receive of the southern/northern halo
-      IF( llrecv_so )   CALL mpprecv( 4, zrcv_so(1-nn_hls+1,1,1,1,1), isize, noso )
-      IF( llrecv_no )   CALL mpprecv( 3, zrcv_no(1-nn_hls+1,1,1,1,1), isize, nono )
+      IF( llrecv_so )   CALL mpprecv( 4, zrcv_so(1,1,1,1,1), isize, noso )
+      IF( llrecv_no )   CALL mpprecv( 3, zrcv_no(1,1,1,1,1), isize, nono )
       !
       IF( ln_timing ) CALL tic_tac(.FALSE.)
@@ -303,17 +301,17 @@
       CASE ( jpfillnothing )               ! no filling 
       CASE ( jpfillmpi   )                 ! use data received by MPI 
-         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1-nn_hls+1, jpi
-            ARRAY_IN(ji,jj-nn_hls+1,jk,jl,jf) = zrcv_so(ji,jj,jk,jl,jf)   ! 1 -> nn_hls
+         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
+            ARRAY_IN(ji,jj,jk,jl,jf) = zrcv_so(ji,jj,jk,jl,jf)   ! 1 -> nn_hls
          END DO;   END DO   ;   END DO   ;   END DO   ;   END DO
       CASE ( jpfillperio )                 ! use north-south periodicity
          ishift2 = jpj - 2 * nn_hls
-         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1-nn_hls+1, jpi
-            ARRAY_IN(ji,jj-nn_hls+1,jk,jl,jf) = ARRAY_IN(ji,ishift2+jj,jk,jl,jf)
+         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
+            ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(ji,ishift2+jj,jk,jl,jf)
          END DO;   END DO   ;   END DO   ;   END DO   ;   END DO
       CASE ( jpfillcopy  )                 ! filling with inner domain values
          DO jf = 1, ipf                               ! number of arrays to be treated
             IF( .NOT. NAT_IN(jf) == 'F' ) THEN        ! do nothing for F point
-               DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1-nn_hls+1, jpi
-                  ARRAY_IN(ji,jj-nn_hls+1,jk,jl,jf) = ARRAY_IN(ji,1+jj,jk,jl,jf)
+               DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
+                  ARRAY_IN(ji,jj,jk,jl,jf) = ARRAY_IN(ji,nn_hls+1,jk,jl,jf)
                END DO   ;   END DO   ;   END DO   ;   END DO
             ENDIF
@@ -322,6 +320,6 @@
          DO jf = 1, ipf                               ! number of arrays to be treated
             IF( .NOT. NAT_IN(jf) == 'F' ) THEN        ! do nothing for F point
-               DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1-nn_hls+1, jpi 
-                  ARRAY_IN(ji,jj-nn_hls+1,jk,jl,jf) = zland
+               DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi 
+                  ARRAY_IN(ji,jj,jk,jl,jf) = zland
                END DO;   END DO   ;   END DO   ;   END DO
             ENDIF
@@ -335,19 +333,18 @@
       CASE ( jpfillnothing )               ! no filling 
       CASE ( jpfillmpi   )                 ! use data received by MPI 
-         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1-nn_hls+1, jpi
+         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
             ARRAY_IN(ji,ishift+jj,jk,jl,jf) = zrcv_no(ji,jj,jk,jl,jf)   ! jpj-nn_hls+1 -> jpj
          END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO
       CASE ( jpfillperio )                 ! use north-south periodicity
-         ishift2 = 1
-         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1-nn_hls+1, jpi
+         ishift2 = nn_hls
+         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
             ARRAY_IN(ji,ishift+jj,jk,jl,jf) = ARRAY_IN(ji,ishift2+jj,jk,jl,jf)
          END DO;   END DO   ;   END DO   ;   END DO   ;   END DO
       CASE ( jpfillcopy  )                 ! filling with inner domain values
-      	 ishift2 = jpj - 2*nn_hls
-         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1-nn_hls+1, jpi
-            ARRAY_IN(ji,ishift+jj,jk,jl,jf) = ARRAY_IN(ji,ishift2+jj,jk,jl,jf)
+         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
+            ARRAY_IN(ji,ishift+jj,jk,jl,jf) = ARRAY_IN(ji,ishift,jk,jl,jf)
          END DO;   END DO   ;   END DO   ;   END DO   ;   END DO
       CASE ( jpfillcst   )                 ! filling with constant value
-         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1-nn_hls+1, jpi
+         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi
             ARRAY_IN(ji,ishift+jj,jk,jl,jf) = zland
          END DO;   END DO   ;   END DO   ;   END DO   ;   END DO
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/mpp_nfd_generic.h90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/mpp_nfd_generic.h90	(revision 12718)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/mpp_nfd_generic.h90	(revision 12719)
@@ -48,5 +48,5 @@
    SUBROUTINE ROUTINE_NFD( ptab, cd_nat, psgn, kfld )
       !!----------------------------------------------------------------------
-      ARRAY_TYPE(1-nn_hls+1:,1-nn_hls+1:,:,:,:)   ! array or pointer of arrays on which the boundary condition is applied
+      ARRAY_TYPE(:,:,:,:,:)   ! array or pointer of arrays on which the boundary condition is applied
       CHARACTER(len=1) , INTENT(in   ) ::   NAT_IN(:)   ! nature of array grid-points
       REAL(wp)         , INTENT(in   ) ::   SGN_IN(:)   ! sign used across the north fold boundary
@@ -80,6 +80,6 @@
          ALLOCATE(ipj_s(ipf))
 
-         ijpj      = 2 + nn_hls - 1           ! Max 2nd dimension of message transfers (last two j-line only)
-         ipj_s(:) = 1 + nn_hls - 1           ! Real 2nd dimension of message transfers (depending on perf requirement)
+         ijpj     = 2 + nn_hls -1           ! Max 2nd dimension of message transfers (last two j-line only)
+         ipj_s(:) = 1 + nn_hls -1           ! Real 2nd dimension of message transfers (depending on perf requirement)
                                  ! by default, only one line is exchanged
 
@@ -98,5 +98,5 @@
          IF ( l_full_nf_update .OR.                          &    ! if coupling fields
               ( ncom_stp == nit000 .AND. .NOT. ln_rstart ) ) &    ! at first time step, if not restart
-            ipj_s(:) = 2 + nn_hls - 1 
+            ipj_s(:) = 2 + nn_hls -1
 
          ! Index of modifying lines in input
@@ -110,11 +110,11 @@
                !
                CASE ( 'T' , 'W' ,'U' )                            ! T-, U-, W-point
-   	            	DO ji = 1, nn_hls+1
-						jj_s(jf,ji) = nlcj - 2*nn_hls +ji -1
-					ENDDO
+                  DO ji = 1, nn_hls+1
+                     jj_s(jf,ji) = nlcj - 2*nn_hls +ji -1
+                  ENDDO
                CASE ( 'V' , 'F' )                                 ! V-, F-point
-					DO ji = 1, nn_hls+1
-						jj_s(jf,ji) = nlcj - 2*nn_hls +ji - 2
-					ENDDO
+                  DO ji = 1, nn_hls+1
+                     jj_s(jf,ji) = nlcj - 2*nn_hls +ji - 2
+                  ENDDO
                END SELECT
             !
@@ -123,12 +123,12 @@
                !
                CASE ( 'T' , 'W' ,'U' )                            ! T-, U-, W-point
-					DO ji = 1, nn_hls
-						jj_s(jf,ji) = nlcj - 2*nn_hls + ji     
-					ENDDO
-					ipj_s(jf) = nn_hls                  ! need only one line anyway
+                  DO ji = 1, nn_hls
+                     jj_s(jf,ji) = nlcj - 2*nn_hls + ji
+                  ENDDO
+                  ipj_s(jf) = nn_hls                  ! need only one line anyway
                CASE ( 'V' , 'F' )                                 ! V-, F-point
-					DO ji = 1, nn_hls+1
-						jj_s(jf,ji) = nlcj - 2*nn_hls +ji -1
-					ENDDO
+                  DO ji = 1, nn_hls+1
+                     jj_s(jf,ji) = nlcj - 2*nn_hls +ji -1
+                  ENDDO
                END SELECT
             !
@@ -139,5 +139,5 @@
          ipf_j = sum (ipj_s(:))      ! Total number of lines to be exchanged
          !
-         ALLOCATE( znorthloc(1-nn_hls+1:jpimax,ipf_j,ipk,ipl,1) )
+         ALLOCATE( znorthloc(jpimax,ipf_j,ipk,ipl,1) )
          !
          js = 0
@@ -147,5 +147,5 @@
                DO jl = 1, ipl
                   DO jk = 1, ipk
-                     znorthloc(1-nn_hls+1:jpi,js,jk,jl,1) = ARRAY_IN(1-nn_hls+1:jpi,jj_s(jf,jj),jk,jl,jf)
+                     znorthloc(1:jpi,js,jk,jl,1) = ARRAY_IN(1:jpi,jj_s(jf,jj),jk,jl,jf)
                   END DO
                END DO
@@ -153,8 +153,8 @@
          END DO
          !
-         ibuffsize = (jpimax + nn_hls -1) * ipf_j * ipk * ipl
-         !
-         ALLOCATE( zfoldwk(1-nn_hls+1:jpimax,ipf_j,ipk,ipl,1) )
-         ALLOCATE( ztabr(1-nn_hls+1:(jpi+nn_hls-1)*jpmaxngh-nn_hls+1,ijpj,ipk,ipl,ipf) ) 
+         ibuffsize = jpimax * ipf_j * ipk * ipl
+         !
+         ALLOCATE( zfoldwk(jpimax,ipf_j,ipk,ipl,1) )
+         ALLOCATE( ztabr(jpimax*jpmaxngh,ijpj,ipk,ipl,ipf) ) 
          ! when some processors of the north fold are suppressed, 
          ! values of ztab* arrays corresponding to these suppressed domain won't be defined 
@@ -177,8 +177,8 @@
                iilb = nimppt(iproc+1)
                ilci = nlcit (iproc+1)
-               ildi = nldit (iproc+1)
-               ilei = nleit (iproc+1)
-               IF( iilb            ==      1 )   ildi = 1      ! e-w boundary already done -> force to take 1st column
-               IF( iilb + ilci - 1 == jpiglo )   ilei = ilci   ! e-w boundary already done -> force to take last column
+               ildi = nldit (iproc+1) + nn_hls-1
+               ilei = nleit (iproc+1) + nn_hls-1
+               IF( iilb            ==      1 )   ildi = nn_hls   ! e-w boundary already done -> force to take 1st column
+               IF( iilb + ilci - 1 == jpiglo )   ilei = nlei+1   ! e-w boundary already done -> force to take last column
                iilb = nfiimpp(isendto(jr),jpnj) - nfiimpp(isendto(1),jpnj)
             ENDIF
@@ -191,5 +191,5 @@
                      DO jk = 1, ipk
                         DO ji = ildi, ilei
-                           ztabr(iilb+ji,jj,jk,jl,jf) = zfoldwk(ji,js,jk,jl,1)
+                           ztabr(iilb-nn_hls+1+ji,jj,jk,jl,jf) = zfoldwk(ji,js,jk,jl,1)
                         END DO
                      END DO
@@ -201,5 +201,5 @@
                      DO jk = 1, ipk
                         DO ji = ildi, ilei
-                           ztabr(iilb+ji,jj,jk,jl,jf) = ARRAY_IN(ji,jj_s(jf,jj),jk,jl,jf)
+                           ztabr(iilb-nn_hls+1+ji,jj,jk,jl,jf) = ARRAY_IN(ji,jj_s(jf,jj),jk,jl,jf)
                         END DO
                      END DO
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/TRA/traadv_mus.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/TRA/traadv_mus.F90	(revision 12718)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/TRA/traadv_mus.F90	(revision 12719)
@@ -83,6 +83,6 @@
       LOGICAL                                  , INTENT(in   ) ::   ld_msc_ups      ! use upstream scheme within muscl
       REAL(wp)                                 , INTENT(in   ) ::   p2dt            ! tracer time-step
-      REAL(wp), POINTER, DIMENSION(:,:,:    )           , INTENT(in   ) ::   pU, pV, pW      ! 3 ocean volume flux components
-      REAL(wp), POINTER, DIMENSION(:,:,:,:,:)           , INTENT(inout) ::   pt              ! tracers and RHS of tracer equation
+      REAL(wp), POINTER, DIMENSION(:,:,:)      , INTENT(in   ) ::   pU, pV, pW      ! 3 ocean volume flux components
+      REAL(wp), POINTER, DIMENSION(:,:,:,:,:)  , INTENT(inout) ::   pt              ! tracers and RHS of tracer equation
       !
       INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
@@ -96,8 +96,8 @@
       CALL halo_mng_set(jphls)
 
-      ALLOCATE(zwx(jplbi:jpi,jplbj:jpj,jpk))
-      ALLOCATE(zwy(jplbi:jpi,jplbj:jpj,jpk))
-      ALLOCATE(zslpx(jplbi:jpi,jplbj:jpj,jpk))
-      ALLOCATE(zslpy(jplbi:jpi,jplbj:jpj,jpk))
+      ALLOCATE(zwx(jpi,jpj,jpk))
+      ALLOCATE(zwy(jpi,jpj,jpk))
+      ALLOCATE(zslpx(jpi,jpj,jpk))
+      ALLOCATE(zslpy(jpi,jpj,jpk))
 
       CALL halo_mng_resize(r1_e1e2t,'T', 1._wp)
@@ -105,20 +105,20 @@
       CALL halo_mng_resize(r1_e1e2v,'V', 1._wp)
       CALL halo_mng_resize(tmask,'T', 1._wp)
-      CALL halo_mng_resize(wmask, 'W', 1._wp)
-      CALL halo_mng_resize(umask, 'U', 1._wp)
-      CALL halo_mng_resize(vmask, 'V', 1._wp)
+      CALL halo_mng_resize(wmask,'W', 1._wp)
+      CALL halo_mng_resize(umask,'U', 1._wp)
+      CALL halo_mng_resize(vmask,'V', 1._wp)
       CALL halo_mng_resize(pt, 'T', 1._wp, kjpt=kjpt, fjpt=Kbb )
       CALL halo_mng_resize(pt, 'T', 1._wp, kjpt=kjpt, fjpt=Krhs )
       CALL halo_mng_resize(e3t,'T', 1._wp, fillval=1._wp, fjpt=Kmm)
-      CALL halo_mng_resize(e3u, 'U', 1._wp, fillval=1._wp, fjpt=Kmm )
-      CALL halo_mng_resize(e3v, 'V', 1._wp, fillval=1._wp, fjpt=Kmm)
-      CALL halo_mng_resize(e3w, 'W', 1._wp, fillval=1._wp, fjpt=Kmm)
+      CALL halo_mng_resize(e3u,'U', 1._wp, fillval=1._wp, fjpt=Kmm )
+      CALL halo_mng_resize(e3v,'V', 1._wp, fillval=1._wp, fjpt=Kmm)
+      CALL halo_mng_resize(e3w,'W', 1._wp, fillval=1._wp, fjpt=Kmm)
       CALL halo_mng_resize(pU, 'U', -1._wp)
       CALL halo_mng_resize(pV, 'V', -1._wp)
       CALL halo_mng_resize(pW, 'W', 1._wp)
-      !      
-      IF( ln_isfcav ) CALL halo_mng_resize(mikt, 'T', 1._wp)
-      IF( ld_msc_ups) CALL halo_mng_resize(rnfmsk, 'T', 1._wp)
-      IF( ld_msc_ups) CALL halo_mng_resize(upsmsk, 'T', 1._wp)
+      !
+      IF( ln_isfcav ) CALL halo_mng_resize(mikt,  'T', 1._wp)
+      IF( ld_msc_ups) CALL halo_mng_resize(rnfmsk,'T', 1._wp)
+      IF( ld_msc_ups) CALL halo_mng_resize(upsmsk,'T', 1._wp)
 
       IF( kt == kit000 )  THEN
@@ -131,9 +131,9 @@
          ! Upstream / MUSCL scheme indicator
          !
-         ALLOCATE( xind(jplbi:jpi,jplbj:jpj,jpk), STAT=ierr )
+         ALLOCATE( xind(jpi,jpj,jpk), STAT=ierr )
          xind(:,:,:) = 1._wp              ! set equal to 1 where up-stream is not needed
          !
          IF( ld_msc_ups ) THEN            ! define the upstream indicator (if asked)
-            ALLOCATE( upsmsk(jplbi:jpi,jplbj:jpj), STAT=ierr )
+            ALLOCATE( upsmsk(jpi,jpj), STAT=ierr )
             upsmsk(:,:) = 0._wp                             ! not upstream by default
             !
@@ -146,5 +146,5 @@
          !
       ENDIF 
-
+      !      
       l_trd = .FALSE.
       l_hst = .FALSE.
@@ -162,13 +162,14 @@
          zwx(:,:,jpk) = 0._wp                   ! bottom values
          zwy(:,:,jpk) = 0._wp  
-         DO_3D_20_20( 1, jpkm1 )
+         DO_3D_10_10( 1, jpkm1 )
             zwx(ji,jj,jk) = umask(ji,jj,jk) * ( pt(ji+1,jj,jk,jn,Kbb) - pt(ji,jj,jk,jn,Kbb) )
             zwy(ji,jj,jk) = vmask(ji,jj,jk) * ( pt(ji,jj+1,jk,jn,Kbb) - pt(ji,jj,jk,jn,Kbb) )
          END_3D
-         ! 
+         ! lateral boundary conditions   (changed sign)
+         !CALL lbc_lnk_multi( 'traadv_mus', zwx, 'U', -1. , zwy, 'V', -1. )
          !                                !-- Slopes of tracer
          zslpx(:,:,jpk) = 0._wp                 ! bottom values
          zslpy(:,:,jpk) = 0._wp
-         DO_3D_31_31( 1, jpkm1 )
+         DO_3D_01_01( 1, jpkm1 )
             zslpx(ji,jj,jk) =                    ( zwx(ji,jj,jk) + zwx(ji-1,jj  ,jk) )   &
                &            * ( 0.25 + SIGN( 0.25, zwx(ji,jj,jk) * zwx(ji-1,jj  ,jk) ) )
@@ -177,5 +178,5 @@
          END_3D
          !
-         DO_3D_31_31( 1, jpkm1 )
+         DO_3D_01_01( 1, jpkm1 )
             zslpx(ji,jj,jk) = SIGN( 1., zslpx(ji,jj,jk) ) * MIN(    ABS( zslpx(ji  ,jj,jk) ),   &
                &                                                 2.*ABS( zwx  (ji-1,jj,jk) ),   &
@@ -186,5 +187,5 @@
          END_3D
          !
-         DO_3D_30_30( 1, jpkm1 )
+         DO_3D_00_00( 1, jpkm1 )
             ! MUSCL fluxes
             z0u = SIGN( 0.5, pU(ji,jj,jk) )
@@ -202,6 +203,7 @@
             zwy(ji,jj,jk) = pV(ji,jj,jk) * ( zalpha * zzwx + (1.-zalpha) * zzwy )
          END_3D
-         !
-         DO_3D_30_30( 1, jpkm1 )
+         !CALL lbc_lnk_multi( 'traadv_mus', zwx, 'U', -1. , zwy, 'V', -1. )   ! lateral boundary conditions   (changed sign)
+         !
+         DO_3D_00_00( 1, jpkm1 )
             pt(ji,jj,jk,jn,Krhs) = pt(ji,jj,jk,jn,Krhs) - ( zwx(ji,jj,jk) - zwx(ji-1,jj  ,jk  )       &
             &                                     + zwy(ji,jj,jk) - zwy(ji  ,jj-1,jk  ) )     &
@@ -228,14 +230,14 @@
          !                                !-- Slopes of tracer
          zslpx(:,:,1) = 0._wp                   ! surface values
-         DO_3D_21_21( 2, jpkm1 )
+         DO_3D_11_11( 2, jpkm1 )
             zslpx(ji,jj,jk) =                     ( zwx(ji,jj,jk) + zwx(ji,jj,jk+1) )  &
                &            * (  0.25 + SIGN( 0.25, zwx(ji,jj,jk) * zwx(ji,jj,jk+1) )  )
          END_3D
-         DO_3D_21_21( 2, jpkm1 )
+         DO_3D_11_11( 2, jpkm1 )
             zslpx(ji,jj,jk) = SIGN( 1., zslpx(ji,jj,jk) ) * MIN(    ABS( zslpx(ji,jj,jk  ) ),   &
                &                                                 2.*ABS( zwx  (ji,jj,jk+1) ),   &
                &                                                 2.*ABS( zwx  (ji,jj,jk  ) )  )
          END_3D
-         DO_3D_30_30( 1, jpk-2 )
+         DO_3D_00_00( 1, jpk-2 )
             z0w = SIGN( 0.5, pW(ji,jj,jk+1) )
             zalpha = 0.5 + z0w
@@ -247,5 +249,5 @@
          IF( ln_linssh ) THEN                   ! top values, linear free surface only
             IF( ln_isfcav ) THEN                      ! ice-shelf cavities (top of the ocean)
-               DO_2D_21_21
+               DO_2D_11_11
                   zwx(ji,jj, mikt(ji,jj) ) = pW(ji,jj,mikt(ji,jj)) * pt(ji,jj,mikt(ji,jj),jn,Kbb)
                END_2D
@@ -255,5 +257,5 @@
          ENDIF
          !
-         DO_3D_30_30( 1, jpkm1 )
+         DO_3D_00_00( 1, jpkm1 )
             pt(ji,jj,jk,jn,Krhs) =  pt(ji,jj,jk,jn,Krhs) - ( zwx(ji,jj,jk) - zwx(ji,jj,jk+1) ) * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm)
          END_3D
@@ -262,31 +264,30 @@
          !
       END DO                     ! end of tracer loop
-      !
+
       DEALLOCATE(zwx,zwy)
       DEALLOCATE(zslpx,zslpy)
 
       CALL halo_mng_set(1)
-
+      !
       CALL halo_mng_resize(r1_e1e2t,'T', 1._wp)
       CALL halo_mng_resize(r1_e1e2u,'U', 1._wp)
       CALL halo_mng_resize(r1_e1e2v,'V', 1._wp)
-      CALL halo_mng_resize(pt, 'T', 1._wp, kjpt=kjpt, fjpt=Kbb )
-      CALL halo_mng_resize(pt, 'T', 1._wp, kjpt=kjpt, fjpt=Krhs )
+      CALL halo_mng_resize(pt,'T', 1._wp, kjpt=kjpt, fjpt=Kbb )
+      CALL halo_mng_resize(pt,'T', 1._wp, kjpt=kjpt, fjpt=Krhs )
       CALL halo_mng_resize(tmask,'T', 1._wp)
-      CALL halo_mng_resize(wmask, 'W', 1._wp)
-      CALL halo_mng_resize(umask, 'U', 1._wp)
-      CALL halo_mng_resize(vmask, 'V', 1._wp)
+      CALL halo_mng_resize(wmask,'W', 1._wp)
+      CALL halo_mng_resize(umask,'U', 1._wp)
+      CALL halo_mng_resize(vmask,'V', 1._wp)
       CALL halo_mng_resize(e3t,'T', 1._wp, fillval=1._wp, fjpt=Kmm)
-      CALL halo_mng_resize(e3u, 'U', 1._wp, fillval=1._wp, fjpt=Kmm)
-      CALL halo_mng_resize(e3v, 'V', 1._wp, fillval=1._wp, fjpt=Kmm)
-      CALL halo_mng_resize(e3w, 'W', 1._wp, fillval=1._wp, fjpt=Kmm)
-      CALL halo_mng_resize(pU, 'U', 1._wp)
-      CALL halo_mng_resize(pV, 'V', 1._wp)
-      CALL halo_mng_resize(pW, 'W', 1._wp)
+      CALL halo_mng_resize(e3u,'U', 1._wp, fillval=1._wp, fjpt=Kmm)
+      CALL halo_mng_resize(e3v,'V', 1._wp, fillval=1._wp, fjpt=Kmm)
+      CALL halo_mng_resize(e3w,'W', 1._wp, fillval=1._wp, fjpt=Kmm)
+      CALL halo_mng_resize(pU,'U', 1._wp)
+      CALL halo_mng_resize(pV,'V', 1._wp)
+      CALL halo_mng_resize(pW,'W', 1._wp)
 
       IF( ln_isfcav ) CALL halo_mng_resize(mikt, 'T', 1._wp)
       IF( ld_msc_ups) CALL halo_mng_resize(rnfmsk, 'T', 1._wp)
       IF( ld_msc_ups) CALL halo_mng_resize(upsmsk, 'T', 1._wp)
-
    END SUBROUTINE tra_adv_mus
 
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/do_loop_substitute.h90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/do_loop_substitute.h90	(revision 12718)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/do_loop_substitute.h90	(revision 12719)
@@ -59,9 +59,4 @@
 #define __kIsm1_   1
 #define __kJsm1_   1
-#
-#define __kIsmh_   jplbi
-#define __kJsmh_   jplbj
-#define __kIsmhp1_   jplbi+1
-#define __kJsmhp1_   jplbj+1
 
 #define __kIe_     jpi-1
@@ -83,9 +78,4 @@
 #define DO_2D_10_10   DO jj = __kJsm1_, __kJe_   ;   DO ji = __kIsm1_, __kIe_
 #define DO_2D_10_11   DO jj = __kJsm1_, __kJe_   ;   DO ji = __kIsm1_, __kIep1_
-#
-#define DO_2D_20_20   DO jj = __kJsmh_, __kJe_   ;   DO ji = __kIsmh_, __kIe_
-#define DO_2D_21_21   DO jj = __kJsmh_, __kJep1_   ;   DO ji = __kIsmh_, __kIep1_
-#define DO_2D_31_31   DO jj = __kJsmhp1_, __kJep1_ ;   DO ji = __kIsmhp1_, __kIep1_
-#define DO_2D_30_30   DO jj = __kJsmhp1_, __kJe_   ;   DO ji = __kIsmhp1_, __kIe_
  
 #define DO_2D_11_00   DO jj = __kJsm1_, __kJep1_   ;   DO ji = __kIs_, __kIe_
@@ -102,12 +92,6 @@
 #define DO_3D_10_10(ks,ke)   DO jk = ks, ke   ;   DO_2D_10_10
 #define DO_3D_10_11(ks,ke)   DO jk = ks, ke   ;   DO_2D_10_11
-#
-#define DO_3D_20_20(ks,ke)   DO jk = ks, ke   ;   DO_2D_20_20
-#define DO_3D_21_21(ks,ke)   DO jk = ks, ke   ;   DO_2D_21_21
-#define DO_3D_31_31(ks,ke)   DO jk = ks, ke   ;   DO_2D_31_31
-#define DO_3D_30_30(ks,ke)   DO jk = ks, ke   ;   DO_2D_30_30
  
 #define DO_3D_11_11(ks,ke)   DO jk = ks, ke   ;   DO_2D_11_11
-#define DO_3D_21_21(ks,ke)   DO jk = ks, ke   ;   DO_2D_21_21
 
 #define DO_3DS_00_00(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_00_00
Index: /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/par_oce.F90
===================================================================
--- /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/par_oce.F90	(revision 12718)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/par_oce.F90	(revision 12719)
@@ -61,6 +61,4 @@
    INTEGER, PUBLIC ::   jpimax! = ( jpiglo-2*nn_hls + (jpni-1) ) / jpni + 2*nn_hls !: maximum jpi
    INTEGER, PUBLIC ::   jpjmax! = ( jpjglo-2*nn_hls + (jpnj-1) ) / jpnj + 2*nn_hls !: maximum jpj
-   INTEGER, PUBLIC ::   jplbi
-   INTEGER, PUBLIC ::   jplbj
 
    !!---------------------------------------------------------------------
