2020-07-02 14:27:38 +02:00
|
|
|
subroutine unrestricted_auxiliary_energy(nBas,nEns,nO,eps,Eaux)
|
|
|
|
|
|
|
|
! Compute the auxiliary KS energies
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
|
|
|
integer,intent(in) :: nBas
|
|
|
|
integer,intent(in) :: nEns
|
|
|
|
integer,intent(in) :: nO(nspin)
|
|
|
|
double precision,intent(in) :: eps(nBas,nspin)
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
|
|
|
integer :: iEns,ispin
|
|
|
|
|
|
|
|
! Output variables
|
|
|
|
|
|
|
|
double precision,intent(out) :: Eaux(nspin,nEns)
|
|
|
|
|
|
|
|
! N-electron ground state
|
|
|
|
|
|
|
|
iEns = 1
|
|
|
|
do ispin=1,nspin
|
2020-07-02 15:40:30 +02:00
|
|
|
Eaux(ispin,iEns) = sum(eps(1:nO(ispin),ispin))
|
2020-07-02 14:27:38 +02:00
|
|
|
end do
|
|
|
|
|
2020-07-02 15:40:30 +02:00
|
|
|
! (N-1)-electron ground state
|
2020-07-02 14:27:38 +02:00
|
|
|
|
|
|
|
iEns = 2
|
|
|
|
|
|
|
|
Eaux(1,iEns) = sum(eps(1:nO(1),1))
|
|
|
|
|
|
|
|
if(nO(2) > 1) then
|
|
|
|
Eaux(2,iEns) = sum(eps(1:nO(2)-1,2))
|
|
|
|
else
|
|
|
|
Eaux(2,iEns) = 0d0
|
|
|
|
end if
|
|
|
|
|
2020-07-02 15:40:30 +02:00
|
|
|
! (N+1)-electron ground state
|
2020-07-02 14:27:38 +02:00
|
|
|
|
|
|
|
iEns = 3
|
|
|
|
|
|
|
|
Eaux(1,iEns) = sum(eps(1:nO(1)+1,1))
|
2020-07-04 13:19:45 +02:00
|
|
|
Eaux(2,iEns) = sum(eps(1:nO(2),2))
|
2020-07-02 14:27:38 +02:00
|
|
|
|
|
|
|
end subroutine unrestricted_auxiliary_energy
|