The intermediate markers (in trajectory order) whose times are at most
t: count from first (the first ones for increasing times, the last
for decreasing), by bisection.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(MarkerArtist), | intent(in) | :: | self | |||
| real(kind=wp), | intent(in) | :: | t |
the current time |
||
| integer, | intent(out) | :: | first |
the markers passed: the first, how many |
||
| integer, | intent(out) | :: | count |
the markers passed: the first, how many |
subroutine markers_passed(self, t, first, count) type(MarkerArtist), intent(in) :: self real(wp), intent(in) :: t !! the current time integer, intent(out) :: first, count !! the markers passed: the first, how many integer :: low, high, mid, m m = self%n_inter_written low = 0 high = m + 1 if (.not. decreasing_times(self%traj, self%traj%num_times())) then ! markers 1 .. low passed do while (high - low > 1) mid = (low + high) / 2 if (self%inter_t(mid) <= t) then low = mid else high = mid end if end do first = 1 count = low else ! markers high .. m passed do while (high - low > 1) mid = (low + high) / 2 if (self%inter_t(mid) <= t) then high = mid else low = mid end if end do first = high count = m - high + 1 end if end subroutine markers_passed