2020-09-15 11:18:24 +02:00
|
|
|
subroutine unrestricted_auxiliary_energy(nBas,nEns,eps,Eaux,occnum)
|
2020-07-02 14:27:38 +02:00
|
|
|
|
|
|
|
! Compute the auxiliary KS energies
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
|
|
|
integer,intent(in) :: nBas
|
|
|
|
integer,intent(in) :: nEns
|
|
|
|
double precision,intent(in) :: eps(nBas,nspin)
|
2020-09-11 11:55:04 +02:00
|
|
|
double precision,intent(in) :: occnum(nBas,nspin,nEns)
|
2020-08-01 11:45:17 +02:00
|
|
|
|
2020-07-02 14:27:38 +02:00
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
2020-09-11 11:55:04 +02:00
|
|
|
integer :: iEns
|
|
|
|
integer :: ispin
|
|
|
|
integer :: p
|
2020-07-02 14:27:38 +02:00
|
|
|
|
|
|
|
! Output variables
|
|
|
|
|
|
|
|
double precision,intent(out) :: Eaux(nspin,nEns)
|
|
|
|
|
2020-09-11 11:55:04 +02:00
|
|
|
! Compute auxiliary energies for each state of the ensemble based on occupation numbers
|
2020-08-01 11:45:17 +02:00
|
|
|
|
2020-09-11 11:55:04 +02:00
|
|
|
Eaux(:,:) = 0d0
|
|
|
|
do iEns=1,nEns
|
|
|
|
do ispin=1,nspin
|
|
|
|
do p=1,nBas
|
2020-08-01 11:45:17 +02:00
|
|
|
|
2020-09-11 11:55:04 +02:00
|
|
|
Eaux(ispin,iEns) = Eaux(ispin,iEns) + occnum(p,ispin,iEns)*eps(p,ispin)
|
2020-08-01 11:45:17 +02:00
|
|
|
|
2020-09-11 11:55:04 +02:00
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
2020-07-02 14:27:38 +02:00
|
|
|
|
|
|
|
end subroutine unrestricted_auxiliary_energy
|