tortor_potential Subroutine

public subroutine tortor_potential(bds, V)

Uses

  • proc~~tortor_potential~~UsesGraph proc~tortor_potential tortor_potential module~mod_utils mod_utils proc~tortor_potential->module~mod_utils module~mod_constants mod_constants module~mod_utils->module~mod_constants module~mod_memory mod_memory module~mod_utils->module~mod_memory iso_c_binding iso_c_binding module~mod_constants->iso_c_binding module~mod_memory->module~mod_constants module~mod_memory->iso_c_binding module~mod_io mod_io module~mod_memory->module~mod_io module~mod_io->module~mod_constants

Compute torsion potential

Arguments

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

torsion potential, result will be added to V


Calls

proc~~tortor_potential~~CallsGraph proc~tortor_potential tortor_potential proc~ang_torsion ang_torsion proc~tortor_potential->proc~ang_torsion proc~compute_bicubic_interp compute_bicubic_interp proc~tortor_potential->proc~compute_bicubic_interp

Called by

proc~~tortor_potential~~CalledByGraph proc~tortor_potential tortor_potential proc~ommp_get_tortor_energy ommp_get_tortor_energy proc~ommp_get_tortor_energy->proc~tortor_potential proc~ommp_get_full_bnd_energy ommp_get_full_bnd_energy proc~ommp_get_full_bnd_energy->proc~tortor_potential proc~c_ommp_get_tortor_energy C_ommp_get_tortor_energy proc~c_ommp_get_tortor_energy->proc~ommp_get_tortor_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~ommp_get_full_energy ommp_get_full_energy proc~ommp_get_full_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 tortor_potential(bds, V)
        !! Compute torsion potential

        use mod_utils, only: compute_bicubic_interp

        implicit none

        type(ommp_bonded_type), intent(in) :: bds
        ! Bonded potential data structure
        real(rp), intent(inout) :: V
        !! torsion potential, result will be added to V
        real(rp) :: thetx, thety, vtt, dvttdx, dvttdy

        integer(ip) :: i, j, iprm, ibeg, iend

        if(.not. bds%use_tortor) return
        
        !$omp parallel do default(shared) reduction(+:V) &
        !$omp private(i,iprm,ibeg,j,iend,thetx,thety,vtt,dvttdx,dvttdy)
        do i=1, bds%ntortor
            ! Atoms that defines the two angles
            iprm = bds%tortorprm(i)
            ibeg = 1
            do j=1, iprm-1
                ibeg = ibeg + bds%ttmap_shape(1,j)*bds%ttmap_shape(2,j)
            end do
            iend = ibeg + bds%ttmap_shape(1,iprm)*bds%ttmap_shape(2,iprm) - 1
           
            thetx = ang_torsion(bds%top, bds%tortorat(1:4,i))
            thety = ang_torsion(bds%top, bds%tortorat(2:5,i))
           
            call compute_bicubic_interp(thetx, thety, vtt, &
                                        dvttdx, dvttdy, &
                                        bds%ttmap_shape(1,iprm), &
                                        bds%ttmap_shape(2,iprm), &
                                        bds%ttmap_ang1(ibeg:iend), &
                                        bds%ttmap_ang2(ibeg:iend), &
                                        bds%ttmap_v(ibeg:iend), &
                                        bds%ttmap_vx(ibeg:iend), &
                                        bds%ttmap_vy(ibeg:iend), &
                                        bds%ttmap_vxy(ibeg:iend))

            V = V + vtt
        end do

    end subroutine tortor_potential