Thank you! I think your subroutine will be helpful indeed. I have also found specifying the seed to the RNG inconvenient. Having a robust procedure is great.
As I am writing this, I have another bright idea to boot strap the random_number using itself as shown below to get different integer seeds:
program main
integer, parameter :: dp = kind(1.0d0)
integer nseed
integer, allocatable:: seed(:)
real(kind=dp), allocatable:: tmp(:)
call random_seed(size = nseed)
allocate(seed(nseed))
allocate(tmp(nseed))
seed=333331
call random_seed(put=seed)
call random_number(tmp) !maybe put this statement in a short do loop
seed=floor(huge(seed)*tmp)
call random_seed(put=seed)
do i=1,5
call random_number(tmp)
call random_seed(get=seed)
print "(100(I12,x))", seed
enddo
end program main
Hopefully I will get around to doing a small quantitative analysis of effect of seed choice some day ![]()