2
c == Calculate the point nuclear potential on the grid ==
3
subroutine gridNuclearPotentialPoint(geom,
4
& natoms, ! IN : number of atoms
5
& nqpts, ! IN : number of grid points
6
& qxyz, ! IN : grid points
7
& qwght, ! IN : quadrature weightings
9
& amat_nucl) ! OUT : nuclear potential
14
#include "global.fh" ! Added for using ga_nodeid()
16
integer iatom,natoms,geom,igrid,nqpts
17
double precision nucCharge, nucCoords(3)
18
double precision qxyz(3,nqpts),qwght(nqpts)
19
character*16 tags(natoms)
21
double precision rx,ry,rz,dist
22
double precision amat_nucl(nqpts)
23
integer closegridpts(*)
25
c == get the total nuclear potential on the grid ==
26
do igrid = 1,nqpts ! == loop over the grid points ==
27
amat_nucl(igrid) = 0.d0
28
do iatom = 1,natoms ! == loop over the atoms ==
30
c == get an atom (needs error handling) ==
31
lSuccess = geom_cent_get(geom, iatom, tags, nucCoords,
34
c == distance from the grid points to the atom centers ==
35
rx = nucCoords(1) - qxyz(1,igrid)
36
ry = nucCoords(2) - qxyz(2,igrid)
37
rz = nucCoords(3) - qxyz(3,igrid)
38
dist = dsqrt(rx*rx + ry*ry + rz*rz)
39
if (dist.gt.zoracutoff) then ! == check cutoff ==
40
amat_nucl(igrid) = amat_nucl(igrid) -
43
closegridpts(igrid) = igrid
50
c == Finite nucleus 1 ==
51
subroutine gridNuclearPotentialFinite(
53
& natoms, ! IN : number of atoms
54
& nqpts, ! IN : number of grid points
55
& qxyz, ! IN : grid points
56
& qwght, ! IN : quadrature weightings
57
& zetanuc_arr, ! IN : sqrt(zetanuc) for Gaussian Nuclear Model
59
& amat_nucl) ! OUT : nuclear potential
61
c Evaluates: V_L^{Gauss}(r) = \sum_L -Z_L/r_L erf(\tilde{r}_L)
62
c \tilde{r}_L = srqt(zetanuc) r_L
64
c r_N , nuclear position
66
c according to: Autschbach, J. ChemPhysChem 2009,V10,P 22774-2283
68
c Author: Fredy W. Aquino
75
#include "global.fh" ! Added for using ga_nodeid()
77
integer iatom,natoms,geom,igrid,nqpts
78
double precision nucCharge, nucCoords(3)
79
double precision qxyz(3,nqpts),qwght(nqpts),
81
character*16 tags(natoms)
83
double precision rx,ry,rz,dist
84
double precision amat_nucl(nqpts),
85
& zetanuc_arr(natoms),erf
86
integer closegridpts(*)
88
external merf,get_zetanuc_arr
89
do igrid = 1,nqpts ! == loop over the grid points ==
90
amat_nucl(igrid) = 0.d0
91
do iatom = 1,natoms ! == loop over the atoms ==
92
c == get an atom (needs error handling) ==
93
lSuccess = geom_cent_get(geom, iatom, tags, nucCoords,
95
c == distance from the grid points to the atom centers ==
96
rx = nucCoords(1) - qxyz(1,igrid)
97
ry = nucCoords(2) - qxyz(2,igrid)
98
rz = nucCoords(3) - qxyz(3,igrid)
99
dist = dsqrt(rx*rx + ry*ry + rz*rz)
100
rtemp = zetanuc_arr(iatom)*dist
101
call merf(rtemp,erf) ! Evaluate erf(sqrt(zetanuc)r_L)
102
if (dist.gt.zoracutoff) then ! == check cutoff ==
103
amat_nucl(igrid) = amat_nucl(igrid) -
106
closegridpts(igrid) = igrid
108
end do ! end-loop-iatom
109
end do ! end-loop-igrid
113
c == Finite nucleus 2 ==
114
subroutine gridNuclearPotentialFinite2(
116
& natoms, ! IN : number of atoms
117
& nqpts, ! IN : number of grid points
118
& qxyz, ! IN : grid points
119
& qwght, ! IN : quadrature weightings
121
& amat_nucl) ! OUT : nuclear potential
122
c Evaluates: V_L^{Gauss}(r) = - Z_L/r_L P(1/2,\tilde{r}_L^2)
123
c \tilde{r}_L = srqt(zetanuc) r_L
125
c r_N , nuclear position
127
c according to: Autschbach, J. ChemPhysChem 2009,V10,P 22774-2283
129
c Author: Fredy W. Aquino
135
integer iatom,natoms,geom,igrid,nqpts
136
double precision nucCharge, nucCoords(3)
137
double precision qxyz(3,nqpts),qwght(nqpts)
138
character*16 tags(natoms)
140
double precision rx,ry,rz,dist
141
double precision amat_nucl(nqpts),
142
& zetanuc_arr(natoms)
143
double precision a_coeff,rtemp,gammap,gammaq
144
integer closegridpts(*)
146
external gratio, ! Evaluates Incomplete Gamma Function P(a,x)
149
call get_zetanuc_arr(geom,natoms,zetanuc_arr) ! zetanuc_arr(i) i=1,natoms
152
do igrid = 1,nqpts ! == loop over the grid points ==
153
amat_nucl(igrid) = 0.d0
154
do iatom = 1,natoms ! == loop over the atoms ==
155
c == get an atom (needs error handling) ==
156
lSuccess = geom_cent_get(geom, iatom, tags, nucCoords,
158
c == distance from the grid points to the atom centers ==
159
rx = nucCoords(1) - qxyz(1,igrid)
160
ry = nucCoords(2) - qxyz(2,igrid)
161
rz = nucCoords(3) - qxyz(3,igrid)
162
dist = dsqrt(rx*rx + ry*ry + rz*rz)
163
rtemp = real(zetanuc_arr(iatom)*dist*dist)
164
call gratio(a_coeff,rtemp,gammap,gammaq,0)! Evaluate P(1/2,zetanuc r_L^2)
165
if (dist.gt.zoracutoff) then ! == check cutoff ==
166
amat_nucl(igrid) = amat_nucl(igrid) -
167
& nucCharge/dist*gammap
169
closegridpts(igrid) = igrid
171
end do ! end-loop-iatom
172
end do ! end-loop-igrid
175
c $Id: gridNuclearPotential.F 21488 2011-11-09 22:17:38Z niri $