Index: NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DIA/diaar5.F90
===================================================================
--- NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DIA/diaar5.F90	(revision 14576)
+++ NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DIA/diaar5.F90	(revision 14607)
@@ -34,5 +34,4 @@
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:  ) ::   thick0       ! ocean thickness (interior domain)
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   sn0          ! initial salinity
-   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   hstr_adv, hstr_ldf
 
    LOGICAL  :: l_ar5
@@ -55,6 +54,5 @@
       !!----------------------------------------------------------------------
       !
-      ALLOCATE( thick0(jpi,jpj) , sn0(jpi,jpj,jpk) , &
-         &      hstr_adv(jpi,jpj,jpts,2), hstr_ldf(jpi,jpj,jpts,2), STAT=dia_ar5_alloc )
+      ALLOCATE( thick0(jpi,jpj) , sn0(jpi,jpj,jpk), STAT=dia_ar5_alloc )
       !
       CALL mpp_sum ( 'diaar5', dia_ar5_alloc )
@@ -306,5 +304,5 @@
    END SUBROUTINE dia_ar5
 
-   ! TEMP: [tiling] These changes not necessary if using XIOS (subdomain support, will not output haloes)
+
    SUBROUTINE dia_ar5_hst( ktra, cptr, puflx, pvflx )
       !!----------------------------------------------------------------------
@@ -320,41 +318,30 @@
       !
       INTEGER    ::  ji, jj, jk
-
-      IF( cptr /= 'adv' .AND. cptr /= 'ldf' ) RETURN
-      IF( ktra /= jp_tem .AND. ktra /= jp_sal ) RETURN
+      REAL(wp), DIMENSION(A2D(nn_hls))  :: z2d
+
+      z2d(:,:) = puflx(:,:,1)
+      DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+         z2d(ji,jj) = z2d(ji,jj) + puflx(ji,jj,jk)
+      END_3D
 
       IF( cptr == 'adv' ) THEN
-         DO_2D( 0, 0, 0, 0 )
-            hstr_adv(ji,jj,ktra,1) = puflx(ji,jj,1)
-            hstr_adv(ji,jj,ktra,2) = pvflx(ji,jj,1)
-         END_2D
-         DO_3D( 0, 0, 0, 0, 1, jpkm1 )
-            hstr_adv(ji,jj,ktra,1) = hstr_adv(ji,jj,ktra,1) + puflx(ji,jj,jk)
-            hstr_adv(ji,jj,ktra,2) = hstr_adv(ji,jj,ktra,2) + pvflx(ji,jj,jk)
-         END_3D
+         IF( ktra == jp_tem ) CALL iom_put( 'uadv_heattr' , rho0_rcp * z2d(:,:) )  ! advective heat transport in i-direction
+         IF( ktra == jp_sal ) CALL iom_put( 'uadv_salttr' , rho0     * z2d(:,:) )  ! advective salt transport in i-direction
       ELSE IF( cptr == 'ldf' ) THEN
