Index: NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/ASM/asminc.F90
===================================================================
--- NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/ASM/asminc.F90	(revision 14315)
+++ NEMO/branches/2021/dev_r14273_HPC-02_Daley_Tiling/src/OCE/ASM/asminc.F90	(revision 14537)
@@ -26,4 +26,5 @@
    USE par_oce         ! Ocean space and time domain variables
    USE dom_oce         ! Ocean space and time domain
+   ! TEMP: [tiling] This change not necessary after extended haloes development
    USE domtile
    USE domvvl          ! domain: variable volume level
@@ -519,5 +520,5 @@
       !
       INTEGER  :: ji, jj, jk
-      INTEGER  :: it, itile
+      INTEGER  :: it
       REAL(wp) :: zincwgt  ! IAU weight for current time step
       REAL(wp), DIMENSION(A2D(nn_hls),jpk) :: fzptnz ! 3d freezing point values
@@ -541,5 +542,5 @@
             zincwgt = wgtiau(it) / rn_Dt   ! IAU weight for the current time step
             !
-            IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+            IF( .NOT. l_istiled .OR. ntile == 1 )  THEN                       ! Do only on the first tile
                IF(lwp) THEN
                   WRITE(numout,*)
@@ -578,5 +579,5 @@
          ENDIF
          !
-         IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile
+         IF( .NOT. l_istiled .OR. ntile == nijtile )  THEN                ! Do only on the last tile
             IF ( kt == nitiaufin_r + 1  ) THEN   ! For bias crcn to work
                DEALLOCATE( t_bkginc )
@@ -625,7 +626,6 @@
 
             ! TEMP: [tiling] This change not necessary after extra haloes development (lbc_lnk removed from zps_hde*)
-            IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only for the full domain
-               itile = ntile
-               IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )            ! Use full domain
+            IF( .NOT. l_istiled .OR. ntile == nijtile )  THEN                ! Do only for the full domain
+               IF( ln_tile ) CALL dom_tile_stop( ldhold=.TRUE., cstr='asminc' )             ! Use full domain
 
                IF( ln_zps .AND. .NOT. lk_c1d .AND. .NOT. ln_isfcav)           &
@@ -636,8 +636,8 @@
                   &                                  rhd, gru , grv , grui, grvi          )  ! of t, s, rd at the last ocean level
 
-               IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = itile )            ! Revert to tile domain
+               IF( ln_tile ) CALL dom_tile_start( ldhold=.TRUE., cstr='asminc' )            ! Revert to tile domain
             ENDIF
 
-            IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile
+            IF( .NOT. l_istiled .OR. ntile == nijtile )  THEN                ! Do only on the last tile
                DEALLOCATE( t_bkginc )
                DEALLOCATE( s_bkginc )
@@ -683,9 +683,9 @@
             zincwgt = wgtiau(it) / rn_Dt   ! IAU weight for the current time step
             !
-            IF(lwp) THEN
-               WRITE(numout,*)
-               WRITE(numout,*) 'dyn_asm_inc : Dynamics IAU at time step = ', kt,' with IAU weight = ', wgtiau(it)
-               WRITE(numout,*) '~~~~~~~~~~~~'
-            ENDIF
+               IF(lwp) THEN
+                  WRITE(numout,*)
+                  WRITE(numout,*) 'dyn_asm_inc : Dynamics IAU at time step = ', kt,' with IAU weight = ', wgtiau(it)
+                  WRITE(numout,*) '~~~~~~~~~~~~'
+               ENDIF
             !
             ! Update the dynamic tendencies
@@ -695,10 +695,10 @@
             END DO
             !
-            IF ( kt == nitiaufin_r ) THEN
-               DEALLOCATE( u_bkginc )
-               DEALLOCATE( v_bkginc )
+               IF ( kt == nitiaufin_r ) THEN
+                  DEALLOCATE( u_bkginc )
+                  DEALLOCATE( v_bkginc )
+               ENDIF
+            !
             ENDIF
-            !
-         ENDIF
          !                          !-----------------------------------------
       ELSEIF ( ln_asmdin ) THEN     ! Direct Initialization
@@ -754,10 +754,10 @@
             zincwgt = wgtiau(it) / rn_Dt   ! IAU weight for the current time step
             !
-            IF(lwp) THEN
-               WRITE(numout,*)
-               WRITE(numout,*) 'ssh_asm_inc : SSH IAU at time step = ', &
-                  &  kt,' with IAU weight = ', wgtiau(it)
-               WRITE(numout,*) '~~~~~~~~~~~~'
-            ENDIF
+               IF(lwp) THEN
+                  WRITE(numout,*)
+                  WRITE(numout,*) 'ssh_asm_inc : SSH IAU at time step = ', &
+                     &  kt,' with IAU weight = ', wgtiau(it)
+                  WRITE(numout,*) '~~~~~~~~~~~~'
+               ENDIF
             !
             ! Save the tendency associated with the IAU weighted SSH increment
@@ -770,5 +770,5 @@
             !
             ! test on ssh_bkginc needed as ssh_asm_inc is called twice by time step
-            IF (ALLOCATED(ssh_bkginc)) DEALLOCATE( ssh_bkginc )
+               IF (ALLOCATED(ssh_bkginc)) DEALLOCATE( ssh_bkginc )
             !
 #if defined key_asminc
@@ -832,7 +832,7 @@
          ALLOCATE( ztim(jpi,jpj) )
          ztim(:,:) = ssh_iau(:,:) / ( ht(:,:) + 1.0 - ssmask(:,:) )
-         DO jk = 1, jpkm1
+            DO jk = 1, jpkm1
             phdivn(:,:,jk) = phdivn(:,:,jk) - ztim(:,:) * tmask(:,:,jk)
-         END DO
+            END DO
          !
          DEALLOCATE(ztim)
@@ -876,5 +876,5 @@
             ! note this is not a tendency so should not be divided by rn_Dt (as with the tracer and other increments)
             !
-            IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile
+            IF( .NOT. l_istiled .OR. ntile == 1 )  THEN                       ! Do only on the first tile
                IF(lwp) THEN
                   WRITE(numout,*)
@@ -920,5 +920,5 @@
 #endif
             !
-            IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile
+            IF( .NOT. l_istiled .OR. ntile == nijtile )  THEN                ! Do only on the last tile
                IF ( kt == nitiaufin_r ) THEN
                   DEALLOCATE( seaice_bkginc )
@@ -979,5 +979,5 @@
             END_2D
 #endif
-            IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile
+            IF( .NOT. l_istiled .OR. ntile == nijtile )  THEN                ! Do only on the last tile
                IF ( .NOT. PRESENT(kindic) ) THEN
                   DEALLOCATE( seaice_bkginc )
