Skip to content

Expose ndrop mixing substep count - #577

Draft
susburrows wants to merge 1 commit into
eagles-project:mainfrom
susburrows:codex/instrument-ndrop-nsubmix
Draft

Expose ndrop mixing substep count#577
susburrows wants to merge 1 commit into
eagles-project:mainfrom
susburrows:codex/instrument-ndrop-nsubmix

Conversation

@susburrows

@susburrows susburrows commented Aug 18, 2026

Copy link
Copy Markdown

Expose the exact ndrop explicit mixing substep count without changing the physics.

Summary

  • Add an int& nsubmix output to update_from_explmix and dropmixnuc.
  • Return the same integer that directly controls the existing explicit mixing loop.
  • Update all in-tree validation call sites with local sink variables, leaving their external schemas unchanged.
  • Add a deterministic Kokkos device test for the returned count.

Validation

  • ctest -R '^mam4_ndrop_unit_tests$' --output-on-failure: 1/1 passed.
  • Complete ndrop-label suite: 78 passed and 2 existing max-saturation comparisons were skipped by their configured tolerance rule; no numerical failures.
  • Independent review: PASS for draft-PR readiness.

Scope

This change does not alter the computed substep count, loop bounds, equations, limiters, state updates, or production physics.

@susburrows

susburrows commented Aug 18, 2026

Copy link
Copy Markdown
Author

The purpose of this PR is to expose the number of ndrop explicit substeps for diagnostic output, to assist with understanding the performance impact of the explicit solver.

Developed with codex. FYI @odiazib @jeff-cohere @overfelt

@susburrows

Copy link
Copy Markdown
Author

Used in E3SM-Project/E3SM#8645

REQUIRE(mam4::FloatingPoint<Real>::equiv(q, 0.9));
}

TEST_CASE("test_update_from_explmix_reports_nsubmix", "mam4_ndrop") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don’t think we need a unit test for these diagnostic variables. While agentic coding makes it easy to add these tests, we also need to consider the long-term maintenance effort.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That makes sense. I can remove it and push a revised version.

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.03%. Comparing base (8fbf775) to head (0d076d8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #577      +/-   ##
==========================================
+ Coverage   93.01%   93.03%   +0.01%     
==========================================
  Files         311      311              
  Lines       24581    24631      +50     
  Branches     2828     2828              
==========================================
+ Hits        22865    22915      +50     
  Misses       1716     1716              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jeff-cohere

Copy link
Copy Markdown
Collaborator

@susburrows , here are a few simple "on/off" compile-time options we make available for mam4xx. You could add another one for a diagnostics-heavy eval-facing configuration. Basically:

  1. Add another option alongside the existing ones (e.g. MAM4XX_EVAL_DIAGNOSTICS)
  2. Edit mam4_config.hpp.in and add a line to pass the CMake option to the preprocessor (e.g. #cmakedefine MAM4XX_EVAL_DIAGNOSTICS)
  3. Use the macro (MAM4XX_EVAL_DIAGNOSTICS) to enable/disable code as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants