2015-06-17 18:22:08 +02:00
|
|
|
program scf
|
2015-07-06 14:06:49 +02:00
|
|
|
BEGIN_DOC
|
|
|
|
! Produce `Hartree_Fock` MO orbital
|
|
|
|
! output: mo_basis.mo_tot_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ
|
|
|
|
! output: hartree_fock.energy
|
|
|
|
! optional: mo_basis.mo_coef
|
|
|
|
END_DOC
|
2015-06-17 18:22:08 +02:00
|
|
|
call create_guess
|
|
|
|
call orthonormalize_mos
|
|
|
|
call run
|
|
|
|
end
|
|
|
|
|
|
|
|
subroutine create_guess
|
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
2017-03-29 22:21:46 +02:00
|
|
|
! Create a MO guess if no MOs are present in the EZFIO directory
|
2015-06-17 18:22:08 +02:00
|
|
|
END_DOC
|
|
|
|
logical :: exists
|
|
|
|
PROVIDE ezfio_filename
|
|
|
|
call ezfio_has_mo_basis_mo_coef(exists)
|
|
|
|
if (.not.exists) then
|
|
|
|
if (mo_guess_type == "HCore") then
|
|
|
|
mo_coef = ao_ortho_lowdin_coef
|
|
|
|
TOUCH mo_coef
|
|
|
|
mo_label = 'Guess'
|
2017-09-13 09:06:32 +02:00
|
|
|
call mo_as_eigvectors_of_mo_matrix(mo_mono_elec_integral,size(mo_mono_elec_integral,1),size(mo_mono_elec_integral,2),mo_label,.false.)
|
2015-06-17 18:22:08 +02:00
|
|
|
SOFT_TOUCH mo_coef mo_label
|
|
|
|
else if (mo_guess_type == "Huckel") then
|
|
|
|
call huckel_guess
|
|
|
|
else
|
|
|
|
print *, 'Unrecognized MO guess type : '//mo_guess_type
|
|
|
|
stop 1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
end
|
|
|
|
|
|
|
|
subroutine run
|
|
|
|
|
|
|
|
BEGIN_DOC
|
2017-03-29 22:21:46 +02:00
|
|
|
! Run SCF calculation
|
2015-06-17 18:22:08 +02:00
|
|
|
END_DOC
|
2017-03-29 22:21:46 +02:00
|
|
|
|
|
|
|
use bitmasks
|
|
|
|
implicit none
|
|
|
|
|
2015-11-16 22:08:36 +01:00
|
|
|
double precision :: SCF_energy_before,SCF_energy_after,diag_H_mat_elem
|
2017-03-29 22:21:46 +02:00
|
|
|
double precision :: EHF
|
2015-06-17 18:22:08 +02:00
|
|
|
integer :: i_it, i, j, k
|
|
|
|
|
2017-03-29 22:21:46 +02:00
|
|
|
EHF = HF_energy
|
2015-06-17 18:22:08 +02:00
|
|
|
|
|
|
|
mo_label = "Canonical"
|
2017-03-29 22:21:46 +02:00
|
|
|
|
|
|
|
! Choose SCF algorithm
|
|
|
|
|
2017-06-19 09:42:52 +02:00
|
|
|
! call damping_SCF ! Deprecated routine
|
2017-06-02 23:53:44 +02:00
|
|
|
call Roothaan_Hall_SCF
|
2015-06-17 18:22:08 +02:00
|
|
|
|
|
|
|
end
|
2017-06-02 22:49:42 +02:00
|
|
|
|
|
|
|
|