diff --git a/plugins/MRCC_Utils/amplitudes.irp.f b/plugins/MRCC_Utils/amplitudes.irp.f index b38402a2..0e6a4cf4 100644 --- a/plugins/MRCC_Utils/amplitudes.irp.f +++ b/plugins/MRCC_Utils/amplitudes.irp.f @@ -66,9 +66,18 @@ END_PROVIDER +BEGIN_PROVIDER [ integer, n_exc_active_sze ] + implicit none + BEGIN_DOC + ! Dimension of arrays to avoid zero-sized arrays + END_DOC + n_exc_active_sze = max(n_exc_active,1) +END_PROVIDER - BEGIN_PROVIDER [ integer, active_excitation_to_determinants_idx, (0:N_det_ref+1, n_exc_active) ] -&BEGIN_PROVIDER [ double precision, active_excitation_to_determinants_val, (N_states,N_det_ref+1, n_exc_active) ] + + + BEGIN_PROVIDER [ integer, active_excitation_to_determinants_idx, (0:N_det_ref+1, n_exc_active_sze) ] +&BEGIN_PROVIDER [ double precision, active_excitation_to_determinants_val, (N_states,N_det_ref+1, n_exc_active_sze) ] implicit none BEGIN_DOC ! Sparse matrix A containing the matrix to transform the active excitations to @@ -136,10 +145,10 @@ END_PROVIDER END_PROVIDER - BEGIN_PROVIDER [ integer, mrcc_AtA_ind, (N_det_ref * n_exc_active) ] -&BEGIN_PROVIDER [ double precision, mrcc_AtA_val, (N_states, N_det_ref * n_exc_active) ] -&BEGIN_PROVIDER [ integer, mrcc_col_shortcut, (n_exc_active) ] -&BEGIN_PROVIDER [ integer, mrcc_N_col, (n_exc_active) ] + BEGIN_PROVIDER [ integer, mrcc_AtA_ind, (N_det_ref * n_exc_active_sze) ] +&BEGIN_PROVIDER [ double precision, mrcc_AtA_val, (N_states, N_det_ref * n_exc_active_sze) ] +&BEGIN_PROVIDER [ integer, mrcc_col_shortcut, (n_exc_active_sze) ] +&BEGIN_PROVIDER [ integer, mrcc_N_col, (n_exc_active_sze) ] implicit none BEGIN_DOC ! A is active_excitation_to_determinants in At.A diff --git a/plugins/MRCC_Utils/davidson.irp.f b/plugins/MRCC_Utils/davidson.irp.f index 2c9f5f03..978c96cb 100644 --- a/plugins/MRCC_Utils/davidson.irp.f +++ b/plugins/MRCC_Utils/davidson.irp.f @@ -829,7 +829,9 @@ subroutine davidson_diag_hjj_sjj_mrcc(dets_in,u_in,H_jj,S2_jj,energies,dim_in,sz state_ok(k) = (dabs(s2(k)-expected_s2) < 0.6d0) enddo else - state_ok(k) = .True. + do k=1,size(state_ok) + state_ok(k) = .True. + enddo endif do k=1,shift2 diff --git a/src/Davidson/diagonalization_hs2.irp.f b/src/Davidson/diagonalization_hs2.irp.f index 2402f973..5b5edbbf 100644 --- a/src/Davidson/diagonalization_hs2.irp.f +++ b/src/Davidson/diagonalization_hs2.irp.f @@ -306,7 +306,9 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,S2_jj,energies,dim_in,sze,N_s state_ok(k) = (dabs(s2(k)-expected_s2) < 0.6d0) enddo else - state_ok(k) = .True. + do k=1,size(state_ok) + state_ok(k) = .True. + enddo endif do k=1,shift2 @@ -385,7 +387,8 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,S2_jj,energies,dim_in,sze,N_s do k=1,N_st_diag if (state_ok(k)) then do i=1,sze - U(i,shift2+k) = (lambda(k) * U(i,shift2+k) - W(i,shift2+k) ) & + U(i,shift2+k) = & + (lambda(k) * U(i,shift2+k) - W(i,shift2+k) ) & * (1.d0 + s2(k) * U(i,shift2+k) - S(i,shift2+k) - S_z2_Sz & )/max(H_jj(i) - lambda (k),1.d-2) enddo