4
1
mirror of https://github.com/pfloos/quack synced 2024-07-28 16:14:22 +02:00
quack/src/MCQC/eNcusp.f90.x

43 lines
1.1 KiB
Plaintext
Raw Normal View History

2019-02-07 22:49:12 +01:00
subroutine eNcusp(nEl,nBas,S,T,V,G,X,ENuc,EHF,c,e,P,F)
! Perform restricted Hartree-Fock calculation
implicit none
! Input variables
integer,intent(in) :: nEl,nBas
double precision,intent(in) :: ENuc,EHF
double precision,intent(in) :: S(nBas,nBas),T(nBas,nBas),V(nBas,nBas),G(nBas,nBas,nBas,nBas),X(nBas,nBas)
double precision,intent(out) :: c(nBas,nBas),e(nBas),P(nBas,nBas),F(nBas,nBas)
! Local variables
integer,parameter :: maxSCF = 128
double precision,parameter :: thresh = 1d-6
integer :: nO,nSCF,lwork,info
double precision :: ET,EV,Conv,Gap
double precision,allocatable :: Hc(:,:),cp(:,:),cO(:,:),Fp(:,:),work(:)
integer :: mu,nu,lambda,sigma,i
! Output variables
! Number of occupied orbitals
if(mod(nEl,2) /= 0) then
write(*,*) 'closed-shell system required!'
stop
endif
nO = nEl/2
! Memory allocation
allocate(Hc(nBas,nBas),cp(nBas,nBas),cO(nBas,nO),Fp(nBas,nBas))
lwork = 3*nBas
allocate(work(lwork))
! Core Hamiltonian
Hc = T + V
end subroutine eNcusp