Skip to content

Commit

Permalink
extracted x2czora_atguess()
Browse files Browse the repository at this point in the history
  • Loading branch information
edoapra committed Feb 28, 2024
1 parent b3c8f8a commit dca25de
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 17 deletions.
22 changes: 5 additions & 17 deletions src/nwdft/scf_dft/dft_scf.F
Original file line number Diff line number Diff line change
Expand Up @@ -690,26 +690,13 @@ logical function dft_scf(rtdb, Etold, Enuc, iVcoul_opt, iVxc_opt,
c
c == force sleazy SCF into "direct" mode ==
call fock_force_direct(rtdb)
c
c -------------------------------------------
c calculate superposition of atomic densities
c if ZORA or X2C functionality is requested
c -------------------------------------------

if ((do_zora .or. do_x2c) .and. .not.x2c_noatm()) then
call ga_zero(g_dens_at(1))
if (ipol.gt.1) call ga_zero(g_dens_at(2))
call guess_dens(rtdb, geom, ao_bas_han, g_dens_at)
call dft_quickguess(ipol,nbf_ao,g_dens_at,oskel,
N ntotel,nclosed,
D .false.)
else if (do_x2c .and. x2c_noatm()) then
call ga_zero(g_dens_at(1))
if (ipol.gt.1) call ga_zero(g_dens_at(2))
end if ! do_zora .or. do_x2c
call x2czora_atguess(rtdb,geom,ao_bas_han,
i ipol, nbf_ao, oskel, ntotel, nclosed,
d do_zora, do_x2c,
g g_dens_at)
c
c == get atomic zora contributions ==
if (.not.rtdb_get(rtdb,'zora',mt_log,1,do_zora)) do_zora = .false.
c
if (do_zora) then
if (me.eq.0) then
Expand Down Expand Up @@ -880,6 +867,7 @@ logical function dft_scf(rtdb, Etold, Enuc, iVcoul_opt, iVxc_opt,
endif
if(staticguess) llldb_out=util_statldb(llldb,rtdb)
call dft_guessout(nmo,nbf_ao,g_gmovecs,g_movecs,ipol)
cedo store g_movecs for max_ovl as g_movecs0
if (me.eq.0.and.oprint)
& write(LuOut,'(2x," Time after variat. SCF: ",f8.1)')
& util_wallsec()
Expand Down
33 changes: 33 additions & 0 deletions src/nwdft/x2c/x2c_utils.F
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,36 @@ subroutine x2c_guess(rtdb,nexc,ipol,

return
end

subroutine x2czora_atguess(rtdb,geom,ao_bas_han,
i ipol, nbf_ao, oskel, ntotel, nclosed,
d do_zora, do_x2c,
g g_dens_at)
implicit none
integer rtdb,geom,ao_bas_han
integer ipol, nbf_ao, oskel, ntotel, nclosed
logical do_zora, do_x2c
integer g_dens_at(*)
c
logical x2c_noatm
external x2c_noatm

c
c -------------------------------------------
c calculate superposition of atomic densities
c if ZORA or X2C functionality is requested
c -------------------------------------------

if ((do_zora .or. do_x2c) .and. .not.x2c_noatm()) then
call ga_zero(g_dens_at(1))
if (ipol.gt.1) call ga_zero(g_dens_at(2))
call guess_dens(rtdb, geom, ao_bas_han, g_dens_at)
call dft_quickguess(ipol,nbf_ao,g_dens_at,oskel,
N ntotel,nclosed,
D .false.)
else if (do_x2c .and. x2c_noatm()) then
call ga_zero(g_dens_at(1))
if (ipol.gt.1) call ga_zero(g_dens_at(2))
end if ! do_zora .or. do_x2c
return
end

0 comments on commit dca25de

Please sign in to comment.