From 9d12e2079d9b945848c706ebe7f70116268d7b89 Mon Sep 17 00:00:00 2001 From: Juerg Hutter Date: Sat, 9 Nov 2024 19:04:25 +0100 Subject: [PATCH] Coding conventions and improve stability of one regtest (#3769) --- src/eeq_data.F | 28 ++++++++++++++-------------- src/eeq_method.F | 6 +++--- src/ewald_environment_types.F | 3 ++- tests/xTB/regtest-gfn0/TEST_FILES | 2 +- tests/xTB/regtest-gfn0/ch2o_eeq.inp | 2 ++ 5 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/eeq_data.F b/src/eeq_data.F index 37949e1bd0..eee99d3dd7 100644 --- a/src/eeq_data.F +++ b/src/eeq_data.F @@ -105,20 +105,20 @@ MODULE eeq_data & 2.8055966_dp, 3.0968677_dp, 1.6597596_dp, 3.2191575_dp, 1.5388148_dp, & & 2.1222013_dp] - ! covalent radii (taken from Pyykko and Atsumi, Chem. Eur. J. 15, 2009, 188-197) - ! values for metals decreased by 10 % - REAL(KIND=dp), PARAMETER :: rcov(1:maxElem) = [& - & 0.32_dp, 0.46_dp, 1.20_dp, 0.94_dp, 0.77_dp, 0.75_dp, 0.71_dp, 0.63_dp, & - & 0.64_dp, 0.67_dp, 1.40_dp, 1.25_dp, 1.13_dp, 1.04_dp, 1.10_dp, 1.02_dp, & - & 0.99_dp, 0.96_dp, 1.76_dp, 1.54_dp, 1.33_dp, 1.22_dp, 1.21_dp, 1.10_dp, & - & 1.07_dp, 1.04_dp, 1.00_dp, 0.99_dp, 1.01_dp, 1.09_dp, 1.12_dp, 1.09_dp, & - & 1.15_dp, 1.10_dp, 1.14_dp, 1.17_dp, 1.89_dp, 1.67_dp, 1.47_dp, 1.39_dp, & - & 1.32_dp, 1.24_dp, 1.15_dp, 1.13_dp, 1.13_dp, 1.08_dp, 1.15_dp, 1.23_dp, & - & 1.28_dp, 1.26_dp, 1.26_dp, 1.23_dp, 1.32_dp, 1.31_dp, 2.09_dp, 1.76_dp, & - & 1.62_dp, 1.47_dp, 1.58_dp, 1.57_dp, 1.56_dp, 1.55_dp, 1.51_dp, 1.52_dp, & - & 1.51_dp, 1.50_dp, 1.49_dp, 1.49_dp, 1.48_dp, 1.53_dp, 1.46_dp, 1.37_dp, & - & 1.31_dp, 1.23_dp, 1.18_dp, 1.16_dp, 1.11_dp, 1.12_dp, 1.13_dp, 1.32_dp, & - & 1.30_dp, 1.30_dp, 1.36_dp, 1.31_dp, 1.38_dp, 1.42_dp] +! ! covalent radii (taken from Pyykko and Atsumi, Chem. Eur. J. 15, 2009, 188-197) +! ! values for metals decreased by 10 % +! REAL(KIND=dp), PARAMETER :: rcov(1:maxElem) = [& +! & 0.32_dp, 0.46_dp, 1.20_dp, 0.94_dp, 0.77_dp, 0.75_dp, 0.71_dp, 0.63_dp, & +! & 0.64_dp, 0.67_dp, 1.40_dp, 1.25_dp, 1.13_dp, 1.04_dp, 1.10_dp, 1.02_dp, & +! & 0.99_dp, 0.96_dp, 1.76_dp, 1.54_dp, 1.33_dp, 1.22_dp, 1.21_dp, 1.10_dp, & +! & 1.07_dp, 1.04_dp, 1.00_dp, 0.99_dp, 1.01_dp, 1.09_dp, 1.12_dp, 1.09_dp, & +! & 1.15_dp, 1.10_dp, 1.14_dp, 1.17_dp, 1.89_dp, 1.67_dp, 1.47_dp, 1.39_dp, & +! & 1.32_dp, 1.24_dp, 1.15_dp, 1.13_dp, 1.13_dp, 1.08_dp, 1.15_dp, 1.23_dp, & +! & 1.28_dp, 1.26_dp, 1.26_dp, 1.23_dp, 1.32_dp, 1.31_dp, 2.09_dp, 1.76_dp, & +! & 1.62_dp, 1.47_dp, 1.58_dp, 1.57_dp, 1.56_dp, 1.55_dp, 1.51_dp, 1.52_dp, & +! & 1.51_dp, 1.50_dp, 1.49_dp, 1.49_dp, 1.48_dp, 1.53_dp, 1.46_dp, 1.37_dp, & +! & 1.31_dp, 1.23_dp, 1.18_dp, 1.16_dp, 1.11_dp, 1.12_dp, 1.13_dp, 1.32_dp, & +! & 1.30_dp, 1.30_dp, 1.36_dp, 1.31_dp, 1.38_dp, 1.42_dp] ! ========================================================================== !> Electronegativity equilibration charge model published in !> diff --git a/src/eeq_method.F b/src/eeq_method.F index 47ddeac76d..629b29ff96 100644 --- a/src/eeq_method.F +++ b/src/eeq_method.F @@ -368,7 +368,7 @@ SUBROUTINE eeq_forces(qs_env, charges, dcharges, gradient, stress, & TYPE(neighbor_list_iterator_p_type), & DIMENSION(:), POINTER :: nl_iterator TYPE(neighbor_list_set_p_type), DIMENSION(:), & - POINTER :: sab_ew => NULL() + POINTER :: sab_ew TYPE(particle_type), DIMENSION(:), POINTER :: particle_set TYPE(qs_force_type), DIMENSION(:), POINTER :: force TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set @@ -1011,8 +1011,8 @@ SUBROUTINE pbc_solver(charges, lambda, eeq_energy, eeq_mat, particle_set, & INTEGER, DIMENSION(3) :: cvec, ncell, periodic INTEGER, DIMENSION(:), POINTER :: cind, rind REAL(KIND=dp) :: ad, alpha, astep, deth, dr, eeqn, & - eps_diis = 1.E-9_dp, ftime, grc1, & - grc2, rcut, res, resin, rmax, te, ti + eps_diis, ftime, grc1, grc2, rcut, & + res, resin, rmax, te, ti REAL(KIND=dp), ALLOCATABLE, DIMENSION(:) :: bvec, dvec REAL(KIND=dp), ALLOCATABLE, DIMENSION(:, :) :: dmat, fvec, vmat, xvec REAL(KIND=dp), DIMENSION(3) :: ri, rij, rijl, rj diff --git a/src/ewald_environment_types.F b/src/ewald_environment_types.F index 462cb5430f..314d033571 100644 --- a/src/ewald_environment_types.F +++ b/src/ewald_environment_types.F @@ -392,7 +392,7 @@ SUBROUTINE read_ewald_section_tb(ewald_env, ewald_section, hmat, silent, pset) LOGICAL, INTENT(IN), OPTIONAL :: silent CHARACTER(LEN=*), OPTIONAL :: pset - CHARACTER(LEN=5) :: param = "none" + CHARACTER(LEN=5) :: param INTEGER :: i, iw, n(3) INTEGER, DIMENSION(:), POINTER :: gmax_read LOGICAL :: do_print, explicit @@ -402,6 +402,7 @@ SUBROUTINE read_ewald_section_tb(ewald_env, ewald_section, hmat, silent, pset) logger => cp_get_default_logger() do_print = .TRUE. IF (PRESENT(silent)) do_print = .NOT. silent + param = "none" IF (PRESENT(pset)) param = pset ewald_env%do_multipoles = .FALSE. diff --git a/tests/xTB/regtest-gfn0/TEST_FILES b/tests/xTB/regtest-gfn0/TEST_FILES index fdbea41d85..76d427399a 100644 --- a/tests/xTB/regtest-gfn0/TEST_FILES +++ b/tests/xTB/regtest-gfn0/TEST_FILES @@ -16,7 +16,7 @@ si_kp.inp 0 si_smear.inp 0 SiC_virial.inp 0 SiC-stress.inp 0 -ch2o_eeq.inp 1 1.0E-12 -7.84498782089221 +ch2o_eeq.inp 1 1.0E-11 -7.84498782090161 ch2o_eloc.inp 0 ch2o_eper.inp 0 #EOF diff --git a/tests/xTB/regtest-gfn0/ch2o_eeq.inp b/tests/xTB/regtest-gfn0/ch2o_eeq.inp index 279c8316ee..a35c679888 100644 --- a/tests/xTB/regtest-gfn0/ch2o_eeq.inp +++ b/tests/xTB/regtest-gfn0/ch2o_eeq.inp @@ -18,6 +18,8 @@ &END XTB &END QS &SCF + EPS_SCF 1.E-8 + MAX_SCF 50 SCF_GUESS ATOMIC &END SCF &END DFT