Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anisotropic polarizabilities #34

Open
wants to merge 3 commits into
base: release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions source/analyze.f
Original file line number Diff line number Diff line change
Expand Up @@ -1183,12 +1183,14 @@ subroutine paramyze (active)
header = .false.
write (iout,740)
740 format (/,' Dipole Polarizability Parameters :',
& //,10x,'Atom Number',5x,'Alpha',5x,'Damp',
& //,9x,'Atom Number',4x,'Alpha xx',2x,
& 'Alpha yy',2x,'Alpha zz',3x,'Damp',
& 6x,'Polarization Group',/)
end if
write (iout,750) i,ia,polarity(i),thole(i),
write (iout,750) i,ia,polarity(1,i),polarity(2,i),
& polarity(3,i), thole(i),
& (ip11(j,ia),j=1,np11(ia))
750 format (i6,3x,i6,6x,f10.4,f9.3,3x,120i6)
750 format (i6,3x,i6,6x,3f10.4,f9.3,3x,20i6)
end if
end do
end if
Expand Down Expand Up @@ -2403,10 +2405,12 @@ subroutine amberyze (active)
header = .false.
write (iout,730)
730 format (/,' Dipole Polarizability Parameters :',
& //,10x,'Atom Number',9x,'Alpha',8x,
& //,10x,'Atom Number',9x,'Alpha xx',8x,
& 'Alpha yy',4x, 'Alpha zz',4x,
& 'Polarization Group',/)
end if
write (iout,740) i,ia,polarity(i),
write (iout,740) i,ia,polarity(1,i),polarity(2,i),
& polarity(3,i),
& (ip11(j,ia),j=1,np11(ia))
740 format (i6,3x,i6,10x,f10.4,5x,20i6)
end if
Expand Down
23 changes: 11 additions & 12 deletions source/epolar.f
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,7 @@ subroutine epolar0e
use potent
use units
implicit none
integer i,j,ii
integer i,j,ii,m
real*8 e,f,fi,term
real*8 xd,yd,zd
real*8 xu,yu,zu
Expand Down Expand Up @@ -1660,20 +1660,17 @@ subroutine epolar0e
c OpenMP directives for the major loop structure
c
!$OMP PARALLEL default(private)
!$OMP& shared(npole,polarity,f,uind,udirp,ep)
!$OMP& shared(npole,rpolarityinv,f,uind,udirp,ep)
!$OMP DO reduction(+:ep) schedule(guided)
c
c get polarization energy via induced dipoles times field
c
do i = 1, npole
if (polarity(i) .ne. 0.0d0) then
fi = f / polarity(i)
e = 0.0d0
do j = 1, 3
e = fi * uind(j,i) * udirp(j,i)
ep = ep + e
do j = 1, 3
do m = 1, 3
ep = ep + f * uind(j,i) * udirp(m,i) * rpolarityinv(m,j,i)
end do
end if
end do
end do
c
c OpenMP directives for the major loop structure
Expand Down Expand Up @@ -1759,7 +1756,7 @@ subroutine eprecip
integer m1,m2,m3
integer ntot,nff
integer nf1,nf2,nf3
real*8 e,r1,r2,r3
real*8 e,r1,r2,r3,f
real*8 h1,h2,h3
real*8 volterm,denom
real*8 hsq,expterm
Expand All @@ -1769,6 +1766,7 @@ subroutine eprecip
real*8, allocatable :: fuind(:,:)
real*8, allocatable :: fuinp(:,:)
c
f = electric / dielec
c
c return if the Ewald coefficient is zero
c
Expand Down Expand Up @@ -1890,7 +1888,7 @@ subroutine eprecip
call fphi_mpole (fphi)
do i = 1, npole
do j = 1, 20
fphi(j,i) = electric * fphi(j,i)
fphi(j,i) = f * fphi(j,i)
end do
end do
end if
Expand Down Expand Up @@ -1926,7 +1924,7 @@ subroutine eprecip
if (.not. use_bounds) then
expterm = 0.5d0 * pi / xbox
struc2 = qgrid(1,1,1,1)**2 + qgrid(2,1,1,1)**2
e = 0.5d0 * electric * expterm * struc2
e = 0.5d0 * f * expterm * struc2
ep = ep + e
end if
c
Expand All @@ -1939,6 +1937,7 @@ subroutine eprecip
e = e + fuind(k,i)*fphi(k+1,i)
end do
end do
c e = 0.5d0 * f * e
e = 0.5d0 * e
ep = ep + e
c
Expand Down
Loading