Index: NEMO/branches/2020/dev_r13383_HPC-02_Daley_Tiling/src/OCE/TRA/traldf.F90
===================================================================
--- NEMO/branches/2020/dev_r13383_HPC-02_Daley_Tiling/src/OCE/TRA/traldf.F90	(revision 13515)
+++ NEMO/branches/2020/dev_r13383_HPC-02_Daley_Tiling/src/OCE/TRA/traldf.F90	(revision 13551)
@@ -17,5 +17,5 @@
    USE oce            ! ocean dynamics and tracers
    USE dom_oce        ! ocean space and time domain
-   ! TEMP: This change not necessary after trd_tra is tiled
+   ! TEMP: This change not necessary after extra haloes development (lbc_lnk removed from tra_ldf_blp, zps_hde*)
    USE domain, ONLY : dom_tile
    USE phycst         ! physical constants
@@ -40,6 +40,4 @@
    PUBLIC   tra_ldf_init   ! called by nemogcm.F90 
 
-   !! * Substitutions
-#  include "do_loop_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
@@ -59,10 +57,6 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts             ! active tracers and RHS of tracer equation
       !!
-      ! TEMP: This change not necessary after trd_tra is tiled
-      INTEGER ::   itile
-      INTEGER ::   ji, jj, jk    ! dummy loop indices
-      ! TEMP: This change not necessary after trd_tra is tiled
-      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ztrdt, ztrds
-      ! TEMP: This change not necessary after extra haloes development
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ztrdt, ztrds
+      ! TEMP: This change not necessary after extra haloes development (lbc_lnk removed from tra_ldf_blp, zps_hde*)
       LOGICAL :: lskip
       !!----------------------------------------------------------------------
@@ -72,9 +66,8 @@
       lskip = .FALSE.
 
-      IF( l_trdtra ) THEN
-         IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
-            ! TEMP: This can be ST_2D(nn_hls) after trd_tra is tiled
-            ALLOCATE( ztrdt(jpi,jpj,jpk), ztrds(jpi,jpj,jpk) )
-         ENDIF
+      IF( l_trdtra )   THEN                    !* Save ta and sa trends
+         ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) )
+         ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs)
+         ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs)
       ENDIF
 
@@ -90,14 +83,4 @@
       ENDIF
       IF( .NOT. lskip ) THEN
-
-         ! TEMP: This change not necessary after trd_tra is tiled
-         itile = ntile
-
-         IF( l_trdtra )   THEN                    !* Save ta and sa trends
-            DO_3D( 0, 0, 0, 0, 1, jpk )
-               ztrdt(ji,jj,jk) = pts(ji,jj,jk,jp_tem,Krhs)
-               ztrds(ji,jj,jk) = pts(ji,jj,jk,jp_sal,Krhs)
-            END_3D
-         ENDIF
          !
          SELECT CASE ( nldf_tra )                 !* compute lateral mixing trend and add it to the general trend
@@ -112,26 +95,14 @@
          END SELECT
          !
-         ! TEMP: These changes not necessary after trd_tra is tiled
          IF( l_trdtra )   THEN                    !* save the horizontal diffusive trends for further diagnostics
-            DO_3D( 0, 0, 0, 0, 1, jpk )
-               ztrdt(ji,jj,jk) = pts(ji,jj,jk,jp_tem,Krhs) - ztrdt(ji,jj,jk)
-               ztrds(ji,jj,jk) = pts(ji,jj,jk,jp_sal,Krhs) - ztrds(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, 'TRA', jp_tem, jptra_ldf, ztrdt )
-               CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_ldf, ztrds )
-               DEALLOCATE( ztrdt, ztrds )
-
-               IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = itile )     ! Revert to tile domain
-            ENDIF
+            ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) - ztrdt(:,:,:)
+            ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs) - ztrds(:,:,:)
+            CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_ldf, ztrdt )
+            CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_ldf, ztrds )
+            DEALLOCATE( ztrdt, ztrds )
          ENDIF
 
          ! TEMP: This change not necessary after extra haloes development (lbc_lnk removed from tra_ldf_blp, zps_hde*)
          IF( ln_tile .AND. ntile == 0 ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 1 )
-
       ENDIF
       !                                        !* print mean trends (used for debugging)
