C Library Functions  - random_init (3)

NAME

RANDOM_INIT(3) - [MATHEMATICS:RANDOM] Initializes the state of the pseudorandom number generator

SYNOPSIS

call random_init(repeatable, image_distinct)

         logical,intent(in) :: repeatable
         logical,intent(in) :: image_distinct

CHARACTERISTICS

o HARVEST and IMAGE_DISTINCT are logical scalars
Description

Initializes the state of the pseudorandom number generator used by RANDOM_NUMBER.

OPTIONS

REPEATABLE : If it is .TRUE., the seed is set to a processor-dependent value that is the same each time RANDOM_INIT is called from the same image. The term "same image" means a single instance of program execution. The sequence of random numbers is different for repeated execution of the program.

If it is .FALSE., the seed is set to a processor-dependent value.

IMAGE_DISTINCT : If is .true., the seed is set to a processor-dependent value that is distinct from the seed set by a call to RANDOM_INITin another image. If it is .FALSE., the seed is set value that does depend which image called RANDOM_INIT.

STANDARD

Fortran 2018

EXAMPLE

program demo_random_seed implicit none real x(3), y(3) call random_init(.true., .true.) call random_number(x) call random_init(.true., .true.) call random_number(y) ! x and y should be the same sequence if ( any(x /= y) ) stop "x(:) and y(:) are not all equal" end program demo_random_seed

SEE ALSO

random_number, random_seed

_fortran-lang intrinsic descriptions


Nemo Release 3.1 random_init (3) July 22, 2023
Generated by manServer 1.08 from 7b5f93e9-5dd5-40a0-aadc-67830d812ff6 using man macros.