SABER
type_rng Module Reference

Generic ranks, dimensions and types. 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, seed)
 Linear congruential generator. More...
 
subroutine rng_rand_int_r0 (rng, binf, bsup, value)
 Generate a random int. More...
 
subroutine rng_rand_real_r0 (rng, binf, bsup, value)
 Generate a random real. More...
 
subroutine rng_rand_int_r1 (rng, binf, bsup, array)
 Generate a random int. More...
 
subroutine rng_rand_int_r2 (rng, binf, bsup, array)
 Generate a random int. More...
 
subroutine rng_rand_int_r3 (rng, binf, bsup, array)
 Generate a random int. More...
 
subroutine rng_rand_int_r4 (rng, binf, bsup, array)
 Generate a random int. More...
 
subroutine rng_rand_int_r5 (rng, binf, bsup, array)
 Generate a random int. More...
 
subroutine rng_rand_int_r6 (rng, binf, bsup, array)
 Generate a random int. More...
 
subroutine rng_rand_real_r1 (rng, binf, bsup, array)
 Generate a random real. More...
 
subroutine rng_rand_real_r2 (rng, binf, bsup, array)
 Generate a random real. More...
 
subroutine rng_rand_real_r3 (rng, binf, bsup, array)
 Generate a random real. More...
 
subroutine rng_rand_real_r4 (rng, binf, bsup, array)
 Generate a random real. More...
 
subroutine rng_rand_real_r5 (rng, binf, bsup, array)
 Generate a random real. More...
 
subroutine rng_rand_real_r6 (rng, binf, bsup, array)
 Generate a random real. More...
 
subroutine rng_rand_gau_r0 (rng, value)
 Generate random Gaussian deviate. More...
 
subroutine rng_rand_gau_r1 (rng, array)
 Generate a random Gaussian deviates array. More...
 
subroutine rng_rand_gau_r2 (rng, array)
 Generate a random Gaussian deviates array. More...
 
subroutine rng_rand_gau_r3 (rng, array)
 Generate a random Gaussian deviates array. More...
 
subroutine rng_rand_gau_r4 (rng, array)
 Generate a random Gaussian deviates array. More...
 
subroutine rng_rand_gau_r5 (rng, array)
 Generate a random Gaussian deviates array. More...
 
subroutine rng_rand_gau_r6 (rng, array)
 Generate a random Gaussian deviates array. More...
 

Variables

integer, parameter default_seed = 140587
 Default seed. More...
 
integer(kind_long), parameter a = 1103515245_kind_long
 Linear congruential multiplier. More...
 
integer(kind_long), parameter c = 12345_kind_long
 Linear congruential offset. More...
 
integer(kind_long), parameter m = 2147483648_kind_long
 Linear congruential modulo. More...
 

Detailed Description

Generic ranks, dimensions and types.

Subroutines/functions list Instrumentation functions 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 289 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 174 of file type_rng.F90.

◆ rng_lcg()

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

Linear congruential generator.

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

Definition at line 318 of file type_rng.F90.

◆ rng_rand_gau_r0()

subroutine type_rng::rng_rand_gau_r0 ( class(rng_type), intent(inout)  rng,
real(kind_real), intent(out)  value 
)
private

Generate random Gaussian deviate.

Parameters
[in,out]rngRandom number generator
[out]valueGaussian deviate

Definition at line 1100 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_gau_r1()

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

Generate a random Gaussian deviates array.

Parameters
[in,out]rngRandom number generator
[out]arrayRandom array

Definition at line 1146 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_gau_r2()

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

Generate a random Gaussian deviates array.

Parameters
[in,out]rngRandom number generator
[out]arrayRandom array

Definition at line 1183 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_gau_r3()

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

Generate a random Gaussian deviates array.

Parameters
[in,out]rngRandom number generator
[out]arrayRandom array

Definition at line 1226 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_gau_r4()

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

Generate a random Gaussian deviates array.

Parameters
[in,out]rngRandom number generator
[out]arrayRandom array

Definition at line 1275 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_gau_r5()

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

Generate a random Gaussian deviates array.

Parameters
[in,out]rngRandom number generator
[out]arrayRandom array

