Commit 9685cb46 authored by Matthias Redies's avatar Matthias Redies

this is THE worst random number generator every. Who wrote this?

parent dba4ae41
......@@ -14,7 +14,6 @@ math/inwint.f
math/matmul.f
math/outint.f
math/points.f
math/qranf.f
math/qsf.f
math/rfft.F
math/sphbes.f
......@@ -23,6 +22,7 @@ math/util.F
math/difcub.f
)
set(fleur_F90 ${fleur_F90}
math/qranf.f90
math/differentiate.f90
math/fft2d.F90
math/fft3d.f90
......
MODULE m_qranf
CONTAINS
MODULE m_qranf
CONTAINS
REAL FUNCTION qranf(x,j)
c **********************************************************
c quasi random generator in the interval (0.,1.)
c **********************************************************
! **********************************************************
! quasi random generator in the interval (0.,1.)
! **********************************************************
IMPLICIT NONE
C .. Scalar Arguments ..
! .. Scalar Arguments ..
REAL x
INTEGER j
C ..
C .. Intrinsic Functions ..
! ..
! .. Intrinsic Functions ..
INTRINSIC aint
C ..
! ..
j = j + 1
qranf = j*x
qranf = qranf - aint(qranf)
RETURN
END FUNCTION
END
END
  • Hey, this will be initialized with x=sqrt(13) after all!

  • When it's called it uses the same x and j throughout the whole loop. I don't know what it does but I have a suspicion it's wrong.

  • No, j actually is increased by one each time this is called. Thus "quasi-random" numbers are generated... :-)

  • If this keeps failling i will just revert it. It seems to work or fail fairly randomly.

Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment