sc_prepare Subroutine

private subroutine sc_prepare(self, prepare_type, pc)

Uses

Prepare the field matrix for calculating field updates

Type Bound

supercell_type

Arguments

Type IntentOptional Attributes Name
class(supercell_type), intent(inout) :: self
integer, intent(in) :: prepare_type
class(pc_type), intent(in) :: pc

Contents

Source Code


Source Code

  subroutine sc_prepare(self,prepare_type,pc)
    use mp, only: mp_abort
    implicit none
    class(supercell_type), intent(inout) :: self
    class(pc_type), intent(in) :: pc
    integer, intent(in) :: prepare_type
    character (len=40) :: errmesg

    !Exit early if we're empty
    if(self%is_empty) return
    if(.not.self%is_local) return

    !Need to decide what method we're using to prepare the
    !field matrix
    select case(prepare_type)
    case(0) !Invert
       call self%invert(pc)
    case default
       write(errmesg,'("ERROR: Invalid prepare_type : ",I0)') prepare_type
       call mp_abort(trim(errmesg))
    end select

    ! Now dump the matrix
    if (dump_response) call self%dump_to_file
  end subroutine sc_prepare