set_time Subroutine

private recursive subroutine set_time(self, t, wall)

Set the simulation time (limited to the time range) and restart counting from it.

Type Bound

SimulationClock

Arguments

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

simulation time (s)

real(kind=wp), intent(in), optional :: wall

wall time (s; default: wall_time())


Calls

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

Called by

proc~~set_time~4~~CalledByGraph proc~set_time~4 SimulationClock%set_time proc~set_time~4->proc~set_time~4 proc~pause SimulationClock%pause proc~pause->proc~set_time~4 proc~set_time WindowProxy%set_time proc~set_time->proc~set_time~4 proc~set_time_scale~2 SimulationClock%set_time_scale proc~set_time_scale~2->proc~set_time~4 proc~set_time_scale~2->proc~set_time_scale~2 proc~stop_recording WindowProxy%stop_recording proc~stop_recording->proc~set_time~4 proc~synchronize SimulationClock%synchronize proc~synchronize->proc~set_time~4 proc~synchronize->proc~synchronize proc~update~3 SimulationClock%update proc~update~3->proc~set_time~4 proc~close WindowProxy%close proc~close->proc~stop_recording proc~frame WindowProxy%frame proc~frame->proc~stop_recording proc~frame->proc~update~3 proc~set_time_scale WindowProxy%set_time_scale proc~set_time_scale->proc~set_time_scale~2 proc~resize WindowProxy%resize proc~resize->proc~frame proc~run WindowProxy%run proc~run->proc~frame

Source Code

    recursive subroutine set_time(self, t, wall)
        class(SimulationClock), intent(inout) :: self
        real(wp), intent(in) :: t                   !! simulation time (s)
        real(wp), intent(in), optional :: wall      !! wall time (s; default: wall_time())
        if (associated(self%sync)) then
            call self%sync%set_time(t, wall)
            return
        end if
        self%time_ = max(self%t_min, min(self%t_max, t))
        self%offset = self%time_
        self%wall_ref = now(wall)
        self%started = .true.
    end subroutine set_time