From 0b769ccf32537d8b217d54427a8cabcb115948c7 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 28 Sep 2016 20:27:59 +0200 Subject: [PATCH] EZFIO I/O for 1-e integrals --- src/AO_Basis/EZFIO.cfg | 22 +++++ .../ao_overlap.irp.f | 98 ++++++++++--------- src/Integrals_Monoelec/kin_ao_ints.irp.f | 7 +- src/Integrals_Monoelec/pot_ao_ints.irp.f | 7 +- 4 files changed, 82 insertions(+), 52 deletions(-) rename src/{AO_Basis => Integrals_Monoelec}/ao_overlap.irp.f (57%) diff --git a/src/AO_Basis/EZFIO.cfg b/src/AO_Basis/EZFIO.cfg index 34bf2879..9e548514 100644 --- a/src/AO_Basis/EZFIO.cfg +++ b/src/AO_Basis/EZFIO.cfg @@ -54,3 +54,25 @@ type: logical doc: If true, use AOs in Cartesian coordinates (6d,10f,...) interface: ezfio, provider default: false + +[integral_overlap] +type: double precision +doc: Overlap integrals in AO basis set +size: (ao_basis.ao_num,ao_basis.ao_num) +interface: ezfio +default: false + +[integral_nuclear] +type: double precision +doc: Nucleus-electron integrals in AO basis set +size: (ao_basis.ao_num,ao_basis.ao_num) +interface: ezfio +default: false + +[integral_kinetic] +type: double precision +doc: Kinetic energy integrals in AO basis set +size: (ao_basis.ao_num,ao_basis.ao_num) +interface: ezfio +default: false + diff --git a/src/AO_Basis/ao_overlap.irp.f b/src/Integrals_Monoelec/ao_overlap.irp.f similarity index 57% rename from src/AO_Basis/ao_overlap.irp.f rename to src/Integrals_Monoelec/ao_overlap.irp.f index 4487ff77..0b603303 100644 --- a/src/AO_Basis/ao_overlap.irp.f +++ b/src/Integrals_Monoelec/ao_overlap.irp.f @@ -14,51 +14,61 @@ double precision :: alpha, beta, c double precision :: A_center(3), B_center(3) integer :: power_A(3), power_B(3) - dim1=100 - !$OMP PARALLEL DO SCHEDULE(GUIDED) & - !$OMP DEFAULT(NONE) & - !$OMP PRIVATE(A_center,B_center,power_A,power_B,& - !$OMP overlap_x,overlap_y, overlap_z, overlap, & - !$OMP alpha, beta,i,j,c) & - !$OMP SHARED(nucl_coord,ao_power,ao_prim_num, & - !$OMP ao_overlap_x,ao_overlap_y,ao_overlap_z,ao_overlap,ao_num,ao_coef_normalized_ordered_transp,ao_nucl, & - !$OMP ao_expo_ordered_transp,dim1) - do j=1,ao_num - A_center(1) = nucl_coord( ao_nucl(j), 1 ) - A_center(2) = nucl_coord( ao_nucl(j), 2 ) - A_center(3) = nucl_coord( ao_nucl(j), 3 ) - power_A(1) = ao_power( j, 1 ) - power_A(2) = ao_power( j, 2 ) - power_A(3) = ao_power( j, 3 ) - !DEC$ VECTOR ALIGNED - !DEC$ VECTOR ALWAYS - do i= 1,ao_num - ao_overlap(i,j)= 0.d0 - ao_overlap_x(i,j)= 0.d0 - ao_overlap_y(i,j)= 0.d0 - ao_overlap_z(i,j)= 0.d0 - B_center(1) = nucl_coord( ao_nucl(i), 1 ) - B_center(2) = nucl_coord( ao_nucl(i), 2 ) - B_center(3) = nucl_coord( ao_nucl(i), 3 ) - power_B(1) = ao_power( i, 1 ) - power_B(2) = ao_power( i, 2 ) - power_B(3) = ao_power( i, 3 ) - do n = 1,ao_prim_num(j) - alpha = ao_expo_ordered_transp(n,j) - !DEC$ VECTOR ALIGNED - do l = 1, ao_prim_num(i) - beta = ao_expo_ordered_transp(l,i) - call overlap_gaussian_xyz(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,overlap_y,overlap_z,overlap,dim1) - c = ao_coef_normalized_ordered_transp(n,j) * ao_coef_normalized_ordered_transp(l,i) - ao_overlap(i,j) += c * overlap - ao_overlap_x(i,j) += c * overlap_x - ao_overlap_y(i,j) += c * overlap_y - ao_overlap_z(i,j) += c * overlap_z - enddo + if (read_ao_one_integrals) then + call ezfio_get_ao_basis_integral_overlap(ao_overlap(1:ao_num, 1:ao_num)) + call ezfio_set_ao_basis_integral_overlap(ao_overlap(1:ao_num, 1:ao_num)) + print *, 'AO overlap integrals read from disk' + else + dim1=100 + !$OMP PARALLEL DO SCHEDULE(GUIDED) & + !$OMP DEFAULT(NONE) & + !$OMP PRIVATE(A_center,B_center,power_A,power_B,& + !$OMP overlap_x,overlap_y, overlap_z, overlap, & + !$OMP alpha, beta,i,j,c) & + !$OMP SHARED(nucl_coord,ao_power,ao_prim_num, & + !$OMP ao_overlap_x,ao_overlap_y,ao_overlap_z,ao_overlap,ao_num,ao_coef_normalized_ordered_transp,ao_nucl, & + !$OMP ao_expo_ordered_transp,dim1) + do j=1,ao_num + A_center(1) = nucl_coord( ao_nucl(j), 1 ) + A_center(2) = nucl_coord( ao_nucl(j), 2 ) + A_center(3) = nucl_coord( ao_nucl(j), 3 ) + power_A(1) = ao_power( j, 1 ) + power_A(2) = ao_power( j, 2 ) + power_A(3) = ao_power( j, 3 ) + !DEC$ VECTOR ALIGNED + !DEC$ VECTOR ALWAYS + do i= 1,ao_num + ao_overlap(i,j)= 0.d0 + ao_overlap_x(i,j)= 0.d0 + ao_overlap_y(i,j)= 0.d0 + ao_overlap_z(i,j)= 0.d0 + B_center(1) = nucl_coord( ao_nucl(i), 1 ) + B_center(2) = nucl_coord( ao_nucl(i), 2 ) + B_center(3) = nucl_coord( ao_nucl(i), 3 ) + power_B(1) = ao_power( i, 1 ) + power_B(2) = ao_power( i, 2 ) + power_B(3) = ao_power( i, 3 ) + do n = 1,ao_prim_num(j) + alpha = ao_expo_ordered_transp(n,j) + !DEC$ VECTOR ALIGNED + do l = 1, ao_prim_num(i) + beta = ao_expo_ordered_transp(l,i) + call overlap_gaussian_xyz(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,overlap_y,overlap_z,overlap,dim1) + c = ao_coef_normalized_ordered_transp(n,j) * ao_coef_normalized_ordered_transp(l,i) + ao_overlap(i,j) += c * overlap + ao_overlap_x(i,j) += c * overlap_x + ao_overlap_y(i,j) += c * overlap_y + ao_overlap_z(i,j) += c * overlap_z + enddo + enddo enddo - enddo - enddo - !$OMP END PARALLEL DO + enddo + !$OMP END PARALLEL DO + endif + if (write_ao_one_integrals) then + call ezfio_set_ao_basis_integral_overlap(ao_overlap(1:ao_num, 1:ao_num)) + print *, 'AO overlap integrals written to disk' + endif END_PROVIDER diff --git a/src/Integrals_Monoelec/kin_ao_ints.irp.f b/src/Integrals_Monoelec/kin_ao_ints.irp.f index e3e92348..6cb2aa49 100644 --- a/src/Integrals_Monoelec/kin_ao_ints.irp.f +++ b/src/Integrals_Monoelec/kin_ao_ints.irp.f @@ -131,8 +131,8 @@ BEGIN_PROVIDER [double precision, ao_kinetic_integral, (ao_num_align,ao_num)] integer :: i,j,k,l if (read_ao_one_integrals) then - call read_one_e_integrals('ao_kinetic_integral', ao_kinetic_integral,& - size(ao_kinetic_integral,1), size(ao_kinetic_integral,2)) + call ezfio_get_ao_basis_integral_kinetic(ao_kinetic_integral(1:ao_num, 1:ao_num)) + call ezfio_set_ao_basis_integral_kinetic(ao_kinetic_integral(1:ao_num, 1:ao_num)) print *, 'AO kinetic integrals read from disk' else !$OMP PARALLEL DO DEFAULT(NONE) & @@ -151,8 +151,7 @@ BEGIN_PROVIDER [double precision, ao_kinetic_integral, (ao_num_align,ao_num)] !$OMP END PARALLEL DO endif if (write_ao_one_integrals) then - call write_one_e_integrals('ao_kinetic_integral', ao_kinetic_integral,& - size(ao_kinetic_integral,1), size(ao_kinetic_integral,2)) + call ezfio_set_ao_basis_integral_kinetic(ao_kinetic_integral(1:ao_num, 1:ao_num)) print *, 'AO kinetic integrals written to disk' endif END_PROVIDER diff --git a/src/Integrals_Monoelec/pot_ao_ints.irp.f b/src/Integrals_Monoelec/pot_ao_ints.irp.f index 45b9067a..913b1396 100644 --- a/src/Integrals_Monoelec/pot_ao_ints.irp.f +++ b/src/Integrals_Monoelec/pot_ao_ints.irp.f @@ -11,8 +11,8 @@ BEGIN_PROVIDER [ double precision, ao_nucl_elec_integral, (ao_num_align,ao_num)] double precision :: overlap_x,overlap_y,overlap_z,overlap,dx,NAI_pol_mult if (read_ao_one_integrals) then - call read_one_e_integrals('ao_ne_integral', ao_nucl_elec_integral, & - size(ao_nucl_elec_integral,1), size(ao_nucl_elec_integral,2)) + call ezfio_get_ao_basis_integral_nuclear(ao_nucl_elec_integral(1:ao_num, 1:ao_num)) + call ezfio_set_ao_basis_integral_nuclear(ao_nucl_elec_integral(1:ao_num, 1:ao_num)) print *, 'AO N-e integrals read from disk' else @@ -74,8 +74,7 @@ BEGIN_PROVIDER [ double precision, ao_nucl_elec_integral, (ao_num_align,ao_num)] !$OMP END PARALLEL endif if (write_ao_one_integrals) then - call write_one_e_integrals('ao_ne_integral', ao_nucl_elec_integral, & - size(ao_nucl_elec_integral,1), size(ao_nucl_elec_integral,2)) + call ezfio_set_ao_basis_integral_nuclear(ao_nucl_elec_integral(1:ao_num, 1:ao_num)) print *, 'AO N-e integrals written to disk' endif