Serial and local but only for the supercells || Decomp_type=1 for which we have some data
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pc_type), | intent(inout) | :: | self | |||
class(fieldmat_type), | intent(inout) | :: | fieldmat |
subroutine pc_decomp_own_serial_local(self,fieldmat)
implicit none
class(pc_type), intent(inout) :: self
class(fieldmat_type), intent(in out) :: fieldmat
integer :: ik, is, ic, ifq
integer :: nrow_tmp
logical :: have_some
!First need to work out which supercells we have part of
do ik=1,fieldmat%naky
if(.not.any(self%is_local(:,ik)==1)) cycle
do is=1,fieldmat%kyb(ik)%nsupercell
have_some=.false.
!/See if we have any parts of this supercell
do ic=1,fieldmat%kyb(ik)%supercells(is)%ncell
if(self%is_local(fieldmat%kyb(ik)%supercells(is)%cells(ic)%it_ind,ik)==1) then
have_some=.true.
endif
enddo
!/If so then make sure we mark is_local
if(have_some)then
do ic=1,fieldmat%kyb(ik)%supercells(is)%ncell
self%is_local(fieldmat%kyb(ik)%supercells(is)%cells(ic)%it_ind,ik)=1
enddo
endif
enddo
enddo
!Now we calculate how much data is available
call self%count_avail(fieldmat)
!Set the number of rows responsible
self%nresp_per_cell=self%navail_per_cell
!Now loop over all cells, setting the row_llim of
!their row blocks
do ik=1,fieldmat%naky
do is=1,fieldmat%kyb(ik)%nsupercell
nrow_tmp=fieldmat%kyb(ik)%supercells(is)%nrow
do ic=1,fieldmat%kyb(ik)%supercells(is)%ncell
do ifq=1,fieldmat%kyb(ik)%supercells(is)%cells(ic)%nrb
if(self%is_local(fieldmat%kyb(ik)%supercells(is)%cells(ic)%it_ind,ik)==1) then
fieldmat%kyb(ik)%supercells(is)%cells(ic)%rb(ifq)%row_llim=1
fieldmat%kyb(ik)%supercells(is)%cells(ic)%rb(ifq)%row_ulim=nrow_tmp
else
fieldmat%kyb(ik)%supercells(is)%cells(ic)%rb(ifq)%row_llim=0
fieldmat%kyb(ik)%supercells(is)%cells(ic)%rb(ifq)%row_ulim=0
endif
call fieldmat%kyb(ik)%supercells(is)%cells(ic)%rb(ifq)%set_nrow
enddo
enddo
enddo
enddo
end subroutine pc_decomp_own_serial_local