! compile as: gfortran -O2 sumj.f ! try also the option -march=native program sumj implicit none integer, parameter :: Prec=8 integer(8) :: j,N,base,p0,p1,power real(8) :: t0,t1,t real(Prec) :: x character(3) :: sprec character(100) :: f_out,shost ! Preparations write(sprec,'(I3)') Prec call HOSTNM(shost) !get computer name ! make a file name for output f_out=trim(adjustl(sprec))//"_"//trim(adjustl(shost))//".dat0" ! Collect system info and write that to a file call system("bash sys_info.sh "//f_out) ! Actual calculation base=2 p0=10 p1=34 open(1,file=f_out,position="append") do power= p0,p1 N= base**power x= real(0.,Prec) call cpu_time(t0) do j= -N,N x=x + real(j,Prec) end do call cpu_time(t1) t=t1-t0 write(1,*) power,N,x,kind(x),t write(*,*) power,N,x,kind(x),t enddo close(1) end program