@@ -17,7 +17,7 @@ subroutine dip(uDip, P_density)
17
17
18
18
use garcha_mod , only: NCO, Nunp, Iz, r, pc, d, natom, nsol
19
19
use basis_data , only: a, c, Nuc, ncont, M, nshell, norm
20
- use constants_mod, only: pi32, pi5
20
+ use constants_mod, only: pi32
21
21
22
22
implicit none
23
23
double precision , intent (in ) :: P_density(M* (M+1 )/ 2 )
@@ -27,7 +27,7 @@ subroutine dip(uDip, P_density)
27
27
aux6(3 ), srs(3 ), Q(3 ), uDipAt(3 )
28
28
double precision :: sq3, alf, alf2, cc, cCoef, dd, dp, dijs, f1, f2, &
29
29
factor, z2, zij, Qc, ps, pis, pjs, ss, t0, t1
30
- integer :: M2, ns, np, nd, i, j, k, ii, jj, l1, l2, l3, l4, l12, l34, n, &
30
+ integer :: M2, ns, np, nd, i, j, k, ii, jj, l1, l2, l3, l4, l12, l34, &
31
31
ni, nj, iCrd, nElec
32
32
33
33
! Constants
@@ -50,8 +50,7 @@ subroutine dip(uDip, P_density)
50
50
alf = a(i,ni) * a(j,nj) / zij
51
51
ss = pi32 * exp (- alf* dd) / (zij* sqrt (zij))
52
52
k = i + ((M2- j) * (j-1 )) / 2
53
- cCoef = c(i,ni) * c(j,nj)
54
- cc = cCoef * P_density(k)
53
+ cc = c(i,ni) * c(j,nj) * P_density(k)
55
54
do iCrd = 1 , 3
56
55
Q(iCrd) = (a(i,ni) * r(Nuc(i),iCrd) &
57
56
+ a(j,nj) * r(Nuc(j),iCrd)) / zij
@@ -165,12 +164,9 @@ subroutine dip(uDip, P_density)
165
164
cCoef= c(i,ni)* c(j,nj)
166
165
167
166
do l1 = 1 , 3
168
- t1= Q(l1)- r(Nuc(i),l1)
169
- ps= ss* t1
170
- aux(1 )= t1* srs(1 )
171
- aux(2 )= t1* srs(2 )
172
- aux(3 )= t1* srs(3 )
173
- aux(l1)= aux(l1)+ ss/ z2
167
+ ps = ss * t1
168
+ aux = (Q(l1) - r(Nuc(i),l1)) * srs
169
+ aux(l1) = aux(l1) + ss / z2
174
170
175
171
do l2 = 1 , l1
176
172
t1 = Q(l2) - r(Nuc(i),l2)
@@ -404,9 +400,9 @@ subroutine dip(uDip, P_density)
404
400
uDipAt(3 ) = uDipAt(3 ) + Iz(i)* r(i,3 )
405
401
enddo
406
402
407
- Qc= Qc - nElec
403
+ Qc = Qc - nElec
408
404
if (Nsol > 0 ) then
409
- do k= 1 , Nsol
405
+ do k = natom +1 , natom + Nsol
410
406
Qc = Qc + pc(k)
411
407
enddo
412
408
endif
@@ -416,8 +412,8 @@ subroutine dip(uDip, P_density)
416
412
! center of charge (important in Reaction Field calculations). For neutral !
417
413
! systems this is not necessary. !
418
414
419
- factor = (Qc + nElec)/ nElec
420
- uDip = (uDipAt - uDip* factor) * 2.54D0
415
+ factor = (Qc + nElec) / nElec
416
+ uDip = (uDipAt - uDip * factor) * 2.54D0
421
417
422
418
return
423
419
end subroutine dip
0 commit comments