1      Subroutine hfnai_er(ncenters,E,R0C,IJK,Vab,Nint,NPP,
2     &     La,Lb,Li,Lp,Lp3,canAB)
3c $Id$
4
5      Implicit real*8 (a-h,o-z)
6      Implicit integer (i-n)
7
8      Logical canAB
9
10c--> Hermite Linear Expansion Coefficients
11
12      Dimension E(3,NPP,0:((La+Li)+(Lb+Li)),0:(La+Li),0:(Lb+Li))
13
14c--> Auxiliary Function Integrals & Index
15
16      Dimension R0C(ncenters,NPP,Lp3),IJK(0:Lp,0:Lp,0:Lp)
17
18c--> Nuclear Attraction Integrals
19
20      Dimension Vab(ncenters,Nint)
21
22c--> Scratch Space
23
24      Dimension Nxyz(3)
25c
26c Compute the nuclear attraction integrals.
27c
28c     formula:
29c           __
30c           \    Ia,Ib    Ja,Jb    Ka,Kb
31c     Vab = /  Ex     * Ey     * Ez     * R
32c           --   Ip       Jp       Kp      Ip,Jp,Kp
33c        Ip,Jp,Kp
34c
35c******************************************************************************
36
37c Initialize the block of NAIs.
38      do 10 nn = 1,Nint
39      do 10 ic=1,ncenters
40       Vab(ic,nn) = 0.D0
41   10 continue
42
43c Define the number of shell components on each center.
44
45      La2 = ((La+1)*(La+2))/2
46      Lb2 = ((Lb+1)*(Lb+2))/2
47
48c Loop over shell components.
49
50      nn = 0
51
52      do 50 ma = 1,La2
53
54c Define the angular momentum indices for shell "A".
55
56       call getNxyz(La,ma,Nxyz)
57
58       Ia = Nxyz(1)
59       Ja = Nxyz(2)
60       Ka = Nxyz(3)
61
62       if( canAB )then
63        mb_limit = ma
64       else
65        mb_limit = Lb2
66       end if
67
68       do 40 mb = 1,mb_limit
69
70c Define the angular momentum indices for shell "B".
71
72        call getNxyz(Lb,mb,Nxyz)
73
74        Ib = Nxyz(1)
75        Jb = Nxyz(2)
76        Kb = Nxyz(3)
77
78        nn = nn + 1
79
80        do 30 Ip = 0,Ia+Ib
81        do 30 Jp = 0,Ja+Jb
82        do 30 Kp = 0,Ka+Kb
83
84         np = IJK(Ip,Jp,Kp)
85
86         do 20 mp = 1,NPP
87           fact=E(1,mp,Ip,Ia,Ib)*E(2,mp,Jp,Ja,Jb)*E(3,mp,Kp,Ka,Kb)
88           call daxpy(ncenters,fact,R0C(1,mp,np),1,Vab(1,nn),1)
89   20    continue
90
91   30   continue
92
93   40  continue
94
95   50 continue
96
97      end
98