10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-10-19 22:41:48 +02:00

Fixed Segfault

This commit is contained in:
Anthony Scemama 2018-12-01 00:55:39 +01:00
parent b9d7611af4
commit 34ba5d4fd4
4 changed files with 15 additions and 9 deletions

View File

@ -2133,6 +2133,11 @@ subroutine ac_operator(iorb,ispin,key,hjj,Nint,na,nb)
key(k,ispin) = ibset(key(k,ispin),l) key(k,ispin) = ibset(key(k,ispin),l)
other_spin = iand(ispin,1)+1 other_spin = iand(ispin,1)+1
if (iorb > mo_tot_num) then
print *, irp_here, 'iorb > mo_tot_num'
print *, iorb, mo_tot_num
stop -1
endif
hjj = hjj + mo_mono_elec_integral(iorb,iorb) hjj = hjj + mo_mono_elec_integral(iorb,iorb)
! Same spin ! Same spin

View File

@ -204,7 +204,8 @@ subroutine make_selection_buffer_s2(b)
endif endif
enddo enddo
if (dup) then if (dup) then
val(i) = val(i) + val(j) ! val(i) = val(i) + val(j)
val(i) = max(val(i), val(j))
duplicate(j) = .True. duplicate(j) = .True.
endif endif
j+=1 j+=1
@ -254,14 +255,14 @@ subroutine make_selection_buffer_s2(b)
call occ_pattern_to_dets_size(o(1,1,i),sze,elec_alpha_num,N_int) call occ_pattern_to_dets_size(o(1,1,i),sze,elec_alpha_num,N_int)
n_d = n_d + sze n_d = n_d + sze
if (n_d > b%cur) then if (n_d > b%cur) then
if (n_d - b%cur > b%cur - n_d + sze) then ! if (n_d - b%cur > b%cur - n_d + sze) then
n_d = n_d - sze ! n_d = n_d - sze
endif ! endif
exit exit
endif endif
enddo enddo
allocate(b%det(N_int,2,n_d), b%val(n_d)) allocate(b%det(N_int,2,2*n_d), b%val(2*n_d))
k=1 k=1
do i=1,n_p do i=1,n_p
n=n_d n=n_d
@ -274,7 +275,7 @@ subroutine make_selection_buffer_s2(b)
if (k > n_d) exit if (k > n_d) exit
enddo enddo
deallocate(o) deallocate(o)
b%N = n_d b%N = 2*n_d
b%cur = n_d b%cur = n_d
end end

View File

@ -403,8 +403,8 @@ subroutine lapack_diagd(eigvalues,eigvectors,H,nmax,n)
! print*,'n = ',n ! print*,'n = ',n
A=H A=H
lwork = 2*n*n + 6*n+ 1 lwork = max(1000,2*n*n + 6*n+ 1)
liwork = 5*n + 3 liwork = max(5*n + 3,1000)
allocate (work(lwork),iwork(liwork)) allocate (work(lwork),iwork(liwork))
lwork = -1 lwork = -1

View File

@ -28,7 +28,7 @@ function run_FCI() {
} }
@test "FCI H2O cc-pVDZ" { @test "FCI H2O cc-pVDZ" {
run_FCI h2o.ezfio 2000 -76.1247512890078 -76.1258973417948 run_FCI h2o.ezfio 2000 -76.1250464119599 -76.1258876912360
} }