init_quantum_fragment Subroutine

private subroutine init_quantum_fragment(this, id, nuclei, cell, density, potential)

Initialize quantum fragment

Arguments

TypeIntentOptionalAttributesName
class(quantum_fragment_type), intent(inout) :: this
integer, intent(in) :: id
type(nucleus_type), intent(in), dimension(:):: nuclei
type(cell_type), intent(in) :: cell
type(density_type), intent(in) :: density
type(potential_type), intent(in), optional :: potential

Contents

Source Code


Source Code

subroutine init_quantum_fragment(this, id, nuclei, cell, density, potential)

    class(quantum_fragment_type), intent(inout) :: this
    integer, intent(in) :: id
    type(nucleus_type), dimension(:), intent(in) :: nuclei
    type(cell_type), intent(in) :: cell
    type(density_type), intent(in) :: density
    type(potential_type), optional, intent(in) :: potential

    this%id = id
    this%num_nuclei = size(nuclei)
    allocate(this%nuclei(this%num_nuclei))
    this%nuclei = nuclei
    this%cell = cell
    this%density = density
    if (present(potential)) then
        this%potential = potential
    end if

end subroutine init_quantum_fragment