identify_stencilNeigh Subroutine

public recursive subroutine identify_stencilNeigh(iElem, iLevel, iStencil, tree, pathFirst, pathLast, levelDesc, proc, stencil, nesting)

Invoke the identify_elements for each neighbor of the stencil and store the positions of the encountered elements

Arguments

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

element position in levelDesc to identify

integer, intent(in) :: iLevel

element level

integer, intent(in) :: iStencil

stencil within the element to act on

type(treelmesh_type), intent(in) :: tree

tree information

type(tem_path_type), intent(in) :: pathFirst(:)

first treeID path in every process

type(tem_path_type), intent(in) :: pathLast(:)

last treeID path in every process

type(tem_levelDesc_type), intent(inout) :: levelDesc(tree%global%minLevel:)

the level descriptor to be filled

type(tem_comm_env_type), intent(in) :: proc

process

type(tem_stencilHeader_type), intent(in) :: stencil

current stencil definition

integer, intent(in) :: nesting

nesting level


Calls

proc~~identify_stencilneigh~~CallsGraph proc~identify_stencilneigh identify_stencilNeigh proc~identify_elements identify_elements proc~identify_stencilneigh->proc~identify_elements proc~identify_elements->proc~identify_stencilneigh proc~identify_elements->proc~identify_elements interface~append~29 append proc~identify_elements->interface~append~29 interface~init~20 init proc~identify_elements->interface~init~20 proc~create_allparentneighbors create_allParentNeighbors proc~identify_elements->proc~create_allparentneighbors proc~single_process_element single_process_element proc~identify_elements->proc~single_process_element proc~tem_directchildren tem_directChildren proc~identify_elements->proc~tem_directchildren proc~tem_find_depproc tem_find_depProc proc~identify_elements->proc~tem_find_depproc proc~tem_levelof tem_LevelOf proc~identify_elements->proc~tem_levelof proc~tem_pathof tem_PathOf proc~identify_elements->proc~tem_pathof proc~tem_tidinfo tem_tIDinfo proc~identify_elements->proc~tem_tidinfo proc~append_ga_dynlong append_ga_dynlong interface~append~29->proc~append_ga_dynlong proc~append_ga_dynlong_vec append_ga_dynlong_vec interface~append~29->proc~append_ga_dynlong_vec proc~init_ga2d_real init_ga2d_real interface~init~20->proc~init_ga2d_real proc~create_allparentneighbors->proc~identify_stencilneigh proc~create_allparentneighbors->proc~identify_elements proc~create_allparentneighbors->interface~append~29 interface~tem_parentof tem_ParentOf proc~create_allparentneighbors->interface~tem_parentof proc~single_process_element->interface~append~29 proc~single_process_element->interface~init~20 proc~single_process_element->proc~tem_levelof proc~identify_local_element identify_local_element proc~single_process_element->proc~identify_local_element proc~tem_abort tem_abort proc~single_process_element->proc~tem_abort proc~tem_find_depproc_globsearch tem_find_depProc_globSearch proc~tem_find_depproc->proc~tem_find_depproc_globsearch proc~tem_pathcomparison tem_PathComparison proc~tem_find_depproc->proc~tem_pathcomparison proc~tem_baryofid tem_BaryOfId proc~tem_tidinfo->proc~tem_baryofid proc~tem_coordofid tem_CoordOfId proc~tem_tidinfo->proc~tem_coordofid proc~tem_elemsize tem_ElemSize proc~tem_tidinfo->proc~tem_elemsize proc~tem_directparent tem_directParent interface~tem_parentof->proc~tem_directparent proc~tem_parentatlevel tem_ParentAtLevel interface~tem_parentof->proc~tem_parentatlevel interface~expand~25 expand proc~append_ga_dynlong->interface~expand~25 proc~append_ga_dynlong_vec->interface~expand~25 proc~identify_local_element->interface~append~29 proc~identify_local_element->proc~tem_levelof proc~identify_local_element->proc~tem_pathof proc~identify_local_element->proc~tem_tidinfo interface~positionofval~5 positionofval proc~identify_local_element->interface~positionofval~5 proc~add_all_virtual_children add_all_virtual_children proc~identify_local_element->proc~add_all_virtual_children proc~add_ghostfromfiner add_ghostFromFiner proc~identify_local_element->proc~add_ghostfromfiner proc~tem_posofpath tem_PosOfPath proc~identify_local_element->proc~tem_posofpath mpi_abort mpi_abort proc~tem_abort->mpi_abort proc~tem_baryofid->proc~tem_coordofid proc~tem_elemsizelevel tem_ElemSizeLevel proc~tem_baryofid->proc~tem_elemsizelevel proc~tem_coordofid->proc~tem_levelof proc~tem_elemsize->proc~tem_levelof proc~tem_elemsize->proc~tem_elemsizelevel proc~tem_find_depproc_globsearch->proc~tem_pathcomparison

