4
1
mirror of https://github.com/pfloos/quack synced 2024-11-09 07:33:55 +01:00

remove read/write guess

This commit is contained in:
Pierre-Francois Loos 2023-07-17 13:39:13 +02:00
parent 2c7653b7bc
commit 62b9722256
3 changed files with 12 additions and 70 deletions

View File

@ -1,5 +1,5 @@
subroutine RHF(maxSCF,thresh,max_diis,guess_type,level_shift,nNuc,ZNuc,rNuc,ENuc, &
nBas,nO,S,T,V,Hc,F,ERI,dipole_int,X,ERHF,e,c,P,Vx)
nBas,nO,S,T,V,Hc,F,ERI,dipole_int,X,EHF,eps,c,P,Vx)
! Perform restricted Hartree-Fock calculation
@ -53,8 +53,8 @@ subroutine RHF(maxSCF,thresh,max_diis,guess_type,level_shift,nNuc,ZNuc,rNuc,ENuc
! Output variables
double precision,intent(out) :: ERHF
double precision,intent(out) :: e(nBas)
double precision,intent(out) :: EHF
double precision,intent(out) :: eps(nBas)
double precision,intent(out) :: c(nBas,nBas)
double precision,intent(out) :: P(nBas,nBas)
double precision,intent(out) :: Vx(nBas)
@ -137,7 +137,7 @@ subroutine RHF(maxSCF,thresh,max_diis,guess_type,level_shift,nNuc,ZNuc,rNuc,ENuc
Fp = matmul(transpose(X),matmul(F,X))
cp(:,:) = Fp(:,:)
call diagonalize_matrix(nBas,cp,e)
call diagonalize_matrix(nBas,cp,eps)
c = matmul(X,cp)
! Density matrix
@ -146,7 +146,7 @@ subroutine RHF(maxSCF,thresh,max_diis,guess_type,level_shift,nNuc,ZNuc,rNuc,ENuc
! Compute HF energy
ERHF = trace_matrix(nBas,matmul(P,Hc)) &
EHF = trace_matrix(nBas,matmul(P,Hc)) &
+ 0.5d0*trace_matrix(nBas,matmul(P,J)) &
+ 0.25d0*trace_matrix(nBas,matmul(P,K))
@ -154,7 +154,7 @@ subroutine RHF(maxSCF,thresh,max_diis,guess_type,level_shift,nNuc,ZNuc,rNuc,ENuc
if(nBas > nO) then
Gap = e(nO+1) - e(nO)
Gap = eps(nO+1) - eps(nO)
else
@ -165,7 +165,7 @@ subroutine RHF(maxSCF,thresh,max_diis,guess_type,level_shift,nNuc,ZNuc,rNuc,ENuc
! Dump results
write(*,'(1X,A1,1X,I3,1X,A1,1X,F16.10,1X,A1,1X,F10.6,1X,A1,1X,F10.6,1X,A1,1X)') &
'|',nSCF,'|',ERHF+ENuc,'|',Conv,'|',Gap,'|'
'|',nSCF,'|',EHF+ENuc,'|',Conv,'|',Gap,'|'
enddo
write(*,*)'----------------------------------------------------'
@ -193,16 +193,12 @@ subroutine RHF(maxSCF,thresh,max_diis,guess_type,level_shift,nNuc,ZNuc,rNuc,ENuc
EV = trace_matrix(nBas,matmul(P,V))
EJ = 0.5d0*trace_matrix(nBas,matmul(P,J))
EK = 0.25d0*trace_matrix(nBas,matmul(P,K))
ERHF = ET + EV + EJ + EK
EHF = ET + EV + EJ + EK
! Compute dipole moments
call dipole_moment(nBas,P,nNuc,ZNuc,rNuc,dipole_int,dipole)
call print_RHF(nBas,nO,e,C,ENuc,ET,EV,EJ,EK,ERHF,dipole)
! dump orbitals for potential restart
call dump_orbitals(nBas,c)
call print_RHF(nBas,nO,eps,C,ENuc,ET,EV,EJ,EK,EHF,dipole)
! Compute Vx for post-HF calculations

View File

@ -20,11 +20,7 @@ subroutine mo_guess(nBas,guess_type,S,Hc,X,c)
double precision,intent(out) :: c(nBas,nBas)
if(guess_type == 0) then
call read_guess(nBas,c)
elseif(guess_type == 1) then
if(guess_type == 1) then
call core_guess(nBas,Hc,X,c)

View File

@ -1,50 +0,0 @@
subroutine read_guess(nBas,c)
! Read the orbitals from a file
implicit none
include 'parameters.h'
! Input variables
integer,intent(in) :: nBas
! Local variables
logical :: debug
integer :: mu,p
double precision :: coeff
! Output variables
double precision,intent(out) :: c(nBas,nBas)
! Open file with orbitals
debug = .false.
open(unit=12,file='int/MO.dat')
! Read coefficients
c(:,:) = 0d0
do
read(12,*,end=12) mu,p,coeff
c(mu,p) = coeff
c(mu,p) = coeff
enddo
! Close file
12 close(unit=12)
! Print results
if(debug) then
write(*,'(A28)') '----------------------'
write(*,'(A28)') 'Orbitals'
write(*,'(A28)') '----------------------'
call matout(nBas,nBas,c)
write(*,*)
endif
end subroutine read_guess