Repository navigation
fix(SIPNET): apply plantStorageNInit default conditionally (#4114) - #4117
coder-Yash886 wants to merge 4 commits into
Conversation
9e48e89 to
7c9825e
Compare
|
@dlebauer Please review the Pr When you have free time |
59bae89 to
3f187af
Compare
|
@divine7022 @infotroph @dlebauer I have addressed all your comments Please Review the PR when you have free time |
|
@coder-Yash886 run |
divine7022
left a comment
There was a problem hiding this comment.
@coder-Yash886 thanks for turning this round quickly!
CI fails isn't only .Rd sync that @S1DDHEY flagged; devtools::document
will fix that one, but test file also doesn't pass. the new plantStorageNInit precedence in v2 test matches on the literal string plantStorageNInit 5.0 while the writer emits plantStorageNInit 5, and carbon-limited leaf flush block is still have the computed behaviour this PR removes
not blocking -- update News.md and it still describe the computed default
|
plantStorageNInit here is sipnet parameter name rather than a standard_vars one, so this branch only fires for a hand built poolinitcond file. meanwhile soil_organic_nitrogen_content is standard var that read from the IC nc, it's not in this list. fine by me if the sipnet name is what you agreed on, but #4116 is going to add the soil and litter side and it'd be good if the two don't end up on different naming conventions |
|
@divine7022 @dlebauer Changes addressed Please review the Pr when you have free time |
infotroph
left a comment
There was a problem hiding this comment.
Posting some comments I had started before your last commit, with apologies if you resolved / changed these already.
@divine7022 I don't know of any documented names for storage pools in the existing standard vars, so I'd say the choice is between "make up something that looks similar" ( I lean weakly[*] toward the former today, but will go along with what you like. The existing IC.nc names are such a mess that I don't think we can make it worse here -- I mean look at this, we have camelcase and snake case AND spaces! 😉 [*] So weakly I came back to edit my vote after posting... |
|
@divine7022 @infotroph @dlebauer Please review the pr |
|
@dlebauer @divine7022 Sir please review the Pr |
- Fix expect_match
6a85923 to
5da8cc2
Compare
Closes #4114
What Changed
1.
inst/template.param_v2— Static default value set to5.0Changed
plantStorageNInitfrom0.0→5.0g N m⁻². This value (derived from the Niwot-specific template:plantWoodInit = 30000g C m⁻² →~5.04g N m⁻²) ensures the first leafon event is not suppressed when the nitrogen cycle is active, without requiring any computation insidewrite.config.2.
R/write.configs.SIPNET.R— Dropped dynamic unconditional overwriteplantStorageNInitthat previously overwrote template values unconditionally (violating the pattern used by all other parameters inwrite.config.SIPNET).has_n_cycle = rev_str == "v2"to thecapslist (suggested by @infotroph) — replacing the implicit and misleading"plantStorageNInit" %in% param[, 1]check.ICprecedence handling forplantStorageNInitvia both theICargument andpoolinitcond, including explicit zero values.plantStorageNInitsupport viatrait.valuesfor v2.3.
tests/testthat/test-write.config.SIPNET.R— Cleaned up + new tests5.0is preserved when no IC is provided.IC = 0(intentional nitrogen-limited start) is respected.IC = 12.5(explicit non-zero) is respected.4.
man/write.config.SIPNET.Rd— Documented precedenceAdded a Parameter precedence section explaining the override order:
template →
defaults$constants→trait.values→IC/poolinitcond(highest, including explicit zero).