Prepare the field matrix for calculating field updates
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fieldmat_type), | intent(inout) | :: | self | |||
class(pc_type), | intent(in) | :: | pc |
subroutine fm_prepare(self, pc)
implicit none
class(fieldmat_type), intent(inout) :: self
class(pc_type), intent(in) :: pc
integer :: ik
!Exit early if we're empty
if(self%is_empty) return
if(.not.self%is_local) return
if(self%no_prepare) return
!Tell each ky to prepare
!This might be a good place to add OpenMP as each prepare (inversion)
!has the potential to be quite slow. However, as the cost per inversion
!can be quite variable (due to very variable length supercell domains)
!it may make more sense to OpenMP at the next level down (i.e. the kyb)
!so we're more likely to be sharing work a bit more fairly. Also, at scale
!one might expect most of the ky to be "empty" on a given processor.
do ik=1,self%naky
call self%kyb(ik)%prepare(self%prepare_type, pc)
enddo
end subroutine fm_prepare