For FOLLOW_LOOP, t wrapped into the combined time range of the trajectories.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(TrajectoryFollower), | intent(in) | :: | self | |||
| real(kind=wp), | intent(in) | :: | t |
the time (s) |
real(wp) function wrapped_time(self, t) result(tw) type(TrajectoryFollower), intent(in) :: self real(wp), intent(in) :: t !! the time (s) real(wp) :: t0, tf, a, b integer :: k tw = t if (self%mode_ == FOLLOW_LIMIT) return t0 = huge(1.0_wp) tf = -huge(1.0_wp) do k = 1, self%n if (.not. self%trajs(k)%p%time_range(a, b)) cycle t0 = min(t0, a) tf = max(tf, b) end do if (t0 == huge(1.0_wp)) return if (tf - t0 <= 8.0_wp * tiny(1.0_wp)) then tw = t0 else tw = t0 + modulo(t - t0, tf - t0) ! t - floor((t - t0)/(tf - t0)) * (tf - t0), in real arithmetic end if end function wrapped_time