qranf.f90 486 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
MODULE m_qranf
CONTAINS
   REAL FUNCTION qranf(x,j)
!     **********************************************************
!     quasi random generator in the interval (0.,1.)
!     **********************************************************

      IMPLICIT NONE
!     .. Scalar Arguments ..
      REAL x
      INTEGER j
!     ..
!     .. Intrinsic Functions ..
      INTRINSIC aint
!     ..
      j = j + 1
      qranf = j*x
      qranf = qranf - aint(qranf)
      RETURN
   END FUNCTION
END