   !!======================================================================

  SUBROUTINE init_flux

   !&E---------------------------------------------------------------------
   !&E                 ***  ROUTINE init_flux  ***
   !&E
   !&E ** Purpose : initialize all the variables that are cumulated over several half time-steps
   !&E              for the advection computation
   !&E
   !&E ** Description : step3dxy, step3dxy
   !&E
   !&E ** Called by :
   !&E
   !&E ** External calls :
   !&E
   !&E ** Reference :
   !&E
   !&E ** History :
   !&E       !          Original code
   !&E       !  2004-10-04  last modifications
   !&E       !  2011-11     (V. Garnier, B. Thouvenin) New organisation for the initializations of the flux
   !&E       !  2015-04  (B. Thouvenin) separation of forcing ktest commands ==> put in a new subroutine foringKtest.F90
   !&E       !  2016-12  (B.Thouvenin) version sedim_MUSTANG : only mixsed (mudsand not operationnal)
   !&E
   !&E---------------------------------------------------------------------

#include "toolcpp.h"

   !! * Modules used

   USE parameters
   USE comfluxdo,    ONLY : phieau

#ifdef key_substance
   USE comsubstance, ONLY : phicon
   USE comsubstance, ONLY : phicon_drycell
   USE comvars2d,    ONLY : h0fond,h0
   USE comvarp2d,    ONLY : ssh
#ifdef key_sedim_MUSTANG
   USE comvars2d,    ONLY : halfdt
#endif
#endif
   !USE cometemp,ONLY:phitemp,phisal
   IMPLICIT NONE

   !! * Arguments

   !! * Local declarations
   INTEGER :: i,j
   
   !!----------------------------------------------------------------------
   !! * Executable part

!$OMP PARALLEL DO PRIVATE(i,j)
   DO j= ljmin,ljmax
     phieau(:,:,j)=0.0_rlg
#ifdef key_substance
     phicon(:,:,:,j)=0.0_rsh
     DO i=liminp1,limax
       IF (h0(i,j)+ssh(i,j) > h0fond) THEN
         phicon(:,:,i,j)=phicon_drycell(:,:,i,j)
         phicon_drycell(:,:,i,j)=0.0_rsh
       ENDIF
     END DO
#endif
   ENDDO
!$OMP END PARALLEL DO


   PRINT_DBG*, 'exit INIT_FLUX routine'

  END SUBROUTINE init_flux
