tem_directParent Function

private elemental function tem_directParent(TreeID) result(res)

This function delivers the parent ID of a given TreeID

Arguments

Type IntentOptional Attributes Name
integer(kind=long_k), intent(in) :: TreeID

current treeID

Return Value integer(kind=long_k)

result of function containing parent ID


Source Code

  elemental function tem_directParent(TreeID) result(res)
    ! ---------------------------------------------------------------------------
    !> current treeID
    integer(kind=long_k), intent(in) :: TreeID
    !> result of function containing parent ID
    integer(kind=long_k) :: res
    ! ---------------------------------------------------------------------------

    ! res = ( treeID - 1 ) / 8
    res = ishft( (treeID-1_long_k), -3 )

  end function tem_directParent