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

  SUBROUTINE init_tssub(sal,temp        &
#ifdef key_substance
                                ,cv_wat &
#endif
                                       )

   !&E---------------------------------------------------------------------
   !&E                 ***  ROUTINE init_tssub ***
   !&E
   !&E ** Purpose : initialize the temperature, salinity and tracers fields.
   !&E
   !&E ** Description : The temperature and salinity values are respectively initialised to
   !&E                  tempref and saliref (parameters set in the namelist dedicated to each rank).
   !&E                  The other tracers are initialised from the cini_wat array,
   !&E                  which components are set in the variable.dat file
   !&E                  to be found in the "inputs" directory.
   !&E
   !&E ** Called by : main
   !&E
   !&E ** External calls :
   !&E
   !&E ** Reference :
   !&E
   !&E ** History :
   !&E       !          Original code
   !&E       !  2004-06-10  last modifications
   !&E
   !&E---------------------------------------------------------------------
   !! * Modules used

   USE parameters
   USE comvars2d
   USE comvars3d
#ifdef key_substance
   USE comsubstance, ONLY : cini_wat,nv_state
#endif
   IMPLICIT NONE

   !! * Arguments

   REAL(KIND=rsh),DIMENSION(kmax,liminm1:limaxp2,ljminm1:ljmaxp2),INTENT(inout) :: sal,temp
#ifdef key_substance
   REAL(KIND=rsh),DIMENSION(nb_var,kmax,liminm1:limaxp2,ljminm1:ljmaxp2),INTENT(inout) :: cv_wat
#endif

   !! * Local declarations
   INTEGER                                                       :: i,j,l

   !!----------------------------------------------------------------------
   !! * Executable part

!$OMP parallel default(none)             &
!$OMP & private(j,i,l)                   &
!$OMP & shared(h0,temp,                  &
#ifdef key_substance
!$OMP & cv_wat,cini_wat,nv_state,        &
#endif
!$OMP & saliref,tetaref,                 &
!$OMP & ljminm1,ljmaxp2,liminm1,limaxp2, &
!$OMP & sal               )
!$OMP do schedule(static)  
   DO j=ljminm1,ljmaxp2
     DO i=liminm1,limaxp2
       IF (h0(i,j) == -valmanq) THEN
         sal(:,i,j)=valmanq
         temp(:,i,j)=valmanq
#ifdef key_substance
         cv_wat(1:nv_state,:,i,j)=valmanq
#endif
       ELSE
         sal(:,i,j)=saliref
         temp(:,i,j)=tetaref
#ifdef key_substance
         DO l=1,nv_state
           cv_wat(l,:,i,j)=cini_wat(l)
         END DO
#endif
       END IF
     END DO
   END DO
!$OMP end do
!$OMP end parallel

  END SUBROUTINE init_tssub
