Index: branches/2017/dev_r8789_sbc/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90
===================================================================
--- branches/2017/dev_r8789_sbc/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90	(revision 8795)
+++ branches/2017/dev_r8789_sbc/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90	(revision 8829)
@@ -20,4 +20,5 @@
    !!   dyn_asm_inc    : Apply the dynamic (u and v) increments
    !!   ssh_asm_inc    : Apply the SSH increment
+   !!   ssh_asm_div    : Apply divergence associated with SSH increment
    !!   seaice_asm_inc : Apply the seaice increment
    !!----------------------------------------------------------------------
@@ -798,4 +799,39 @@
    END SUBROUTINE ssh_asm_inc
 
+   SUBROUTINE ssh_asm_div( kt, phdivn )
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE ssh_asm_div  ***
+      !!
+      !! ** Purpose :   ssh increment with z* is incorporated via a correction of the local divergence          
+      !!                across all the water column
+      !!
+      !! ** Method  :
+      !!                CAUTION : sshiau is positive (inflow) decreasing the
+      !!                          divergence and expressed in m/s
+      !!
+      !! ** Action  :   phdivn   decreased by the ssh increment
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(IN) :: kt                               ! ocean time-step index
+      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   phdivn   ! horizontal divergence
+      !!
+      INTEGER  ::   jk                                        ! dummy loop index
+      REAL(wp), DIMENSION(:,:)  , POINTER       ::   ztim     ! local array
+      !!----------------------------------------------------------------------
+      ! 
+      CALL ssh_asm_inc( kt ) !==   (calculate increments)
+      !
+      IF( ln_linssh ) THEN 
+         phdivn(:,:,1) = phdivn(:,:,1) - ssh_iau(:,:) / e3t_n(:,:,1) * tmask(:,:,1)
+      ELSE 
+         CALL wrk_alloc( jpi,jpj, ztim)
+         ztim(:,:) = ssh_iau(:,:) / ( ht_n(:,:) + 1.0 - ssmask(:,:) )
+         DO jk = 1, jpkm1                                 
+            phdivn(:,:,jk) = phdivn(:,:,jk) - ztim(:,:) * tmask(:,:,jk) 
+         END DO
+         !
+         CALL wrk_dealloc( jpi,jpj, ztim)
+      ENDIF
+      !
+   END SUBROUTINE ssh_asm_div
 
    SUBROUTINE seaice_asm_inc( kt, kindic )
Index: branches/2017/dev_r8789_sbc/NEMOGCM/NEMO/OPA_SRC/DYN/divhor.F90
===================================================================
--- branches/2017/dev_r8789_sbc/NEMOGCM/NEMO/OPA_SRC/DYN/divhor.F90	(revision 8795)
+++ branches/2017/dev_r8789_sbc/NEMOGCM/NEMO/OPA_SRC/DYN/divhor.F90	(revision 8829)
@@ -25,4 +25,7 @@
    USE iscplhsb        ! ice sheet / ocean coupling
    USE iscplini        ! ice sheet / ocean coupling
+#if defined key_asminc   
+   USE asminc          ! Assimilation increment
+#endif
    !
    USE in_out_manager  ! I/O manager
@@ -92,4 +95,8 @@
       IF( ln_rnf )   CALL sbc_rnf_div( hdivn )      !==  runoffs    ==!   (update hdivn field)
       !
+#if defined key_asminc 
+      IF( ln_sshinc .AND. ln_asmiau )   CALL ssh_asm_div( kt, hdivn )   !==  SSH assimilation  ==!   (update hdivn field)
+      ! 
+#endif
       IF( ln_isf )   CALL sbc_isf_div( hdivn )      !==  ice shelf  ==!   (update hdivn field)
       !
Index: branches/2017/dev_r8789_sbc/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90
===================================================================
--- branches/2017/dev_r8789_sbc/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90	(revision 8795)
+++ branches/2017/dev_r8789_sbc/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90	(revision 8829)
@@ -27,7 +27,4 @@
    USE agrif_opa_interp
 #endif
-#if defined key_asminc   
-   USE   asminc       ! Assimilation increment
-#endif
    !
    USE in_out_manager ! I/O manager
@@ -99,26 +96,4 @@
 
       CALL div_hor( kt )                               ! Horizontal divergence
