Stopwatch to time parts of the code
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | tag | |||
| type(timer_list_type), | intent(inout) | :: | timers |
Which stopwatch to act upon Action 1=start 2=stop |
subroutine io_stopwatch_stop(tag, timers) !===================================== !! Stopwatch to time parts of the code !===================================== use w90_types, only: timer_list_type implicit none ! arguments character(len=*), intent(in) :: tag type(timer_list_type), intent(inout) :: timers !! Which stopwatch to act upon !integer, intent(in) :: mode !! Action 1=start 2=stop ! local variables integer :: i real(kind=dp) :: t call cpu_time(t) do i = 1, timers%nnames if (timers%clocks(i)%label .eq. tag) then timers%clocks(i)%ctime = timers%clocks(i)%ctime + t - timers%clocks(i)%ptime return end if end do return end subroutine io_stopwatch_stop