Change events.out to pool amounts instead of fluxes#349
Open
Alomir wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates SIPNET’s events.out output to report per-event pool deltas (amounts applied over the timestep) instead of per-day flux rates, to reduce confusion when interpreting event diagnostics.
Changes:
- Switch event writing in
processEvents()(and leaf-on computed output) fromfluxes.*rate-style values to timestep deltas and remove thefluxes.prefix from parameter names. - Update unit-test canned outputs and smoke-test
events.outbaselines to match the new event output semantics. - Refresh user-facing documentation and changelog to describe the new
events.outformat.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/smoke/russell_3/events.out | Updates smoke baseline to new events.out pool-delta values and parameter names. |
| tests/smoke/russell_2/events.out | Updates smoke baseline to new events.out pool-delta values and parameter names (includes fert events). |
| tests/smoke/russell_1/events.out | Updates smoke baseline to new events.out pool-delta values and parameter names. |
| tests/sipnet/test_events_infrastructure/events_output_no_header.out | Updates unit-test expected output for no-header event output format/values. |
| tests/sipnet/test_events_infrastructure/events_output_header.out | Updates unit-test expected output for header-included event output format/values. |
| src/sipnet/sipnet.c | Writes leaf-on computed event values as timestep deltas and drops fluxes. prefix for those fields. |
| src/sipnet/events.c | Writes scheduled/instant event outputs as timestep deltas with event* parameter names (while still accumulating per-day event fluxes internally). |
| docs/user-guide/model-outputs.md | Updates the events.out example and description to reflect pool-delta outputs and new parameter names. |
| docs/CHANGELOG.md | Notes the user-visible change in events.out semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
1251
to
+1258
| void writeLeafOnEventIfNeeded(void) { | ||
| const char *type = eventTypeToString(LEAFON); | ||
| const double len = climate->length; | ||
| if (fluxes.leafOnCreation > TINY && ctx.events) { | ||
| writeComputedEventOut(climate->year, climate->day, type, 2, | ||
| "fluxes.leafOnCreation", fluxes.leafOnCreation, | ||
| "fluxes.leafOnCreationFromWood", | ||
| fluxes.leafOnCreationFromWood); | ||
| "leafOnCreation", fluxes.leafOnCreation * len, | ||
| "leafOnCreationFromWood", | ||
| fluxes.leafOnCreationFromWood * len); |
Collaborator
Author
There was a problem hiding this comment.
When you're right, you're right. Will fix.
| ### Changed | ||
|
|
||
| - Renamed the CLI option `--file-name` to `--file-prefix` for clarity while keeping `--file-name` as a backward-compatible alias (#320) | ||
| - Values in `events.out` changed to pool deltas rather than flux amounts (#349) |
dlebauer
reviewed
Jul 3, 2026
dlebauer
left a comment
Member
There was a problem hiding this comment.
LGTM, though holding off on approval until the copilot feedback is addressed
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?
Other than values in events.out, there should be no functional changes in this PR.
testEventOutputFilecanned output)Updated events.out for relevant smoke tests are included. Since there were no changes in sipnet.out for the smoke tests, there is no output capture for smoke-check.py.
Related issues
Checklist
docs/CHANGELOG.mdupdated with noteworthy changesclang-format(rungit clang-formatif needed)Note: See CONTRIBUTING.md for additional guidance. This repository uses automated formatting checks; if the pre-commit hook blocks your commit, run
git clang-formatto format staged changes.