tem_comm_count Subroutine

public subroutine tem_comm_count(me, comm_size, nHalos)

Allocate tem_communication_type and its variables

Arguments

Type IntentOptional Attributes Name
type(tem_communication_type), intent(inout) :: me
integer, intent(in) :: comm_size

communicator size

integer, intent(in) :: nHalos(comm_size)

number of halos for each other processes


Called by

proc~~tem_comm_count~~CalledByGraph proc~tem_comm_count tem_comm_count proc~communicate_nelemstotransfer communicate_nElemsToTransfer proc~communicate_nelemstotransfer->proc~tem_comm_count proc~communicate_elements communicate_elements proc~communicate_elements->proc~communicate_nelemstotransfer proc~tem_find_allelements tem_find_allElements proc~tem_find_allelements->proc~communicate_elements proc~tem_create_leveldesc tem_create_levelDesc proc~tem_create_leveldesc->proc~tem_find_allelements

Contents

Source Code


Source Code

  subroutine tem_comm_count( me, comm_size, nHalos )
    ! -------------------------------------------------------------------- !
    type( tem_communication_type ), intent(inout) :: me
    !> communicator size
    integer, intent(in) :: comm_size
    !> number of halos for each other processes
    integer, intent(in) :: nHalos( comm_size )
    ! -------------------------------------------------------------------- !
    integer :: iPartner, iProc
    ! -------------------------------------------------------------------- !

    iPartner = 0
    do iProc = 1, comm_size
      if( nHalos( iProc ) > 0 ) then
        ! Store the processes numbers to receive from
        iPartner = iPartner + 1
        me%nElemsProc( iPartner ) = nHalos( iProc )
        me%proc( iPartner )       = iProc - 1
      end if
    end do

  end subroutine tem_comm_count