Index: branches/UKMO/dev_r5518_GO6_diag_bitcomp/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_diag_bitcomp/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 9608)
+++ branches/UKMO/dev_r5518_GO6_diag_bitcomp/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 9614)
@@ -102,4 +102,5 @@
 
       !
+      z2d(:,:) = 0._wp
       z3d(:,:,:) = 0._wp
       IF( PRESENT( pvtr ) ) THEN
@@ -246,4 +247,6 @@
          !
          IF( iom_use("zotemglo") ) THEN    ! i-mean i-k-surface 
+            zmask(:,:,:) = 0._wp
+            zts(:,:,:,:) = 0._wp
             DO jk = 1, jpkm1
                DO jj = 1, jpj
Index: branches/UKMO/dev_r5518_GO6_diag_bitcomp/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_diag_bitcomp/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90	(revision 9608)
+++ branches/UKMO/dev_r5518_GO6_diag_bitcomp/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90	(revision 9614)
@@ -246,4 +246,5 @@
             z3d(:,:,jk) = wn(:,:,jk) * z2d(:,:)
          END DO
+         CALL lbc_lnk( z3d(:,:,:), 'W', 1. )
          CALL iom_put( "w_masstr" , z3d )  
          IF( iom_use('w_masstr2') )   CALL iom_put( "w_masstr2", z3d(:,:,:) * z3d(:,:,:) )
@@ -334,5 +335,7 @@
             z2d(:,:) = z2d(:,:) + z3d(:,:,jk)
          END DO
+         CALL lbc_lnk( z3d(:,:,:), 'U', -1. )
          CALL iom_put( "u_masstr", z3d )                  ! mass transport in i-direction
+         CALL lbc_lnk( z2d(:,:), 'U', -1. )
          CALL iom_put( "u_masstr_vint", z2d )             ! mass transport in i-direction vertical sum
       ENDIF
@@ -370,4 +373,5 @@
             z3d(:,:,jk) = rau0 * vn(:,:,jk) * e1v(:,:) * fse3v(:,:,jk) * vmask(:,:,jk)
          END DO
+         CALL lbc_lnk( z3d(:,:,:), 'V', -1. )
          CALL iom_put( "v_masstr", z3d )                  ! mass transport in j-direction
       ENDIF
Index: branches/UKMO/dev_r5518_GO6_diag_bitcomp/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_diag_bitcomp/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90	(revision 9608)
+++ branches/UKMO/dev_r5518_GO6_diag_bitcomp/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90	(revision 9614)
@@ -254,5 +254,7 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   bathy                              !: ocean depth (meters)
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tmask_i, umask_i, vmask_i, fmask_i !: interior domain T-point mask
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tmask_i_3d       !: 3D T-point mask of wrap and redundant N-fold points only.
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: tmask_i_3d       !: 3D T-point mask of wrap and redundant N-fold points only.
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: umask_i_3d       !: 3D U-point mask of wrap and redundant N-fold points only.
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: vmask_i_3d       !: 3D V-point mask of wrap and redundant N-fold points only.
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   bmask                              !: land/ocean mask of barotropic stream function
 
@@ -408,5 +410,8 @@
       ALLOCATE( tmask(jpi,jpj,jpk) , umask(jpi,jpj,jpk),     & 
          &      vmask(jpi,jpj,jpk) , fmask(jpi,jpj,jpk),     &
-                tmask_i_3d(jpi,jpj,jpk),       STAT=ierr(11) )
+                tmask_i_3d(jpi,jpj,jpk),       &
+                umask_i_3d(jpi,jpj,jpk),       &
+                vmask_i_3d(jpi,jpj,jpk),       &
+                STAT=ierr(11) )
 
       ALLOCATE( wmask(jpi,jpj,jpk) , wumask(jpi,jpj,jpk), wvmask(jpi,jpj,jpk) , STAT=ierr(12) )
Index: branches/UKMO/dev_r5518_GO6_diag_bitcomp/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_diag_bitcomp/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90	(revision 9608)
+++ branches/UKMO/dev_r5518_GO6_diag_bitcomp/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90	(revision 9614)
@@ -256,4 +256,6 @@
          ENDIF
       ENDIF
+
+
       IF( jperio == 5 .OR. jperio == 6 ) THEN      ! F-point pivot
          tpol(     1    :jpiglo) = 0._wp
@@ -292,4 +294,23 @@
       CALL lbc_lnk( vmask_i, 'V', 1._wp )
       CALL lbc_lnk( fmask_i, 'F', 1._wp )
+
+      ! Set up interior 3d U mask
+      umask_i_3d(:,:,:) = umask(:,:,:) 
+      ! Now mask out any wrap columns
+      umask_i_3d( 1 :iif,:,:) = 0._wp       ! first columns
+      umask_i_3d(iil:jpi,:,:) = 0._wp       ! last  columns (including mpp extra columns)
+      ! Now mask out any extra rows
+      umask_i_3d(:,1:ijf,:) = 0._wp         ! first rows
+      umask_i_3d(:,ijl:jpj,:) = 0._wp       ! last  rows (including mpp extra rows)
+
+      ! Set up interior 3d V mask
+      vmask_i_3d(:,:,:) = vmask(:,:,:) 
+      ! Now mask out any wrap columns
+      vmask_i_3d( 1 :iif,:,:) = 0._wp       ! first columns
+      vmask_i_3d(iil:jpi,:,:) = 0._wp       ! last  columns (including mpp extra columns)
+      ! Now mask out any extra rows
+      vmask_i_3d(:,1:ijf,:) = 0._wp         ! first rows
+      vmask_i_3d(:,ijl:jpj,:) = 0._wp       ! last  rows (including mpp extra rows)
+
 
       ! 3. Ocean/land mask at wu-, wv- and w points 
Index: branches/UKMO/dev_r5518_GO6_diag_bitcomp/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_diag_bitcomp/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 9608)
+++ branches/UKMO/dev_r5518_GO6_diag_bitcomp/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 9614)
@@ -1402,11 +1402,9 @@
          SELECT CASE ( cdgrd )
          CASE('T')   
-            zmask(:,:,:)       = tmask_i_3d(:,:,:)
+            zmask(:,:,:) = tmask_i_3d(:,:,:)
          CASE('U')
-            zmask(2:jpim1,:,:) = tmask_i_3d(2:jpim1,:,:) + tmask_i_3d(3:jpi,:,:)   
-            CALL lbc_lnk( zmask, 'U', 1. )
+            zmask(:,:,:) = umask_i_3d(:,:,:) 
          CASE('V') 
-            zmask(:,2:jpjm1,:) = tmask_i_3d(:,2:jpjm1,:) + tmask_i_3d(:,3:jpj,:)   
-            CALL lbc_lnk( zmask, 'V', 1. )
+            zmask(:,:,:) = vmask_i_3d(:,:,:) 
          CASE('W')   
             zmask(:,:,2:jpk  ) = tmask_i_3d(:,:,1:jpkm1) + tmask_i_3d(:,:,2:jpk)   
