Conversation
Alomir
marked this pull request as ready for review
September 30, 2026 15:19
Alomir
requested review from
dlebauer,
mdietze and
mswilburn
as code owners
September 30, 2026 15:19
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused guards address the zero-division paths and are covered by an appropriate regression test.
Review effort: Balanced
Findings: None
What changed in this PR
Prevents non-finite nitrogen fluxes when zero-carbon pools produce zero transfers.
Changes:
- Guards zero-carbon nitrogen transfer calculations.
- Adds regression coverage for empty carbon pools and nitrogen conservation.
- Documents the fix.
| File | Description |
|---|---|
src/sipnet/nitrogen.c |
Safely handles zero carbon fluxes. |
tests/sipnet/test_modeling/testNitrogenCycle.c |
Tests finite, conserved nitrogen pools. |
docs/CHANGELOG.md |
Records the fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Collaborator
Author
|
I strongly suspect this is the source of the NaNs that @infotroph was seeing when pools dropped to zero; I believe those started with litter N |
dlebauer
approved these changes
Oct 3, 2026
Collaborator
Author
|
@dlebauer I believe you need to merge this with master? |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
How was this change tested?
Related issues
Checklist
docs/CHANGELOG.mdupdated with noteworthy changesclang-format(rungit clang-formatif needed)