SUEWS API Site
Documentation of SUEWS source code
Data Types | Functions/Subroutines
mod_clock Module Reference

Data Types

type  clock
 

Functions/Subroutines

pure elemental subroutine reset (self)
 
pure elemental subroutine tick (self)
 

Function/Subroutine Documentation

◆ reset()

pure elemental subroutine mod_clock::reset ( class(clock), intent(inout)  self)
private

Definition at line 1710 of file suews_util_datetime.f95.

1710 
1711  !! Resets the clock to its start time.
1712 
1713  class(clock), intent(inout) :: self
1714 
1715  self%currentTime = self%startTime
1716 
1717  self%started = .false.
1718  self%stopped = .false.
1719 

◆ tick()

pure elemental subroutine mod_clock::tick ( class(clock), intent(inout)  self)
private

Definition at line 1725 of file suews_util_datetime.f95.

1725 
1726  !! Increments the currentTime of the clock instance by one tickInterval.
1727 
1728  class(clock), intent(inout) :: self
1729 
1730  if (self%stopped) then
1731  return
1732  endif
1733 
1734  if (.not. self%started) then
1735  self%started = .true.
1736  self%currentTime = self%startTime
1737  endif
1738 
1739  self%currentTime = self%currentTime + self%tickInterval
1740 
1741  if (self%currentTime >= self%stopTime) then
1742  self%stopped = .true.
1743  endif
1744