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)

Definition at line 1709 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 1724 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 END IF
1733
1734 IF (.NOT. self%started) THEN
1735 self%started = .true.
1736 self%currentTime = self%startTime
1737 END IF
1738
1739 self%currentTime = self%currentTime + self%tickInterval
1740
1741 IF (self%currentTime >= self%stopTime) THEN
1742 self%stopped = .true.
1743 END IF
1744