Index: NEMO/trunk/src/OCE/lib_fortran.F90
===================================================================
--- NEMO/trunk/src/OCE/lib_fortran.F90	(revision 13323)
+++ NEMO/trunk/src/OCE/lib_fortran.F90	(revision 13324)
@@ -217,6 +217,8 @@
       IF( SIZE(p2d,2) /= jpj ) CALL ctl_stop( 'STOP', 'wrong call of sum3x3_2d, the second dimension is not equal to jpj' ) 
       !
-      DO_2D( 1, 1, 1, 1 )
-         IF( MOD(mig(ji), 3) == 1 .AND. MOD(mjg(jj), 3) == 1 ) THEN   ! bottom left corber of a 3x3 box
+      ! work over the whole domain (guarantees all internal cells are set when nn_hls=2)
+      !
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+         IF( MOD(mig(ji), 3) == 1 .AND. MOD(mjg(jj), 3) == 1 ) THEN   ! bottom left corner of a 3x3 box
             ji2 = MIN(mig(ji)+2, jpiglo) - nimpp + 1                  ! right position of the box
             jj2 = MIN(mjg(jj)+2, jpjglo) - njmpp + 1                  ! upper position of the box
@@ -227,21 +229,24 @@
       END_2D
       CALL lbc_lnk( 'lib_fortran', p2d, 'T', 1.0_wp )
-      IF( nbondi /= -1 ) THEN
-         IF( MOD(mig(    1), 3) == 1 )   p2d(    1,:) = p2d(    2,:)
-         IF( MOD(mig(    1), 3) == 2 )   p2d(    2,:) = p2d(    1,:)
-      ENDIF
-      IF( nbondi /=  1 ) THEN
-         IF( MOD(mig(jpi-2), 3) == 1 )   p2d(  jpi,:) = p2d(jpi-1,:)
-         IF( MOD(mig(jpi-2), 3) == 0 )   p2d(jpi-1,:) = p2d(  jpi,:)
-      ENDIF
-      IF( nbondj /= -1 ) THEN
-         IF( MOD(mjg(    1), 3) == 1 )   p2d(:,    1) = p2d(:,    2)
-         IF( MOD(mjg(    1), 3) == 2 )   p2d(:,    2) = p2d(:,    1)
-      ENDIF
-      IF( nbondj /=  1 ) THEN
-         IF( MOD(mjg(jpj-2), 3) == 1 )   p2d(:,  jpj) = p2d(:,jpj-1)
-         IF( MOD(mjg(jpj-2), 3) == 0 )   p2d(:,jpj-1) = p2d(:,  jpj)
-      ENDIF
-      CALL lbc_lnk( 'lib_fortran', p2d, 'T', 1.0_wp )
+      ! no need for 2nd exchange when nn_hls = 2
+      IF( nn_hls /= 2 ) THEN
+         IF( nbondi /= -1 ) THEN
+            IF( MOD(mig(    1), 3) == 1 )   p2d(    1,:) = p2d(    2,:)
+            IF( MOD(mig(    1), 3) == 2 )   p2d(    2,:) = p2d(    1,:)
+         ENDIF
+         IF( nbondi /=  1 ) THEN
+            IF( MOD(mig(jpi-2), 3) == 1 )   p2d(  jpi,:) = p2d(jpi-1,:)
+            IF( MOD(mig(jpi-2), 3) == 0 )   p2d(jpi-1,:) = p2d(  jpi,:)
+         ENDIF
+         IF( nbondj /= -1 ) THEN
+            IF( MOD(mjg(    1), 3) == 1 )   p2d(:,    1) = p2d(:,    2)
+            IF( MOD(mjg(    1), 3) == 2 )   p2d(:,    2) = p2d(:,    1)
+         ENDIF
+         IF( nbondj /=  1 ) THEN
+            IF( MOD(mjg(jpj-2), 3) == 1 )   p2d(:,  jpj) = p2d(:,jpj-1)
+            IF( MOD(mjg(jpj-2), 3) == 0 )   p2d(:,jpj-1) = p2d(:,  jpj)
+         ENDIF
+         CALL lbc_lnk( 'lib_fortran', p2d, 'T', 1.0_wp )
+      ENDIF
 
    END SUBROUTINE sum3x3_2d
@@ -264,6 +269,9 @@
       !
       DO jn = 1, ipn
