Skip to content

SIP333 Refactor Nitrogen#334

Draft
Alomir wants to merge 4 commits intomasterfrom
SIP333-refactor-nitrogen
Draft

SIP333 Refactor Nitrogen#334
Alomir wants to merge 4 commits intomasterfrom
SIP333-refactor-nitrogen

Conversation

@Alomir
Copy link
Copy Markdown
Collaborator

@Alomir Alomir commented May 8, 2026

Summary

  • What: Refactor code in sipnet
  • Motivation: See ticket

How was this change tested?

This change should have no functional impact; all smoke and unit tests continue to pass without modification (other than access to moved code for unit tests).

Related issues

Checklist

  • Related issues are listed above. PRs without an approved, related issue may not get reviewed.
  • PR title has the issue number in it ("[#] <concise description of proposed change>")
  • Tests added/updated for new features (if applicable)
  • Documentation updated (if applicable)
  • docs/CHANGELOG.md updated with noteworthy changes
  • Code formatted with clang-format (run git clang-format if 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-format to format staged changes.

@Alomir
Copy link
Copy Markdown
Collaborator Author

Alomir commented May 8, 2026

Note that (once I remembered the new files) the current state of the code refactor passes all tests.

Remaining is to do the part that will actually help add other limit checks (looking at you, leaf-on) - splitting calcNFixationAndUptakeFluxes into the calculate part (into nitrogen.c) and the limit check part (into limitations.c). Also, I may take the opportunity to add some utility to nitrogen.h that up-coming leaf-on checks would want. Might leave that until the next step, though.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v19.1.1) reports: 2 concern(s)
  • tests/sipnet/test_modeling/testDependencyFunctions.c:174:26: error: [clang-diagnostic-implicit-function-declaration]

    call to undeclared function 'calcSoilCN'; ISO C99 and later do not support implicit function declarations

      174 |   status |= checkCNRatio(calcSoilCN(), 7.5, "Soil C:N ratio");
          |                          ^
  • tests/sipnet/test_modeling/testDependencyFunctions.c:175:26: error: [clang-diagnostic-implicit-function-declaration]

    call to undeclared function 'calcLitterCN'; ISO C99 and later do not support implicit function declarations

      175 |   status |= checkCNRatio(calcLitterCN(), 5.0, "Litter C:N ratio");
          |                          ^

Have any feedback or feature suggestions? Share it here.

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.

Refactor nitrogen out of sipnet.c

1 participant