Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/developer-guide/code-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ This guide documents how state is advanced each timestep and the conventions tha
- Zero all `fluxes.*` and `fluxes.event*`.

2) Compute fluxes (pure calculations)
- `calculateFluxes()` computes photosynthesis, respiration, water/snow, etc.
- `processEvents()` converts scheduled/instant events to `fluxes.event*` deltas (no pool mutation).
- No function in this phase mutates `envi.*` or `trackers.*`.

- `calculateFluxes()` computes photosynthesis, respiration, water/snow, etc.
- `checkLimitations()` may adjust already-computed fluxes when a flux is resource limited.
- No function in this phase mutates `envi.*` or `trackers.*`.

3) Apply pool updates (single place)
- `updateMainPools()` updates leafC, woodC, soil water and snow pools
- `updatePoolsForSoil()` updates soil carbon pools
- `updateNitrogenPools()` updates mineral, soil organic, and litter nitrogen pools.
- `updatePoolsForEvents()` updates pools for fluxes from events
- The above functions are the only code that changes `envi.*`.
- For each pool P: ΔP = ((sum of rate fluxes to P) + (sum of event fluxes to P)) * climate.length
Expand Down
4 changes: 2 additions & 2 deletions docs/model-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This document provides an overview of the SIPNET model’s structure. It was wri
- Focus on features currently in regular use.

There are multiple ways to configure the model structure, and not all model structures or components are listed.
Implementation in source code (sipnet.c) is annotated with references to specific publications.
Implementation in source code is annotated with references to specific publications.

#### Notes on notation:

Expand Down Expand Up @@ -1174,7 +1174,7 @@ nitrogen (calculated from the leaf C:N ratio) is also transferred to the litter
**Event parameters:**

| Parameter | Value | Description |
|-----------|----------------------|-------------------|
| --------- | -------------------- | ----------------- |
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this was an auto-formatter - let me know if I should change my autoformatting settings

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That would be nice - my IDE complains about the spaces (which perhaps I could change?)

| Year | integer | Year |
| Day | integer | Day of year |
| Type | `leafon` / `leafoff` | The type of event |
Expand Down
Loading