C Library Functions - init_random_seed_by_system_clock (3)
NAME
init_random_seed_by_system_clock(3f) - [M_random] seed random_number(3f) with system clock value
(LICENSE:MIT)
CONTENTS
Synopsis
Description
Examples
Author
License
SYNOPSIS
subroutine init_random_seed_by_system_clock()
DESCRIPTION
A simple wrapper around random_seed(3f) that uses the system clock to initialize the seed so you can
easily call random_number(3f) with varying pseudo-random real number sequences
EXAMPLES
Sample program:
program demo_init_random_seed_by_system_clock
use M_random, only : init_random_seed_by_system_clock
integer :: i
real :: x
call init_random_seed_by_system_clock()
do i=1,10
! generate real pseudo-random numbers from 0 to <1.0
call random_number(x)
write(*,*)i,x
enddo
end program demo_init_random_seed_by_system_clock
Results
> 1 0.661672294
> 2 0.274969578
> 3 0.683666587
> 4 7.35652447E-02
> 5 0.457893968
> 6 0.826303899
> 7 0.727411628
> 8 0.542535722
> 9 0.983459771
> 10 0.527638793
AUTHOR
John S. Urban
LICENSE
MIT License
| Nemo Release 3.1 | init_random_seed_by_system_clock (3) | June 29, 2025 |
Generated by manServer 1.08 from 69dc64d9-da46-464c-964a-d0e41618f7ae using man macros.