Advance the clock to the current wall time (call once per frame) and return the simulation time.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(SimulationClock), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in), | optional | :: | wall |
wall time (s; default: wall_time()) |
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