ky_prepare Subroutine

private subroutine ky_prepare(self, prepare_type)

Prepare the field matrix for calculating field updates

Type Bound

ky_type

Arguments

Type IntentOptional Attributes Name
class(ky_type), intent(inout) :: self
integer, intent(in) :: prepare_type

Contents

Source Code


Source Code

  subroutine ky_prepare(self,prepare_type)
    implicit none
    class(ky_type), intent(inout) :: self
    integer, intent(in) :: prepare_type
    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)
    enddo
  end subroutine ky_prepare