-      !
-#if defined key_asminc
-      !                                                ! Include the IAU weighted SSH increment
-      IF( lk_asminc .AND. ln_sshinc .AND. ln_asmiau ) THEN
-         CALL ssh_asm_inc( kt )
-         IF ( ln_linssh ) THEN
-            ! Adjust sea surface height directly
-            ! (note that qns/sfx are not modified to take into account heat/salt content added as effect would 
-            ! just need to be removed by concentration / dilution effect in trasbc)
-            ssha(:,:) = ssha(:,:) + z2dt * ssh_iau(:,:)
-         ELSE
-            ! Don't directly adjust sea surface height but change horizontal divergence at all levels instead
-            ! (in trasbc the heat and salt content associated with these changes are also taken into account)
-            DO jk = 1, jpkm1                                 
-               hdivn(:,:,jk) = hdivn(:,:,jk) - ( ssh_iau(:,:) / ( ht_0(:,:) + 1.0 - ssmask(:,:) ) )   &
-                                               * ( e3t_0(:,:,jk) / e3t_n(:,:,jk) ) * tmask(:,:,jk) 
-            END DO
-            CALL lbc_lnk( hdivn, 'T', 1. )
-         ENDIF
-      ENDIF
-      !
-#endif
       !
       zhdiv(:,:) = 0._wp
Index: branches/2017/dev_r8789_sbc/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90
===================================================================
--- branches/2017/dev_r8789_sbc/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90	(revision 8795)
+++ branches/2017/dev_r8789_sbc/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90	(revision 8829)
@@ -75,7 +75,7 @@
       INTEGER, INTENT(in) ::   kt   ! ocean time-step index
       !
-      INTEGER  ::   ji, jj, jk, jn        ! dummy loop indices  
-      INTEGER  ::   ikt, ikb              ! local integers
-      REAL(wp) ::   zfact, z1_e3t, zdep   ! local scalar
+      INTEGER  ::   ji, jj, jk, jn              ! dummy loop indices  
+      INTEGER  ::   ikt, ikb                    ! local integers
+      REAL(wp) ::   zfact, z1_e3t, zdep, ztim   ! local scalar
       REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdt, ztrds
       !!----------------------------------------------------------------------
@@ -219,19 +219,18 @@
       IF( ln_sshinc ) THEN         ! input of heat and salt due to assimilation
       	 !
-         ! Only required for vvl case (without vvl all the ssh increment is added to the surface layer and because the extra
-         ! water added by assimilation is always assumed to have the same T/S as the layer it is added to, and no additional T/S 
-         ! content is explicitly added into qns/sfx due to ssh_iau, there is no need to include a compensating term to adjust 
-         ! for it here)
-         !
-         IF( .NOT. ln_linssh ) THEN 
+         IF( ln_linssh ) THEN 
             DO jj = 2, jpj 
                DO ji = fs_2, fs_jpim1
-                  zdep = ssh_iau(ji,jj) / ( ht_0(ji,jj) + 1.0 - ssmask(ji, jj) )
-                  DO jk = 1, jpkm1
-                     tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem)   &
-                                           &            + tsn(ji,jj,jk,jp_tem) * zdep * ( e3t_0(ji,jj,jk) / e3t_n(ji,jj,jk) )
-                     tsa(ji,jj,jk,jp_sal) = tsa(ji,jj,jk,jp_sal)   &
-                                           &            + tsn(ji,jj,jk,jp_sal) * zdep * ( e3t_0(ji,jj,jk) / e3t_n(ji,jj,jk) )
-                  END DO
+                  ztim = ssh_iau(ji,jj) / e3t_n(ji,jj,1)
+                  tsa(ji,jj,1,jp_tem) = tsa(ji,jj,1,jp_tem) + tsn(ji,jj,1,jp_tem) * ztim
+                  tsa(ji,jj,1,jp_sal) = tsa(ji,jj,1,jp_sal) + tsn(ji,jj,1,jp_sal) * ztim
+               END DO
+            END DO
+         ELSE
+            DO jj = 2, jpj 
+               DO ji = fs_2, fs_jpim1
+                  ztim = ssh_iau(ji,jj) / ( ht_n(ji,jj) + 1. - ssmask(ji, jj) )
+                  tsa(ji,jj,:,jp_tem) = tsa(ji,jj,:,jp_tem) + tsn(ji,jj,:,jp_tem) * ztim
+                  tsa(ji,jj,:,jp_sal) = tsa(ji,jj,:,jp_sal) + tsn(ji,jj,:,jp_sal) * ztim
                END DO  
             END DO  
@@ -239,4 +238,5 @@
          !
       ENDIF
+      !
 #endif
 
