Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iounit |
SUBROUTINE seed_random_number(iounit)
INTEGER, INTENT(IN) :: iounit
! Local variables
INTEGER :: k
INTEGER, ALLOCATABLE :: seed(:)
CALL RANDOM_SEED(SIZE=k)
ALLOCATE( seed(k) )
WRITE(*, '(a, i2, a)')' Enter ', k, ' integers for random no. seeds: '
READ(*, *) seed
WRITE(iounit, '(a, (7i10))') ' Random no. seeds: ', seed
CALL RANDOM_SEED(PUT=seed)
DEALLOCATE( seed )
RETURN
END SUBROUTINE seed_random_number