
subroutine output_time
  use ac_mpi_module
  integer scount, ecount, rate, count_max

  write(*,'(a)') 'time (sec)'
  write(*,'(a,t10,2f20.5)') 'la', time_la, time_la-time_la0
  write(*,'(a,t10,2f20.5)') 'fft', time_fft, time_fft-time_fft0
  write(*,'(a,t10,2f20.5)') 'mpi', time_mpi, time_mpi-time_mpi0

  call system_clock(ecount, rate, count_max )
  if(ecount > time_scount) then
     time_total = real(ecount-time_scount)/rate
  else
     time_total = real(ecount+count_max-time_scount)/rate
  end if
  time_as = time_total - time_la - time_fft - time_mpi
  write(*,'(a,t10,2f20.5)') 'as', time_as, time_as-time_as0
  write(*,'(a,t10,2f20.5)') 'total', time_total, time_total-time_total0

  time_la0 = time_la
  time_fft0 = time_fft
  time_mpi0 = time_mpi
  time_as0 = time_as
  time_total0 = time_total

end subroutine output_time
