Prepare the field matrix for calculating field updates
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ky_type), | intent(inout) | :: | self | |||
integer, | intent(in) | :: | prepare_type | |||
class(pc_type), | intent(in) | :: | pc |
subroutine ky_prepare(self,prepare_type,pc)
implicit none
class(ky_type), intent(inout) :: self
integer, intent(in) :: prepare_type
class(pc_type), intent(in) :: pc
integer :: is
!Exit early if we're empty
if(self%is_empty) return
if(.not.self%is_local) return
!Tell each supercell to prepare
! This might be a good place to add OpenMP pragmas
! however it's possible that this could increase peak
! memory consumption due to now having to hold
! multiple matrices in memory at once, thereby
! potentially negating some of the benefit of using OpenMP
! to get more memory per process. More testing would
! be required to explore this further.
do is=1,self%nsupercell
call self%supercells(is)%prepare(prepare_type, pc)
enddo
end subroutine ky_prepare