-         DO_2D( 0, 0, 0, 0 )
-            hstr_ldf(ji,jj,ktra,1) = puflx(ji,jj,1)
-            hstr_ldf(ji,jj,ktra,2) = pvflx(ji,jj,1)
-         END_2D
-         DO_3D( 0, 0, 0, 0, 1, jpkm1 )
-            hstr_ldf(ji,jj,ktra,1) = hstr_ldf(ji,jj,ktra,1) + puflx(ji,jj,jk)
-            hstr_ldf(ji,jj,ktra,2) = hstr_ldf(ji,jj,ktra,2) + pvflx(ji,jj,jk)
-         END_3D
-      ENDIF
-
-      IF( ntile == 0 .OR. ntile == nijtile ) THEN
-         IF( cptr == 'adv' ) THEN
-            IF( ktra == jp_tem ) CALL iom_put( 'uadv_heattr' , rho0_rcp * hstr_adv(:,:,ktra,1) )  ! advective heat transport in i-direction
-            IF( ktra == jp_sal ) CALL iom_put( 'uadv_salttr' , rho0     * hstr_adv(:,:,ktra,1) )  ! advective salt transport in i-direction
-            IF( ktra == jp_tem ) CALL iom_put( 'vadv_heattr' , rho0_rcp * hstr_adv(:,:,ktra,2) )  ! advective heat transport in j-direction
-            IF( ktra == jp_sal ) CALL iom_put( 'vadv_salttr' , rho0     * hstr_adv(:,:,ktra,2) )  ! advective salt transport in j-direction
-         ENDIF
-         IF( cptr == 'ldf' ) THEN
-            IF( ktra == jp_tem ) CALL iom_put( 'udiff_heattr' , rho0_rcp * hstr_ldf(:,:,ktra,1) ) ! diffusive heat transport in i-direction
-            IF( ktra == jp_sal ) CALL iom_put( 'udiff_salttr' , rho0     * hstr_ldf(:,:,ktra,1) ) ! diffusive salt transport in i-direction
-            IF( ktra == jp_tem ) CALL iom_put( 'vdiff_heattr' , rho0_rcp * hstr_ldf(:,:,ktra,2) ) ! diffusive heat transport in j-direction
-            IF( ktra == jp_sal ) CALL iom_put( 'vdiff_salttr' , rho0     * hstr_ldf(:,:,ktra,2) ) ! diffusive salt transport in j-direction
-         ENDIF
+         IF( ktra == jp_tem ) CALL iom_put( 'udiff_heattr' , rho0_rcp * z2d(:,:) ) ! diffusive heat transport in i-direction
+         IF( ktra == jp_sal ) CALL iom_put( 'udiff_salttr' , rho0     * z2d(:,:) ) ! diffusive salt transport in i-direction
+      ENDIF
+      !
+      z2d(:,:) = pvflx(:,:,1)
+      DO_3D( 0, 0, 0, 0, 1, jpkm1 )
+         z2d(ji,jj) = z2d(ji,jj) + pvflx(ji,jj,jk)
+      END_3D
+
+      IF( cptr == 'adv' ) THEN
+         IF( ktra == jp_tem ) CALL iom_put( 'vadv_heattr' , rho0_rcp * z2d(:,:) )  ! advective heat transport in j-direction
+         IF( ktra == jp_sal ) CALL iom_put( 'vadv_salttr' , rho0     * z2d(:,:) )  ! advective salt transport in j-direction
+      ELSE IF( cptr == 'ldf' ) THEN
+         IF( ktra == jp_tem ) CALL iom_put( 'vdiff_heattr' , rho0_rcp * z2d(:,:) ) ! diffusive heat transport in j-direction
+         IF( ktra == jp_sal ) CALL iom_put( 'vdiff_salttr' , rho0     * z2d(:,:) ) ! diffusive salt transport in j-direction
       ENDIF
 
Index: NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DOM/domutl.F90
===================================================================
--- NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DOM/domutl.F90	(revision 14576)
+++ NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/DOM/domutl.F90	(revision 14607)
@@ -22,5 +22,5 @@
 
    INTERFACE is_tile
-      MODULE PROCEDURE is_tile_2d, is_tile_3d, is_tile_4d
+      MODULE PROCEDURE is_tile_2d_sp, is_tile_3d_sp, is_tile_4d_sp, is_tile_2d_dp, is_tile_3d_dp, is_tile_4d_dp
    END INTERFACE is_tile
 
