update Function

private function update(self, wall) result(t)

Advance the clock to the current wall time (call once per frame) and return the simulation time.

Type Bound

SimulationClock

Arguments

Type IntentOptional Attributes Name
class(SimulationClock), intent(inout) :: self
real(kind=wp), intent(in), optional :: wall

wall time (s; default: wall_time())

Return Value real(kind=wp)


Calls

proc~~update~3~~CallsGraph proc~update~3 SimulationClock%update proc~now now proc~update~3->proc~now proc~set_time~4 SimulationClock%set_time proc~update~3->proc~set_time~4 proc~wall_time wall_time proc~now->proc~wall_time proc~set_time~4->proc~now proc~set_time~4->proc~set_time~4

Called by

proc~~update~3~~CalledByGraph proc~update~3 SimulationClock%update proc~frame WindowProxy%frame proc~frame->proc~update~3 proc~resize WindowProxy%resize proc~resize->proc~frame proc~run WindowProxy%run proc~run->proc~frame

Source Code

    real(wp) function update(self, wall) result(t)
        class(SimulationClock), intent(inout) :: self
        real(wp), intent(in), optional :: wall      !! wall time (s; default: wall_time())
        if (associated(self%sync)) then
            self%time_ = self%sync%time()
        else
            if (.not. self%started) call self%set_time(self%time_, wall)
            if (.not. self%paused_) &
                self%time_ = max(self%t_min, min(self%t_max, self%offset + (now(wall) - self%wall_ref) * self%scale_))
        end if
        t = self%time_
    end function update