Initialize quantum fragment
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
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