program speed_test1 implicit none integer*4 :: iarg integer :: int_time, int_count_rate, iloop, ier, i_do_extra, i, j integer*8 :: ncount double precision :: time0, time1, count_rate integer*8, dimension(:), allocatable :: array1, array2 character(len=80) :: arg call system_clock(int_time, int_count_rate) !Start time time0 = real(int_time) write(6,'(''Value of system clock at start = '',F14.4,/)') time0 iarg = 1 call getarg(iarg, arg) read(arg,'(i8)') iloop iarg=2 call getarg(iarg, arg) read(arg,'(i8)') i_do_extra ier=0 allocate(array1(iloop),array2(iloop),stat=ier) if ( ier /= 0 ) then write(6,*) 'Allocation error' end if !Main computation ncount=1 if (i_do_extra>0) then do i = 1, iloop do j = 1, iloop array1(j) = ncount array2(j) = ncount ncount=ncount+1 end do end do else do i = 1, iloop do j = 1, iloop array1(j) = ncount ncount=ncount+1 end do end do end if write(6,*) 'ncount = ',ncount !end Main computation call system_clock(int_time, int_count_rate) !end time time1 = real(int_time) count_rate = real(int_count_rate) write(6,'(''Value of system clock at end = '',F14.4,/)') time1 write(6,'('' Total Execution Time = '',F14.4, '' Seconds'')') (time1-time0)/count_rate end program speed_test1