intialize fragment
calculate fragment charge (perhaps test for closeness to integer)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fragment_type), | intent(inout) | :: | this | |||
integer, | intent(in) | :: | id | |||
type(atom_type), | intent(in), | dimension(:), target | :: | atoms |
subroutine init_fragment(this, id, atoms)
class(fragment_type), intent(inout) :: this
integer, intent(in) :: id
type(atom_type), dimension(:), target, intent(in) :: atoms
integer :: i
this%id = id
this%num_atoms = size(atoms)
this%atoms => atoms
this%charge = 0.0_dp
do i = 1, this%num_atoms
this%charge = this%charge + this%atoms(i)%charge
end do
end subroutine init_fragment