-         DO_2D( 1, 1, 1, 1 )
-            IF( MOD(mig(ji), 3) == 1 .AND. MOD(mjg(jj), 3) == 1 ) THEN   ! bottom left corber of a 3x3 box
+         !
+         ! work over the whole domain (guarantees all internal cells are set when nn_hls=2)
+         !
+         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+            IF( MOD(mig(ji), 3) == 1 .AND. MOD(mjg(jj), 3) == 1 ) THEN   ! bottom left corner of a 3x3 box
                ji2 = MIN(mig(ji)+2, jpiglo) - nimpp + 1                  ! right position of the box
                jj2 = MIN(mjg(jj)+2, jpjglo) - njmpp + 1                  ! upper position of the box
@@ -275,21 +283,24 @@
       END DO
       CALL lbc_lnk( 'lib_fortran', p3d, 'T', 1.0_wp )
-      IF( nbondi /= -1 ) THEN
-         IF( MOD(mig(    1), 3) == 1 )   p3d(    1,:,:) = p3d(    2,:,:)
-         IF( MOD(mig(    1), 3) == 2 )   p3d(    2,:,:) = p3d(    1,:,:)
-      ENDIF
-      IF( nbondi /=  1 ) THEN
-         IF( MOD(mig(jpi-2), 3) == 1 )   p3d(  jpi,:,:) = p3d(jpi-1,:,:)
-         IF( MOD(mig(jpi-2), 3) == 0 )   p3d(jpi-1,:,:) = p3d(  jpi,:,:)
-      ENDIF
-      IF( nbondj /= -1 ) THEN
-         IF( MOD(mjg(    1), 3) == 1 )   p3d(:,    1,:) = p3d(:,    2,:)
-         IF( MOD(mjg(    1), 3) == 2 )   p3d(:,    2,:) = p3d(:,    1,:)
-      ENDIF
-      IF( nbondj /=  1 ) THEN
-         IF( MOD(mjg(jpj-2), 3) == 1 )   p3d(:,  jpj,:) = p3d(:,jpj-1,:)
-         IF( MOD(mjg(jpj-2), 3) == 0 )   p3d(:,jpj-1,:) = p3d(:,  jpj,:)
-      ENDIF
-      CALL lbc_lnk( 'lib_fortran', p3d, 'T', 1.0_wp )
+      ! no need for 2nd exchange when nn_hls = 2
+      IF( nn_hls /= 2 ) THEN
+         IF( nbondi /= -1 ) THEN
+            IF( MOD(mig(    1), 3) == 1 )   p3d(    1,:,:) = p3d(    2,:,:)
+            IF( MOD(mig(    1), 3) == 2 )   p3d(    2,:,:) = p3d(    1,:,:)
+         ENDIF
+         IF( nbondi /=  1 ) THEN
+            IF( MOD(mig(jpi-2), 3) == 1 )   p3d(  jpi,:,:) = p3d(jpi-1,:,:)
+            IF( MOD(mig(jpi-2), 3) == 0 )   p3d(jpi-1,:,:) = p3d(  jpi,:,:)
+         ENDIF
+         IF( nbondj /= -1 ) THEN
+            IF( MOD(mjg(    1), 3) == 1 )   p3d(:,    1,:) = p3d(:,    2,:)
+            IF( MOD(mjg(    1), 3) == 2 )   p3d(:,    2,:) = p3d(:,    1,:)
+         ENDIF
+         IF( nbondj /=  1 ) THEN
+            IF( MOD(mjg(jpj-2), 3) == 1 )   p3d(:,  jpj,:) = p3d(:,jpj-1,:)
+            IF( MOD(mjg(jpj-2), 3) == 0 )   p3d(:,jpj-1,:) = p3d(:,  jpj,:)
+         ENDIF
+         CALL lbc_lnk( 'lib_fortran', p3d, 'T', 1.0_wp )
+      ENDIF
 
    END SUBROUTINE sum3x3_3d
Index: NEMO/trunk/src/TOP/TRP/trcrad.F90
===================================================================
--- NEMO/trunk/src/TOP/TRP/trcrad.F90	(revision 13323)
+++ NEMO/trunk/src/TOP/TRP/trcrad.F90	(revision 13324)
@@ -168,5 +168,5 @@
               IF( l_trdtrc )   ztrtrd(:,:,:) = ptr(:,:,:,jn,itime)                       ! save input tr(:,:,:,:,Kbb) for trend computation           
               !
-              DO_3D( 1, 1, 1, 1, 1, jpkm1 )
+              DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 )
                  IF( ztrneg(ji,jj,jn) /= 0. ) THEN                                 ! if negative values over the 3x3 box
                     !
