      SUBROUTINE LTIMST(DT,COORD,DIM,UPREV,NELEMS,NNODES,ELTOP,IELTOP,
     +     DIMENS,MODULE)
      INTEGER DIM,NELEMS,NNODES,IELTOP
      INTEGER ELTOP(IELTOP,*)
      DOUBLE PRECISION DT,COORD(DIM,*),UPREV(*)
      CHARACTER*(*) DIMENS, MODULE
      INTEGER NELE,I
      DOUBLE PRECISION DX1,DX2,DY1,DY2,YMIN,MN,MIN,REQ,RE,VELOX,VELOY,
     +     DMIN1,DMAX1,XMIN,DLEN

      MIN=+1.0D+10
      DO 10 NELE=1,NELEMS
         DX1=DLEN(COORD(1,ELTOP(3,NELE)),COORD(2,ELTOP(3,NELE)),
     +        COORD(1,ELTOP(4,NELE)),COORD(2,ELTOP(4,NELE)))
         DX2=DLEN(COORD(1,ELTOP(8,NELE)),COORD(2,ELTOP(8,NELE)),
     +        COORD(1,ELTOP(9,NELE)),COORD(2,ELTOP(9,NELE)))

         DY1=DLEN(COORD(1,ELTOP(3,NELE)),COORD(2,ELTOP(3,NELE)),
     +        COORD(1,ELTOP(10,NELE)),COORD(2,ELTOP(10,NELE)))
         DY2=DLEN(COORD(1,ELTOP(5,NELE)),COORD(2,ELTOP(5,NELE)),
     +        COORD(1,ELTOP(6,NELE)),COORD(2,ELTOP(6,NELE)))

         XMIN=DMIN1(DX1,DX2)
         YMIN=DMIN1(DY1,DY2)
         MN=DMIN1(XMIN,YMIN)
         IF (MN .LT. MIN) MIN=MN
 10   CONTINUE
 
      REQ=-1.0D+10
      DO 20 I=1,NNODES
         VELOX=UPREV(2*I-1)
         VELOY=UPREV(2*I)
         RE=DMAX1(VELOX,VELOY)
         IF (RE .GT. REQ) REQ=RE
 20   CONTINUE

      DT=MIN/REQ

      eps = 0.0
      IF (REQ .LT. EPS) THEN
         WRITE(6,*) 'Velocities under ',EPS
      ELSE 
         IF (DT .GT. (MIN/REQ)) THEN
            WRITE(6,100) MODULE
            WRITE(6,110) DIMENS,DT,MIN/REQ
            WRITE(6,120)
            STOP
         ENDIF
      ENDIF
 100  FORMAT(1X,'*** Too large time step in --',A6,'--')
 110  FORMAT(1X,'   ',A6,'=',F10.4,'  It should be at most ',F10.4)
 120  FORMAT(1X,'    Cannot continue ... Bye!')

      RETURN
      END
