1
0
mirror of https://gitlab.com/scemama/qp_plugins_scemama.git synced 2024-11-07 14:43:41 +01:00

Fixing import_integrals_mo

This commit is contained in:
Michel Caffarel 2020-03-04 16:17:22 +01:00
parent 4cea5b32c9
commit 4ddec11676
2 changed files with 60 additions and 20 deletions

View File

@ -53,7 +53,7 @@ subroutine run
close(iunit)
if (A(1,1) /= huge(1.d0)) then
call ezfio_set_nuclei_nuclear_repulsion(A(1,1))
call ezfio_set_nuclei_io_nuclear_repulsion("Read")
call ezfio_set_nuclei_io_nuclear_repulsion('Read')
endif
A = 0.d0
@ -65,7 +65,7 @@ subroutine run
10 continue
close(iunit)
call ezfio_set_ao_one_e_ints_ao_integrals_kinetic(A(1:ao_num, 1:ao_num))
call ezfio_set_ao_one_e_ints_io_ao_integrals_kinetic("Read")
call ezfio_set_ao_one_e_ints_io_ao_integrals_kinetic('Read')
A = 0.d0
iunit = getunitandopen('S.qp','r')
@ -76,7 +76,7 @@ subroutine run
11 continue
close(iunit)
call ezfio_set_ao_one_e_ints_ao_integrals_overlap(A(1:ao_num, 1:ao_num))
call ezfio_set_ao_one_e_ints_io_ao_integrals_overlap("Read")
call ezfio_set_ao_one_e_ints_io_ao_integrals_overlap('Read')
A = 0.d0
iunit = getunitandopen('P.qp','r')
@ -87,7 +87,7 @@ subroutine run
14 continue
close(iunit)
call ezfio_set_ao_one_e_ints_ao_integrals_pseudo(A(1:ao_num,1:ao_num))
call ezfio_set_ao_one_e_ints_io_ao_integrals_pseudo("Read")
call ezfio_set_ao_one_e_ints_io_ao_integrals_pseudo('Read')
A = 0.d0
iunit = getunitandopen('V.qp','r')
@ -98,7 +98,7 @@ subroutine run
12 continue
close(iunit)
call ezfio_set_ao_one_e_ints_ao_integrals_e_n(A(1:ao_num, 1:ao_num))
call ezfio_set_ao_one_e_ints_io_ao_integrals_e_n("Read")
call ezfio_set_ao_one_e_ints_io_ao_integrals_e_n('Read')
allocate(buffer_i(ao_num**3), buffer_values(ao_num**3))
iunit = getunitandopen('W.qp','r')

View File

