  SUBROUTINE dyn2dy_tls_presolve

   !&E---------------------------------------------------------------------
   !&E                 ***  ROUTINE dyn2dy_tls_presolve  ***
   !&E
   !&E ** Purpose : Estimate of the coefficients of the tridiagonal
   !&E              linear system and the RHS relative to the
   !&E              momentum and continuity equations
   !&E              1st step : combination of the continuity and momentum equation
   !&E
   !&E ** Description : estimate along y-direction
   !&E
   !&E ** Called by : dyn2dxy.F90,dyn2dyx.F90
   !&E
   !&E ** External calls :
   !&E
   !&E ** Used ij-arrays : y2dxe,y2dv,axe,bxe,cxe,cv,bv,av
   !&E
   !&E ** Modified variables : y2dxe,axe,bxe,cxe
   !&E
   !&E ** Reference :
   !&E
   !&E ** History :
   !&E       !  2010-07  (L. Debreu, F. Dumas) Original code - rewritting of ADI
   !&E
   !&E---------------------------------------------------------------------

#include "toolcpp.h"

   !! * Modules used
   USE parameters
   USE comvars2d,  ONLY : jb,jh
   USE comcolig2d, ONLY : y2dxe,y2dv,axe,bxe,cxe,cv,bv,av
   USE_MPI toolmpi,ONLY : ex_j_rlg

   IMPLICIT NONE

   !! * Arguments

   !! * Local declarations
   INTEGER                                       :: i,j

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

   PRINT_DBG*, 'enter DYN2DY_TLS_PRESOLVE routine'

OMPMPI barrier
OMPMPI master
   CALL_MPI ex_j_rlg(-1,0,1,liminm1,limax,ljminm1,ljmax,y2dv(liminm1:limax,ljminm1:ljmax))
   CALL_MPI ex_j_rlg(-1,0,1,liminm1,limax,ljminm1,ljmax,av(liminm1:limax,ljminm1:ljmax))
   CALL_MPI ex_j_rlg(-1,0,1,liminm1,limax,ljminm1,ljmax,bv(liminm1:limax,ljminm1:ljmax))
   CALL_MPI ex_j_rlg(-1,0,1,liminm1,limax,ljminm1,ljmax,cv(liminm1:limax,ljminm1:ljmax))
OMPMPI end master
OMPMPI barrier
OMPMPI flush(av,bv,cv,y2dv)

#ifdef key_MPI_2D
!$OMP DO SCHEDULE(RUNTIME)
#else
!$OMP DO SCHEDULE(DYNAMIC,5)
#endif
   DO j=ljminp1,ljmax
     DO i=liminp2,limaxm1
       IF (j >= jb(i)+1 .and. j <= jh(i)-1) THEN

         y2dxe(i,j)=y2dxe(i,j)-(cxe(i,j)*y2dv(i,j)*bv(i,j)+axe(i,j)*y2dv(i,j-1)*bv(i,j-1)) 
         bxe(i,j)=bxe(i,j) - (cxe(i,j)*av(i,j)*bv(i,j)+axe(i,j)*cv(i,j-1)*bv(i,j-1))
         axe(i,j)= - axe(i,j)*av(i,j-1)*bv(i,j-1)
         cxe(i,j)= - cxe(i,j)*cv(i,j)*bv(i,j)
       END IF
     END DO
   END DO
!$OMP END DO

   PRINT_DBG*, 'exit DYN2DY_TLS_PRESOLVE routine'

  END SUBROUTINE dyn2dy_tls_presolve
