mirror of
https://github.com/pfloos/quack
synced 2024-11-03 20:53:53 +01:00
guess read implementation
This commit is contained in:
parent
20264ca56c
commit
715c97a1e3
@ -1,5 +1,5 @@
|
||||
# HF: maxSCF thresh DIIS n_diis guess_type ortho_type mix_guess level_shift stability
|
||||
256 0.0000001 T 5 2 1 F 1.0 F
|
||||
512 0.0000001 T 5 2 1 F 1.0 F
|
||||
# MP:
|
||||
|
||||
# CC: maxSCF thresh DIIS n_diis
|
||||
@ -15,6 +15,6 @@
|
||||
# ACFDT: AC Kx XBS
|
||||
F F T
|
||||
# BSE: BSE dBSE dTDA evDyn
|
||||
T T T T
|
||||
T T T F
|
||||
# MCMP2: nMC nEq nWalk dt nPrint iSeed doDrift
|
||||
1000000 100000 10 0.3 10000 1234 T
|
||||
|
@ -204,6 +204,10 @@ subroutine RHF(maxSCF,thresh,max_diis,guess_type,level_shift,nNuc,ZNuc,rNuc,ENuc
|
||||
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)
|
||||
|
||||
! Compute Vx for post-HF calculations
|
||||
|
||||
call mo_fock_exchange_potential(nBas,c,P,ERI,Vx)
|
||||
|
36
src/HF/dump_orbitals.f90
Normal file
36
src/HF/dump_orbitals.f90
Normal file
@ -0,0 +1,36 @@
|
||||
subroutine dump_orbitals(nBas,c)
|
||||
|
||||
! Write orbitals in a file
|
||||
|
||||
implicit none
|
||||
include 'parameters.h'
|
||||
|
||||
! Input variables
|
||||
|
||||
integer,intent(in) :: nBas
|
||||
|
||||
! Local variables
|
||||
|
||||
integer :: mu,p
|
||||
|
||||
! Output variables
|
||||
|
||||
double precision,intent(out) :: c(nBas,nBas)
|
||||
|
||||
! Open file with orbitals
|
||||
|
||||
open(unit=12,file='int/MO.dat')
|
||||
|
||||
! Dump orbitals
|
||||
|
||||
do mu=1,nBas
|
||||
do p=1,nBas
|
||||
if(abs(c(mu,p)) > 1d-15) write(12,'(I6,I6,F20.15)') mu,p,c(mu,p)
|
||||
enddo
|
||||
enddo
|
||||
|
||||
! Close file
|
||||
|
||||
12 close(unit=12)
|
||||
|
||||
end subroutine dump_orbitals
|
@ -20,7 +20,11 @@ subroutine mo_guess(nBas,guess_type,S,Hc,X,c)
|
||||
|
||||
double precision,intent(out) :: c(nBas,nBas)
|
||||
|
||||
if(guess_type == 1) then
|
||||
if(guess_type == 0) then
|
||||
|
||||
call read_guess(nBas,c)
|
||||
|
||||
elseif(guess_type == 1) then
|
||||
|
||||
call core_guess(nBas,Hc,X,c)
|
||||
|
||||
|
50
src/HF/read_guess.f90
Normal file
50
src/HF/read_guess.f90
Normal file
@ -0,0 +1,50 @@
|
||||
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
|
Loading…
Reference in New Issue
Block a user