This function delivers all sibling treeIDs of TreeID in an array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=long_k), | intent(in) | :: | TreeID |
current treeID |
treeIDs siblings
function tem_SiblingsOfId( TreeID ) result(siblings) ! --------------------------------------------------------------------------- !> current treeID integer(kind=long_k), intent(in) :: TreeID !> treeIDs siblings integer(kind=long_k) :: siblings(7) ! --------------------------------------------------------------------------- integer :: myNumber, iElem, i integer(kind=long_k) :: offset ! --------------------------------------------------------------------------- offset = ishft((TreeID-1_long_k), -3) * 8_long_k myNumber = int( TreeID - offset ) iElem = 0 do i = 1,8 if( i /= myNumber ) then iElem = iElem + 1 siblings( iElem ) = offset + int(i,long_k) endif enddo end function tem_SiblingsOfId