Work out how many rows are available in each cell
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pc_type), | intent(inout) | :: | self | |||
class(fieldmat_type), | intent(in) | :: | fieldmat |
subroutine pc_count_avail(self, fieldmat)
use kt_grids, only: ntheta0, naky
implicit none
class(pc_type),intent(inout) :: self
class(fieldmat_type), intent(in) :: fieldmat
integer :: it,ik,is
!Initialise
self%navail_per_cell=0
!Loop over cells
do ik=1,naky
do it=1,ntheta0
!If cell isn't local then cycle
if(self%is_local(it,ik)/=1) cycle
!Now find the supercell object with this it,ik
do is=1,fieldmat%kyb(ik)%nsupercell
!If this supercell has the it then store the
!size of the supercell and exit loop
if(fieldmat%kyb(ik)%supercells(is)%has_it(it)) then
self%navail_per_cell(it,ik)=fieldmat%kyb(ik)%supercells(is)%nrow
exit
endif
enddo
enddo
enddo
!Set the total number of responsible rows
self%navail_tot=sum(self%navail_per_cell)
end subroutine pc_count_avail