tem_childNumber Function

public elemental function tem_childNumber(TreeID) result(res)

This function delivers of TreeID, which child number it is from its parent

Arguments

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

current treeID

Return Value integer

result of function containing child number


Called by

proc~~tem_childnumber~~CalledByGraph proc~tem_childnumber tem_childNumber proc~add_all_virtual_children add_all_virtual_children proc~add_all_virtual_children->proc~tem_childnumber proc~add_all_virtual_children->proc~add_all_virtual_children proc~tem_build_verticaldependencies tem_build_verticalDependencies proc~tem_build_verticaldependencies->proc~tem_childnumber proc~identify_local_element identify_local_element proc~identify_local_element->proc~add_all_virtual_children proc~tem_create_leveldesc tem_create_levelDesc proc~tem_create_leveldesc->proc~tem_build_verticaldependencies proc~identify_halo identify_halo proc~identify_halo->proc~identify_local_element proc~single_process_element single_process_element proc~single_process_element->proc~identify_local_element proc~tem_dimbydim_construction tem_dimByDim_construction proc~tem_dimbydim_construction->proc~tem_create_leveldesc proc~identify_elements identify_elements proc~identify_elements->proc~single_process_element proc~request_remotehalos request_remoteHalos proc~request_remotehalos->proc~identify_halo proc~tem_build_face_info tem_build_face_info proc~tem_build_face_info->proc~tem_dimbydim_construction

Source Code

  elemental function tem_childNumber( TreeID ) result(res)
    ! ---------------------------------------------------------------------------
    !> current treeID
    integer(kind=long_k), intent(in) :: TreeID
    !> result of function containing child number
    integer :: res
    ! ---------------------------------------------------------------------------
    integer(kind=long_k) :: offset
    ! ---------------------------------------------------------------------------

    ! offset = ((treeID-1)/8) * 8
    offset = ishft((TreeID-1_long_k), -3) * 8_long_k
    res    = int( TreeID - offset )

  end function tem_childNumber