tem_LastIdAtLevel Function

public elemental function tem_LastIdAtLevel(level) result(res)

Last ID in the complete tree on a given level

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: level

level to check

Return Value integer(kind=long_k)

resulting last treeID


Called by

proc~~tem_lastidatlevel~~CalledByGraph proc~tem_lastidatlevel tem_LastIdAtLevel proc~tem_shape_initbylevels tem_shape_initByLevels proc~tem_shape_initbylevels->proc~tem_lastidatlevel proc~generate_treelm_cube generate_treelm_cube proc~generate_treelm_cube->proc~tem_lastidatlevel proc~tem_shape2subtree tem_shape2subTree proc~tem_shape2subtree->proc~tem_shape_initbylevels proc~tem_load_internal tem_load_internal proc~tem_load_internal->proc~generate_treelm_cube proc~tem_create_subtree_of tem_create_subTree_of proc~tem_create_subtree_of->proc~tem_shape2subtree proc~load_tem load_tem proc~load_tem->proc~tem_load_internal proc~tem_init_convergence tem_init_convergence proc~tem_init_convergence->proc~tem_create_subtree_of proc~tem_restart_readheader tem_restart_readHeader proc~tem_restart_readheader->proc~load_tem proc~tem_write_debugmesh tem_write_debugMesh proc~tem_write_debugmesh->proc~tem_create_subtree_of proc~tem_init_tracker_subtree tem_init_tracker_subTree proc~tem_init_tracker_subtree->proc~tem_create_subtree_of proc~tem_create_subtree_of_st_funlist tem_create_subTree_of_st_funList proc~tem_create_subtree_of_st_funlist->proc~tem_create_subtree_of

Contents

Source Code


Source Code

  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