https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98253
--- Comment #3 from kargl at gcc dot gnu.org --- Third thought. Here are the programs you meant to write (without error checking such as how_to_use_random_init must be run before how_to_seed_with_random_seed_like_random_init). program how_to_use_random_init implicit none integer fd, i, n integer, allocatable :: seeds(:) real r call random_init(repeatable=.true., image_distinct=.true.) call random_seed(size=n) allocate(seeds(n)) call random_seed(get=seeds) open(newunit=fd,file='seed.cache',access='stream',status='replace') write(fd) seeds close(fd) do i=1,5 call random_number(r) print *,r end do end program how_to_use_random_init program how_to_seed_with_random_seed_like_random_init implicit none integer fd, i, n integer, allocatable :: seeds(:) real r call random_seed(size=n) allocate(seeds(n)) open(newunit=fd,file='seed.cache',access='stream',status='old') read(fd) seeds close(fd) call random_seed(put=seeds) do i=1,5 call random_number(r) print *,r end do end program how_to_seed_with_random_seed_like_random_init