Skip to content

Commit

Permalink
ADMM initialization only if HFX present (GS or RPA) (cp2k#3797)
Browse files Browse the repository at this point in the history
  • Loading branch information
juerghutter authored Dec 6, 2024
1 parent 15f7139 commit 8960cd3
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/cp_control_utils.F
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,16 @@ SUBROUTINE read_dft_control(dft_control, dft_section)
DIMENSION(:), POINTER :: tmpstringlist
INTEGER :: admmtype, excitations, irep, isize, &
method_id, nrep, xc_deriv_method_id
LOGICAL :: do_ot, do_rtp, exopt1, exopt2, exopt3, &
explicit, is_present, l_param, not_SE, &
LOGICAL :: do_hfx, do_ot, do_rpa_admm, do_rtp, &
exopt1, exopt2, exopt3, explicit, &
is_present, l_param, not_SE, &
was_present
REAL(KIND=dp) :: density_cut, gradient_cut, tau_cut
REAL(KIND=dp), DIMENSION(:), POINTER :: pol
TYPE(cp_logger_type), POINTER :: logger
TYPE(section_vals_type), POINTER :: maxwell_section, sccs_section, &
scf_section, tmp_section, &
xc_fun_section, xc_section
TYPE(section_vals_type), POINTER :: hfx_section, maxwell_section, &
sccs_section, scf_section, &
tmp_section, xc_fun_section, xc_section

was_present = .FALSE.

Expand Down Expand Up @@ -238,6 +239,12 @@ SUBROUTINE read_dft_control(dft_control, dft_section)
!! check if we do wavefunction fitting
tmp_section => section_vals_get_subs_vals(dft_section, "AUXILIARY_DENSITY_MATRIX_METHOD")
CALL section_vals_get(tmp_section, explicit=is_present)
!
hfx_section => section_vals_get_subs_vals(xc_section, "HF")
CALL section_vals_get(hfx_section, explicit=do_hfx)
CALL section_vals_val_get(xc_section, "WF_CORRELATION%RI_RPA%ADMM", l_val=do_rpa_admm)
is_present = is_present .AND. (do_hfx .OR. do_rpa_admm)
!
dft_control%do_admm = is_present
dft_control%do_admm_mo = .FALSE.
dft_control%do_admm_dm = .FALSE.
Expand Down

0 comments on commit 8960cd3

Please sign in to comment.