fix(fates): fix c13disc_acc weighting order and add EDAccumulateFluxes unit tests - #1602
Draft
johnpaulalex wants to merge 3 commits into
Draft
Conversation
…reateBare for unit tests
…es/CreateTestSite helpers in FatesFactoryMod
9 tasks
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.
Depends on parent PR: #1601
Description:
Fixes a calculation ordering bug in
EDAccumulateFluxesMod.F90wheregpp_accwas accumulated prior to computing thec13disc_accweighted mean, resulting in double-countinggpp_tstepin the denominator. Also updates the zero-denominator check to<= 0.0_r8for negative total GPP underflow protection, adds aprt_globalassociation safeguard inPRTGenericMod.F90, introduces shared test factory helpers (CreateTestSiteandSetTestFluxes) inFatesFactoryMod.F90, and adds a full pFUnit test suite (test_EDAccumulateFluxes.pf) verifying multi-site iteration, multi-cohort/multi-layer accumulation, empty cohort linked lists, and underflow protections.Specific notes
Collaborators:
Linked issues addressed, if any:
Expectation of Answer Changes:
Modifies carbon isotope discrimination accumulation (
c13disc_acc) across timesteps for active vegetated canopy cohorts.Description of generative AI usage (as necessary)
Google Antigravity was used to write the code and tests, followed by human-guided verification.
Checklist
Contributor
Integrator
Test Results:
CTSM (or) E3SM (specify which) test hash-tag: N/A
CTSM (or) E3SM (specify which) baseline hash-tag:
5efa6fbfd173afe85d523431e75c8a6ec493b242FATES baseline hash-tag:
960a4f1cTest Output:
[x] Executed pFUnit / CIME regression tests