-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathget_intMolpro.f90
75 lines (50 loc) · 1.5 KB
/
get_intMolpro.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
subroutine get_intMolpro(ecore)
use commonarrays, only:nsym,nword,nbft,nbpsy,e1ints,e2ints,ipoint
use dyn_par
implicit real*8 (a-h,o-z)
integer norb,nelec,ms2,orbsym(500),isym
NAMELIST /FCI/ norb,nelec,ms2,orbsym,isym
open(UNIT=14,FILE='FCIDUMP')
READ(14,NML=FCI)
nbft=norb
nsym=orbsym(nbft)
nbpsy=0
!!create nbpsy from orbsym
do i=1,nbft
nbpsy(orbsym(i))=nbpsy(orbsym(i))+1
end do
! PRINT *,nbpsy
! store values for pointer array for indexing symmetric matrices
ipoint(1) = 0
do i = 2, max2
ipoint(i) = ipoint(i-1) + i - 1
enddo
!cccccccccccccccccc Read in integrals
nword = ((nbft-1)/int_bits) + 1
i2=1
do while (i2/=0)
READ(14,*) eint, i2, j2, k2, l2
if (i2/=0) THEN
if (k2==0) THEN !1 body
if(j2.gt.i2) STOP 'Error get_int: 1e ints #2 ' !molpro 1e ints reverse labels
ij = ipoint(i2)+j2
e1ints(ij) = eint
ELSE !two body
if(j2.gt.i2 .or. l2.gt.k2) STOP 'Error get_int: 2e ints #1'
ij = ipoint(i2)+j2
kl = ipoint(k2)+l2
if( kl .gt. ij) then
itmp = ij
ij =kl
kl = itmp
endif
ijkl = ipoint(ij)+kl
e2ints(ijkl)=eint
END IF
END IF
end do
!last eint has i2=0 so ecore
ecore=eint
CLOSE(14)
return
end