Initialize array used in calculation of bond stratching terms of potential energy
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ommp_bonded_type) | :: | bds | ||||
integer(kind=ip) | :: | n |
Number of bond stretching functions in the potential energy of the system |
subroutine bond_init(bds, n)
!! Initialize array used in calculation of bond stratching terms of
!! potential energy
use mod_memory, only: mallocate
implicit none
type(ommp_bonded_type) :: bds
! Bonded potential data structure
integer(ip) :: n
!! Number of bond stretching functions in the potential
!! energy of the system
if( n < 1 ) return
bds%use_bond = .true.
call mallocate('bond_init [bondat]', 2_ip, n, bds%bondat)
call mallocate('bond_init [kbond]', n, bds%kbond)
call mallocate('bond_init [l0bond]', n, bds%l0bond)
bds%nbond = n
bds%bond_cubic = 0.0_rp
bds%bond_quartic = 0.0_rp
end subroutine bond_init