10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-23 04:43:50 +01:00

Memory allocation bug in Huckel guess corrected

This commit is contained in:
Anthony Scemama 2015-09-22 13:26:20 +02:00
parent 8b8946f1e3
commit f04e6619a5
3 changed files with 18 additions and 14 deletions

View File

@ -73,19 +73,19 @@ BEGIN_PROVIDER [double precision, diagonal_Fock_matrix_mo_sum, (mo_tot_num)]
END_DOC END_DOC
integer :: i,j integer :: i,j
double precision :: accu double precision :: accu
do i = 1,elec_alpha_num do j = 1,elec_alpha_num
accu = 0.d0 accu = 0.d0
do j = 1, elec_alpha_num do i = 1, elec_alpha_num
accu += 2.d0 * mo_bielec_integral_jj_from_ao(i,j) - mo_bielec_integral_jj_exchange_from_ao(i,j) accu += 2.d0 * mo_bielec_integral_jj_from_ao(i,j) - mo_bielec_integral_jj_exchange_from_ao(i,j)
enddo enddo
diagonal_Fock_matrix_mo_sum(i) = accu + mo_mono_elec_integral(i,i) diagonal_Fock_matrix_mo_sum(j) = accu + mo_mono_elec_integral(j,j)
enddo enddo
do i = elec_alpha_num+1,mo_tot_num do j = elec_alpha_num+1,mo_tot_num
accu = 0.d0 accu = 0.d0
do j = 1, elec_alpha_num do i = 1, elec_alpha_num
accu += 2.d0 * mo_bielec_integral_jj_from_ao(i,j) - mo_bielec_integral_jj_exchange_from_ao(i,j) accu += 2.d0 * mo_bielec_integral_jj_from_ao(i,j) - mo_bielec_integral_jj_exchange_from_ao(i,j)
enddo enddo
diagonal_Fock_matrix_mo_sum(i) = accu + mo_mono_elec_integral(i,i) diagonal_Fock_matrix_mo_sum(j) = accu + mo_mono_elec_integral(j,j)
enddo enddo
END_PROVIDER END_PROVIDER

View File

@ -4,7 +4,7 @@ subroutine huckel_guess
! Build the MOs using the extended Huckel model ! Build the MOs using the extended Huckel model
END_DOC END_DOC
integer :: i,j integer :: i,j
double precision :: tmp_matrix(ao_num_align,ao_num),accu double precision :: accu
double precision :: c double precision :: c
character*(64) :: label character*(64) :: label
@ -19,18 +19,19 @@ subroutine huckel_guess
c = 0.5d0 * 1.75d0 c = 0.5d0 * 1.75d0
do j=1,ao_num do j=1,ao_num
!DIR$ VECTOR ALIGNED
do i=1,ao_num do i=1,ao_num
if (i.ne.j) then Fock_matrix_ao(i,j) = c*ao_overlap(i,j)*(ao_mono_elec_integral_diag(i) + &
Fock_matrix_ao(i,j) = c*ao_overlap(i,j)*(ao_mono_elec_integral(i,i) + & ao_mono_elec_integral_diag(j))
ao_mono_elec_integral(j,j))
else
Fock_matrix_ao(i,j) = Fock_matrix_alpha_ao(i,j)
endif
enddo enddo
Fock_matrix_ao(j,j) = Fock_matrix_alpha_ao(j,j)
enddo enddo
TOUCH Fock_matrix_ao TOUCH Fock_matrix_ao
print *, "Huckel matrix computed"
mo_coef = eigenvectors_fock_matrix_mo mo_coef = eigenvectors_fock_matrix_mo
SOFT_TOUCH mo_coef SOFT_TOUCH mo_coef
print *, "Saving MOs"
call save_mos call save_mos
print *, "Saving MOs saved"
end end

View File

@ -1,4 +1,5 @@
BEGIN_PROVIDER [ double precision, ao_mono_elec_integral,(ao_num_align,ao_num)] BEGIN_PROVIDER [ double precision, ao_mono_elec_integral,(ao_num_align,ao_num)]
&BEGIN_PROVIDER [ double precision, ao_mono_elec_integral_diag,(ao_num)]
implicit none implicit none
integer :: i,j,n,l integer :: i,j,n,l
BEGIN_DOC BEGIN_DOC
@ -6,9 +7,11 @@ BEGIN_PROVIDER [ double precision, ao_mono_elec_integral,(ao_num_align,ao_num)]
! : sum of the kinetic and nuclear electronic potential ! : sum of the kinetic and nuclear electronic potential
END_DOC END_DOC
do j = 1, ao_num do j = 1, ao_num
!DIR$ VECTOR ALIGNED
do i = 1, ao_num do i = 1, ao_num
ao_mono_elec_integral(i,j) = ao_nucl_elec_integral(i,j) + ao_kinetic_integral(i,j) + ao_pseudo_integral(i,j) ao_mono_elec_integral(i,j) = ao_nucl_elec_integral(i,j) + ao_kinetic_integral(i,j) + ao_pseudo_integral(i,j)
enddo enddo
ao_mono_elec_integral_diag(j) = ao_mono_elec_integral(j,j)
enddo enddo
END_PROVIDER END_PROVIDER