This function returns the complete path through the tree from a given treeID to the root (all parents).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=long_k), | intent(in) | :: | TreeID |
current treeID |
resulting path
elemental function tem_PathOf( TreeID ) result(res) ! --------------------------------------------------------------------------- !> current treeID integer(kind=long_k), intent(in) :: TreeID !> resulting path type(tem_path_type) :: res ! --------------------------------------------------------------------------- res%level = 1 res%Node(res%Level) = treeID do while (res%Node(res%Level) > 0) res%Level = res%Level + 1 ! res%Node(res%Level) = (res%Node(res%Level-1)-1) / 8 res%Node(res%Level) = ishft( (res%Node(res%Level-1)-1), -3 ) end do end function tem_PathOf