Index: NEMO/branches/2020/dev_r13383_HPC-02_Daley_Tiling/src/OCE/TRA/traadv_qck.F90
===================================================================
--- NEMO/branches/2020/dev_r13383_HPC-02_Daley_Tiling/src/OCE/TRA/traadv_qck.F90	(revision 13516)
+++ NEMO/branches/2020/dev_r13383_HPC-02_Daley_Tiling/src/OCE/TRA/traadv_qck.F90	(revision 13551)
@@ -17,6 +17,4 @@
    USE oce             ! ocean dynamics and active tracers
    USE dom_oce         ! ocean space and time domain
-   ! TEMP: This change not necessary after trd_tra is tiled
-   USE domain, ONLY : dom_tile
    USE trc_oce         ! share passive tracers/Ocean variables
    USE trd_oce         ! trends: ocean variables
@@ -93,5 +91,5 @@
       INTEGER                                  , INTENT(in   ) ::   kjpt            ! number of tracers
       REAL(wp)                                 , INTENT(in   ) ::   p2dt            ! tracer time-step
-      ! TEMP: This can be ST_2D(nn_hls) after trd_tra is tiled
+      ! TEMP: This can be ST_2D(nn_hls) if using XIOS (subdomain support)
       REAL(wp), DIMENSION(jpi,jpj,jpk         ), INTENT(in   ) ::   pU, pV, pW      ! 3 ocean volume transport components
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::   pt              ! tracers and RHS of tracer equation
@@ -132,25 +130,13 @@
       INTEGER                                  , INTENT(in   ) ::   kjpt       ! number of tracers
       REAL(wp)                                 , INTENT(in   ) ::   p2dt       ! tracer time-step
-      ! TEMP: This can be ST_2D(nn_hls) after trd_tra is tiled
+      ! TEMP: This can be ST_2D(nn_hls) if using XIOS (subdomain support)
       REAL(wp), DIMENSION(jpi,jpj,jpk         ), INTENT(in   ) ::   pU        ! i-velocity components
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::   pt              ! active tracers and RHS of tracer equation
       !!
-      ! TEMP: This change not necessary after trd_tra is tiled
-      INTEGER  ::   itile
       INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
       REAL(wp) ::   ztra, zbtr, zdir, zdx, zmsk   ! local scalars
       REAL(wp), DIMENSION(ST_2D(nn_hls),jpk) ::   zwx, zfu, zfc, zfd
-      ! TEMP: This change not necessary after trd_tra is tiled
-      REAL(wp), DIMENSION(:,:,:), SAVE, ALLOCATABLE ::   ztrdx
       !----------------------------------------------------------------------
-      ! TEMP: This change not necessary after trd_tra is tiled
-      itile = ntile
-      !
-      ! TEMP: This can be ST_2D(nn_hls) after trd_tra is tiled
-      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
-         IF( kt == nit000 .AND. l_trd ) THEN
-            ALLOCATE( ztrdx(jpi,jpj,jpk) )
-         ENDIF
-      ENDIF
+      !
       !                                                          ! ===========
       DO jn = 1, kjpt                                            ! tracer loop
@@ -218,19 +204,5 @@
          END_3D
          !                                 ! trend diagnostics
-         ! TEMP: These changes not necessary after trd_tra is tiled
-         IF( l_trd )  THEN
-            DO_3D( 1, 0, 1, 0, 1, jpk )
-               ztrdx(ji,jj,jk) = zwx(ji,jj,jk)
-            END_3D
-
-            IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only for the full domain
-               IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )         ! Use full domain
-
-               ! TODO: TO BE TILED- trd_tra
-               CALL trd_tra( kt, Kmm, Krhs, cdtype, jn, jptra_xad, ztrdx, pU, pt(:,:,:,jn,Kmm) )
-
-               IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = itile )     ! Revert to tile domain
-            ENDIF
-         ENDIF
+         IF( l_trd )   CALL trd_tra( kt, Kmm, Krhs, cdtype, jn, jptra_xad, zwx, pU, pt(:,:,:,jn,Kmm) )
          !
       END DO
@@ -248,25 +220,13 @@
       INTEGER                                  , INTENT(in   ) ::   kjpt       ! number of tracers
       REAL(wp)                                 , INTENT(in   ) ::   p2dt       ! tracer time-step
-      ! TEMP: This can be ST_2D(nn_hls) after trd_tra is tiled
+      ! TEMP: This can be ST_2D(nn_hls) if using XIOS (subdomain support)
       REAL(wp), DIMENSION(jpi,jpj,jpk         ), INTENT(in   ) ::   pV        ! j-velocity components
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::   pt              ! active tracers and RHS of tracer equation
       !!
