From 2f8dfa158c9dbf8013b589caec8ed85ac498898a Mon Sep 17 00:00:00 2001 From: Juerg Hutter Date: Wed, 11 Feb 2026 15:04:18 +0100 Subject: [PATCH] D4: correctly set CN rc cutoff (#4821) --- src/input_cp2k_xc.F | 2 +- src/qs_dispersion_pairpot.F | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/input_cp2k_xc.F b/src/input_cp2k_xc.F index 886fde8761..db2dacd20a 100644 --- a/src/input_cp2k_xc.F +++ b/src/input_cp2k_xc.F @@ -966,7 +966,7 @@ CONTAINS CALL keyword_release(keyword) CALL keyword_create(keyword, __LOCATION__, name="D4_CN_CUTOFF", & description="Coordination number cutoff for D4", & - usage="D4_CN_CUTOFF 30.0", default_r_val=10.0_dp, & + usage="D4_CN_CUTOFF 30.0", default_r_val=-1.0_dp, & unit_str="angstrom") CALL section_add_keyword(subsection, keyword) CALL keyword_release(keyword) diff --git a/src/qs_dispersion_pairpot.F b/src/qs_dispersion_pairpot.F index fde59b70e0..55c7fd6287 100644 --- a/src/qs_dispersion_pairpot.F +++ b/src/qs_dispersion_pairpot.F @@ -350,7 +350,9 @@ CONTAINS dispersion_env%alp = 14._dp ! dispersion_env%cnfun = 3 - dispersion_env%rc_cn = get_cn_radius(dispersion_env) + IF (dispersion_env%rc_cn < 0.0_dp) THEN + dispersion_env%rc_cn = get_cn_radius(dispersion_env) + END IF IF (PRESENT(pp_section)) THEN eeq_section => section_vals_get_subs_vals(pp_section, "EEQ") CALL read_eeq_param(eeq_section, dispersion_env%eeq_sparam)