From bde1f300d77a692b88715444dd0f805832884dac Mon Sep 17 00:00:00 2001 From: abussy Date: Tue, 16 Jan 2024 17:17:04 +0100 Subject: [PATCH] Clarify RI-HFXk input --- src/hfx_ri_kp.F | 7 ++----- src/input_cp2k_hfx.F | 27 +++++++++------------------ 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/src/hfx_ri_kp.F b/src/hfx_ri_kp.F index 5fe5004aab..91de3791ee 100644 --- a/src/hfx_ri_kp.F +++ b/src/hfx_ri_kp.F @@ -4154,7 +4154,7 @@ SUBROUTINE get_kp_and_ri_images(ri_data, qs_env) INTEGER, ALLOCATABLE, DIMENSION(:) :: dist_AO_1, dist_AO_2, dist_RI, & nRI_per_atom, present_img, RI_cells INTEGER, DIMENSION(:, :, :), POINTER :: cell_to_index - REAL(dp) :: bump_fact, dij, dik, fact, image_range, & + REAL(dp) :: bump_fact, dij, dik, image_range, & RI_range, rij(3), rik(3) TYPE(dbt_type) :: t_dummy TYPE(dft_control_type), POINTER :: dft_control @@ -4189,7 +4189,6 @@ SUBROUTINE get_kp_and_ri_images(ri_data, qs_env) kp_index_ubounds = UBOUND(cell_to_index) hfx_section => section_vals_get_subs_vals(qs_env%input, "DFT%XC%HF%RI") - CALL section_vals_val_get(hfx_section, "KP_RI_EXTENSION_FACTOR", r_val=fact) CALL section_vals_val_get(hfx_section, "KP_NGROUPS", i_val=ngroups) ALLOCATE (basis_set_RI(nkind), basis_set_AO(nkind)) @@ -4207,7 +4206,7 @@ SUBROUTINE get_kp_and_ri_images(ri_data, qs_env) ri_data%kp_image_range = 0.0_dp DO ikind = 1, nkind - CALL init_interaction_radii_orb_basis(basis_set_AO(ikind)%gto_basis_set, fact*ri_data%eps_pgf_orb) + CALL init_interaction_radii_orb_basis(basis_set_AO(ikind)%gto_basis_set, ri_data%eps_pgf_orb) CALL get_gto_basis_set(basis_set_AO(ikind)%gto_basis_set, kind_radius=RI_range) ri_data%kp_RI_range = MAX(RI_range, ri_data%kp_RI_range) @@ -4330,8 +4329,6 @@ SUBROUTINE get_kp_and_ri_images(ri_data, qs_env) IF (ri_data%unit_nr > 0) THEN WRITE (ri_data%unit_nr, FMT="(/T3,A,I29)") & "KP-HFX_RI_INFO| Number of RI-KP parallel groups:", ngroups - WRITE (ri_data%unit_nr, FMT="(T3,A,F35.3)") & - "KP-HFX_RI_INFO| RI basis extension factor:", fact WRITE (ri_data%unit_nr, FMT="(T3,A,F31.3,A)") & "KP-HFX_RI_INFO| RI basis extension radius:", ri_data%kp_RI_range*angstrom, " Ang" WRITE (ri_data%unit_nr, FMT="(T3,A,F12.3,A, F6.3, A)") & diff --git a/src/input_cp2k_hfx.F b/src/input_cp2k_hfx.F index 9c13dd6c5b..2cc756fc02 100644 --- a/src/input_cp2k_hfx.F +++ b/src/input_cp2k_hfx.F @@ -484,7 +484,9 @@ SUBROUTINE create_hf_ri_section(section) CPASSERT(.NOT. ASSOCIATED(section)) CALL section_create(section, __LOCATION__, name="RI", & - description="Parameters for RI method in HFX (experimental, forces not yet implemented).") + description="Parameters for RI methods in HFX, including RI-HFXk with "// & + "k-point sampling. All keywords relevant to RI-HFXk have an "// & + "alias starting with KP_") CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", & description="controls the activation of RI", & @@ -495,7 +497,8 @@ SUBROUTINE create_hf_ri_section(section) CALL keyword_release(keyword) CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", & - description="Filter threshold for DBCSR tensor contraction.", & + description="Filter threshold for DBT tensor contraction.", & + variants=(/"KP_EPS_FILTER"/), & default_r_val=1.0E-09_dp) CALL section_add_keyword(section, keyword) CALL keyword_release(keyword) @@ -524,6 +527,7 @@ SUBROUTINE create_hf_ri_section(section) CALL keyword_create(keyword, __LOCATION__, name="OMEGA", & description="The range parameter for the short range operator (in 1/a0). "// & "Default is OMEGA from INTERACTION_POTENTIAL. ", & + variants=(/"KP_OMEGA"/), & default_r_val=0.0_dp, & repeats=.FALSE.) CALL section_add_keyword(section, keyword) @@ -532,6 +536,7 @@ SUBROUTINE create_hf_ri_section(section) CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS", & description="The cutoff radius (in Angstroms) for the truncated Coulomb operator. "// & "Default is CUTOFF_RADIUS from INTERACTION_POTENTIAL. ", & + variants=(/"KP_CUTOFF_RADIUS"/), & default_r_val=0.0_dp, & repeats=.FALSE., & unit_str="angstrom") @@ -578,22 +583,6 @@ SUBROUTINE create_hf_ri_section(section) CALL section_add_keyword(section, keyword) CALL keyword_release(keyword) - CALL keyword_create(keyword, __LOCATION__, name="KP_RI_EXTENSION_FACTOR", & - variants=s2a("RI_EXTENSION_FACTOR", "RI_EXT", "RI_EXT_FACT", "KP_RI_EXT", & - "KP_RI_EXT_FACT", "KP_RI_BASIS_EXT", "RI_BASIS_EXT"), & - description="In KP-RI-HFX, each atom has its own local RI basis. The RI "// & - "basis is defined by a sphere of radius R centered on the atom, "// & - "whereby all neighboring atoms within that sphere contribute their "// & - "RI basis elements. The radius of that sphere is calculated based "// & - "on the systems' most diffuse orbital PGF (with exponant alpha), such "// & - "that EPS_PGF_ORB * KP_RI_EXTENSION_FACTOR = exp(-alpha*R^2). "// & - "The default value of 1.0 is safe. More accurate results can be "// & - "obtained with a value < 1.0, at greated computational cost.", & - default_r_val=1.0_dp, & - repeats=.FALSE.) - CALL section_add_keyword(section, keyword) - CALL keyword_release(keyword) - CALL keyword_create(keyword, __LOCATION__, name="KP_RI_BUMP_FACTOR", & variants=s2a("RI_BUMP", "BUMP", "BUMP_FACTOR"), & description="In KP-RI-HFX, the extended RI basis set has a bump radius. "// & @@ -614,6 +603,7 @@ SUBROUTINE create_hf_ri_section(section) "Coulomb operator cannot be used in periodic systems.", & usage="OPERATOR {string}", & repeats=.FALSE., & + variants=(/"KP_RI_METRIC"/), & default_i_val=0, & enum_c_vals=s2a("HFX", "COULOMB", "IDENTITY", "TRUNCATED", "SHORTRANGE"), & enum_desc=s2a("Same as HFX operator", & @@ -677,6 +667,7 @@ SUBROUTINE create_hf_ri_section(section) CALL keyword_create(keyword, __LOCATION__, name="EPS_PGF_ORB", & description="Sets precision of the integral tensors.", & + variants=(/"KP_EPS_PGF_ORB"/), & default_r_val=1.0E-5_dp) CALL section_add_keyword(section, keyword) CALL keyword_release(keyword)