-      ! TEMP: This change not necessary after trd_tra is tiled
-      INTEGER  ::   itile
       INTEGER  :: ji, jj, jk, jn                ! dummy loop indices
       REAL(wp) :: ztra, zbtr, zdir, zdx, zmsk   ! local scalars
       REAL(wp), DIMENSION(ST_2D(nn_hls),jpk) ::   zwy, zfu, zfc, zfd   ! 3D workspace
-      ! TEMP: This change not necessary after trd_tra is tiled
-      REAL(wp), DIMENSION(:,:,:), SAVE, ALLOCATABLE ::   ztrdy
       !----------------------------------------------------------------------
-      ! TEMP: This change not necessary after trd_tra is tiled
-      itile = ntile
-      !
-      ! TEMP: This can be ST_2D(nn_hls) after trd_tra is tiled
-      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
-         IF( kt == nit000 .AND. l_trd ) THEN
-            ALLOCATE( ztrdy(jpi,jpj,jpk) )
-         ENDIF
-      ENDIF
+      !
       !                                                          ! ===========
       DO jn = 1, kjpt                                            ! tracer loop
@@ -341,19 +301,5 @@
          END_3D
          !                                 ! trend diagnostics
-         ! TEMP: These changes not necessary after trd_tra is tiled
-         IF( l_trd )  THEN
-            DO_3D( 1, 0, 1, 0, 1, jpk )
-               ztrdy(ji,jj,jk) = zwy(ji,jj,jk)
-            END_3D
-
-            IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only for the full domain
-               IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )         ! Use full domain
-
-               ! TODO: TO BE TILED- trd_tra
-               CALL trd_tra( kt, Kmm, Krhs, cdtype, jn, jptra_yad, ztrdy, pV, pt(:,:,:,jn,Kmm) )
-
-               IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = itile )     ! Revert to tile domain
-            ENDIF
-         ENDIF
+         IF( l_trd )   CALL trd_tra( kt, Kmm, Krhs, cdtype, jn, jptra_yad, zwy, pV, pt(:,:,:,jn,Kmm) )
          !                                 ! "Poleward" heat and salt transports (contribution of upstream fluxes)
          IF( l_ptr )   CALL dia_ptr_hst( jn, 'adv', zwy(:,:,:) )
@@ -372,25 +318,12 @@
       CHARACTER(len=3)                         , INTENT(in   ) ::   cdtype   ! =TRA or TRC (tracer indicator)
       INTEGER                                  , INTENT(in   ) ::   kjpt     ! number of tracers
-      ! TEMP: This can be ST_2D(nn_hls) after trd_tra is tiled
+      ! TEMP: This can be ST_2D(nn_hls) if using XIOS (subdomain support)
       REAL(wp), DIMENSION(jpi,jpj,jpk         ), INTENT(in   ) ::   pW      ! vertical velocity
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::   pt              ! active tracers and RHS of tracer equation
       !
-      ! TEMP: This change not necessary after trd_tra is tiled
-      INTEGER  ::   itile
       INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
       REAL(wp), DIMENSION(ST_2D(nn_hls),jpk) ::   zwz   ! 3D workspace
-      ! TEMP: This change not necessary after trd_tra is tiled
-      REAL(wp), DIMENSION(:,:,:), SAVE, ALLOCATABLE ::   ztrdz
-      !!----------------------------------------------------------------------
-      ! TEMP: This change not necessary after trd_tra is tiled
-      itile = ntile
-      !
-      ! TEMP: This can be ST_2D(nn_hls) after trd_tra is tiled
-      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
-         IF( kt == nit000 .AND. l_trd ) THEN
-            ALLOCATE( ztrdz(jpi,jpj,jpk) )
-         ENDIF
-      ENDIF
-
+      !!----------------------------------------------------------------------
+      !
       zwz(:,:, 1 ) = 0._wp       ! surface & bottom values set to zero for all tracers
       zwz(:,:,jpk) = 0._wp
@@ -421,19 +354,5 @@
          END_3D
          !                                 ! Send trends for diagnostic
-         ! TEMP: These changes not necessary after trd_tra is tiled
-         IF( l_trd )  THEN
-            DO_3D( 0, 0, 0, 0, 1, jpk )
-               ztrdz(ji,jj,jk) = zwz(ji,jj,jk)
-            END_3D
-
-            IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only for the full domain
-               IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )         ! Use full domain
-
-               ! TODO: TO BE TILED- trd_tra
-               CALL trd_tra( kt, Kmm, Krhs, cdtype, jn, jptra_zad, ztrdz, pW, pt(:,:,:,jn,Kmm) )
-
-               IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = itile )     ! Revert to tile domain
-            ENDIF
-         ENDIF
+         IF( l_trd )  CALL trd_tra( kt, Kmm, Krhs, cdtype, jn, jptra_zad, zwz, pW, pt(:,:,:,jn,Kmm) )
          !
       END DO
