remove Function

private function remove(list, n, frame)

Remove frame from list(1:n); false if it is not in it.

Arguments

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

first n used

integer, intent(inout) :: n

number of frames in list (decremented if removed)

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

the frame to remove

Return Value logical


Calls

proc~~remove~~CallsGraph proc~remove remove proc~find find proc~remove->proc~find

Called by

proc~~remove~~CalledByGraph proc~remove remove proc~remove_child ReferenceFrame%remove_child proc~remove_child->proc~remove proc~detach~2 ReferenceFrame%detach proc~detach~2->proc~remove_child

Source Code

    logical function remove(list, n, frame)
        type(FramePointer), allocatable, intent(inout) :: list(:)  !! first n used
        integer, intent(inout) :: n                         !! number of frames in list (decremented if removed)
        class(ReferenceFrame), intent(in), target :: frame  !! the frame to remove
        integer :: k
        k = find(list, n, frame)
        remove = k > 0
        if (.not. remove) return
        list(k:n-1) = list(k+1:n)
        list(n)%p => null()
        n = n - 1
    end function remove