Note
Module with subrotuines for generating integer
and real random numbers.
This subroutines were taken from Numerical Recipes in Fortran 90,
and provide a way for generating random numbers of 'better quality'
in a faster way than build-in Fortran random generators (at least
better than those of Fortran 77). For more details we refer the user
to Numerical Recipes in Fortran 90.
Variables
Type | Visibility |
Attributes | | Name | | Initial | |
integer(kind=8), |
public, |
parameter | :: |
iv | = | 4101842887655102017_8 | |
integer(kind=8), |
public, |
parameter | :: |
iw | = | 1_8 | |
integer(kind=8), |
public, |
parameter | :: |
a | = | 4294957665_8 | |
integer(kind=8), |
public, |
parameter | :: |
b | = | 4294967295_8 | |
integer(kind=8), |
public, |
parameter | :: |
d | = | 2862933555777941757_8 | |
integer(kind=8), |
public, |
parameter | :: |
e | = | 7046029254386353087_8 | |
real(kind=rp), |
public, |
parameter | :: |
rcoeff | = | 5.42101086242752217E-20_rp | |
type(URAND), |
private |
| :: |
urand_vars | | | |
Interfaces
-
private subroutine rand_int64(irand)
Arguments
Type |
Intent | Optional |
Attributes | | Name | |
integer(kind=8), |
intent(out), |
optional |
| :: |
irand | |
-
private subroutine rand_int32(irand32)
Arguments
Type |
Intent | Optional |
Attributes | | Name | |
integer(kind=4), |
intent(out) |
|
| :: |
irand32 | |
-
private subroutine rand_real(rrand)
Arguments
Type |
Intent | Optional |
Attributes | | Name | |
real(kind=rp), |
intent(out) |
|
| :: |
rrand | |
-
Arguments
Type |
Intent | Optional |
Attributes | | Name | |
real(kind=rp), |
intent(inout), |
|
DIMENSION(:) | :: |
rrand | |
Derived Types
Components
Type | Visibility |
Attributes | | Name | | Initial | |
integer(kind=8), |
public |
| :: |
u | | | |
integer(kind=8), |
public |
| :: |
v | | | |
integer(kind=8), |
public |
| :: |
w | | | |
Subroutines
Arguments
Type |
Intent | Optional |
Attributes | | Name | |
integer(kind=8), |
intent(in) |
|
| :: |
seed | |
Arguments
Type |
Intent | Optional |
Attributes | | Name | |
integer(kind=8), |
intent(out), |
optional |
| :: |
irand | |
Arguments
Type |
Intent | Optional |
Attributes | | Name | |
integer(kind=4), |
intent(out) |
|
| :: |
irand32 | |
Arguments
Type |
Intent | Optional |
Attributes | | Name | |
real(kind=rp), |
intent(inout), |
|
DIMENSION(:) | :: |
rrand | |
Arguments
Type |
Intent | Optional |
Attributes | | Name | |
real(kind=rp), |
intent(out) |
|
| :: |
rrand | |