forked from cxlsmiles/fanoci_code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reduce_moint.f90
81 lines (64 loc) · 2.3 KB
/
reduce_moint.f90
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
module reduce_moint
use globals
use intindex_module
use read_hf_data
implicit none
contains
subroutine reduce_int2e ()
integer :: temp
integer :: i, j, k, l
integer*8 :: tot_index, i1
integer*8 :: n_int2e_total
double precision :: t_2eint_in, t_2eint_fi
double precision, dimension(:), allocatable :: int2e_temp
temp = n_mo + 1
n_int2e_total = temp * (temp+1) * (temp*temp + temp + 2)/8
allocate(int2e_temp(n_int2e_total))
call cpu_time(t_2eint_in)
call read_2e_integrals(n_int2e_total, int2e_temp)
call cpu_time(t_2eint_fi)
write(*,'(A27,F10.2,A2)')"Reading 2e integrals took ",t_2eint_fi-t_2eint_in,"s"
write(*,'(A30,I15)')"Total number of 2e integrals ",n_int2e_total
call cpu_time(t_2eint_in)
do i = 1, n_occ
do j = i, n_occ
do k = 1, n_occ
do l = k, n_mo
tot_index = intindex(i,j,k,l)
int2e(tot_index) = int2e_temp(tot_index)
end do
end do
end do
end do
do i = 1, n_occ
do j = i, n_occ
do k = n_occ+1, n_mo
do l = k, n_mo
tot_index = intindex(i,j,k,l)
int2e(tot_index) = int2e_temp(tot_index)
end do
end do
end do
end do
do i = 1, n_occ
do j = n_occ+1, n_mo
do k = i, n_occ
do l = j, n_mo
tot_index = intindex(i,j,k,l)
int2e(tot_index) = int2e_temp(tot_index)
end do
end do
end do
end do
open(329,file="moint_red.txt")
do i1 = 1, n_int2e
if ( int2e(i1) .ne. 0.000000000000000) then
write(329,'(A3,I15,A1,F20.15)')" ",i1," ",int2e(i1)
end if
end do
close(329)
deallocate(int2e_temp)
call cpu_time(t_2eint_fi)
write(*,'(A26,F8.2,A2)')"2e integral sorting took ", t_2eint_fi-t_2eint_in, " s"
end subroutine reduce_int2e
end module reduce_moint