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 12600)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/LBC/lbc_nfd_nogather_generic.h90	(revision 12601)
@@ -64,5 +64,5 @@
       !
       INTEGER  ::    ji,  jj,   jk, jn, ii,   jl,   jh,  jf   ! dummy loop indices
-      INTEGER  ::   ipi, ipj,  ipk,    ipl,  ipf, ijj   ! dimension of the input array
+      INTEGER  ::   ipi, ipj,  ipk,    ipl,  ipf, iij, ijj   ! dimension of the input array
       INTEGER  ::   ijt, iju, ijta, ijua, jia, startloop, endloop
       LOGICAL  ::   l_fast_exchanges
@@ -109,5 +109,5 @@
                	  		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)
+                     		   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
@@ -284,32 +284,40 @@
          CASE ( 5, 6 )                        ! *  North fold  F-point pivot
             !
-         	WRITE(*,*) 'extrahalo not handled in this case', __FILE__, __LINE__
             SELECT CASE ( NAT_IN(jf) )
             CASE ( 'T' , 'W' )                               ! T-, W-point
                DO jl = 1, ipl; DO jk = 1, ipk
-				  DO jj = 1, nn_hls
-               		 ijj = nlcj -jj+1
-                  DO ji = 1, nlci
-                     ijt = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 3
-                     ARRAY_IN(ji,ijj,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(ijt,jj,jk,jl,jf)
-                  END DO
-				  END DO
+		  DO jj = 1, nn_hls
+ 		     ijj = nlcj-jj+1
+		     DO ji = 1, nlci
+                     	ijt = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 3
+                     	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
                !
             CASE ( 'U' )                                     ! U-point
-               IF( nimpp + nlci - 1 /= jpiglo ) THEN
+               IF( nimpp + nlci - nn_hls /= jpiglo ) THEN
                   endloop = nlci
                ELSE
-                  endloop = nlci - 1
-               ENDIF
-               DO jl = 1, ipl; DO jk = 1, ipk
-                  DO ji = 1, endloop
-                     iju = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 2
-                     ARRAY_IN(ji,nlcj,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(iju,ijpj-1,jk,jl,jf)
-                  END DO
-               END DO; END DO
-               IF((nimpp + nlci - 1) .eq. jpiglo) THEN
-                  DO jl = 1, ipl; DO jk = 1, ipk
-                     ARRAY_IN(nlci,nlcj,jk,jl,jf) = SGN_IN(jf) * ARRAY_IN(nlci-2,nlcj-1,jk,jl,jf)
+                  endloop = nlci - nn_hls
+               ENDIF
+               DO jl = 1, ipl; DO jk = 1, ipk
+		  DO jj = 1, nn_hls
+ 		     ijj = nlcj-jj+1
+                     DO ji = 1, endloop
+                        iju = jpiglo - ji - nimpp - 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
+                  DO jl = 1, ipl; DO jk = 1, ipk
+                     DO jj = 1, nn_hls
+               	        ijj = nlcj-jj+1
+                        DO ii = 1, nn_hls
+			   iij = nlci-ii+1
+                           ARRAY_IN(iij,ijj,jk,jl,jf) = SGN_IN(jf) * ARRAY_IN(nlci-2*nn_hls+ii-1,nlcj-2*nn_hls+jj,jk,jl,jf)
+                        END DO
+                     END DO
                   END DO; END DO
                ENDIF
@@ -318,14 +326,17 @@
                DO jl = 1, ipl; DO jk = 1, ipk
                   DO ji = 1, nlci
-                     ijt = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 3
-                     ARRAY_IN(ji,nlcj,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(ijt,ijpj-1,jk,jl,jf)
+		     DO jj = 1, nn_hls
+			ijj = nlcj -jj +1
+                        ijt = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 3
+                        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 ( .NOT. l_fast_exchanges ) THEN
-                  IF( nimpp >= jpiglo/2+1 ) THEN
-                     startloop = 1
-                  ELSEIF( nimpp+nlci-1 >= jpiglo/2+1 .AND. nimpp < jpiglo/2+1 ) THEN
-                     startloop = jpiglo/2+1 - nimpp + 1
+                  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
+                     startloop = jpiglo/2+1 - nimpp + nn_hls
                   ELSE
                      startloop = nlci + 1
@@ -333,8 +344,8 @@
                   IF( startloop <= nlci ) THEN
                   DO jl = 1, ipl; DO jk = 1, ipk
-                     DO ji = startloop, nlci
-                        ijt = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 3
-                        ARRAY_IN(ji,nlcj-1,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(ijt,ijpj,jk,jl,jf)
-                     END DO
+                        DO ji = startloop, nlci
+                   	   ijt = jpiglo - ji - nimpp - 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
                   END DO; END DO
                   ENDIF
@@ -342,31 +353,40 @@
                !
             CASE ( 'F' )                               ! F-point
-               IF( nimpp + nlci - 1 /= jpiglo ) THEN
+               IF( nimpp + nlci - nn_hls /= jpiglo ) THEN
                   endloop = nlci
                ELSE
-                  endloop = nlci - 1
-               ENDIF
-               DO jl = 1, ipl; DO jk = 1, ipk
-                  DO ji = 1, endloop
-                     iju = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 2
-                     ARRAY_IN(ji,nlcj ,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(iju,ijpj-1,jk,jl,jf)
-                  END DO
-               END DO; END DO
-               IF((nimpp + nlci - 1) .eq. jpiglo) THEN
-                  DO jl = 1, ipl; DO jk = 1, ipk
-                     ARRAY_IN(nlci,nlcj,jk,jl,jf) = SGN_IN(jf) * ARRAY_IN(nlci-2,nlcj-2,jk,jl,jf)
-                  END DO; END DO
-               ENDIF
-               !
-               IF ( .NOT. l_fast_exchanges ) THEN
-                  IF( nimpp + nlci - 1 /= jpiglo ) THEN
+                  endloop = nlci - nn_hls
+               ENDIF
+               DO jl = 1, ipl; DO jk = 1, ipk
+		  DO jj = 1, nn_hls
+		    ijj = nlcj -jj +1
+                    DO ji = 1, endloop
+                       iju = jpiglo - ji - nimpp - 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
+                  DO jl = 1, ipl; DO jk = 1, ipk
+                     DO jj = 1, nn_hls
+                        ijj = nlcj -jj +1
+                        DO ii = 1, nn_hls
+			   iij = nlci -ii+1
+                     	   ARRAY_IN(iij,ijj,jk,jl,jf) = SGN_IN(jf) * ARRAY_IN(nlci-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 + nlci - nn_hls /= jpiglo ) THEN
                      endloop = nlci
                   ELSE
-                     endloop = nlci - 1
-                  ENDIF
-                  IF( nimpp >= jpiglo/2+1 ) THEN
-                     startloop = 1
-                  ELSEIF( nimpp+nlci-1 >= jpiglo/2+1 .AND. nimpp < jpiglo/2+1 ) THEN
-                     startloop = jpiglo/2+1 - nimpp + 1
+                     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
+                     startloop = jpiglo/2+1 - nimpp + nn_hls
                   ELSE
                      startloop = endloop + 1
@@ -376,5 +396,5 @@
                         DO ji = startloop, endloop
                            iju = jpiglo - ji - nimpp - nfiimpp(isendto(1),jpnj) + 2
-                           ARRAY_IN(ji,nlcj-1,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(iju,ijpj,jk,jl,jf)
+                           ARRAY_IN(ji,nlcj-nn_hls,jk,jl,jf) = SGN_IN(jf) * ARRAY2_IN(iju,nn_hls+1,jk,jl,jf)
                         END DO
                      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 12600)
+++ /NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/TRA/traadv_mus.F90	(revision 12601)
@@ -114,6 +114,6 @@
       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(pU, 'U', -1._wp)
+      CALL halo_mng_resize(pV, 'V', -1._wp)
       CALL halo_mng_resize(pW, 'W', 1._wp)
       !      
@@ -166,7 +166,5 @@
             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( 'traadv_mus', zwx, 'U', -1. )   ! lateral boundary conditions   (changed sign)
-         CALL lbc_lnk( 'traadv_mus', zwy, 'V', -1. )   ! lateral boundary conditions   (changed sign)
+         ! 
          !                                !-- Slopes of tracer
          zslpx(:,:,jpk) = 0._wp                 ! bottom values
@@ -204,6 +202,4 @@
             zwy(ji,jj,jk) = pV(ji,jj,jk) * ( zalpha * zzwx + (1.-zalpha) * zzwy )
          END_3D
-         CALL lbc_lnk( 'traadv_mus', zwx, 'U', -1. )   ! lateral boundary conditions   (changed sign)
-         CALL lbc_lnk( 'traadv_mus', zwy, 'V', -1. )   ! lateral boundary conditions   (changed sign)
          !
          DO_3D_30_30( 1, jpkm1 )
