From e8d1ac1fd2fda2b4da60c295f7220791582fdb08 Mon Sep 17 00:00:00 2001 From: SY Wang Date: Tue, 17 Mar 2026 18:49:42 +0800 Subject: [PATCH] Fix dashboard issues (#4969) --- src/input_cp2k_scf.F | 8 ++++---- src/qs_mo_occupation.F | 12 ++++++++---- tests/QS/regtest-gpw-5/TEST_FILES.toml | 2 +- tests/QS/regtest-gpw-5/si8_pulay_md.inp | 3 +-- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/input_cp2k_scf.F b/src/input_cp2k_scf.F index 159d5b12ec..644ffb9f88 100644 --- a/src/input_cp2k_scf.F +++ b/src/input_cp2k_scf.F @@ -1292,16 +1292,16 @@ CONTAINS "Use this method if the temperature equivalence is important for you, "// & "e.g. if you want to compute some properties based on the occupations. "// & "If you use this method without interest in electronic temperature, "// & - "it's suggested use extrapolated result from finite ELECTRONIC_TEMPERATURE "// & + "it's suggested to use extrapolated result from finite ELECTRONIC_TEMPERATURE "// & "to ELECTRONIC_TEMPERATURE = 0. Note the forces and stress are consistent "// & "with the free energy and not with the extrapolated energy.", & "Energy window defined by the keyword WINDOW_SIZE.", & "Use a fixed list of occupations.", & "Gaussian broadening with width SIGMA; should work well in most cases. "// & "With this method you have to use extrapolated results from finite "// & - "SIGMA results to SIGMA = 0, but usually this value will not be accurate "// & - "without systematically reducing SIGMA. Note the forces and stress are "// & - "consistent with the free energy and not with the extrapolated energy.", & + "SIGMA results to SIGMA = 0, but usually this value would not be quite "// & + "accurate without systematically reducing SIGMA. Note the forces and stress "// & + "are consistent with the free energy and not with the extrapolated energy.", & "First-order Methfessel-Paxton distribution with width SIGMA. Don't "// & "use it for semiconductors and insulators because the partial "// & "occupancies can be unphysical and thus lead to wrong results.", & diff --git a/src/qs_mo_occupation.F b/src/qs_mo_occupation.F index 8b3fdd1ca8..dcf411697e 100644 --- a/src/qs_mo_occupation.F +++ b/src/qs_mo_occupation.F @@ -424,6 +424,7 @@ CONTAINS REAL(KIND=dp) :: delectron, e1, e2, edelta, edist, & el_count, nelec, occ_estate, & total_zeff_corr, xas_nelectron + REAL(KIND=dp), ALLOCATABLE, DIMENSION(:) :: tmp_v CALL timeset(routineN, handle) @@ -621,11 +622,12 @@ CONTAINS smear%electronic_temperature, mo_set%maxocc, smear_fermi_dirac, & xas_estate, occ_estate) ELSE - eval_deriv = eval_deriv - mo_set%eigenvalues + mo_set%mu + IF (.NOT. ALLOCATED(tmp_v)) ALLOCATE (tmp_v(SIZE(eval_deriv))) + tmp_v(:) = eval_deriv - mo_set%eigenvalues + mo_set%mu CALL SmearFixedDerivMV(eval_deriv, mo_set%occupation_numbers(1:mo_set%nmo), mo_set%mu, & mo_set%kTS, mo_set%eigenvalues(1:mo_set%nmo), Nelec, & smear%electronic_temperature, mo_set%maxocc, smear_fermi_dirac, & - eval_deriv, xas_estate, occ_estate) + tmp_v, xas_estate, occ_estate) END IF ! Find the lowest fractional occupied MO (LFOMO) @@ -663,11 +665,12 @@ CONTAINS smear%smearing_width, mo_set%maxocc, smear%method, & xas_estate, occ_estate) ELSE - eval_deriv = eval_deriv - mo_set%eigenvalues + mo_set%mu + IF (.NOT. ALLOCATED(tmp_v)) ALLOCATE (tmp_v(SIZE(eval_deriv))) + tmp_v(:) = eval_deriv - mo_set%eigenvalues + mo_set%mu CALL SmearFixedDerivMV(eval_deriv, mo_set%occupation_numbers(1:mo_set%nmo), mo_set%mu, & mo_set%kTS, mo_set%eigenvalues(1:mo_set%nmo), Nelec, & smear%smearing_width, mo_set%maxocc, smear%method, & - eval_deriv, xas_estate, occ_estate) + tmp_v, xas_estate, occ_estate) END IF ! Find the lowest fractional occupied MO (LFOMO) @@ -772,6 +775,7 @@ CONTAINS ! zeros don't count as uniform mo_set%uniform_occupation = has_uniform_occupation(mo_set=mo_set) + IF (ALLOCATED(tmp_v)) DEALLOCATE (tmp_v) CALL timestop(handle) END SUBROUTINE set_mo_occupation_1 diff --git a/tests/QS/regtest-gpw-5/TEST_FILES.toml b/tests/QS/regtest-gpw-5/TEST_FILES.toml index a8d24c2b1b..5d6211db95 100644 --- a/tests/QS/regtest-gpw-5/TEST_FILES.toml +++ b/tests/QS/regtest-gpw-5/TEST_FILES.toml @@ -8,7 +8,7 @@ "si8_kerker.inp" = [{matcher="E_total", tol=1e-12, ref=-31.06508598268039}] "si8_pulay.inp" = [{matcher="E_total", tol=2e-13, ref=-31.06537120886255}] "si8_broy.inp" = [{matcher="E_total", tol=7e-14, ref=-31.06537114151118}] -"si8_pulay_md.inp" = [{matcher="E_total", tol=5e-09, ref=-31.06663571989989}] +"si8_pulay_md.inp" = [{matcher="E_total", tol=5e-09, ref=-31.06829331239024}] "si8_pulay_skip.inp" = [{matcher="E_total", tol=5e-14, ref=-31.06537121708260}] # cholesky methods "si8_pulay_reduce.inp" = [{matcher="E_total", tol=2e-13, ref=-31.06537120886254}] diff --git a/tests/QS/regtest-gpw-5/si8_pulay_md.inp b/tests/QS/regtest-gpw-5/si8_pulay_md.inp index 41c44d1bcc..9348dac5dc 100644 --- a/tests/QS/regtest-gpw-5/si8_pulay_md.inp +++ b/tests/QS/regtest-gpw-5/si8_pulay_md.inp @@ -26,7 +26,6 @@ NGRIDS 5 &END MGRID &QS - EPS_DEFAULT 1.0E-12 EXTRAPOLATION ASPC METHOD GPW &END QS @@ -41,7 +40,7 @@ ALPHA 0.4 BETA 1.0 METHOD PULAY_MIXING - NPULAY 5 + NPULAY 8 PULAY_ALPHA 0.0 &END MIXING &OUTER_SCF OFF