From 53eb7f553171680385f484f91260147933ddf9f5 Mon Sep 17 00:00:00 2001 From: Emmanuel Giner Date: Fri, 5 Jul 2019 15:48:31 +0200 Subject: [PATCH] compiles --- src/cipsi/pert_rdm_providers.irp.f | 6 +++++ src/cipsi/update_2rdm.irp.f | 25 +++++++++++++++---- .../orb_range_routines_openmp.irp.f | 4 +-- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/cipsi/pert_rdm_providers.irp.f b/src/cipsi/pert_rdm_providers.irp.f index ad5355a2..9cf8fba7 100644 --- a/src/cipsi/pert_rdm_providers.irp.f +++ b/src/cipsi/pert_rdm_providers.irp.f @@ -23,6 +23,12 @@ BEGIN_PROVIDER [integer, list_orb_pert_rdm, (n_orb_pert_rdm)] END_PROVIDER +BEGIN_PROVIDER [double precision, pert_2rdm_provider, (n_orb_pert_rdm,n_orb_pert_rdm,n_orb_pert_rdm,n_orb_pert_rdm)] + implicit none + pert_2rdm_provider = 0.d0 + +END_PROVIDER + subroutine fill_buffer_double_rdm(i_generator, sp, h1, h2, bannedOrb, banned, fock_diag_tmp, E0, pt2, variance, norm, mat, buf, psi_det_connection, psi_coef_connection, n_det_connection) use bitmasks use selection_types diff --git a/src/cipsi/update_2rdm.irp.f b/src/cipsi/update_2rdm.irp.f index 3d6409af..7ae42ea8 100644 --- a/src/cipsi/update_2rdm.irp.f +++ b/src/cipsi/update_2rdm.irp.f @@ -2,14 +2,14 @@ use bitmasks subroutine give_2rdm_pert_contrib(det,coef,psi_det_connection,psi_coef_connection,n_det_connection,nkeys,keys,values,sze_buff) implicit none - integer, intent(in) :: n_det_connection,nkeys + integer, intent(in) :: n_det_connection,sze_buff double precision, intent(in) :: coef(N_states) integer(bit_kind), intent(in) :: det(N_int,2) integer(bit_kind), intent(in) :: psi_det_connection(N_int,2,n_det_connection) double precision, intent(in) :: psi_coef_connection(n_det_connection, N_states) - integer, intent(inout) :: keys(4,sze_buff),sze_buff + integer, intent(inout) :: keys(4,sze_buff),nkeys double precision, intent(inout) :: values(sze_buff) - integer :: i + integer :: i,j integer :: exc(0:2,2,2) integer :: degree double precision :: phase, contrib @@ -41,7 +41,7 @@ end subroutine update_buffer_single_exc_rdm(det1,det2,exc,phase,contrib,nkeys,keys,values,sze_buff) implicit none - integer, intent(in) :: nkeys,sze_buff + integer, intent(in) :: sze_buff integer(bit_kind), intent(in) :: det1(N_int,2) integer(bit_kind), intent(in) :: det2(N_int,2) integer,intent(in) :: exc(0:2,2,2) @@ -55,7 +55,7 @@ end subroutine update_buffer_double_exc_rdm(exc,phase,contrib,nkeys,keys,values,sze_buff) implicit none - integer, intent(in) :: nkeys,sze_buff + integer, intent(in) :: sze_buff integer,intent(in) :: exc(0:2,2,2) double precision,intent(in) :: phase, contrib integer, intent(inout) :: nkeys, keys(4,sze_buff) @@ -63,3 +63,18 @@ subroutine update_buffer_double_exc_rdm(exc,phase,contrib,nkeys,keys,values,sze_ end + + +subroutine update_rdms(nkeys,keys,values,sze_buff) + implicit none + integer, intent(in) :: nkeys, keys(4,sze_buff),sze_buff + double precision, intent(in) :: values(sze_buff) + integer :: i,h1,h2,p1,p2 + do i = 1, nkeys + h1 = keys(1,i) + h2 = keys(2,i) + p1 = keys(3,i) + p2 = keys(4,i) + pert_2rdm_provider(h1,h2,p1,p2) += values(i) + enddo +end diff --git a/src/two_body_rdm/orb_range_routines_openmp.irp.f b/src/two_body_rdm/orb_range_routines_openmp.irp.f index 269f789c..b6e59540 100644 --- a/src/two_body_rdm/orb_range_routines_openmp.irp.f +++ b/src/two_body_rdm/orb_range_routines_openmp.irp.f @@ -155,7 +155,7 @@ subroutine orb_range_two_rdm_state_av_openmp_work_$N_int(big_array,dim1,norb,lis ! Prepare the array of all alpha single excitations ! ------------------------------------------------- - PROVIDE N_int nthreads_davidson + PROVIDE N_int nthreads_davidson elec_alpha_num !$OMP PARALLEL DEFAULT(NONE) NUM_THREADS(nthreads_davidson) & !$OMP SHARED(psi_bilinear_matrix_rows, N_det,lock_2rdm,& !$OMP psi_bilinear_matrix_columns, & @@ -166,7 +166,7 @@ subroutine orb_range_two_rdm_state_av_openmp_work_$N_int(big_array,dim1,norb,lis !$OMP psi_bilinear_matrix_transp_order, N_st, & !$OMP psi_bilinear_matrix_order_transp_reverse, & !$OMP psi_bilinear_matrix_columns_loc, & - !$OMP psi_bilinear_matrix_transp_rows_loc, & + !$OMP psi_bilinear_matrix_transp_rows_loc,elec_alpha_num, & !$OMP istart, iend, istep, irp_here,list_orb_reverse, n_states, state_weights, dim1, & !$OMP ishift, idx0, u_t, maxab, alpha_alpha,beta_beta,alpha_beta,spin_trace,ispin,big_array,sze_buff,orb_bitmask) & !$OMP PRIVATE(krow, kcol, tmp_det, spindet, k_a, k_b, i,c_1, c_2, &