slice Subroutine

private subroutine slice(self, j, i1, i2, lo, hi, p)

The part lo .. hi of points i1 .. i2 that chunk j holds, and its buffer p(xyz and distance, high/low, lo:hi) (null if none).

Type Bound

LineChain

Arguments

Type IntentOptional Attributes Name
class(LineChain), intent(in) :: self
integer, intent(in) :: j

the chunk, and points i1 .. i2 (chain indices)

integer, intent(in) :: i1

the chunk, and points i1 .. i2 (chain indices)

integer, intent(in) :: i2

the chunk, and points i1 .. i2 (chain indices)

integer, intent(out) :: lo

chain indices (lo > hi: none)

integer, intent(out) :: hi

chain indices (lo > hi: none)

real(kind=c_float), intent(out), dimension(:,:,:), pointer :: p

(4, 2, hi-lo+1)


Calls

proc~~slice~~CallsGraph proc~slice LineChain%slice proc~line_buffer line_buffer proc~slice->proc~line_buffer interface~vkf_line_points vkf_line_points proc~line_buffer->interface~vkf_line_points

Called by

proc~~slice~~CalledByGraph proc~slice LineChain%slice proc~write_intermediates write_intermediates proc~write_intermediates->proc~slice proc~write_marker write_marker proc~write_marker->proc~slice proc~write_segments write_segments proc~write_segments->proc~slice proc~write_segments~2 write_segments proc~write_segments~2->proc~slice proc~add_intermediates add_intermediates proc~add_intermediates->proc~write_intermediates proc~marker_update MarkerArtist%marker_update proc~marker_update->proc~write_marker proc~marker_update->proc~add_intermediates proc~segment_update SegmentArtist%segment_update proc~segment_update->proc~write_segments proc~segments_late_update CustomLineSegments%segments_late_update proc~segments_late_update->proc~write_segments~2

Source Code

    subroutine slice(self, j, i1, i2, lo, hi, p)
        class(LineChain), intent(in) :: self
        integer, intent(in) :: j, i1, i2                            !! the chunk, and points i1 .. i2 (chain indices)
        integer, intent(out) :: lo, hi                              !! chain indices (lo > hi: none)
        real(c_float), dimension(:,:,:), pointer, intent(out) :: p  !! (4, 2, hi-lo+1)
        real(c_float), dimension(:,:,:), pointer :: all
        p => null()
        associate (c => self%chunks(j))
            lo = max(i1, c%first)
            hi = min(i2, c%first + c%capacity - 1)
            if (lo > hi) return
            call line_buffer(c%line, all)
            if (associated(all)) p => all(:, :, lo-c%first+1:hi-c%first+1)
        end associate
    end subroutine slice