Initialize arrays used in calculation of angle bending functions
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ommp_bonded_type), | intent(inout) | :: | bds | |||
integer(kind=ip) | :: | n |
Number of angle bending functions in the potential energy of the system |
subroutine angle_init(bds, n)
!! Initialize arrays used in calculation of angle bending functions
use mod_memory, only: mallocate
implicit none
type(ommp_bonded_type), intent(inout) :: bds
! Bonded potential data structure
integer(ip) :: n
!! Number of angle bending functions in the potential
!! energy of the system
if( n < 1 ) return
bds%use_angle = .true.
call mallocate('angle_init [angleat]', 3, n, bds%angleat)
call mallocate('angle_init [anglety]', n, bds%anglety)
call mallocate('angle_init [angauxat]', n, bds%angauxat)
call mallocate('angle_init [kangle]', n, bds%kangle)
call mallocate('angle_init [eqangle]', n, bds%eqangle)
bds%nangle = n
bds%angauxat = 0
bds%angle_cubic = 0.0_rp
bds%angle_quartic = 0.0_rp
bds%angle_pentic = 0.0_rp
bds%angle_sextic = 0.0_rp
end subroutine angle_init