-
Notifications
You must be signed in to change notification settings - Fork 13
/
pckao.f
executable file
·135 lines (122 loc) · 3.02 KB
/
pckao.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
! This file is part of stda.
!
! Copyright (C) 2013-2019 Stefan Grimme
!
! stda is free software: you can redistribute it and/or modify it under
! the terms of the GNU Lesser General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! stda is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU Lesser General Public License for more details.
!
! You should have received a copy of the GNU Lesser General Public License
! along with stda. If not, see <https://www.gnu.org/licenses/>.
!
SUBROUTINE pckao(NPR,NAO,A,B)
use stdacommon
IMPLICIT REAL*8(A-H,O-Z)
integer*8 ij,kl,k,iaa,iii
dimension a(*),b(*)
if(nao.eq.0) then
k=0
do i=1,npr
do j=1,i
k=k+1
b(k)=a(k)
enddo
enddo
return
endif
ij=nao
ij=ij*(ij+1)/2
b(1:ij)=0.0d0
kl=0
do i=1,npr
iai=ipao(i)
c1=cxip(i)
do j=1,i-1
kl=kl+1
c2=cxip(j)
iaj=ipao(j)
iaa=max(iaj,iai)
iii=min(iaj,iai)
ij=iii+iaa*(iaa-1)/2
b(ij)=b(ij)+a(kl)*c1*c2*2.0d0
enddo
kl=kl+1
ij=iai
ij=ij+ij*(ij-1)/2
b(ij)=b(ij)+a(kl)*c1*c1
enddo
ij=0
do i=1,nao
do j=1,i-1
ij=ij+1
b(ij)=b(ij)*0.5
enddo
ij=ij+1
enddo
return
end
SUBROUTINE pckao3(NPR,NAO,A1,A2,A3,B1,B2,B3)
use stdacommon
IMPLICIT REAL*8(A-H,O-Z)
integer*8 ij,kl,k
dimension a1(*),b1(*)
dimension a2(*),b2(*)
dimension a3(*),b3(*)
if(nao.eq.0) then
k=0
do i=1,npr
do j=1,i
k=k+1
b1(k)=a1(k)
b2(k)=a2(k)
b3(k)=a3(k)
enddo
enddo
return
endif
ij=nao
ij=ij*(ij+1)/2
b1(1:ij)=0.0d0
b2(1:ij)=0.0d0
b3(1:ij)=0.0d0
kl=0
do i=1,npr
iai=ipao(i)
c1=cxip(i)
do j=1,i-1
kl=kl+1
c2=cxip(j)
iaj=ipao(j)
iaa=max(iaj,iai)
iii=min(iaj,iai)
ij=iii+iaa*(iaa-1)/2
ccf=c1*c2*2.0d0
b1(ij)=b1(ij)+a1(kl)*ccf
b2(ij)=b2(ij)+a2(kl)*ccf
b3(ij)=b3(ij)+a3(kl)*ccf
enddo
kl=kl+1
ij=iai
ij=ij+ij*(ij-1)/2
b1(ij)=b1(ij)+a1(kl)*c1*c1
b2(ij)=b2(ij)+a2(kl)*c1*c1
b3(ij)=b3(ij)+a3(kl)*c1*c1
enddo
ij=0
do i=1,nao
do j=1,i-1
ij=ij+1
b1(ij)=b1(ij)*0.50d0
b2(ij)=b2(ij)*0.50d0
b3(ij)=b3(ij)*0.50d0
enddo
ij=ij+1
enddo
return
end