      DOUBLE PRECISION FUNCTION DVMAG (V1,EPS)
C
C     RETURNS DOUBLE PRECISION MAGNITUDE OF VECTOR V1
C        DVMAG= 0.D0 WHEN .LE. EPS
C
      DOUBLE PRECISION V1(3), A, EPS, DADOTB
C
C
      DVMAG= 0.D0
      A= DADOTB(V1,V1)
      IF (A .GT. 0.D0) DVMAG= DSQRT(A)
      IF ( DVMAG .LE. EPS)             DVMAG= 0.D0
      RETURN
      END
