imptorsion_potential Subroutine

public subroutine imptorsion_potential(bds, V)

Uses

  • proc~~imptorsion_potential~~UsesGraph proc~imptorsion_potential imptorsion_potential module~mod_constants mod_constants proc~imptorsion_potential->module~mod_constants iso_c_binding iso_c_binding module~mod_constants->iso_c_binding

Compute torsion potential

Arguments

Type IntentOptional Attributes Name
type(ommp_bonded_type), intent(in) :: bds
real(kind=rp), intent(inout) :: V

improper torsion potential, result will be added to V


Called by

proc~~imptorsion_potential~~CalledByGraph proc~imptorsion_potential imptorsion_potential proc~ommp_get_imptorsion_energy ommp_get_imptorsion_energy proc~ommp_get_imptorsion_energy->proc~imptorsion_potential proc~ommp_get_full_bnd_energy ommp_get_full_bnd_energy proc~ommp_get_full_bnd_energy->proc~imptorsion_potential proc~c_ommp_get_imptorsion_energy C_ommp_get_imptorsion_energy proc~c_ommp_get_imptorsion_energy->proc~ommp_get_imptorsion_energy program~test_si_potential test_SI_potential program~test_si_potential->proc~ommp_get_imptorsion_energy proc~ommp_get_full_energy ommp_get_full_energy proc~ommp_get_full_energy->proc~ommp_get_full_bnd_energy proc~c_ommp_get_full_bnd_energy C_ommp_get_full_bnd_energy proc~c_ommp_get_full_bnd_energy->proc~ommp_get_full_bnd_energy proc~c_ommp_get_full_energy C_ommp_get_full_energy proc~c_ommp_get_full_energy->proc~ommp_get_full_energy

Contents

Source Code


Source Code

    subroutine imptorsion_potential(bds, V)
        !! Compute torsion potential
        use mod_constants, only: pi, eps_rp

        implicit none

        type(ommp_bonded_type), intent(in) :: bds
        ! Bonded potential data structure
        real(rp), intent(inout) :: V
        !! improper torsion potential, result will be added to V
        real(rp) :: thet, costhet
        integer(ip) :: i, j
        
        if(.not. bds%use_imptorsion) return
        
        do i=1, bds%nimptorsion
            ! Atoms that defines the dihedral angle
            costhet = cos_torsion(bds%top, bds%imptorsionat(:,i))
            
            if(costhet + 1.0 <= eps_rp) then
                thet = pi
            else
                thet = acos(costhet)
            end if
            
            do j=1, 3
                if(bds%imptorsn(j,i) < 1) exit
                V = V + bds%imptorsamp(j,i) * (1+cos(real(bds%imptorsn(j,i))*thet &
                                            - bds%imptorsphase(j,i)))
            end do
        end do

    end subroutine imptorsion_potential