10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-28 08:02:20 +02:00
quantum_package/src/Hartree_Fock/SCF.irp.f

53 lines
1.2 KiB
FortranFixed
Raw Normal View History

2014-06-19 17:58:45 +02:00
2014-06-25 14:58:58 +02:00
program scf
call create_guess
2014-06-25 14:58:58 +02:00
call orthonormalize_mos
call run
2014-06-19 17:58:45 +02:00
end
subroutine create_guess
implicit none
BEGIN_DOC
! Create an MO guess if no MOs are present in the EZFIO directory
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'
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)
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
2014-06-25 14:58:58 +02:00
subroutine run
2014-06-19 17:58:45 +02:00
2014-06-25 14:58:58 +02:00
use bitmasks
2014-06-19 22:34:56 +02:00
implicit none
BEGIN_DOC
! Run SCF calculation
END_DOC
2014-06-25 14:58:58 +02:00
double precision :: SCF_energy_before,SCF_energy_after,diag_H_mat_elem,get_mo_bielec_integral
double precision :: E0
integer :: i_it, i, j, k
E0 = HF_energy
2014-06-25 14:58:58 +02:00
thresh_SCF = 1.d-10
call damping_SCF
mo_label = "Canonical"
TOUCH mo_label mo_coef
call save_mos
2014-06-19 22:34:56 +02:00
2014-06-19 17:58:45 +02:00
end