find Function

private function find(list, n, frame)

Index of frame in list(1:n), or 0.

Arguments

Type IntentOptional Attributes Name
type(FramePointer), intent(in), allocatable :: list(:)

first n used

integer, intent(in) :: n

number of frames in list

class(ReferenceFrame), intent(in), target :: frame

the frame to find

Return Value integer


Called by

proc~~find~~CalledByGraph proc~find find proc~child_index ReferenceFrame%child_index proc~child_index->proc~find proc~parent_index ReferenceFrame%parent_index proc~parent_index->proc~find proc~remove remove proc~remove->proc~find proc~add_child ReferenceFrame%add_child proc~add_child->proc~child_index proc~remove_child ReferenceFrame%remove_child proc~remove_child->proc~remove proc~detach~2 ReferenceFrame%detach proc~detach~2->proc~remove_child

Source Code

    integer function find(list, n, frame)
        type(FramePointer), allocatable, intent(in) :: list(:)  !! first n used
        integer, intent(in) :: n                            !! number of frames in list
        class(ReferenceFrame), intent(in), target :: frame  !! the frame to find
        integer :: k
        find = 0
        do k = 1, n
            if (associated(list(k)%p, frame)) then
                find = k
                return
            end if
        end do
    end function find