From 2d20035e0260b8f116d20aa775352d7285b6f1d9 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 7 Dec 2022 09:53:26 +0100 Subject: [PATCH] Update read integrals --- devel/trexio/import_trexio_integrals.irp.f | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/devel/trexio/import_trexio_integrals.irp.f b/devel/trexio/import_trexio_integrals.irp.f index e147125..865f95c 100644 --- a/devel/trexio/import_trexio_integrals.irp.f +++ b/devel/trexio/import_trexio_integrals.irp.f @@ -104,19 +104,19 @@ subroutine run ! --------------- PROVIDE ao_integrals_map - allocate(buffer_i(ao_num**3), buffer_values(ao_num**3)) - allocate(Vi(4,ao_num**3), V(ao_num**3)) + integer*4 :: BUFSIZE + BUFSIZE=ao_num**2 + allocate(buffer_i(BUFSIZE), buffer_values(BUFSIZE)) + allocate(Vi(4,BUFSIZE), V(BUFSIZE)) integer*8 :: offset, icount + open(unit=104,file='tmp') offset = 0_8 - icount = size(V) + icount = BUFSIZE rc = TREXIO_SUCCESS do while (icount == size(V)) rc = trexio_read_ao_2e_int_eri(f, offset, icount, Vi, V) - if (rc /= TREXIO_SUCCESS) then - exit - endif do m=1,icount i = Vi(1,m) j = Vi(2,m) @@ -125,11 +125,16 @@ subroutine run integral = V(m) call two_e_integrals_index(i, j, k, l, buffer_i(m) ) buffer_values(m) = integral + write(104,'(4(I5,X),2D22.15)') i,j,k,l, integral enddo call insert_into_ao_integrals_map(int(icount,4),buffer_i,buffer_values) offset = offset + icount + if (rc /= TREXIO_SUCCESS) then + exit + endif end do n_integrals = offset + close(104) call map_sort(ao_integrals_map) call map_unique(ao_integrals_map)