push_intermediate Subroutine

private subroutine push_intermediate(self, v, t)

Append an intermediate marker at v, time t (the arrays grown as needed).

Arguments

Type IntentOptional Attributes Name
type(MarkerArtist), intent(inout) :: self
real(kind=wp), intent(in) :: v(3)

the marker's point; its time

real(kind=wp), intent(in) :: t

the marker's point; its time


Calls

proc~~push_intermediate~~CallsGraph proc~push_intermediate push_intermediate proc~color_at color_at proc~push_intermediate->proc~color_at proc~is_colored LineChain%is_colored proc~push_intermediate->proc~is_colored num_times num_times proc~color_at->num_times proc~point_rgba_or point_rgba_or proc~color_at->proc~point_rgba_or time_index time_index proc~color_at->time_index proc~color~3 Trajectory%color proc~point_rgba_or->proc~color~3 proc~num_colors Trajectory%num_colors proc~point_rgba_or->proc~num_colors

Called by

proc~~push_intermediate~~CalledByGraph proc~push_intermediate push_intermediate proc~intermediates_by_data intermediates_by_data proc~intermediates_by_data->proc~push_intermediate proc~intermediates_by_distance intermediates_by_distance proc~intermediates_by_distance->proc~push_intermediate proc~intermediates_by_time intermediates_by_time proc~intermediates_by_time->proc~push_intermediate proc~add_intermediates add_intermediates proc~add_intermediates->proc~intermediates_by_data proc~add_intermediates->proc~intermediates_by_distance proc~add_intermediates->proc~intermediates_by_time proc~marker_update MarkerArtist%marker_update proc~marker_update->proc~add_intermediates

Source Code

    subroutine push_intermediate(self, v, t)
        type(MarkerArtist), intent(inout) :: self
        real(wp), intent(in) :: v(3), t                     !! the marker's point; its time
        real(wp), allocatable :: xyz(:,:), times(:), rgba(:,:)
        integer :: m
        if (.not. allocated(self%inter_xyz)) allocate(self%inter_xyz(3, 64), self%inter_t(64), self%inter_rgba(4, 64))
        m = size(self%inter_t)
        if (self%n_inter == m) then
            allocate(xyz(3, 2 * m), times(2 * m), rgba(4, 2 * m))
            xyz(:, 1:m) = self%inter_xyz
            times(1:m) = self%inter_t
            rgba(:, 1:m) = self%inter_rgba
            call move_alloc(xyz, self%inter_xyz)
            call move_alloc(times, self%inter_t)
            call move_alloc(rgba, self%inter_rgba)
        end if
        self%n_inter = self%n_inter + 1
        self%inter_xyz(:, self%n_inter) = v
        self%inter_t(self%n_inter) = t
        if (self%inter%is_colored()) self%inter_rgba(:, self%n_inter) = color_at(self, t, self%intermediate_color)
    end subroutine push_intermediate