programmer's documentation
Functions/Subroutines
zufall.f90 File Reference

This package downloaded at http://www.netlib.org/random/zufall.f. It generates random numbers. More...

Functions/Subroutines

subroutine zufall (n, a)
 
subroutine zufalli (seed)
 Generates initial seed buffer by linear congruential method. Taken from Marsaglia, FSU report FSU-SCRI-87-50 variable seed should be 0 < seed <31328. More...
 
subroutine normalen (n, x)
 Box-Muller method for Gaussian random numbers. More...
 
subroutine normal00
 
subroutine fische (n, mu, p)
 Poisson generator for distribution function of p's: $ q(mu,p) = exp(-mu) mu**p/p $. More...
 

Detailed Description

This package downloaded at http://www.netlib.org/random/zufall.f. It generates random numbers.

This package contains a portable random number generator set for: uniform (u in [0,1)), normal (<g> = 0, <g^2> = 1), and Poisson distributions. The basic module, the uniform generator, uses a lagged Fibonacci series generator:

\begin{eqnarray*} t & = & u(n-273) + u(n-607) \\ u(n)& = & t - float(int(t)) \end{eqnarray*}

where each number generated, u(k), is floating point. Since the numbers are floating point, the left end boundary of the range contains zero. This package is nearly portable except for the following. (1) It is written in lower case, (2) the test package contains a timer (second) which is not portable, and (3) there are cycle times (in seconds) in data statements for NEC SX-3, Fujitsu VP2200, and Cray Y-MP. Select your favorite and comment out the others. Replacement functions for 'second' are included - comment out the others. Otherwise the package is portable and returns the same set of floating point numbers up to word precision on any machine. There are compiler directives ($cdir for Cray, *vdir for SX-3, and VOCL for Fujitsu VP2200) which should be otherwise ignored.

To compile this beast, note that all floating point numbers are declared 'double precision'. On Cray X-MP, Y-MP, and C-90 machines, use the cft77 (cf77) option -dp to run this in 64 bit mode (not 128 bit double).

External documentation, "Lagged Fibonacci Random Number Generators for the NEC SX-3," is to be published in the International Journal of High Speed Computing (1994). Otherwise, ask the author:

    W. P. Petersen
    IPS, RZ F-5
    ETHZ
    CH 8092, Zurich
    Switzerland

e-mail: wpp@i.nosp@m.ps.e.nosp@m.thz.c.nosp@m.h.

Function/Subroutine Documentation

◆ fische()

subroutine fische ( integer  n,
double precision  mu,
integer, dimension(*)  p 
)

Poisson generator for distribution function of p's: $ q(mu,p) = exp(-mu) mu**p/p $.

Parameters
[in]nseed
[in]muparameter
[out]prandom number

◆ normal00()

subroutine normal00 ( )

◆ normalen()

subroutine normalen ( integer  n,
double precision, dimension(*)  x 
)

Box-Muller method for Gaussian random numbers.

Parameters
[in]nseed
[out]xrandom number

◆ zufall()

subroutine zufall ( integer  n,
double precision, dimension(*)  a 
)
Parameters
[in]nseed
[in]arandom number

◆ zufalli()

subroutine zufalli ( integer  seed)

Generates initial seed buffer by linear congruential method. Taken from Marsaglia, FSU report FSU-SCRI-87-50 variable seed should be 0 < seed <31328.

Parameters
[in]seedseed