2022-02-08 23:25:04 +11:00
|
|
|
module mathstuff
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
contains
|
|
|
|
|
|
|
|
! ----------------------------------------------------------------
|
2022-02-17 01:59:42 +11:00
|
|
|
! really quick'n'dirty hack
|
2022-03-18 22:21:40 +11:00
|
|
|
! not really tested yet...
|
2022-02-08 23:25:04 +11:00
|
|
|
|
|
|
|
subroutine init_random_seed()
|
2024-02-07 03:03:00 +11:00
|
|
|
implicit none
|
2022-02-08 23:25:04 +11:00
|
|
|
|
|
|
|
integer, dimension(3) :: tarray
|
2022-03-18 22:21:40 +11:00
|
|
|
integer :: t3, foo
|
2022-02-18 04:08:58 +11:00
|
|
|
real :: dummy
|
2024-02-07 03:03:00 +11:00
|
|
|
|
2022-02-08 23:25:04 +11:00
|
|
|
call itime(tarray)
|
2022-02-17 23:41:09 +11:00
|
|
|
t3 = 3600*tarray(1) + 60*tarray(2) + tarray(3)
|
2024-02-07 03:03:00 +11:00
|
|
|
! write(0, '(A,3I3,A,I6)') " sranding: ", tarray, " --> ", t3
|
2022-02-08 23:25:04 +11:00
|
|
|
call srand(t3)
|
|
|
|
|
2022-02-19 05:30:10 +11:00
|
|
|
! after initializing the random generator engine,
|
|
|
|
! you MUST use it for initializing the initializer
|
2024-02-07 03:03:00 +11:00
|
|
|
do foo=1, tarray(1)+15
|
2022-03-18 22:21:40 +11:00
|
|
|
dummy = rand()
|
|
|
|
enddo
|
2022-02-18 04:08:58 +11:00
|
|
|
|
2022-02-08 23:25:04 +11:00
|
|
|
end subroutine
|
|
|
|
|
|
|
|
! ----------------------------------------------------------------
|
|
|
|
end module mathstuff
|
|
|
|
|