不好意思我是fortran新手
爬了文還是搞不太懂QAQ
我照 http://latinboy.pixnet.net/blog/post/23342072
這篇文章的程式碼打
program random_test
implicit none
real*8 :: x(10)
call random_seed()
! call init_random_seed() !<- this line is for GFortran
call random_number(x)
write(*,'(F21.18)') x
end program
SUBROUTINE init_random_seed()
INTEGER :: i, n, clock
INTEGER, ALLOCATABLE :: seed(:)
call RANDOM_SEED(SIZE = n)
ALLOCATE(seed(n))
call SYSTEM_CLOCK(COUNT=clock)
seed = clock - 2047 * (/ (i - 1, i = 1, n) /)
seed = seed * 1103515245 + 2531011
call RANDOM_SEED(PUT = seed)
DEALLOCATE(seed)
END SUBROUTINE
每次執行的亂數還是都一樣
到底要改哪裡呢