@@ -116,42 +116,69 @@
 
 
-   FUNCTION is_tile_2d( pt )
-      !!
-      REAL(wp), DIMENSION(:,:), INTENT(in) ::   pt
-      INTEGER :: is_tile_2d
-      !!
-      IF( ln_tile .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN
-         is_tile_2d = 1
+   ! TODO: Move these into domtile
+   INTEGER FUNCTION is_tile_2d_sp( pt )
+      REAL(sp), DIMENSION(:,:), INTENT(in) ::   pt
+
+      IF( l_istiled .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN
+         is_tile_2d_sp = 1
       ELSE
-         is_tile_2d = 0
+         is_tile_2d_sp = 0
       ENDIF
-   END FUNCTION is_tile_2d
+   END FUNCTION is_tile_2d_sp
 
 
-   FUNCTION is_tile_3d( pt )
-      !!
-      REAL(wp), DIMENSION(:,:,:), INTENT(in) ::   pt
-      INTEGER :: is_tile_3d
-      !!
-      IF( ln_tile .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN
-         is_tile_3d = 1
+   INTEGER FUNCTION is_tile_2d_dp( pt )
+      REAL(dp), DIMENSION(:,:), INTENT(in) ::   pt
+
+      IF( l_istiled .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN
+         is_tile_2d_dp = 1
       ELSE
-         is_tile_3d = 0
+         is_tile_2d_dp = 0
       ENDIF
-   END FUNCTION is_tile_3d
+   END FUNCTION is_tile_2d_dp
 
 
-   FUNCTION is_tile_4d( pt )
-      !!
-      REAL(wp), DIMENSION(:,:,:,:), INTENT(in) ::   pt
-      INTEGER :: is_tile_4d
-      !!
-      IF( ln_tile .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN
-         is_tile_4d = 1
+   INTEGER FUNCTION is_tile_3d_sp( pt )
+      REAL(sp), DIMENSION(:,:,:), INTENT(in) ::   pt
+
+      IF( l_istiled .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN
+         is_tile_3d_sp = 1
       ELSE
-         is_tile_4d = 0
+         is_tile_3d_sp = 0
       ENDIF
-   END FUNCTION is_tile_4d
+   END FUNCTION is_tile_3d_sp
 
+
+   INTEGER FUNCTION is_tile_3d_dp( pt )
+      REAL(dp), DIMENSION(:,:,:), INTENT(in) ::   pt
+
+      IF( l_istiled .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN
+         is_tile_3d_dp = 1
+      ELSE
+         is_tile_3d_dp = 0
+      ENDIF
+   END FUNCTION is_tile_3d_dp
+
+
+   INTEGER FUNCTION is_tile_4d_sp( pt )
+      REAL(sp), DIMENSION(:,:,:,:), INTENT(in) ::   pt
+
+      IF( l_istiled .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN
+         is_tile_4d_sp = 1
+      ELSE
+         is_tile_4d_sp = 0
+      ENDIF
+   END FUNCTION is_tile_4d_sp
+
+
+   INTEGER FUNCTION is_tile_4d_dp( pt )
+      REAL(dp), DIMENSION(:,:,:,:), INTENT(in) ::   pt
+
+      IF( l_istiled .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN
+         is_tile_4d_dp = 1
+      ELSE
+         is_tile_4d_dp = 0
+      ENDIF
+   END FUNCTION is_tile_4d_dp
    !!======================================================================
 END MODULE domutl
Index: NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/IOM/iom.F90
===================================================================
--- NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/IOM/iom.F90	(revision 14576)
+++ NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/IOM/iom.F90	(revision 14607)
@@ -2014,5 +2014,9 @@
       IF( iom_use(cdname) ) THEN
 #if defined key_xios
-         CALL xios_send_field( cdname, pfield2d )
+         IF( is_tile(pfield2d) == 1 ) THEN
+            CALL xios_send_field( cdname, pfield2d, ntile - 1 )
+         ELSE IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN
+            CALL xios_send_field( cdname, pfield2d )
+         ENDIF
 #else
          WRITE(numout,*) pfield2d   ! iom_use(cdname) = .F. -> useless test to avoid compilation warnings
@@ -2026,5 +2030,9 @@
       IF( iom_use(cdname) ) THEN
 #if defined key_xios
-         CALL xios_send_field( cdname, pfield2d )
+         IF( is_tile(pfield2d) == 1 ) THEN
+            CALL xios_send_field( cdname, pfield2d, ntile - 1 )
+         ELSE IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN
+            CALL xios_send_field( cdname, pfield2d )
+         ENDIF
 #else
          WRITE(numout,*) pfield2d   ! iom_use(cdname) = .F. -> useless test to avoid compilation warnings
@@ -2038,5 +2046,9 @@
       IF( iom_use(cdname) ) THEN
 #if defined key_xios
-         CALL xios_send_field( cdname, pfield3d )
+         IF( is_tile(pfield3d) == 1 ) THEN
+            CALL xios_send_field( cdname, pfield3d, ntile - 1 )
+         ELSE IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN
+            CALL xios_send_field( cdname, pfield3d )
+         ENDIF
 #else
          WRITE(numout,*) pfield3d   ! iom_use(cdname) = .F. -> useless test to avoid compilation warnings
@@ -2050,5 +2062,9 @@
       IF( iom_use(cdname) ) THEN
 #if defined key_xios
-         CALL xios_send_field( cdname, pfield3d )
+         IF( is_tile(pfield3d) == 1 ) THEN
+            CALL xios_send_field( cdname, pfield3d, ntile - 1 )
+         ELSE IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN
+            CALL xios_send_field( cdname, pfield3d )
+         ENDIF
 #else
          WRITE(numout,*) pfield3d   ! iom_use(cdname) = .F. -> useless test to avoid compilation warnings
@@ -2062,5 +2078,9 @@
       IF( iom_use(cdname) ) THEN
 #if defined key_xios
-         CALL xios_send_field (cdname, pfield4d )
+         IF( is_tile(pfield4d) == 1 ) THEN
+            CALL xios_send_field( cdname, pfield4d, ntile - 1 )
+         ELSE IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN
+            CALL xios_send_field( cdname, pfield4d )
+         ENDIF
 #else
          WRITE(numout,*) pfield4d   ! iom_use(cdname) = .F. -> useless test to avoid compilation warnings
@@ -2074,5 +2094,9 @@
       IF( iom_use(cdname) ) THEN
 #if defined key_xios
-         CALL xios_send_field (cdname, pfield4d )
+         IF( is_tile(pfield4d) == 1 ) THEN
+            CALL xios_send_field( cdname, pfield4d, ntile - 1 )
+         ELSE IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN
+            CALL xios_send_field( cdname, pfield4d )
+         ENDIF
 #else
          WRITE(numout,*) pfield4d   ! iom_use(cdname) = .F. -> useless test to avoid compilation warnings
@@ -2088,4 +2112,6 @@
    SUBROUTINE iom_set_domain_attr( cdid, ni_glo, nj_glo, ibegin, jbegin, ni, nj,                                               &
       &                                    data_dim, data_ibegin, data_ni, data_jbegin, data_nj, lonvalue, latvalue, mask,     &
+      &                                  ntiles, tile_ibegin, tile_jbegin, tile_ni, tile_nj,                                   &
+      &                                  tile_data_ibegin, tile_data_jbegin, tile_data_ni, tile_data_nj,                       &
       &                                    nvertex, bounds_lon, bounds_lat, area )
       !!----------------------------------------------------------------------
@@ -2093,6 +2119,8 @@
       CHARACTER(LEN=*)                  , INTENT(in) ::   cdid
       INTEGER                 , OPTIONAL, INTENT(in) ::   ni_glo, nj_glo, ibegin, jbegin, ni, nj
+      INTEGER,  DIMENSION(:)  , OPTIONAL, INTENT(in) ::   tile_ibegin, tile_jbegin, tile_ni, tile_nj
+      INTEGER,  DIMENSION(:)  , OPTIONAL, INTENT(in) ::   tile_data_ibegin, tile_data_jbegin, tile_data_ni, tile_data_nj
       INTEGER                 , OPTIONAL, INTENT(in) ::   data_dim, data_ibegin, data_ni, data_jbegin, data_nj
-      INTEGER                 , OPTIONAL, INTENT(in) ::   nvertex
+      INTEGER                 , OPTIONAL, INTENT(in) ::   nvertex, ntiles
       REAL(dp), DIMENSION(:)  , OPTIONAL, INTENT(in) ::   lonvalue, latvalue
       REAL(dp), DIMENSION(:,:), OPTIONAL, INTENT(in) ::   bounds_lon, bounds_lat, area
@@ -2103,4 +2131,7 @@
          CALL xios_set_domain_attr     ( cdid, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   &
             &    data_dim=data_dim, data_ibegin=data_ibegin, data_ni=data_ni, data_jbegin=data_jbegin, data_nj=data_nj ,   &
+            &    ntiles=ntiles, tile_ibegin=tile_ibegin, tile_jbegin=tile_jbegin, tile_ni=tile_ni, tile_nj=tile_nj,        &
+            &    tile_data_ibegin=tile_data_ibegin, tile_data_jbegin=tile_data_jbegin,                                     &
+            &    tile_data_ni=tile_data_ni, tile_data_nj=tile_data_nj,                                                     &
             &    lonvalue_1D=lonvalue, latvalue_1D=latvalue, mask_1D=mask, nvertex=nvertex, bounds_lon_1D=bounds_lon,      &
             &    bounds_lat_1D=bounds_lat, area=area, type='curvilinear')
@@ -2109,4 +2140,7 @@
          CALL xios_set_domaingroup_attr( cdid, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   &
             &    data_dim=data_dim, data_ibegin=data_ibegin, data_ni=data_ni, data_jbegin=data_jbegin, data_nj=data_nj ,   &
+            &    ntiles=ntiles, tile_ibegin=tile_ibegin, tile_jbegin=tile_jbegin, tile_ni=tile_ni, tile_nj=tile_nj,        &
+            &    tile_data_ibegin=tile_data_ibegin, tile_data_jbegin=tile_data_jbegin,                                     &
+            &    tile_data_ni=tile_data_ni, tile_data_nj=tile_data_nj,                                                     &
             &    lonvalue_1D=lonvalue, latvalue_1D=latvalue, mask_1D=mask, nvertex=nvertex, bounds_lon_1D=bounds_lon,      &
             &    bounds_lat_1D=bounds_lat, area=area, type='curvilinear' )
@@ -2276,4 +2310,6 @@
       !
       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zmask
+      INTEGER :: jn
+      INTEGER, DIMENSION(nijtile) :: ini, inj, idb
       LOGICAL, INTENT(IN) :: ldxios, ldrxios
       !!----------------------------------------------------------------------
@@ -2281,4 +2317,20 @@
       CALL iom_set_domain_attr("grid_"//cdgrd, ni_glo=Ni0glo,nj_glo=Nj0glo,ibegin=mig0(Nis0)-1,jbegin=mjg0(Njs0)-1,ni=Ni_0,nj=Nj_0)
       CALL iom_set_domain_attr("grid_"//cdgrd, data_dim=2, data_ibegin = -nn_hls, data_ni=jpi, data_jbegin = -nn_hls, data_nj=jpj)
+
+      IF( ln_tile ) THEN
+         DO jn = 1, nijtile
+            ini(jn) = ntei_a(jn) - ntsi_a(jn) + 1     ! Tile size in i and j
+            inj(jn) = ntej_a(jn) - ntsj_a(jn) + 1
+            idb(jn) = -nn_hls                         ! Tile data offset (halo size)
+         END DO
+
+         ! Tile_[ij]begin are defined with respect to the processor data domain, so data_[ij]begin is added
+         CALL iom_set_domain_attr("grid_"//cdgrd, ntiles=nijtile,                                     &
+            & tile_ibegin=ntsi_a(1:nijtile) + idb(:) - 1, tile_jbegin=ntsj_a(1:nijtile) + idb(:) - 1, &
+            & tile_ni=ini(:), tile_nj=inj(:),                                                         &
+            & tile_data_ibegin=idb(:), tile_data_jbegin=idb(:),                                       &
+            & tile_data_ni=ini(:) - 2 * idb(:), tile_data_nj=inj(:) - 2 * idb(:))
+      ENDIF
+
 !don't define lon and lat for restart reading context.
       IF ( .NOT.ldrxios ) &
Index: NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/trabbc.F90
===================================================================
--- NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/trabbc.F90	(revision 14576)
+++ NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/trabbc.F90	(revision 14607)
@@ -102,7 +102,6 @@
       ENDIF
       !
-      IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only for the full domain
-         CALL iom_put ( "hfgeou" , rho0_rcp * qgh_trd0(:,:) )
-      ENDIF
+      CALL iom_put ( "hfgeou" , rho0_rcp * qgh_trd0(:,:) )
+
       IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' bbc  - Ta: ', mask1=tmask, clinfo3='tra-ta' )
       !
Index: NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/trabbl.F90
===================================================================
--- NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/trabbl.F90	(revision 14576)
+++ NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/trabbl.F90	(revision 14607)
@@ -126,8 +126,6 @@
          CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' bbl_ldf  - Ta: ', mask1=tmask, &
             &          tab3d_2=pts(:,:,:,jp_sal,Krhs), clinfo2=           ' Sa: ', mask2=tmask, clinfo3='tra' )
-         IF( ntile == 0 .OR. ntile == nijtile ) THEN                       ! Do only on the last tile
          CALL iom_put( "ahu_bbl", ahu_bbl )   ! bbl diffusive flux i-coef
          CALL iom_put( "ahv_bbl", ahv_bbl )   ! bbl diffusive flux j-coef
-         ENDIF
          !
       ENDIF
@@ -142,7 +140,7 @@
             ! lateral boundary conditions ; just need for outputs
             CALL lbc_lnk( 'trabbl', utr_bbl, 'U', 1.0_wp , vtr_bbl, 'V', 1.0_wp )
+         ENDIF
          CALL iom_put( "uoce_bbl", utr_bbl )  ! bbl i-transport
          CALL iom_put( "voce_bbl", vtr_bbl )  ! bbl j-transport
-         ENDIF
          !
       ENDIF
Index: NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/tramle.F90
===================================================================
--- NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/tramle.F90	(revision 14576)
+++ NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/tramle.F90	(revision 14607)
@@ -96,9 +96,6 @@
       REAL(wp) ::   zcvw, zmvw          !   -      -
       INTEGER , DIMENSION(A2D(nn_hls))     :: inml_mle
-      REAL(wp), DIMENSION(A2D(nn_hls))     :: zpsim_u, zpsim_v, zmld, zbm, zhu, zhv, zn2, zLf_MH
+      REAL(wp), DIMENSION(A2D(nn_hls))     :: zpsim_u, zpsim_v, zmld, zbm, zhu, zhv, zn2, zLf_NH, zLf_MH
       REAL(wp), DIMENSION(A2D(nn_hls),jpk) :: zpsi_uw, zpsi_vw
-      ! TEMP: [tiling] These changes not necessary if using XIOS (subdomain support)
-      REAL(wp), DIMENSION(:,:),   ALLOCATABLE, SAVE :: zLf_NH
-      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE :: zpsiu_mle, zpsiv_mle
       !!----------------------------------------------------------------------
       !
@@ -282,10 +279,5 @@
       END DO
 
-      ! TEMP: [tiling] These changes not necessary if using XIOS (subdomain support)
       IF( cdtype == 'TRA') THEN              !==  outputs  ==!
-         IF( ntile == 0 .OR. ntile == 1 ) THEN                             ! Do only on the first tile
-            ALLOCATE( zLf_NH(jpi,jpj), zpsiu_mle(jpi,jpj,jpk), zpsiv_mle(jpi,jpj,jpk) )
-            zpsiu_mle(:,:,:) = 0._wp ; zpsiv_mle(:,:,:) = 0._wp
-         ENDIF
          !
          IF (ln_osm_mle.and.ln_zdfosm) THEN
@@ -301,17 +293,13 @@
          ENDIF
          !
+         CALL iom_put( "Lf_NHpf" , zLf_NH  )    ! Lf = N H / f
+         !
          ! divide by cross distance to give streamfunction with dimensions m^2/s
-         ! [comm_cleanup] ! DO_3D( 0, 0, 0, 0, 1, ikmax+1 )
-         DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 1, ikmax+1 )
-            zpsiu_mle(ji,jj,jk) = zpsi_uw(ji,jj,jk) * r1_e2u(ji,jj)
-            zpsiv_mle(ji,jj,jk) = zpsi_vw(ji,jj,jk) * r1_e1v(ji,jj)
+         DO_3D( 0, 0, 0, 0, 1, ikmax+1 )
+            zpsi_uw(ji,jj,jk) = zpsi_uw(ji,jj,jk) * r1_e2u(ji,jj)
+            zpsi_vw(ji,jj,jk) = zpsi_vw(ji,jj,jk) * r1_e1v(ji,jj)
          END_3D
-
-         IF( ntile == 0 .OR. ntile == nijtile ) THEN                       ! Do only on the last tile
-            CALL iom_put( "Lf_NHpf" , zLf_NH  )    ! Lf = N H / f
-            CALL iom_put( "psiu_mle", zpsiu_mle )    ! i-mle streamfunction
-            CALL iom_put( "psiv_mle", zpsiv_mle )    ! j-mle streamfunction
-            DEALLOCATE( zLf_NH, zpsiu_mle, zpsiv_mle )
-         ENDIF
+         CALL iom_put( "psiu_mle", zpsi_uw )    ! i-mle streamfunction
+         CALL iom_put( "psiv_mle", zpsi_vw )    ! j-mle streamfunction
       ENDIF
       !
Index: NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/traqsr.F90
===================================================================
--- NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/traqsr.F90	(revision 14576)
+++ NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/traqsr.F90	(revision 14607)
@@ -293,15 +293,12 @@
       END_2D
       !
-      ! TEMP: [tiling] This change not necessary and working array can use A2D(nn_hls) if using XIOS (subdomain support)
-      IF( .NOT. l_istiled .OR. ntile == nijtile )  THEN                ! Do only for the full domain
-         IF( iom_use('qsr3d') ) THEN      ! output the shortwave Radiation distribution
-            ALLOCATE( zetot(jpi,jpj,jpk) )
-            zetot(:,:,nksr+1:jpk) = 0._wp     ! below ~400m set to zero
-            DO jk = nksr, 1, -1
-               zetot(:,:,jk) = zetot(:,:,jk+1) + qsr_hc(:,:,jk) * rho0_rcp
-            END DO
-            CALL iom_put( 'qsr3d', zetot )   ! 3D distribution of shortwave Radiation
-            DEALLOCATE( zetot )
-         ENDIF
+      IF( iom_use('qsr3d') ) THEN      ! output the shortwave Radiation distribution
+         ALLOCATE( zetot(A2D(nn_hls),jpk) )
+         zetot(:,:,nksr+1:jpk) = 0._wp     ! below ~400m set to zero
+         DO_3DS(0, 0, 0, 0, nksr, 1, -1)
+            zetot(ji,jj,jk) = zetot(ji,jj,jk+1) + qsr_hc(ji,jj,jk) * rho0_rcp
+         END_3D
+         CALL iom_put( 'qsr3d', zetot )   ! 3D distribution of shortwave Radiation
+         DEALLOCATE( zetot )
       ENDIF
       !
Index: NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/trasbc.F90
===================================================================
--- NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/trasbc.F90	(revision 14576)
+++ NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/TRA/trasbc.F90	(revision 14607)
@@ -142,8 +142,6 @@
             sbc_tsc(ji,jj,jp_sal) = sbc_tsc(ji,jj,jp_sal) + r1_rho0 * emp(ji,jj) * pts(ji,jj,1,jp_sal,Kmm)
          END_2D                                 !==>> output c./d. term
-         IF( .NOT. l_istiled .OR. ntile == nijtile )  THEN             ! Do only on the last tile
-            IF( iom_use('emp_x_sst') )   CALL iom_put( "emp_x_sst", emp (:,:) * pts(:,:,1,jp_tem,Kmm) )
-            IF( iom_use('emp_x_sss') )   CALL iom_put( "emp_x_sss", emp (:,:) * pts(:,:,1,jp_sal,Kmm) )
-         ENDIF
+         IF( iom_use('emp_x_sst') )   CALL iom_put( "emp_x_sst", emp (:,:) * pts(:,:,1,jp_tem,Kmm) )
+         IF( iom_use('emp_x_sss') )   CALL iom_put( "emp_x_sss", emp (:,:) * pts(:,:,1,jp_sal,Kmm) )
       ENDIF
       !
@@ -181,8 +179,6 @@
       ENDIF
 
-      IF( .NOT. l_istiled .OR. ntile == nijtile )  THEN                ! Do only on the last tile
-          IF( iom_use('rnf_x_sst') )   CALL iom_put( "rnf_x_sst", rnf*pts(:,:,1,jp_tem,Kmm) )   ! runoff term on sst
-          IF( iom_use('rnf_x_sss') )   CALL iom_put( "rnf_x_sss", rnf*pts(:,:,1,jp_sal,Kmm) )   ! runoff term on sss
-      ENDIF
+      IF( iom_use('rnf_x_sst') )   CALL iom_put( "rnf_x_sst", rnf*pts(:,:,1,jp_tem,Kmm) )   ! runoff term on sst
+      IF( iom_use('rnf_x_sss') )   CALL iom_put( "rnf_x_sss", rnf*pts(:,:,1,jp_sal,Kmm) )   ! runoff term on sss
 
 #if defined key_asminc
