test: add Ci solver pFUnit unit test suite and optional error flag#1590
Open
johnpaulalex wants to merge 1 commit into
Open
test: add Ci solver pFUnit unit test suite and optional error flag#1590johnpaulalex wants to merge 1 commit into
johnpaulalex wants to merge 1 commit into
Conversation
Adds a new leaf_biophysics_solver test suite targeting the intracellular
CO2 (Ci) solver stack in biogeophys/LeafBiophysicsMod.F90:
- CiMinMax: verifies bracket validity (ci_min < ci_max, physically
bounded) and that fval at each endpoint straddles zero
- CiFunc: verified indirectly via test_CiFunc_zero_at_solution, which
asserts |fval| < ci_tol at the Ci returned by CiBisection. Documents
the decision process not to use an analytical root due to Medlyn complexity.
- CiBisection: convergence under full light (anet > 0, gs > gs0,
solve_iter < 200), darkness (anet < 0, gs ≈ gs0), varying tolerances
(loose vs tight), and different environmental temperatures/low-light.
- Max Iterations: test_CiBisection_max_iters_sets_ierr tests the
maximum iteration failure path by passing ci_tol=0.
To allow testing the failure path, an optional ierr argument is added to
CiBisection in biogeophys/LeafBiophysicsMod.F90. If present, the solver returns
gracefully with ierr=1 when max iterations is reached instead of calling
endrun(). Traditional callers that omit ierr retain the original behavior.
New files:
testing/tests/unit/leaf_biophysics_solver_test/test_LeafBiophysicsSolvers.pf
testing/tests/unit/leaf_biophysics_solver_test/CMakeLists.txt
Integration:
testing/CMakeLists.txt
testing/config/unit.cfg
Contributor
|
@johnpaulalex , I was curious, have you triggered any failures in the photosynthesis code with your tests? |
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.
(not intending to submit yet, just sending for discussion)
Adds a new leaf_biophysics_solver test suite targeting the intracellular CO2 (Ci) solver stack in biogeophys/LeafBiophysicsMod.F90:
To allow testing the failure path, an optional ierr argument is added to CiBisection in biogeophys/LeafBiophysicsMod.F90. If present, the solver returns gracefully with ierr=1 when max iterations is reached instead of calling endrun(). Traditional callers that omit ierr retain the original behavior.
New files:
testing/tests/unit/leaf_biophysics_solver_test/test_LeafBiophysicsSolvers.pf
testing/tests/unit/leaf_biophysics_solver_test/CMakeLists.txt
Integration:
testing/CMakeLists.txt
testing/config/unit.cfg
Description:
Collaborators:
Expectation of Answer Changes:
Description of generative AI usage (as necessary)
Checklist
If this is your first time contributing, please read the CONTRIBUTING document.
All checklist items must be checked to enable merging this pull request:
Contributor
Integrator
If satellite phenology regressions are not b4b, please hold merge and notify the FATES development team.
Documentation
Test Results:
CTSM (or) E3SM (specify which) test hash-tag:
CTSM (or) E3SM (specify which) baseline hash-tag:
FATES baseline hash-tag:
Test Output: