diff --git a/src/Hartree_Fock/NEEDED_MODULES b/src/Hartree_Fock/NEEDED_MODULES index 163bdf10..4ebba314 100644 --- a/src/Hartree_Fock/NEEDED_MODULES +++ b/src/Hartree_Fock/NEEDED_MODULES @@ -1 +1 @@ -AOs BiInts Bitmask Electrons Ezfio_files MonoInts MOs Nuclei Output Utils +AOs BiInts Bitmask Electrons Ezfio_files MonoInts MOGuess MOs Nuclei Output Utils diff --git a/src/Hartree_Fock/SCF.irp.f b/src/Hartree_Fock/SCF.irp.f index 55c42178..9683d3c3 100644 --- a/src/Hartree_Fock/SCF.irp.f +++ b/src/Hartree_Fock/SCF.irp.f @@ -1,19 +1,40 @@ program scf + call create_guess call orthonormalize_mos call run end +subroutine create_guess + implicit none + BEGIN_DOC +! Create an H_core 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 + mo_coef = ao_ortho_lowdin_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 + endif +end + + subroutine run use bitmasks implicit none + BEGIN_DOC +! Run SCF calculation + END_DOC 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 - + thresh_SCF = 1.d-10 call damping_SCF mo_label = "Canonical" diff --git a/src/MOs/mos.irp.f b/src/MOs/mos.irp.f index f1158530..ce8e5272 100644 --- a/src/MOs/mos.irp.f +++ b/src/MOs/mos.irp.f @@ -39,14 +39,7 @@ END_PROVIDER logical :: exists PROVIDE ezfio_filename - !Label - call ezfio_has_mo_basis_mo_label(exists) - if (exists) then - call ezfio_get_mo_basis_mo_label(mo_label) - else - mo_label = 'no_label' - endif - + ! Coefs call ezfio_has_mo_basis_mo_coef(exists) if (exists) then @@ -62,8 +55,15 @@ END_PROVIDER enddo enddo deallocate(buffer) + call ezfio_has_mo_basis_mo_label(exists) + if (exists) then + call ezfio_get_mo_basis_mo_label(mo_label) + else + mo_label = 'no_label' + endif else - mo_coef = 0.d0 + ! Orthonormalized AO basis + mo_coef = 0. endif END_PROVIDER