start_timer Subroutine

public subroutine start_timer(title, unit)

Arguments

Type IntentOptional Attributes Name
character(len=*), optional :: title
integer, optional :: unit

Calls

proc~~start_timer~~CallsGraph proc~start_timer start_timer mpi_wtime mpi_wtime proc~start_timer->mpi_wtime proc~check_mpi check_MPI proc~start_timer->proc~check_mpi proc~get_rank_mpi Get_rank_MPI proc~start_timer->proc~get_rank_mpi mpi_initialized mpi_initialized proc~check_mpi->mpi_initialized mpi_comm_rank mpi_comm_rank proc~get_rank_mpi->mpi_comm_rank proc~error_mpi Error_MPI proc~get_rank_mpi->proc~error_mpi

Called by

proc~~start_timer~~CalledByGraph proc~start_timer start_timer interface~start_progress start_progress interface~start_progress->proc~start_timer

Source Code

  subroutine start_timer(title,unit)
    character(len=*),optional :: title
    integer,optional          :: unit
    !
    Tindex=Tindex+1
    if(Tindex>Tmax)stop "start_timer error: too many timers started"
    !
    mpi_id = 0
#ifdef _MPI    
    if(check_MPI())mpi_id = get_Rank_MPI()
#endif
    funit(Tindex)=6+mpi_id;if(present(unit))funit(Tindex)=unit
    if(funit(Tindex)==5)funit(Tindex)=6
    !
    if(present(title))write(funit(Tindex),"(1x,A)")trim(title)
    !
#ifdef _MPI    
    if(check_MPI())then
       st_T_start(Tindex) = MPI_Wtime()
    else
       call system_clock(count_rate=st_rate)
       call system_clock(count=st_T_start(Tindex))
    endif
#else
    call system_clock(count_rate=st_rate)
    call system_clock(count=st_T_start(Tindex))
#endif
    call cpu_time(ct_T_start(Tindex))
    call date_and_time(values=dt_T_start(Tindex,:))
    st_T0 = st_T_start
    ct_T0 = ct_T_start
    dt_T0 = dt_T_start
    !
    !init variables for ETA:
    elapsed_time = 0.0
    old_time     = 0.0
    time         = 0.0
  end subroutine start_timer