@ -1,4 +1,5 @@
program import_integrals_mo
PROVIDE mo_num
call run
end
@ -39,8 +40,7 @@ subroutine run
integer(key_kind), allocatable :: buffer_i(:)
real(integral_kind), allocatable :: buffer_values(:)
call ezfio_set_mo_basis_mo_num(mo_num)
allocate(buffer_i(mo_num**3), buffer_values(mo_num**3))
allocate (A(mo_num,mo_num))
A(1,1) = huge(1.d0)
@ -50,53 +50,93 @@ subroutine run
close(iunit)
if (A(1,1) /= huge(1.d0)) then
call ezfio_set_nuclei_nuclear_repulsion(A(1,1))
call ezfio_set_nuclei_io_nuclear_repulsion("Read")
call ezfio_set_nuclei_io_nuclear_repulsion('Read')
endif
A = 0.d0
iunit = getunitandopen('Tmo.qp','r')
do
read (iunit,*,end=10) i,j, integral
if (i<0 .or. i>mo_num) then
print *, i
stop 'i out of bounds in Tmo.qp'
endif
if (j<0 .or. j>mo_num) then
print *, j
stop 'j out of bounds in Tmo.qp'
endif
A(i,j) = integral
enddo
10 continue
close(iunit)
call ezfio_set_mo_one_e_ints_mo_integrals_kinetic(A(1:mo_num, 1:mo_num))
call ezfio_set_mo_one_e_ints_io_mo_integrals_kinetic("Read")
call ezfio_set_mo_one_e_ints_mo_integrals_kinetic(A)
call ezfio_set_mo_one_e_ints_io_mo_integrals_kinetic('Read')
A = 0.d0
iunit = getunitandopen('Pmo.qp','r')
do
read (iunit,*,end=14) i,j, integral
if (i<0 .or. i>mo_num) then
print *, i
stop 'i out of bounds in Pmo.qp'
endif
if (j<0 .or. j>mo_num) then
print *, j
stop 'j out of bounds in Pmo.qp'
endif
A(i,j) = integral
enddo
14 continue
close(iunit)
call ezfio_set_mo_one_e_ints_mo_integrals_pseudo(A(1:mo_num,1:mo_num))
call ezfio_set_mo_one_e_ints_io_mo_integrals_pseudo("Read")
call ezfio_set_mo_one_e_ints_mo_integrals_pseudo(A)
call ezfio_set_mo_one_e_ints_io_mo_integrals_pseudo('Read')
A = 0.d0
iunit = getunitandopen('Vmo.qp','r')
do
read (iunit,*,end=12) i,j, integral
if (i<0 .or. i>mo_num) then
print *, i
stop 'i out of bounds in Vmo.qp'
endif
if (j<0 .or. j>mo_num) then
print *, j
stop 'j out of bounds in Vmo.qp'
endif
A(i,j) = integral
enddo
12 continue
close(iunit)
call ezfio_set_mo_one_e_ints_mo_integrals_e_n(A(1:mo_num, 1:mo_num))
call ezfio_set_mo_one_e_ints_io_mo_integrals_e_n("Read")
call ezfio_set_mo_one_e_ints_mo_integrals_e_n(A)
call ezfio_set_mo_one_e_ints_io_mo_integrals_e_n('Read')
allocate(buffer_i(mo_num**3), buffer_values(mo_num**3))
iunit = getunitandopen('Wmo.qp','r')
n_integrals=0
buffer_values = 0.d0
do
read (iunit,*,end=13) i,j,k,l, integral
if (i<0 .or. i>mo_num) then
print *, i
stop 'i out of bounds in Wmo.qp'
endif
if (j<0 .or. j>mo_num) then
print *, j
stop 'j out of bounds in Wmo.qp'
endif
if (k<0 .or. k>mo_num) then
print *, k
stop 'k out of bounds in Wmo.qp'
endif
if (l<0 .or. l>mo_num) then
print *, l
stop 'l out of bounds in Wmo.qp'
endif
n_integrals += 1
call two_e_integrals_index(i, j, k, l, buffer_i(n_integrals) )
call mo_two_e_integrals_index(i, j, k, l, buffer_i(n_integrals) )
buffer_values(n_integrals) = integral
if (n_integrals == size(buffer_i)) then
call insert_into_mo_integrals_map(n_integrals,buffer_i,buffer_values)
call insert_into_mo_integrals_map(n_integrals, buffer_i, buffer_values, &
real(mo_integrals_threshold,integral_kind))
n_integrals = 0
endif
enddo
@ -104,11 +144,11 @@ subroutine run
close(iunit)
if (n_integrals > 0) then
call insert_into_mo_integrals_map(n_integrals,buffer_i,buffer_values)
call insert_into_mo_integrals_map(n_integrals, buffer_i, buffer_values, &
real(mo_integrals_threshold,integral_kind))
endif
call map_sort(mo_integrals_map)
call map_unique(mo_integrals_map)
call map_merge(mo_integrals_map)
call map_save_to_disk(trim(ezfio_filename)//'/work/mo_ints',mo_integrals_map)
call ezfio_set_mo_two_e_ints_io_mo_two_e_integrals('Read')