diff --git a/plugins/Full_CI_ZMQ/selection.irp.f b/plugins/Full_CI_ZMQ/selection.irp.f index 3febff69..631c96ab 100644 --- a/plugins/Full_CI_ZMQ/selection.irp.f +++ b/plugins/Full_CI_ZMQ/selection.irp.f @@ -308,7 +308,7 @@ subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_d call bitstring_to_list_ab(hole , hole_list , N_holes , N_int) call bitstring_to_list_ab(particle, particle_list, N_particles, N_int) - integer :: l_a, nmax + integer :: l_a, nmax, idx integer, allocatable :: indices(:), exc_degree(:), iorder(:) allocate (indices(N_det), & exc_degree(max(N_det_alpha_unique,N_det_beta_unique))) @@ -331,7 +331,9 @@ subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_d do l_a=psi_bilinear_matrix_columns_loc(j), psi_bilinear_matrix_columns_loc(j+1)-1 i = psi_bilinear_matrix_rows(l_a) if (nt + exc_degree(i) <= 4) then - indices(k) = psi_det_sorted_order(psi_bilinear_matrix_order(l_a)) + idx = psi_det_sorted_order(psi_bilinear_matrix_order(l_a)) + if (psi_average_norm_contrib_sorted(idx) < 1.d-12) cycle + indices(k) = idx k=k+1 endif enddo @@ -350,9 +352,11 @@ subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_d i = psi_bilinear_matrix_transp_columns(l_a) if (exc_degree(i) < 3) cycle if (nt + exc_degree(i) <= 4) then - indices(k) = psi_det_sorted_order( & - psi_bilinear_matrix_order( & - psi_bilinear_matrix_transp_order(l_a))) + idx = psi_det_sorted_order( & + psi_bilinear_matrix_order( & + psi_bilinear_matrix_transp_order(l_a))) + if (psi_average_norm_contrib_sorted(idx) < 1.d-12) cycle + indices(k) = idx k=k+1 endif enddo diff --git a/plugins/Generators_full/generators.irp.f b/plugins/Generators_full/generators.irp.f index 2ce6f854..b996d31b 100644 --- a/plugins/Generators_full/generators.irp.f +++ b/plugins/Generators_full/generators.irp.f @@ -9,11 +9,12 @@ BEGIN_PROVIDER [ integer, N_det_generators ] integer :: i double precision :: norm call write_time(6) - norm = 0.d0 + norm = 1.d0 N_det_generators = N_det do i=1,N_det - norm = norm + psi_average_norm_contrib_sorted(i) - if (norm > threshold_generators+1d-10) then + norm = norm - psi_average_norm_contrib_sorted(i) + if (psi_average_norm_contrib_sorted(i) == 0.d0) exit + if (norm < 1.d0 - threshold_generators) then N_det_generators = i exit endif diff --git a/plugins/Selectors_full/selectors.irp.f b/plugins/Selectors_full/selectors.irp.f index 3d58bdcc..f0d50c94 100644 --- a/plugins/Selectors_full/selectors.irp.f +++ b/plugins/Selectors_full/selectors.irp.f @@ -10,17 +10,16 @@ BEGIN_PROVIDER [ integer, N_det_selectors] double precision :: norm, norm_max call write_time(6) N_det_selectors = N_det - if (threshold_generators < 1.d0) then - norm = 0.d0 - do i=1,N_det - norm = norm + psi_average_norm_contrib_sorted(i) - if (norm > threshold_selectors) then - N_det_selectors = i - exit - endif - enddo - N_det_selectors = max(N_det_selectors,N_det_generators) - endif + norm = 1.d0 + do i=1,N_det + norm = norm - psi_average_norm_contrib_sorted(i) + if (psi_average_norm_contrib_sorted(i) == 0.d0) exit + if (norm < 1.d0 - threshold_selectors) then + N_det_selectors = i + exit + endif + enddo + N_det_selectors = max(N_det_selectors,N_det_generators) call write_int(6,N_det_selectors,'Number of selectors') END_PROVIDER diff --git a/src/DavidsonUndressed/print_energy.irp.f b/src/DavidsonUndressed/print_energy.irp.f index ae6f1da2..d694cb6c 100644 --- a/src/DavidsonUndressed/print_energy.irp.f +++ b/src/DavidsonUndressed/print_energy.irp.f @@ -2,7 +2,12 @@ program print_energy implicit none read_wf = .true. touch read_wf + provide mo_bielec_integrals_in_map + double precision :: time1, time0 + call wall_time(time0) call routine + call wall_time(time1) + print *, 'Wall time :' , time1 - time0 end subroutine routine