Last ID in the complete tree on a given level
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | level |
level to check |
resulting last treeID
elemental function tem_LastIdAtLevel( level ) result(res) ! --------------------------------------------------------------------------- !> level to check integer, intent(in) :: level !> resulting last treeID integer(kind=long_k) :: res ! --------------------------------------------------------------------------- integer :: i integer(kind=long_k) :: monomonial ! --------------------------------------------------------------------------- res = -1 monomonial = 1 do i = 0, level res = res + monomonial monomonial = monomonial * 8 end do end function tem_LastIdAtLevel