SABER
type_rng Module Reference

Random numbers generator derived type. More...

Data Types

type  rng_type
 

Functions/Subroutines

subroutine rng_init (rng, mpl, nam)
 Initialize the random number generator. More...
 
subroutine rng_reseed (rng, mpl)
 Re-seed the random number generator. More...
 
subroutine rng_resync (rng, mpl)
 Resynchronize the random number generator between processors. More...
 
subroutine rng_desync (rng, mpl)
 Desynchronize the random number generator between processors. More...
 
subroutine rng_lcg (rng, x)
 Linear congruential generator. More...
 
subroutine rng_rand_integer_0d (rng, binf, bsup, ir)
 Generate a random integer, 0d. More...
 
subroutine rng_rand_integer_1d (rng, binf, bsup, ir)
 Generate a random integer, 1d. More...
 
subroutine rng_rand_real_0d (rng, binf, bsup, rr)
 Generate a random real, 0d. More...
 
subroutine rng_rand_real_1d (rng, binf, bsup, rr)
 Generate a random real, 1d. More...
 
subroutine rng_rand_real_2d (rng, binf, bsup, rr)
 Generate a random real, 2d. More...
 
subroutine rng_rand_real_3d (rng, binf, bsup, rr)
 Generate a random real, 3d. More...
 
subroutine rng_rand_real_4d (rng, binf, bsup, rr)
 Generate a random real, 4d. More...
 
subroutine rng_rand_real_5d (rng, binf, bsup, rr)
 Generate a random real, 5d. More...
 
subroutine rng_rand_gau_1d (rng, rr)
 Generate random Gaussian deviates, 1d. More...
 
subroutine rng_rand_gau_5d (rng, rr)
 Generate random Gaussian deviates, 5d. More...
 

Variables

integer, parameter default_seed = 140587
 
integer(kind=int64), parameter a = 1103515245_int64
 
integer(kind=int64), parameter c = 12345_int64
 
integer(kind=int64), parameter m = 2147483648_int64
 

Detailed Description

Random numbers generator derived type.

Function/Subroutine Documentation

◆ rng_desync()

subroutine type_rng::rng_desync ( class(rng_type), intent(inout)  rng,
type(mpl_type), intent(inout)  mpl 
)
private

Desynchronize the random number generator between processors.

Parameters
[in,out]rngRandom number generator
[in,out]mplMPI data

Definition at line 142 of file type_rng.F90.

◆ rng_init()

subroutine type_rng::rng_init ( class(rng_type), intent(inout)  rng,
type(mpl_type), intent(inout)  mpl,
type(nam_type), intent(in)  nam 
)
private

Initialize the random number generator.

Parameters
[in,out]rngRandom number generator
[in,out]mplMPI data
[in]namNamelist variables

Definition at line 54 of file type_rng.F90.

◆ rng_lcg()

subroutine type_rng::rng_lcg ( class(rng_type), intent(inout)  rng,
real(kind_real), intent(out)  x 
)
private

Linear congruential generator.

Parameters
[in,out]rngRandom number generator
[out]xRandom number between 0 and 1

Definition at line 162 of file type_rng.F90.

◆ rng_rand_gau_1d()

subroutine type_rng::rng_rand_gau_1d ( class(rng_type), intent(inout)  rng,
real(kind_real), dimension(:), intent(out)  rr 
)
private

Generate random Gaussian deviates, 1d.

Parameters
[in,out]rngRandom number generator
[out]rrRandom integer

Definition at line 396 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_gau_5d()

subroutine type_rng::rng_rand_gau_5d ( class(rng_type), intent(inout)  rng,
real(kind_real), dimension(:,:,:,:,:), intent(out)  rr 
)
private

Generate random Gaussian deviates, 5d.

Parameters
[in,out]rngRandom number generator
[out]rrRandom integer

Definition at line 437 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_integer_0d()

