1      Subroutine hfabc(E,Sabc,NABC,La,Lb,Lc,TriDiag)
2c $Id$
3
4      Implicit real*8 (a-h,o-z)
5      Implicit integer (i-n)
6
7      Logical TriDiag
8
9      Dimension E(NABC,3,0:(La+Lb+Lc),0:La,0:Lb,0:Lc),Sabc(*)
10
11      Dimension Nxyz(3)
12c
13c Compute a block of 3-ctr OIs.
14c
15c     formula:
16c
17c              Ia,Ib,Ic   Ja,Jb,Jc   Ka,Kb,Kc
18c     Sabc = Ex         Ey         Ez
19c              0          0          0
20c
21c******************************************************************************
22
23c Define the number of shell components on each center.
24
25      La2 = ((La+1)*(La+2))/2
26      Lb2 = ((Lb+1)*(Lb+2))/2
27      Lc2 = ((Lc+1)*(Lc+2))/2
28
29c Loop over shell components.
30
31      n = 0
32
33      do 40 ica = 1,La2
34
35       call getNxyz(La,ica,Nxyz)
36
37       Ia = Nxyz(1)
38       Ja = Nxyz(2)
39       Ka = Nxyz(3)
40
41       do 30 icb = 1,Lb2
42
43        call getNxyz(Lb,icb,Nxyz)
44
45        Ib = Nxyz(1)
46        Jb = Nxyz(2)
47        Kb = Nxyz(3)
48
49        if( TriDiag )then
50         icc_lim = icb
51        else
52         icc_lim = Lc2
53        end if
54
55        do 20 icc = 1,icc_lim
56
57         call getNxyz(Lc,icc,Nxyz)
58
59         Ic = Nxyz(1)
60         Jc = Nxyz(2)
61         Kc = Nxyz(3)
62
63         n = n + 1
64
65         Sabc(n) = 0.D0
66
67         do 10 m = 1,NABC
68          Sabc(n) = Sabc(n) +
69     &             E(m,1,0,Ia,Ib,Ic)*E(m,2,0,Ja,Jb,Jc)*E(m,3,0,Ka,Kb,Kc)
70
71   10    continue
72
73   20   continue
74
75   30  continue
76
77   40 continue
78
79      end
80