Skip to content

C-API: Fix s9 not being set to 0.0#334

Merged
marvinfriede merged 3 commits intomainfrom
fix-s9-capi
Feb 4, 2026
Merged

C-API: Fix s9 not being set to 0.0#334
marvinfriede merged 3 commits intomainfrom
fix-s9-capi

Conversation

@marvinfriede
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the C-API behavior for the atm/MBD toggle (s9 parameter) and adds a regression test to ensure the bug does not reappear.

Changes:

  • Update load_rational_damping_api to explicitly set s9 to 1.0_wp when atm is true and 0.0_wp when atm is false.
  • Add test_mbd_toggle in the C API example test to compare energies with MBD on vs. off and verify they differ.
  • Wire the new test into main so it is executed with the other API tests.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/dftd4/api.f90 Fixes load_rational_damping_api so s9 is set correctly for both atm=.true. and atm=.false..
test/api/example.c Adds test_mbd_toggle that exercises the atm boolean in dftd4_load_rational_damping and ensures MBD-on/off energies are not (near-)identical; registers the new test in main.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@marvinfriede marvinfriede merged commit 1769a0e into main Feb 4, 2026
47 checks passed
@marvinfriede marvinfriede deleted the fix-s9-capi branch February 4, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dftd4_load_rational_damping third arg uneffective

2 participants