1
0
mirror of https://gitlab.com/scemama/qp_plugins_scemama.git synced 2024-08-30 07:53:39 +02:00

Added bounds check

This commit is contained in:
Anthony Scemama 2020-03-10 09:44:59 +01:00
parent 4ddec11676
commit 4a9ced7303
3 changed files with 97 additions and 27 deletions

View File

@ -96,7 +96,7 @@ subroutine get_fock_matrix_alpha(det,F)
integer :: i,j,k
F(:,:) = fock_operator_closed_shell_ref_bitmask(:,:)
F(:,:) = fock_op_cshell_ref_bitmask(:,:)
end
@ -112,7 +112,7 @@ subroutine get_fock_matrix_beta(det,F)
integer :: i,j,k
F(:,:) = fock_operator_closed_shell_ref_bitmask(:,:)
F(:,:) = fock_op_cshell_ref_bitmask(:,:)
end

View File

@ -57,9 +57,19 @@ subroutine run
endif
A = 0.d0
i = 1
j = 1
iunit = getunitandopen('T.qp','r')
do
read (iunit,*,end=10) i,j, integral
if (i<0 .or. i>ao_num) then
print *, i
stop 'i out of bounds in T.qp'
endif
if (j<0 .or. j>ao_num) then
print *, j
stop 'j out of bounds in T.qp'
endif
A(i,j) = integral
enddo
10 continue
@ -68,9 +78,19 @@ subroutine run
call ezfio_set_ao_one_e_ints_io_ao_integrals_kinetic('Read')
A = 0.d0
i = 1
j = 1
iunit = getunitandopen('S.qp','r')
do
read (iunit,*,end=11) i,j, integral
if (i<0 .or. i>ao_num) then
print *, i
stop 'i out of bounds in S.qp'
endif
if (j<0 .or. j>ao_num) then
print *, j
stop 'j out of bounds in S.qp'
endif
A(i,j) = integral
enddo
11 continue
@ -79,8 +99,18 @@ subroutine run
call ezfio_set_ao_one_e_ints_io_ao_integrals_overlap('Read')
A = 0.d0
i = 1
j = 1
iunit = getunitandopen('P.qp','r')
do
if (i<0 .or. i>ao_num) then
print *, i
stop 'i out of bounds in P.qp'
endif
if (j<0 .or. j>ao_num) then
print *, j
stop 'j out of bounds in P.qp'
endif
read (iunit,*,end=14) i,j, integral
A(i,j) = integral
enddo
@ -90,9 +120,19 @@ subroutine run
call ezfio_set_ao_one_e_ints_io_ao_integrals_pseudo('Read')
A = 0.d0
i = 1
j = 1
iunit = getunitandopen('V.qp','r')
do
read (iunit,*,end=12) i,j, integral
if (i<0 .or. i>ao_num) then
print *, i
stop 'i out of bounds in V.qp'
endif
if (j<0 .or. j>ao_num) then
print *, j
stop 'j out of bounds in V.qp'
endif
A(i,j) = integral
enddo
12 continue
@ -103,9 +143,29 @@ subroutine run
allocate(buffer_i(ao_num**3), buffer_values(ao_num**3))
iunit = getunitandopen('W.qp','r')
n_integrals=0
i = 1
j = 1
k = 1
l = 1
buffer_values = 0.d0
do
read (iunit,*,end=13) i,j,k,l, integral
if (i<0 .or. i>ao_num) then
print *, i
stop 'i out of bounds in W.qp'
endif
if (j<0 .or. j>ao_num) then
print *, j
stop 'j out of bounds in W.qp'
endif
if (k<0 .or. k>ao_num) then
print *, k
stop 'k out of bounds in W.qp'
endif
if (l<0 .or. l>ao_num) then
print *, l
stop 'l out of bounds in W.qp'
endif
n_integrals += 1
call two_e_integrals_index(i, j, k, l, buffer_i(n_integrals) )
buffer_values(n_integrals) = integral

View File

@ -54,6 +54,8 @@ subroutine run
endif
A = 0.d0
i = 1
j = 1
iunit = getunitandopen('Tmo.qp','r')
do
read (iunit,*,end=10) i,j, integral
@ -73,6 +75,8 @@ subroutine run
call ezfio_set_mo_one_e_ints_io_mo_integrals_kinetic('Read')
A = 0.d0
i = 1
j = 1
iunit = getunitandopen('Pmo.qp','r')
do
read (iunit,*,end=14) i,j, integral
@ -92,6 +96,8 @@ subroutine run
call ezfio_set_mo_one_e_ints_io_mo_integrals_pseudo('Read')
A = 0.d0
i = 1
j = 1
iunit = getunitandopen('Vmo.qp','r')
do
read (iunit,*,end=12) i,j, integral
@ -112,6 +118,10 @@ subroutine run
iunit = getunitandopen('Wmo.qp','r')
n_integrals=0
i = 1
j = 1
k = 1
l = 1
buffer_values = 0.d0
do
read (iunit,*,end=13) i,j,k,l, integral