Skip to content

Conversation

ckoven
Copy link
Contributor

@ckoven ckoven commented Apr 9, 2025

This PR adds a few new summary variables that include carbon information from FATES as well as soil biogeochemistry and wood product decay when FATES is active: NBP, NEE as fluxes, and TOTECOSYSC as stocks.

This depends on bc_out variables that are introduced in FATES PR NGEET/fates#1382.

Nopte that there are a couple of other bug fixes that I've added here, one of which is conceptually related (as it fixes balance checking when wood harvest is active in FATES), and one of which is unrelated (correctly defining history dimension information for a multiplexed land use by PFT dimension)

@rljacob
Copy link
Member

rljacob commented Apr 17, 2025

instead of a "Do Not Merge" label, this can be made a draft PR. Its been converted.


if (use_fates) then
call alm_fates%wrap_FatesAtmosphericCarbonFluxes(bounds, num_soilc, filter_soilc)
call alm_fates%wrap_FatesCarbonStocks(bounds, num_soilc, filter_soilc)
Copy link
Contributor

@rgknox rgknox Jun 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ckoven This call to wrap_FatesCarbonStocks over-writes the values for totecosysc (and others), which are filled above in col_cs_Summary(col_cs,bounds, num_soilc, filter_soilc). We should make sure we aren't filling the same variable in two different places (at least for similar indices). Option 1 is to use the col%is_fates filter to only update values in col_cs_Summary for non fates indices, and set to NaN for fates indices. Option 2, which I like more, is to have totecosysc only updated in col_cs_Summary, but have optional logic for FATES columns...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave it a go of refactoring this, but ran into circular dependencies. I don't want the perfect to get in the way of the good, so I think this is fine.

@glemieux glemieux force-pushed the fates_nbp_totecosysc branch from d5ddd96 to bb4287c Compare June 4, 2025 23:28
@glemieux
Copy link
Contributor

glemieux commented Jun 4, 2025

This branch has been brought up to date with API 40 by rebasing against master.

@glemieux
Copy link
Contributor

@ckoven @rgknox I've updated this PR to use fates tag sci.1.86.0_api.40.0.0 now that we've got the fates-side NBP pull request integrated. I think this is ready for final review and testing, yeah?

@glemieux glemieux marked this pull request as ready for review July 16, 2025 20:04
@rljacob
Copy link
Member

rljacob commented Jul 24, 2025

Needs approval from a reviewer.

@glemieux glemieux moved this from Under Review to Final Testing in FATES Pull Request Planning and Status Jul 28, 2025
@glemieux glemieux moved this from Final Testing to Stuck in FATES Pull Request Planning and Status Jul 28, 2025
@glemieux
Copy link
Contributor

Per FATES software development meeting today, @ckoven noted that we should hold off on testing this due to a potential bug in the FATES-side NBP diagnostic.

@ckoven
Copy link
Contributor Author

ckoven commented Aug 1, 2025

Per FATES software development meeting today, @ckoven noted that we should hold off on testing this due to a potential bug in the FATES-side NBP diagnostic.

I've sorted out the issues I was having, they were unique to the specific branch I was using and so not relevant to this PR branch, so please proceed.

@glemieux glemieux moved this from Stuck to Final Testing in FATES Pull Request Planning and Status Aug 1, 2025
@glemieux glemieux force-pushed the fates_nbp_totecosysc branch from 0884e6e to afce6b1 Compare August 5, 2025 19:37
@glemieux
Copy link
Contributor

glemieux commented Aug 7, 2025

During regression testing I found an issue in which NEP, NEE, and NBP are not b4b during an exact restart (ERP test to be specific), but only for the time step immediately following the restart day. I'm currently working to address this; as such this is not ready for integration yet.

@glemieux glemieux moved this from Final Testing to Stuck in FATES Pull Request Planning and Status Aug 7, 2025
@glemieux
Copy link
Contributor

During regression testing I found an issue in which NEP, NEE, and NBP are not b4b during an exact restart (ERP test to be specific), but only for the time step immediately following the restart day. I'm currently working to address this; as such this is not ready for integration yet.

We currently have a fix in the works on the fates-side for the exact restart issue via NGEET/fates#1448.

@rljacob rljacob marked this pull request as draft August 14, 2025 17:29
@glemieux
Copy link
Contributor

Rerunning regression tests on perlmutter with NGEET/fates#1448.

@glemieux glemieux marked this pull request as ready for review September 19, 2025 17:10
@glemieux glemieux moved this from Hold to Final Testing in FATES Pull Request Planning and Status Sep 19, 2025
@glemieux glemieux moved this from Final Testing to Hold in FATES Pull Request Planning and Status Sep 19, 2025
@glemieux glemieux force-pushed the fates_nbp_totecosysc branch from f70ef8c to d5bbb15 Compare September 19, 2025 17:17
@glemieux
Copy link
Contributor

FYI, @peterdschwartz this needs to be held until #7665 comes in. The fates tag will need to be rebased against master and point to a fates tag that was brought in in API41.

@glemieux glemieux mentioned this pull request Sep 20, 2025
5 tasks
@glemieux
Copy link
Contributor

Note that this will fix #7278.

@glemieux glemieux linked an issue Sep 20, 2025 that may be closed by this pull request
This gives access to ncgen to enable on-the-fly generation of the fates
parameter file
@glemieux
Copy link
Contributor

This also fixes #7720

@glemieux glemieux linked an issue Sep 20, 2025 that may be closed by this pull request
@rljacob
Copy link
Member

rljacob commented Sep 25, 2025

Is this ready?

@glemieux
Copy link
Contributor

@rljacob this is ready, but needs to come in after #7665.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fates_cold_twostream testmod fails due to not finding e4s module fates_cold_allvars FAILs COMP_base_rest
5 participants