Definition at line 1330 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_gau_r6()

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

Generate a random Gaussian deviates array.

Parameters
[in,out]rngRandom number generator
[out]arrayRandom array

Definition at line 1391 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_int_r0()

subroutine type_rng::rng_rand_int_r0 ( class(rng_type), intent(inout)  rng,
integer(kind_int), intent(in)  binf,
integer(kind_int), intent(in)  bsup,
integer(kind_int), intent(out)  value 
)
private

Generate a random int.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]valueRandom value

Definition at line 365 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_int_r1()

subroutine type_rng::rng_rand_int_r1 ( class(rng_type), intent(inout)  rng,
integer(kind_int), intent(in)  binf,
integer(kind_int), intent(in)  bsup,
integer(kind_int), dimension(:), intent(out)  array 
)
private

Generate a random int.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]arrayRandom array

Definition at line 448 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_int_r2()

subroutine type_rng::rng_rand_int_r2 ( class(rng_type), intent(inout)  rng,
integer(kind_int), intent(in)  binf,
integer(kind_int), intent(in)  bsup,
integer(kind_int), dimension(:,:), intent(out)  array 
)
private

Generate a random int.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]arrayRandom array

Definition at line 487 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_int_r3()

subroutine type_rng::rng_rand_int_r3 ( class(rng_type), intent(inout)  rng,
integer(kind_int), intent(in)  binf,
integer(kind_int), intent(in)  bsup,
integer(kind_int), dimension(:,:,:), intent(out)  array 
)
private

Generate a random int.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]arrayRandom array

Definition at line 532 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_int_r4()

subroutine type_rng::rng_rand_int_r4 ( class(rng_type), intent(inout)  rng,
integer(kind_int), intent(in)  binf,
integer(kind_int), intent(in)  bsup,
integer(kind_int), dimension(:,:,:,:), intent(out)  array 
)
private

Generate a random int.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]arrayRandom array

Definition at line 583 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_int_r5()

subroutine type_rng::rng_rand_int_r5 ( class(rng_type), intent(inout)  rng,
integer(kind_int), intent(in)  binf,
integer(kind_int), intent(in)  bsup,
integer(kind_int), dimension(:,:,:,:,:), intent(out)  array 
)
private

Generate a random int.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]arrayRandom array

Definition at line 640 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_int_r6()

subroutine type_rng::rng_rand_int_r6 ( class(rng_type), intent(inout)  rng,
integer(kind_int), intent(in)  binf,
integer(kind_int), intent(in)  bsup,
integer(kind_int), dimension(:,:,:,:,:,:), intent(out)  array 
)
private

Generate a random int.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]arrayRandom array

Definition at line 703 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_real_r0()

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

Generate a random real.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]valueRandom value

Definition at line 405 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_real_r1()

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

Generate a random real.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]arrayRandom array

Definition at line 774 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_real_r2()

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

Generate a random real.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]arrayRandom array

Definition at line 813 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_real_r3()

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

Generate a random real.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]arrayRandom array

Definition at line 858 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_real_r4()

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

Generate a random real.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]arrayRandom array

Definition at line 909 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_real_r5()

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

Generate a random real.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]arrayRandom array

Definition at line 966 of file type_rng.F90.

Here is the caller graph for this function:

◆ rng_rand_real_r6()

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

Generate a random real.

Parameters
[in,out]rngRandom number generator
[in]binfLower bound
[in]bsupUpper bound
[out]arrayRandom array

Definition at line 1029 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 225 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 260 of file type_rng.F90.

Variable Documentation

◆ a

integer(kind_long), parameter type_rng::a = 1103515245_kind_long

Linear congruential multiplier.

Definition at line 53 of file type_rng.F90.

◆ c

integer(kind_long), parameter type_rng::c = 12345_kind_long

Linear congruential offset.

Definition at line 54 of file type_rng.F90.

◆ default_seed

integer, parameter type_rng::default_seed = 140587

Default seed.

Definition at line 52 of file type_rng.F90.

◆ m

integer(kind_long), parameter type_rng::m = 2147483648_kind_long

Linear congruential modulo.

Definition at line 55 of file type_rng.F90.