subroutine type_rng::rng_rand_integer_0d ( class(rng_type), intent(inout)  rng,
integer, intent(in)  binf,
integer, intent(in)  bsup,
integer, intent(out)  ir 
)
private

Generate a random integer, 0d.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]irRandom integer

Definition at line 182 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_integer_1d()

subroutine type_rng::rng_rand_integer_1d ( class(rng_type), intent(inout)  rng,
integer, intent(in)  binf,
integer, intent(in)  bsup,
integer, dimension(:), intent(out)  ir 
)
private

Generate a random integer, 1d.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]irRandom integer

Definition at line 210 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_real_0d()

subroutine type_rng::rng_rand_real_0d ( class(rng_type), intent(inout)  rng,
real(kind_real), intent(in)  binf,
real(kind_real), intent(in)  bsup,
real(kind_real), intent(out)  rr 
)
private

Generate a random real, 0d.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]rrRandom integer

Definition at line 233 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_real_1d()

subroutine type_rng::rng_rand_real_1d ( class(rng_type), intent(inout)  rng,
real(kind_real), intent(in)  binf,
real(kind_real), intent(in)  bsup,
real(kind_real), dimension(:), intent(out)  rr 
)
private

Generate a random real, 1d.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]rrRandom integer

Definition at line 261 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_real_2d()

subroutine type_rng::rng_rand_real_2d ( class(rng_type), intent(inout)  rng,
real(kind_real), intent(in)  binf,
real(kind_real), intent(in)  bsup,
real(kind_real), dimension(:,:), intent(out)  rr 
)
private

Generate a random real, 2d.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]rrRandom integer

Definition at line 284 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_real_3d()

subroutine type_rng::rng_rand_real_3d ( class(rng_type), intent(inout)  rng,
real(kind_real), intent(in)  binf,
real(kind_real), intent(in)  bsup,
real(kind_real), dimension(:,:,:), intent(out)  rr 
)
private

Generate a random real, 3d.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]rrRandom integer

Definition at line 309 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_real_4d()

subroutine type_rng::rng_rand_real_4d ( class(rng_type), intent(inout)  rng,
real(kind_real), intent(in)  binf,
real(kind_real), intent(in)  bsup,
real(kind_real), dimension(:,:,:,:), intent(out)  rr 
)
private

Generate a random real, 4d.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]rrRandom integer

Definition at line 336 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_real_5d()

subroutine type_rng::rng_rand_real_5d ( class(rng_type), intent(inout)  rng,
real(kind_real), intent(in)  binf,
real(kind_real), intent(in)  bsup,
real(kind_real), dimension(:,:,:,:,:), intent(out)  rr 
)
private

Generate a random real, 5d.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]rrRandom integer

Definition at line 365 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_reseed()

subroutine type_rng::rng_reseed ( class(rng_type), intent(inout)  rng,
type(mpl_type), intent(inout)  mpl 
)
private

Re-seed the random number generator.

Parameters
[in,out]rngRandom number generator
[in,out]mplMPI data

Definition at line 96 of file type_rng.F90.

◆ rng_resync()

subroutine type_rng::rng_resync ( class(rng_type), intent(inout)  rng,
type(mpl_type), intent(inout)  mpl 
)
private

Resynchronize the random number generator between processors.

Parameters
[in,out]rngRandom number generator
[in,out]mplMPI data

Definition at line 122 of file type_rng.F90.

Variable Documentation

◆ a

integer(kind=int64), parameter type_rng::a = 1103515245_int64

Definition at line 18 of file type_rng.F90.

◆ c

integer(kind=int64), parameter type_rng::c = 12345_int64

Definition at line 19 of file type_rng.F90.

◆ default_seed

integer, parameter type_rng::default_seed = 140587

Definition at line 17 of file type_rng.F90.

◆ m

integer(kind=int64), parameter type_rng::m = 2147483648_int64

Definition at line 20 of file type_rng.F90.