10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-21 12:42:13 +02:00

Corrected memory access in MRCC

This commit is contained in:
Anthony Scemama 2016-09-15 22:01:46 +02:00
parent 9ddb60fd2e
commit 77b5e99687
3 changed files with 13 additions and 10 deletions

View File

@ -274,11 +274,11 @@ BEGIN_PROVIDER [ double precision, CI_energy_dressed, (N_states_diag) ]
integer :: j
character*(8) :: st
call write_time(output_determinants)
do j=1,N_states_diag
do j=1,min(N_det,N_states_diag)
write(st,'(I4)') j
CI_energy_dressed(j) = CI_electronic_energy_dressed(j) + nuclear_repulsion
call write_double(output_determinants,CI_energy(j),'Energy of state '//trim(st))
call write_double(output_determinants,CI_eigenvectors_s2(j),'S^2 of state '//trim(st))
call write_double(output_determinants,CI_energy_dressed(j),'Energy of state '//trim(st))
call write_double(output_determinants,CI_eigenvectors_s2_dressed(j),'S^2 of state '//trim(st))
enddo
END_PROVIDER
@ -346,7 +346,9 @@ logical function is_generable(det1, det2, Nint)
else
tmp_array = (/s2, p2, s1, p1/)
end if
f = searchExc(pp_exists(1,hh_shortcut(f)), tmp_array, hh_shortcut(f+1)-hh_shortcut(f))
if (f /= -1) then
f = searchExc(pp_exists(1,hh_shortcut(f)), tmp_array, hh_shortcut(f+1)-hh_shortcut(f))
endif
is_generable = (f /= -1)
end function
@ -667,12 +669,13 @@ END_PROVIDER
N_col = 0
col_shortcut = 0
!$OMP PARALLEL DO schedule(static,10) default(none) shared(psi_non_ref, hh_exists, pp_exists, N_int, A_val, A_ind)&
!$OMP PARALLEL default(none) shared(psi_non_ref, hh_exists, pp_exists, N_int, A_val, A_ind)&
!$OMP shared(s, hh_shortcut, psi_ref_coef, N_det_non_ref, psi_non_ref_sorted, psi_non_ref_sorted_idx, psi_ref, N_det_ref)&
!$OMP private(lref, pp, II, ok, myMask, myDet, ind, phase, wk)
allocate(lref(N_det_non_ref))
!$OMP DO schedule(static,10)
do hh = 1, hh_shortcut(0)
do pp = hh_shortcut(hh), hh_shortcut(hh+1)-1
allocate(lref(N_det_non_ref))
lref = 0
do II = 1, N_det_ref
call apply_hole_local(psi_ref(1,1,II), hh_exists(1, hh), myMask, ok, N_int)
@ -701,10 +704,11 @@ END_PROVIDER
A_ind(wk, pp) = i
end if
end do
deallocate(lref)
end do
end do
!$OMP END PARALLEL DO
!$OMP END DO
deallocate(lref)
!$OMP END PARALLEL
AtB = 0d0
AtA_size = 0

View File

@ -24,7 +24,7 @@ BEGIN_PROVIDER [ double precision, CI_energy, (N_states_diag) ]
integer :: j
character*(8) :: st
call write_time(output_determinants)
do j=1,N_states_diag
do j=1,min(N_det,N_states_diag)
CI_energy(j) = CI_electronic_energy(j) + nuclear_repulsion
write(st,'(I4)') j
call write_double(output_determinants,CI_energy(j),'Energy of state '//trim(st))

View File

@ -59,7 +59,6 @@ BEGIN_PROVIDER [ double precision, expected_s2]
double precision :: S
S = (elec_alpha_num-elec_beta_num)*0.5d0
expected_s2 = S * (S+1.d0)
! expected_s2 = elec_alpha_num - elec_beta_num + 0.5d0 * ((elec_alpha_num - elec_beta_num)**2*0.5d0 - (elec_alpha_num-elec_beta_num))
endif
END_PROVIDER