|
我这里有一个简单的程序,你可以在两台电脑上分别试验一下计算时间(也许能帮你分析一下究竟是电脑本身的问题还是程序的问题)。
program main
real*8, allocatable :: x(:), y(:)
real*8 time
integer*4 time0, time1, dtime
integer i, j, n, m
n = 10000
m = 100000
allocate(x(n), y(n))
do i=1,n
x(i) = rand()
end do
call system_clock(time0)
do j=1,m
do i=1,n
y(i) = x(i) + 1d0
end do
end do
call system_clock(time1, dtime)
time = 1d0*(time1-time0)/dtime
write(*,"(a7,f16.7)")"Time = ",time
deallocate(x, y)
end program |
|