This function delivers the parent ID of a given TreeID
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=long_k), | intent(in) | :: | TreeID |
current treeID |
result of function containing parent ID
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