I would like to generate the same set of random numbers each time I execute a program. The problem is that each time I run it, the random numbers are different because they are seeded by a different value. Here is my program:
program test implicit none real :: rand_num integer :: index call random_seed() do index = 1,10 call random_number(rand_num) print*,rand_num end do end program test
So in order to seed with the same value at each execution, one must put an argument in random_seed() that will seed with the same value each time.
The problem is that when I try ‘random_seed(1)’ or ‘random_seed(put=1)’, neither work as the compiler comes up with an error saying
PGF90-S-0074-Illegal number or type of arguments to random_seed - keyword argument size (rand_test.f90: 6)
How do I then use random_seed to force the same seed at each execution of the program?