runif - function to generate uniformly distributed pseudo-random numbers.
a=runif(t,n)
Basic Seismic Utilities (BSU) includes this public domain fortran function to generate pseudo-random numbers (uniformly distributed 0<a<1). Period is given by
Period is P=sqrt(pi*factorial(n)/8*P_rand)
where P_rand is
4194304 (rand.f function). The optimal value of n will be
about 32.
Fortran Version.
Arguments
t (float)
Array, holding table needed to initialize the generator.
n (int)
Value to set the period of the pseudo-random sequence. If n is positive and different than in the previous call, the table is re-initialized for the new value of n. A negative n can be used to restart the sequence with the same table (not commonly used). If n remains the same with each call, then a new number is generated.
EXAMPLE:
real*4 t(33),a(npts)
x=runif(t,32)
do 10, j=1,npts
a(j)=runif(t,32)
10 continue
bnoise(3), rand(3), bnos(1)
No known bugs.
Public Domain
This program is public domain. It may be downloaded from the world wide web: http://gams.nist.gov/serve/cgi/PackageModules/CMLIB
W. Fullerton (LANL)