      SUBROUTINE MPOINT(XP,YP,XVELO,YVELO,DT,COORD,DIM,NNODX,
     +     NODEL,DOFR,ELEMCO,FLOWEL,IP,PREV,IELTOP,ELTOP,
     +     XLEN,INDELE,SHCRU,SHLIQ,NNODM,NELEMM)
      INTEGER DIM,NNODX,NODEL,DOFR,IP,IELTOP,INDELE,NNODM,
     +     NELEMM
      INTEGER ELTOP(IELTOP,*)
      DOUBLE PRECISION XP,YP,XVELO,YVELO,DT,COORD(DIM,*),
     +     ELEMCO(2,*),FLOWEL(*),PREV(*),XLEN,SHLIQ(*),SHCRU(*)

      INTEGER INDX,INDY,NELEX,I,IND
      DOUBLE PRECISION ZERO,EPS,Y,XN,YN
      PARAMETER(ZERO=0.0D0,EPS=1.0D-12)


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

      CALL PCHECK(XP,YP,XN,YN,ZERO,XLEN,SHCRU,SHLIQ,COORD,DIM,NNODX)


      IF (IP .LE. NNODM) THEN
         INDELE=1
      ELSE
         INDELE=NELEMM+1
      ENDIF

      INDX=1
 100  IF ((XP .LT. COORD(1,INDX)-EPS) .OR. 
     +     (XP .GT. COORD(1,INDX+2)+EPS)) THEN
         INDX=INDX+2
         INDELE=INDELE+1
         GOTO 100
      ENDIF


      NELEX=(NNODX-1)/2

      IF (IP .LE. NNODM) THEN
         INDY=INDX
         IND=3*(NELEX+1)-1
      ELSE IF (IP .LE. (NNODM+3*NELEX+2)) THEN
         INDELE=INDELE+INDX-1
      ELSE
         INDY=NNODM+NELEX+1+INDX
         IND=3*(NELEX+1)-1
         INDELE=INDELE+NELEX
      ENDIF

      IF ((IP .LE. NNODM) .OR. (IP .GT. (NNODM+3*NELEX+2))) THEN
 200     Y=COORD(2,INDY+IND)+
     +        (COORD(2,INDY+IND+2)-COORD(2,INDY+IND))/
     +        (COORD(1,INDX+2)-COORD(1,INDX))*
     +        (XP-COORD(1,INDY+IND))

         IF (YP .GT. Y+EPS) THEN
            INDELE=INDELE+NELEX
            INDY=INDY+IND
            GOTO 200
         ENDIF
      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


      IF (DOFR .EQ. NODEL) THEN

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

         DO 500 I=1,NODEL
            FLOWEL(2*I-1)=PREV(2*ELTOP(2+I,INDELE)-1)
            FLOWEL(2*I)=PREV(2*ELTOP(2+I,INDELE))
 500     CONTINUE
      ENDIF

      RETURN
      END
