diff --git a/external/EZFIO.2.0.2.tar.gz b/external/EZFIO.2.0.2.tar.gz deleted file mode 100644 index bae3035f..00000000 Binary files a/external/EZFIO.2.0.2.tar.gz and /dev/null differ diff --git a/src/tools/print_energy.irp.f b/src/tools/print_energy.irp.f index 056531a0..6f770f6a 100644 --- a/src/tools/print_energy.irp.f +++ b/src/tools/print_energy.irp.f @@ -8,6 +8,7 @@ program print_energy ! psi_coef_sorted are the wave function stored in the |EZFIO| directory. read_wf = .True. touch read_wf + PROVIDE N_states if (is_complex) then call run_complex else @@ -17,18 +18,20 @@ end subroutine run implicit none - integer :: i + integer :: i,j double precision :: i_H_psi_array(N_states) double precision :: E(N_states) double precision :: norm(N_states) - E(:) = nuclear_repulsion - norm(:) = 0.d0 + E(1:N_states) = nuclear_repulsion + norm(1:N_states) = 0.d0 do i=1,N_det call i_H_psi(psi_det(1,1,i), psi_det, psi_coef, N_int, N_det, & size(psi_coef,1), N_states, i_H_psi_array) - norm(:) += psi_coef(i,:)**2 - E(:) += i_H_psi_array(:) * psi_coef(i,:) + do j=1,N_states + norm(j) += psi_coef(i,j)*psi_coef(i,j) + E(j) += i_H_psi_array(j) * psi_coef(i,j) + enddo enddo print *, 'Energy:' @@ -44,13 +47,15 @@ subroutine run_complex double precision :: e(n_states) double precision :: norm(n_states) - e(:) = nuclear_repulsion - norm(:) = 0.d0 + e(1:n_states) = nuclear_repulsion + norm(1:n_states) = 0.d0 do i=1,n_det call i_H_psi_complex(psi_det(1,1,i), psi_det, psi_coef_complex, N_int, N_det, & size(psi_coef_complex,1), N_states, i_H_psi_array) - norm(:) += cdabs(psi_coef_complex(i,:))**2 - E(:) += dble(i_h_psi_array(:) * dconjg(psi_coef_complex(i,:))) + do j=1,n_states + norm(j) += cdabs(psi_coef_complex(i,j))**2 + E(j) += dble(i_h_psi_array(j) * dconjg(psi_coef_complex(i,j))) + enddo enddo print *, 'Energy:'