stop_timer Subroutine

public subroutine stop_timer(msg)

Arguments

Type IntentOptional Attributes Name
character(len=*), optional :: msg

Calls

proc~~stop_timer~~CallsGraph proc~stop_timer stop_timer mpi_wtime mpi_wtime proc~stop_timer->mpi_wtime proc~check_mpi check_MPI proc~stop_timer->proc~check_mpi mpi_initialized mpi_initialized proc~check_mpi->mpi_initialized

Called by

proc~~stop_timer~~CalledByGraph proc~stop_timer stop_timer interface~stop_progress stop_progress interface~stop_progress->proc~stop_timer

Source Code

  subroutine stop_timer(msg)
    character(len=*),optional :: msg
    real                      :: ct_T
    real                      :: st_T
    integer,dimension(8)      :: dt_T
    !
    !
#ifdef _MPI    
    if(check_MPI())then
       st_T_stop(Tindex) = MPI_Wtime()
    else
       call system_clock(count=st_T_stop(Tindex))
    endif
#else
    call system_clock(count=st_T_stop(Tindex))
#endif
    call cpu_time(ct_T_stop(Tindex))
    call date_and_time(values=dt_T_stop(Tindex,:))
    ct_T = ct_time_difference(ct_T_stop(Tindex),ct_T_start(Tindex))
    st_T = st_time_difference(st_T_stop(Tindex),st_T_start(Tindex))
    dt_T = dt_time_difference(dt_T_stop(Tindex,:),dt_T_start(Tindex,:))
    !
    if(present(msg))then
       call print_total_time(ct_T,st_T,dt_T,msg)
    else
       call print_total_time(ct_T,st_T,dt_T)
    endif
    ct_T_start(Tindex)   = 0
    st_T_start(Tindex)   = 0
    dt_T_start(Tindex,:) = 0
    ct_T_stop(Tindex)    = 0
    st_T_stop(Tindex)    = 0
    dt_T_stop(Tindex,:)  = 0
    !
    funit(Tindex)        = 6
    !
    if(Tindex>1)then
       Tindex=Tindex-1
    else
       Tindex=0
    endif
  end subroutine stop_timer