pc_find_locality Subroutine

private subroutine pc_find_locality(self)

Work out which cells are local

Type Bound

pc_type

Arguments

Type IntentOptional Attributes Name
class(pc_type), intent(inout) :: self

Contents

Source Code


Source Code

  subroutine pc_find_locality(self)
    use gs2_layouts, only: gf_lo, ik_idx, it_idx
    use mp, only: sum_allreduce
    implicit none
    class(pc_type),intent(inout) :: self
    integer :: it,ik,igf

    !Initialise
    self%is_local=0

    do igf=gf_lo%llim_proc,gf_lo%ulim_proc
       ik=ik_idx(gf_lo,igf)
       it=it_idx(gf_lo,igf)
       self%is_local(it,ik)=1
    enddo

    !Now count how many procs have each cell
    self%nproc_per_cell=self%is_local
    call sum_allreduce(self%nproc_per_cell)
  end subroutine pc_find_locality