      SUBROUTINE MPCRYS(XP,YP,XVELO,YVELO,DT,COORD,DIM,NODEL,ELEMCO,
     +     FLOWEL,IP,TPREV,IELTOP,ELTOP,INDELE,NNODM,NELEXC,NELE,II)

      INTEGER DIM,NODEL,IP,IELTOP,INDELE,NNODM,NELEXC,NELE,II
      INTEGER ELTOP(IELTOP,*)
      DOUBLE PRECISION XP,YP,XVELO,YVELO,DT,COORD(DIM,*),
     +     ELEMCO(2,*),FLOWEL(*),TPREV(*)

      INTEGER NSIDE
      PARAMETER(NSIDE=3)
      DOUBLE PRECISION MIN,EPS,DMIN1
      PARAMETER(EPS=1.0D-12)


      XP=XP-XVELO*DT
      YP=YP-YVELO*DT

      IF (IP .LE. NNODM+NELEXC+1) THEN
         INDELE=NELE
      ELSE IF (II .LE. NSIDE) THEN
         INDELE=NELE-NELEXC
      ELSE
         INDELE=NELE
      ENDIF

      MIN=DMIN1(COORD(1,ELTOP(5,INDELE)),COORD(1,ELTOP(7,INDELE)))
      IF (XP .GT. MIN+EPS) THEN
         XP=(YP-COORD(2,ELTOP(5,INDELE)))*
     +        (COORD(1,ELTOP(5,INDELE))-COORD(1,ELTOP(7,INDELE)))/
     +        (COORD(2,ELTOP(5,INDELE))-COORD(2,ELTOP(7,INDELE)))+
     +        COORD(1,ELTOP(5,INDELE))
      ENDIF

      DO 300 I=1,NODEL
         ELEMCO(1,I)=COORD(1,ELTOP(2+I,INDELE))
         ELEMCO(2,I)=COORD(2,ELTOP(2+I,INDELE))
 300  CONTINUE

      DO 400 I=1,NODEL
         FLOWEL(I)=TPREV(ELTOP(2+I,INDELE))
 400  CONTINUE

      RETURN
      END
