-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhf3OIs.f
154 lines (98 loc) · 3.71 KB
/
hf3OIs.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
Subroutine hf3OIs(Axyz,Aprims,Acoef,NPA,La,
& Bxyz,Bprims,Bcoef,NPB,Lb,
& Cxyz,Cprims,Ccoef,NPC,Lc,
& b3OI,Nint,TriDiag,
& DryRun,W0,maxW0)
c $Id$
Implicit real*8 (a-h,o-z)
Implicit integer (i-n)
Logical TriDiag,DryRun
c--> Cartesian Coordinates, Primitives & Contraction Coefficients
Dimension Axyz(3),Aprims(NPA),Acoef(NPA)
Dimension Bxyz(3),Bprims(NPB),Bcoef(NPB)
Dimension Cxyz(3),Cprims(NPC),Ccoef(NPC)
c--> Block of 3-Center Overlap Integrals
Dimension b3OI(Nint)
c--> Scratch Space.
Dimension W0(maxW0)
c
c Compute 3-ctr overlap integrals (3OIs) for three shells of contracted
c Gaussians functions.
c
c******************************************************************************
c Define the prefactor of the charge distribution.
c Assign pointers to scratch space.
i_alpha = 1
i_top = i_alpha + (NPA*NPB*NPC)*4 - 1
if((i_top.gt.maxW0).and.(.not.Dryrun))then
write(*,*) 'HF3CTR: Insufficient scratch space.'
write(*,*) ' needed ',i_top
write(*,*) ' allocated ',maxW0
write(*,*) 'alpha : ',i_alpha
write(*,*) 'if you get this error doing higher multipoles with',
& 'a small basis set, try modifying NWints/api/exact_mem.F:279' ! Jeff
stop
end if
MaxMem = i_top ! take care of compiler warnings
if( DryRun )then
MaxMem = i_top
NABC = NPA*NPB*NPC
else
call hf1set3(Axyz,Aprims,Acoef,NPA,
& Bxyz,Bprims,Bcoef,NPB,
& Cxyz,Cprims,Ccoef,NPC,
& W0(i_alpha),NABC)
end if
c Define the center of the charge distribution.
c Assign pointers to scratch space.
i_E = i_alpha + NABC*4
i_G = i_E + NABC*3*(La+Lb+Lc+1)*(La+1)*(Lb+1)*(Lc+1)
i_top = i_G + NABC*3 - 1
if((i_top.gt.maxW0).and.(.not.Dryrun)) then
write(*,*) 'HF3CTR: Insufficient scratch space.'
write(*,*) ' needed ',i_top
write(*,*) ' allocated ',maxW0
write(*,*) 'alpha : ',i_alpha
write(*,*) 'E : ',i_E
write(*,*) 'G : ',i_G
write(*,*) 'if you get this error doing higher multipoles with',
& 'a small basis set, try modifying NWints/api/exact_mem.F:279' ! Jeff
stop
end if
if( DryRun )then
MaxMem = max( MaxMem, i_top )
else
call hfctr3(Axyz,Bxyz,Cxyz,W0(i_alpha),W0(i_G),NABC)
end if
c Define the Hermite linear expansion coefficients.
c Assign pointers to scratch space.
i_GT = i_G + NABC*3
i_ABC2I = i_GT + NABC*3
i_top = i_ABC2I + NABC*3 - 1
if( i_top .gt. maxW0 .and. .not.Dryrun)then
write(*,*) 'HF3CTR: Insufficient scratch space.'
write(*,*) ' needed ',i_top
write(*,*) ' allocated ',maxW0
write(*,*) 'alpha : ',i_alpha
write(*,*) 'E : ',i_E
write(*,*) 'G : ',i_G
write(*,*) 'GT : ',i_GT
write(*,*) 'ABC2I : ',i_ABC2I
write(*,*) 'if you get this error doing higher multipoles with',
& 'a small basis set, try modifying NWints/api/exact_mem.F:279' ! Jeff
stop
end if
if( DryRun )then
MaxMem = max( MaxMem, i_top )
else
call hf1mke3(Axyz,Bxyz,Cxyz,W0(i_alpha),W0(i_G),W0(i_GT),
& W0(i_ABC2I),W0(i_E),NABC,La,Lb,Lc)
end if
c Return the maximum amount of scratch space required by a "dry run".
if( DryRun )then
maxW0 = MaxMem
return
end if
c Compute the 3-ctr OIs.
call hfabc(W0(i_E),b3OI,NABC,La,Lb,Lc,TriDiag)
end