Repository navigation
[278] Require positive allocations and reject nonfinite parameters - #405
Conversation
Alomir
left a comment
There was a problem hiding this comment.
Nice work, thank you for your contribution @Nitir4!
I have a request - would you please also enforce that all four allocation parameters are greater than zero?
That's a change from allowing them to be zero, which was what the issue originally asked. However, after discussion with @dlebauer, we've decided it makes more sense for the allocation params to be greater than zero.
|
|
||
| ### Fixed | ||
|
|
||
| - Reject negative leaf, wood, and fine-root NPP allocation parameters during model setup (#278). |
There was a problem hiding this comment.
We put the PR number instead of the tracking number into CHANGELOG - so this should be #405
There was a problem hiding this comment.
Thanks for reviewing. I’ll make all four allocations strictly positive, update the tests and docs, and change the changelog references to #405.
@Alomir Can you fill me in on the logic here? If we're simulating something fully nonwoody I'm not sure why we'd need to keep adding epsilon to the wood pool. |
|
@infotroph: in non woody plants the woody represents structural / non-photosynthetic and storage. |
Alomir
left a comment
There was a problem hiding this comment.
Great, thanks for the changes and your contribution overall!
|
Thanks @Alomir for the review and guidance, and thanks for merging! Looking forward to contributing more. |
Summary
Require positive NPP allocation fractions for leaves, wood, fine roots, and the derived coarse-root remainder. The three supplied fractions must each be below one and sum to less than one. Zero, negative, and nonfinite allocation inputs exit with code 3.
The parameter-file reader also rejects NaN, infinity, and overflow to infinity in supplied, recognized model parameters before assignment. Omitted optional parameters and ignored legacy names retain their existing behavior.
The strict-positive allocation rule follows Alomir's review. This addresses part of #278; parameter-specific ranges, climate and event validation remain outside this PR.
How was this change tested?
make -B test: 27 test executables and four active smoke scenarios passed.russell_4remains a forced skip.make testrun: passed.git diff --checkpassed.No smoke reference outputs were changed. Local clang-tidy and documentation-site builds were not run.
Reproduction steps
Set any supplied allocation to zero, or use
(0.25, 0.25, 0.5)so the coarse-root remainder is zero. Model setup exits with code 3.(0.25, 0.25, 0.25)remains valid. A recognized parameter set tonanorinfalso exits with code 3.Related issues
Addresses part of #278. The allocation rule was updated in response to the review on this PR.
Checklist