tem_directChildren Function

public function tem_directChildren(TreeID) result(childrenIDs)

This function delivers the direct children in the full tree for a given tree ID

Arguments

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

given treeID

Return Value integer(kind=long_k), (8)

Array for the treeIDs of the 8 direct children


Source Code

  function tem_directChildren( TreeID ) result(childrenIDs)
    ! ---------------------------------------------------------------------------
    !> given treeID
    integer(kind=long_k), intent(in) :: TreeID
    !> Array for the treeIDs of the 8 direct children
    integer(kind=long_k) :: childrenIDs(8)
    ! ---------------------------------------------------------------------------
    integer :: childCount
    integer(kind=long_k) :: off
    ! ---------------------------------------------------------------------------

    childrenIDs(:) = 0

    off = treeID * 8_long_k
    do childCount = 1,8
      childrenIDs(childCount) = off + int(childCount, kind=long_k)
    end do

  end function tem_directChildren