Work out which cells are local
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pc_type), | intent(inout) | :: | self |
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