TIMERS: Remove unnecessary comments.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
parent
2d7a4b0d3c
commit
b556b396c3
@ -32,13 +32,9 @@
|
||||
!
|
||||
module timers
|
||||
|
||||
! module variables are not implicit by default
|
||||
!
|
||||
implicit none
|
||||
|
||||
! module variables
|
||||
!
|
||||
integer , parameter :: ntimers = 128
|
||||
integer , parameter :: ntimers = 32
|
||||
integer , save :: ntimer
|
||||
logical , dimension(ntimers), save :: tenabled, tlocked
|
||||
character(len=32), dimension(ntimers), save :: description
|
||||
@ -47,12 +43,8 @@ module timers
|
||||
integer(kind=8) , save :: ticks, tbegin
|
||||
real (kind=8) , save :: conv = 1.0d+00
|
||||
|
||||
! by default everything is private
|
||||
!
|
||||
private
|
||||
|
||||
! declare public subroutines and variables
|
||||
!
|
||||
public :: initialize_timers, finalize_timers
|
||||
public :: set_timer, start_timer, stop_timer
|
||||
public :: get_timer, get_count, get_timer_total
|
||||
@ -75,10 +67,8 @@ module timers
|
||||
!
|
||||
subroutine initialize_timers()
|
||||
|
||||
! local variables are not implicit by default
|
||||
!
|
||||
implicit none
|
||||
!
|
||||
|
||||
!-------------------------------------------------------------------------------
|
||||
!
|
||||
! get the current time and the number of ticks per second
|
||||
@ -121,15 +111,12 @@ module timers
|
||||
!
|
||||
! Subroutine finalizes module.
|
||||
!
|
||||
!
|
||||
!===============================================================================
|
||||
!
|
||||
subroutine finalize_timers()
|
||||
|
||||
! local variables are not implicit by default
|
||||
!
|
||||
implicit none
|
||||
!
|
||||
|
||||
!-------------------------------------------------------------------------------
|
||||
!
|
||||
|
||||
@ -153,23 +140,15 @@ module timers
|
||||
!
|
||||
subroutine set_timer(string, timer)
|
||||
|
||||
! include external procedures
|
||||
!
|
||||
use iso_fortran_env, only : error_unit
|
||||
|
||||
! local variables are not implicit by default
|
||||
!
|
||||
implicit none
|
||||
|
||||
! input arguments
|
||||
!
|
||||
character(len=*), intent(in) :: string
|
||||
integer , intent(out) :: timer
|
||||
|
||||
! local parameters
|
||||
!
|
||||
character(len=*), parameter :: loc = 'TIMERS::set_timer()'
|
||||
!
|
||||
|
||||
!-------------------------------------------------------------------------------
|
||||
!
|
||||
! increase the timer count
|
||||
@ -219,22 +198,14 @@ module timers
|
||||
!
|
||||
subroutine start_timer(timer)
|
||||
|
||||
! include external procedures
|
||||
!
|
||||
use iso_fortran_env, only : error_unit
|
||||
|
||||
! local variables are not implicit by default
|
||||
!
|
||||
implicit none
|
||||
|
||||
! input arguments
|
||||
!
|
||||
integer, intent(in) :: timer
|
||||
|
||||
! local parameters
|
||||
!
|
||||
character(len=*), parameter :: loc = 'TIMERS::start_timer()'
|
||||
!
|
||||
|
||||
!-------------------------------------------------------------------------------
|
||||
!
|
||||
! check if the timer is unlocked, if not, lock it and star counting
|
||||
@ -275,22 +246,14 @@ module timers
|
||||
!
|
||||
subroutine stop_timer(timer)
|
||||
|
||||
! include external procedures
|
||||
!
|
||||
use iso_fortran_env, only : error_unit
|
||||
|
||||
! local variables are not implicit by default
|
||||
!
|
||||
implicit none
|
||||
|
||||
! input arguments
|
||||
!
|
||||
integer, intent(in) :: timer
|
||||
|
||||
! local parameters
|
||||
!
|
||||
character(len=*), parameter :: loc = 'TIMERS::stop_timer()'
|
||||
!
|
||||
|
||||
!-------------------------------------------------------------------------------
|
||||
!
|
||||
! check if the timer is locked
|
||||
@ -339,22 +302,14 @@ module timers
|
||||
!
|
||||
real(kind=8) function get_timer(timer)
|
||||
|
||||
! local variables are not implicit by default
|
||||
!
|
||||
implicit none
|
||||
|
||||
! input arguments
|
||||
!
|
||||
integer, intent(in) :: timer
|
||||
!
|
||||
|
||||
!-------------------------------------------------------------------------------
|
||||
!
|
||||
! estimate the accounted time for the specified timer
|
||||
!
|
||||
get_timer = max(0.0d+00, conv * times(timer))
|
||||
|
||||
! return the value
|
||||
!
|
||||
return
|
||||
|
||||
!-------------------------------------------------------------------------------
|
||||
@ -376,22 +331,14 @@ module timers
|
||||
!
|
||||
integer(kind=4) function get_count(timer)
|
||||
|
||||
! local variables are not implicit by default
|
||||
!
|
||||
implicit none
|
||||
|
||||
! input arguments
|
||||
!
|
||||
integer, intent(in) :: timer
|
||||
!
|
||||
|
||||
!-------------------------------------------------------------------------------
|
||||
!
|
||||
! estimate the accounted time for the specified timer
|
||||
!
|
||||
get_count = tcount(timer)
|
||||
|
||||
! return the value
|
||||
!
|
||||
return
|
||||
|
||||
!-------------------------------------------------------------------------------
|
||||
@ -413,22 +360,14 @@ module timers
|
||||
!
|
||||
logical function timer_enabled(timer)
|
||||
|
||||
! local variables are not implicit by default
|
||||
!
|
||||
implicit none
|
||||
|
||||
! input arguments
|
||||
!
|
||||
integer, intent(in) :: timer
|
||||
!
|
||||
|
||||
!-------------------------------------------------------------------------------
|
||||
!
|
||||
! estimate the accounted time for the specified timer
|
||||
!
|
||||
timer_enabled = tenabled(timer)
|
||||
|
||||
! return the value
|
||||
!
|
||||
return
|
||||
|
||||
!-------------------------------------------------------------------------------
|
||||
@ -450,22 +389,14 @@ module timers
|
||||
!
|
||||
character(len=32) function timer_description(timer)
|
||||
|
||||
! local variables are not implicit by default
|
||||
!
|
||||
implicit none
|
||||
|
||||
! input arguments
|
||||
!
|
||||
integer, intent(in) :: timer
|
||||
!
|
||||
|
||||
!-------------------------------------------------------------------------------
|
||||
!
|
||||
! estimate the accounted time for the specified timer
|
||||
!
|
||||
timer_description = description(timer)
|
||||
|
||||
! return the value
|
||||
!
|
||||
return
|
||||
|
||||
!-------------------------------------------------------------------------------
|
||||
@ -479,19 +410,14 @@ module timers
|
||||
!
|
||||
! Function returns the total execution time.
|
||||
!
|
||||
!
|
||||
!===============================================================================
|
||||
!
|
||||
real(kind=8) function get_timer_total()
|
||||
|
||||
! local variables are not implicit by default
|
||||
!
|
||||
implicit none
|
||||
|
||||
! local variables
|
||||
!
|
||||
integer(kind=8) :: tend
|
||||
!
|
||||
|
||||
!-------------------------------------------------------------------------------
|
||||
!
|
||||
! get the current time
|
||||
@ -502,8 +428,6 @@ module timers
|
||||
!
|
||||
get_timer_total = max(0.0d+00, conv * (tend - tbegin))
|
||||
|
||||
! return the value
|
||||
!
|
||||
return
|
||||
|
||||
!-------------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user