!=============================================
!File: naiveran.f90
!Program to demonstrate the usage of a modulo
!generator with a bad choice of constants 
!resulting in strong pair correlations between
!generated numbers
!=============================================
real(8) function naiveran()
 implicit none
 integer           :: iran=13337
 common /naiveranpar/ iran
 integer,parameter :: m = 131072 ! equal to 2**17
 integer,parameter :: a = 1277

 iran = a*iran
 iran = MOD(iran,m)

 naiveran = iran/DBLE(m)

end function naiveran

