2021-12-06 15:27:39 +01:00
|
|
|
subroutine print_unrestricted_individual_energy(nEns,ENuc,Ew,ET,EV,EH,Ex,Ec,Eaux,ExDD,EcDD,E,Om,OmH,Omx,Omc,Omaux,OmxDD,OmcDD)
|
2020-07-02 14:27:38 +02:00
|
|
|
|
|
|
|
! Print individual energies for eDFT calculation
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
|
|
|
integer,intent(in) :: nEns
|
|
|
|
double precision,intent(in) :: ENuc
|
|
|
|
double precision,intent(in) :: Ew
|
|
|
|
double precision,intent(in) :: ET(nspin,nEns)
|
|
|
|
double precision,intent(in) :: EV(nspin,nEns)
|
2021-11-30 13:43:37 +01:00
|
|
|
double precision,intent(in) :: EH(nsp,nEns)
|
|
|
|
double precision,intent(in) :: Ex(nspin,nEns)
|
|
|
|
double precision,intent(in) :: Ec(nsp,nEns)
|
2020-07-02 14:27:38 +02:00
|
|
|
double precision,intent(in) :: Eaux(nspin,nEns)
|
2021-11-30 13:43:37 +01:00
|
|
|
double precision,intent(in) :: ExDD(nspin,nEns)
|
|
|
|
double precision,intent(in) :: EcDD(nsp,nEns)
|
2020-07-02 14:27:38 +02:00
|
|
|
double precision,intent(in) :: E(nEns)
|
2021-11-30 13:43:37 +01:00
|
|
|
|
2021-12-06 15:27:39 +01:00
|
|
|
double precision,intent(in) :: OmH(nEns)
|
2021-11-30 13:43:37 +01:00
|
|
|
double precision,intent(in) :: Omx(nEns)
|
|
|
|
double precision,intent(in) :: Omc(nEns)
|
|
|
|
double precision,intent(in) :: Omaux(nEns)
|
|
|
|
double precision,intent(in) :: OmxDD(nEns)
|
|
|
|
double precision,intent(in) :: OmcDD(nEns)
|
2020-07-02 14:27:38 +02:00
|
|
|
double precision,intent(in) :: Om(nEns)
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
|
|
|
integer :: iEns
|
|
|
|
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
! Ensemble energies
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,'(A60)') ' ENSEMBLE ENERGIES'
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
2021-11-29 23:32:49 +01:00
|
|
|
write(*,'(A44,F16.10,A3)') ' Ensemble energy: ',Ew + ENuc,' au'
|
2020-07-02 14:27:38 +02:00
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,*)
|
|
|
|
|
2021-11-01 21:51:02 +01:00
|
|
|
!------------------------------------------------------------------------
|
|
|
|
! Individual energies
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
|
2021-12-06 10:03:28 +01:00
|
|
|
! write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
! write(*,'(A60)') ' INDIVIDUAL TOTAL ENERGIES'
|
|
|
|
! write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
! do iEns=1,nEns
|
|
|
|
! write(*,'(A40,I2,A2,F16.10,A3)') ' Individual energy state ',iEns,': ',E(iEns) + ENuc,' au'
|
|
|
|
! end do
|
|
|
|
! write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
! write(*,*)
|
2021-11-01 21:51:02 +01:00
|
|
|
|
2020-07-02 14:27:38 +02:00
|
|
|
!------------------------------------------------------------------------
|
|
|
|
! Kinetic energy
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
|
2021-11-30 13:43:37 +01:00
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,'(A60)') ' INDIVIDUAL KINETIC ENERGIES'
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
do iEns=1,nEns
|
|
|
|
write(*,'(A40,I2,A2,F16.10,A3)') ' Kinetic energy state ',iEns,': ',sum(ET(:,iEns)),' au'
|
|
|
|
end do
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,*)
|
2020-07-02 14:27:38 +02:00
|
|
|
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
! Potential energy
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
|
2021-11-30 13:43:37 +01:00
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,'(A60)') ' INDIVIDUAL POTENTIAL ENERGIES'
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
do iEns=1,nEns
|
|
|
|
write(*,'(A40,I2,A2,F16.10,A3)') ' Potential energy state ',iEns,': ',sum(EV(:,iEns)),' au'
|
|
|
|
end do
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,*)
|
2020-07-02 14:27:38 +02:00
|
|
|
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
! Hartree energy
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
|
2021-11-30 13:43:37 +01:00
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,'(A60)') ' INDIVIDUAL HARTREE ENERGIES'
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
do iEns=1,nEns
|
|
|
|
write(*,'(A40,I2,A2,F16.10,A3)') ' Hartree energy state ',iEns,': ',sum(EH(:,iEns)),' au'
|
|
|
|
end do
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,*)
|
2020-07-02 14:27:38 +02:00
|
|
|
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
! Exchange energy
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
|
2021-11-30 13:43:37 +01:00
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,'(A60)') ' INDIVIDUAL EXCHANGE ENERGIES'
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
do iEns=1,nEns
|
|
|
|
write(*,'(A40,I2,A2,F16.10,A3)') ' Exchange energy state ',iEns,': ',sum(Ex(:,iEns)),' au'
|
|
|
|
end do
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,*)
|
2020-07-02 14:27:38 +02:00
|
|
|
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
! Correlation energy
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
|
2021-11-30 13:43:37 +01:00
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,'(A60)') ' INDIVIDUAL CORRELATION ENERGIES'
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
do iEns=1,nEns
|
|
|
|
write(*,'(A40,I2,A2,F16.10,A3)') ' Correlation energy state ',iEns,': ',sum(Ec(:,iEns)),' au'
|
|
|
|
end do
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,*)
|
2020-07-02 14:27:38 +02:00
|
|
|
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
! Auxiliary energies
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,'(A60)') ' AUXILIARY KS ENERGIES'
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
do iEns=1,nEns
|
|
|
|
write(*,'(A40,I2,A2,F16.10,A3)') 'Auxiliary KS energy state ',iEns,': ',sum(Eaux(:,iEns)),' au'
|
|
|
|
end do
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
! Compute derivative discontinuities
|
|
|
|
!------------------------------------------------------------------------
|
|
|
|
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,'(A60)') ' ENSEMBLE DERIVATIVE CONTRIBUTIONS'
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
do iEns=1,nEns
|
|
|
|
write(*,*)
|
|
|
|
write(*,'(A40,I2,A2,F16.10,A3)') ' x ensemble derivative state ',iEns,': ',sum(ExDD(:,iEns)), ' au'
|
|
|
|
write(*,'(A40,I2,A2,F16.10,A3)') ' c ensemble derivative state ',iEns,': ',sum(EcDD(:,iEns)), ' au'
|
2021-11-30 13:43:37 +01:00
|
|
|
write(*,'(A40,I2,A2,F16.10,A3)') ' xc ensemble derivative state ',iEns,': ',sum(ExDD(:,iEns))+sum(EcDD(:,iEns)),' au'
|
2020-07-02 14:27:38 +02:00
|
|
|
end do
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
!------------------------------------------------------------------------
|
2020-07-02 22:15:29 +02:00
|
|
|
! Total Energy and IP and EA
|
2020-07-02 14:27:38 +02:00
|
|
|
!------------------------------------------------------------------------
|
|
|
|
|
2021-12-06 15:27:39 +01:00
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,'(A60)') ' ENERGY DIFFERENCES FROM AUXILIARY ENERGIES '
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
2021-12-06 10:03:28 +01:00
|
|
|
|
2021-12-06 15:27:39 +01:00
|
|
|
do iEns=2,nEns
|
|
|
|
write(*,'(A40,I2,A1,F16.10,A3)') ' Energy difference 1 -> ',iEns,':',Omaux(iEns)+OmxDD(iEns)+OmcDD(iEns),' au'
|
|
|
|
write(*,*)
|
|
|
|
write(*,'(A44, F16.10,A3)') ' auxiliary energy contribution : ',Omaux(iEns), ' au'
|
|
|
|
write(*,'(A44, F16.10,A3)') ' x ensemble derivative : ',OmxDD(iEns), ' au'
|
|
|
|
write(*,'(A44, F16.10,A3)') ' c ensemble derivative : ',OmcDD(iEns), ' au'
|
|
|
|
write(*,'(A44, F16.10,A3)') ' xc ensemble derivative : ',OmxDD(iEns)+OmcDD(iEns), ' au'
|
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
|
|
|
|
write(*,'(A40,I2,A1,F16.10,A3)') ' Energy difference 1 -> ',iEns,':',(Omaux(iEns)+OmxDD(iEns)+OmcDD(iEns))*HaToeV,' eV'
|
|
|
|
write(*,*)
|
|
|
|
write(*,'(A44, F16.10,A3)') ' auxiliary energy contribution : ',Omaux(iEns)*HaToeV, ' eV'
|
|
|
|
write(*,'(A44, F16.10,A3)') ' x ensemble derivative : ',OmxDD(iEns)*HaToeV, ' eV'
|
|
|
|
write(*,'(A44, F16.10,A3)') ' c ensemble derivative : ',OmcDD(iEns)*HaToeV, ' eV'
|
|
|
|
write(*,'(A44, F16.10,A3)') ' xc ensemble derivative : ',(OmxDD(iEns)+OmcDD(iEns))*HaToeV,' eV'
|
|
|
|
write(*,*)
|
|
|
|
end do
|
2021-12-06 10:03:28 +01:00
|
|
|
|
2021-12-06 15:27:39 +01:00
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,*)
|
2021-11-25 17:45:48 +01:00
|
|
|
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
2021-11-29 13:11:01 +01:00
|
|
|
write(*,'(A60)') ' ENERGY DIFFERENCES FROM INDIVIDUAL ENERGIES '
|
2021-11-23 09:17:13 +01:00
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
2021-11-30 13:43:37 +01:00
|
|
|
do iEns=1,nEns
|
|
|
|
write(*,'(A40,I2,A2,F16.10,A3)') ' Individual energy state ',iEns,': ',E(iEns) + ENuc,' au'
|
|
|
|
end do
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
2021-11-23 09:17:13 +01:00
|
|
|
|
|
|
|
do iEns=2,nEns
|
|
|
|
write(*,'(A40,I2,A1,F16.10,A3)') ' Energy difference 1 -> ',iEns,':',Om(iEns), ' au'
|
|
|
|
write(*,*)
|
2021-12-06 15:27:39 +01:00
|
|
|
write(*,'(A44, F16.10,A3)') ' H energy contribution : ',OmH(iEns), ' au'
|
2021-11-30 13:43:37 +01:00
|
|
|
write(*,'(A44, F16.10,A3)') ' x energy contribution : ',Omx(iEns), ' au'
|
|
|
|
write(*,'(A44, F16.10,A3)') ' c energy contribution : ',Omc(iEns), ' au'
|
2021-12-06 15:27:39 +01:00
|
|
|
write(*,'(A44, F16.10,A3)') ' Hxc energy contribution : ',OmH(iEns)+Omx(iEns)+Omc(iEns), ' au'
|
2021-11-30 13:43:37 +01:00
|
|
|
write(*,*)
|
2021-11-23 09:17:13 +01:00
|
|
|
write(*,'(A44, F16.10,A3)') ' x ensemble derivative : ',OmxDD(iEns), ' au'
|
|
|
|
write(*,'(A44, F16.10,A3)') ' c ensemble derivative : ',OmcDD(iEns), ' au'
|
2021-11-30 13:43:37 +01:00
|
|
|
write(*,'(A44, F16.10,A3)') ' xc ensemble derivative : ',OmxDD(iEns)+OmcDD(iEns),' au'
|
2021-11-23 09:17:13 +01:00
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
2021-11-10 09:48:33 +01:00
|
|
|
|
2021-11-23 09:17:13 +01:00
|
|
|
write(*,'(A40,I2,A1,F16.10,A3)') ' Energy difference 1 -> ',iEns,':',Om(iEns)*HaToeV, ' eV'
|
|
|
|
write(*,*)
|
2021-12-06 15:27:39 +01:00
|
|
|
write(*,'(A44, F16.10,A3)') ' H energy contribution : ',OmH(iEns)*HaToeV, ' eV'
|
2021-11-30 13:43:37 +01:00
|
|
|
write(*,'(A44, F16.10,A3)') ' x energy contribution : ',Omx(iEns)*HaToeV, ' eV'
|
|
|
|
write(*,'(A44, F16.10,A3)') ' c energy contribution : ',Omc(iEns)*HaToeV, ' eV'
|
2021-12-06 15:27:39 +01:00
|
|
|
write(*,'(A44, F16.10,A3)') ' Hxc energy contribution : ',(OmH(iEns)+Omx(iEns)+Omc(iEns))*HaToeV, ' eV'
|
2021-11-30 13:43:37 +01:00
|
|
|
write(*,*)
|
2021-11-23 09:17:13 +01:00
|
|
|
write(*,'(A44, F16.10,A3)') ' x ensemble derivative : ',OmxDD(iEns)*HaToeV, ' eV'
|
|
|
|
write(*,'(A44, F16.10,A3)') ' c ensemble derivative : ',OmcDD(iEns)*HaToeV, ' eV'
|
2021-11-30 13:43:37 +01:00
|
|
|
write(*,'(A44, F16.10,A3)') ' xc ensemble derivative : ',(OmxDD(iEns)+OmcDD(iEns))*HaToeV,' eV'
|
2021-11-25 17:45:48 +01:00
|
|
|
write(*,*)
|
2021-11-23 09:17:13 +01:00
|
|
|
end do
|
|
|
|
write(*,'(A60)') '-------------------------------------------------'
|
|
|
|
write(*,*)
|
2020-07-02 14:27:38 +02:00
|
|
|
|
|
|
|
end subroutine print_unrestricted_individual_energy
|