Called by

proc~~identify_stencilneigh~~CalledByGraph proc~identify_stencilneigh identify_stencilNeigh proc~identify_elements identify_elements proc~identify_stencilneigh->proc~identify_elements proc~create_allparentneighbors create_allParentNeighbors proc~create_allparentneighbors->proc~identify_stencilneigh proc~create_allparentneighbors->proc~identify_elements proc~identify_elements->proc~identify_stencilneigh proc~identify_elements->proc~create_allparentneighbors proc~identify_elements->proc~identify_elements proc~request_remotehalos request_remoteHalos proc~request_remotehalos->proc~identify_stencilneigh proc~request_remotehalos->proc~create_allparentneighbors proc~build_levelelements build_levelElements proc~build_levelelements->proc~identify_elements proc~identify_additionalneigh identify_additionalNeigh proc~build_levelelements->proc~identify_additionalneigh proc~communicate_elements communicate_elements proc~communicate_elements->proc~request_remotehalos proc~identify_additionalneigh->proc~identify_elements proc~tem_find_allelements tem_find_allElements proc~tem_find_allelements->proc~build_levelelements proc~tem_find_allelements->proc~communicate_elements proc~tem_find_allelements->proc~identify_additionalneigh proc~tem_create_leveldesc tem_create_levelDesc proc~tem_create_leveldesc->proc~tem_find_allelements

Source Code

  recursive subroutine identify_stencilNeigh( iElem, iLevel, iStencil, tree,  &
    &                                         pathFirst, pathLast, levelDesc, &
    &                                         proc, stencil, nesting          )
    ! -------------------------------------------------------------------- !
    !> element position in levelDesc to identify
    integer, intent(in)                      :: iElem
    !> element level
    integer, intent(in)                      :: iLevel
    !> stencil within the element to act on
    integer, intent(in)                      :: iStencil
    !> tree information
    type(treelmesh_type), intent(in)         :: tree
    !> first treeID path in every process
    type(tem_path_type), intent(in)          :: pathFirst(:)
    !> last treeID path in every process
    type(tem_path_type), intent(in)          :: pathLast(:)
    !> the level descriptor to be filled
    type(tem_levelDesc_type), intent(inout)  :: levelDesc(tree%global%minLevel:)
    !> process
    type(tem_comm_env_type), intent(in)      :: proc
    !> current stencil definition
    type(tem_stencilHeader_type), intent(in) :: stencil
    !> nesting level
    integer, intent(in)                      :: nesting
    ! -------------------------------------------------------------------- !
    integer :: iStencilElem, elemPos
    integer :: neighIDpos
    integer(kind=long_k) :: neighID
    ! -------------------------------------------------------------------- !
    ! identify all the compute neighbors of the current element
    do iStencilElem = 1, stencil%QQN
      neighIDpos = levelDesc(iLevel)%elem%stencil%val(iElem)          &
        &                           %val(iStencil)%tIDpos(iStencilElem)
      if( neighIDpos > 0 ) then
        neighID = &
          & levelDesc( iLevel )%elem%neighID%val(iElem)%val(neighIDpos)
        ! This call might add new halo elements
        if ( neighID > 0_long_k ) then
          call identify_elements( TreeID     = neighID,   &
            &                     tree       = tree,      &
            &                     pathFirst  = pathFirst, &
            &                     pathLast   = pathLast,  &
            &                     levelDesc  = levelDesc, &
            &                     elemPos    = elemPos,   &
            &                     proc       = proc,      &
            &                     stencil    = stencil,   &
            &                     nesting    = nesting    )
        else ! neighID < 0
          elemPos = 0
        end if
      else ! neighIDpos < 0
        elemPos = 0
      end if ! neighIDpos > 0

      ! And add the encountered neighbor elements to the current element's
      ! stencil neighbors
      levelDesc(iLevel)%elem%stencil%val(iElem)              &
        &              %val(iStencil)%totalPos(iStencilElem) = elemPos
    end do

  end subroutine identify_stencilNeigh