Fortraneries/BloubWorld/mathstuff.f90

33 lines
792 B
Fortran
Raw Normal View History

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