fm_prepare Subroutine

private subroutine fm_prepare(self)

Prepare the field matrix for calculating field updates

Type Bound

fieldmat_type

Arguments

Type IntentOptional Attributes Name
class(fieldmat_type), intent(inout) :: self

Contents

Source Code


Source Code

  subroutine fm_prepare(self)
    implicit none
    class(fieldmat_type), intent(inout) :: self
    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)
    enddo
  end subroutine fm_prepare