program main integer matSize, maxTest parameter (matSize=450) parameter (maxTest=10) double precision matA(matSize,matSize), matB(matSize,matSize), & & matC(matSize,matSize), sum integer i, j, k, tests real tStart, tEnd, tLoop, t C C Initialize the matrices do i=1,matSize do j=1,matSize matA(i,j) = 1.0 + i matB(i,j) = 1.0 + j matC(i,j) = 0.0 enddo enddo C tLoop = 1.0e10 do tests=1,maxTest call cpu_time( tStart ) do i=1,matSize do j=1,matSize sum = 0.0 do k=1,matSize sum = matA(i,k)*matB(k,j) enddo matC(i,j) = sum enddo enddo call cpu_time( tEnd ) t = tEnd - tStart if (t .lt. tLoop) tLoop = t if (matC(1,1) .lt. 0.0) then print *, 'Failed matC sign test' endif enddo C print *, 'Time = ', tLoop rate = (2.0 * matSize) * matSize * (matSize / tLoop) print *, 'Rate = ', rate * 1.0e-6, ' MFlops' end