Skip to content

ctsm5.4.036: Complete the FATES-CLM nitrogen coupling - #3409

Merged
slevis-lmwg merged 57 commits into
ESCOMP:masterfrom
slevis-lmwg:fates-cn
Apr 28, 2026
Merged

slevis-lmwg merged 57 commits into
ESCOMP:masterfrom
slevis-lmwg:fates-cn

Conversation

@slevis-lmwg

@slevis-lmwg slevis-lmwg commented Aug 11, 2025 •

Copy link
Copy Markdown
Contributor

Description of changes

For now see the issue #3378

Corresponding mods on the FATES side:
NGEET/fates#1472

Nutrient enabled FATES handbook
FATES CLM N coupling

Specific notes

Contributors other than yourself, if any:
@rgknox @adrifoster @wwieder

CTSM Issues Fixed (include github issue #):
#3378

Are answers expected to change (and if so in what way)?
For non-fates tests expect roundoff diffs due to a change in the order of operations in CNNDynamicsMod.F90 as documented below.

Any User Interface Changes (namelist or namelist defaults changes)?
Yes, see changes to CLMBuildNamelist and namelistdefaults.

Does this create a need to change or add documentation? Did you do so?
Yes, no.

  • Todo: add a modification to the PRT2 test, make sure that prescribed P uptake is set to 10. This will ensure that there are no P limitations in fates, when FATES becomes coupled to CLM's N cycle (in future PR). i:e: fates_cnp_prescribed_puptake=10

Initial testing performed
...with the first two commits in this PR:

PASS ERS_D_Ld30.1x1_brazil.I2000Clm60FatesCrujraRs.derecho_intel.clm-FatesColdPRT2
PASS ERS_D_Ld30.1x1_brazil.I2000Clm60FatesCrujraRs.derecho_intel.clm-FatesCold

Later comments point out that these two tests were inadequate at catching problems, and that I switched to two other tests.

PASS ERS_D_Ld30.1x1_brazil.I2000Clm60FatesCrujraRs.derecho_intel.clm-FatesColdPRT2
FAIL ERS_D_Ld30.1x1_brazil.I2000Clm60FatesCrujraRs.derecho_intel.clm-FatesColdPRT2--clm-mimicsFatesCold--clm-nofireemis
The latter needs "nofireemis" to work with Fates, but it then dumps core in line 1180 SoilBiogeochemDecompCascadeMIMICSMod.F90
...calculating these variables:
nf_soil%decomp_npools_sourcesink_col
nf_soil%fates_litter_flux
@slevis-lmwg slevis-lmwg self-assigned this Aug 11, 2025
@slevis-lmwg slevis-lmwg added enhancement new capability or improved behavior of existing capability investigation Needs to be verified and more investigation into what's going on. science Enhancement to or bug impacting science test: aux_clm Pass aux_clm suite before merging test: fates Pass fates test suite before merging labels Aug 11, 2025
@slevis-lmwg slevis-lmwg linked an issue Aug 11, 2025 that may be closed by this pull request
1 task done
@slevis-lmwg

slevis-lmwg commented Aug 13, 2025 •

Copy link
Copy Markdown
Contributor Author

With the latest commit, I repeated the two earlier tests and added another to check whether answers have changed from the baseline:

PASS ERS_D_Ld30.1x1_brazil.I2000Clm60FatesCrujraRs.derecho_intel.clm-FatesColdPRT2
PASS ERS_D_Ld30.1x1_brazil.I2000Clm60FatesCrujraRs.derecho_intel.clm-FatesCold
FAIL ERP_Ld9.f45_f45_mg37.I2000Clm50FatesRs.derecho_intel.clm-FatesColdAllVars -c /glade/campaign/cgd/tss/ctsm_baselines/ctsm5.3.065

The latter fails in case2, after reading the restart file, with a N balance error.

UPDATE

  • See below for suggestions to resolve FAIL
  • Add new test ERP_Ld9.f45_f45_mg37.I2000Clm50FatesRs.derecho_intel.clm-FatesColdPRT2 (sanity check first that it meets requirements set forth in the fourth checkbox here, which I think means pointing to an alternate fates paramfile)
  • Later comment explains why I decided to revert to preexisting ERS tests and skip adding this ERP test.

@slevis-lmwg

slevis-lmwg commented Aug 26, 2025 •

Copy link
Copy Markdown
Contributor Author

Enabled fixation and ran the same tests:

PASS ERS_D_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.derecho_intel.clm-FatesColdPRT2 -c /glade/campaign/cgd/tss/ctsm_baselines/fates-sci.1.84.0_api.40.0.0-ctsm5.3.066
PASS ERS_D_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.derecho_intel.clm-FatesColdLUH2 -c /glade/campaign/cgd/tss/ctsm_baselines/fates-sci.1.84.0_api.40.0.0-ctsm5.3.066

PRT2 still b4b with the baseline.
LUH2 now DIFF from the baseline.

PASS The same tests with the code change for harvest (same results relative to the baseline).

@slevis-lmwg

slevis-lmwg commented Sep 20, 2025 •

Copy link
Copy Markdown
Contributor Author

Worked on the next checkbox in the issue (#3378), submitted the same tests, and after some troubleshooting:
PASS PRT2 and b4b with the baseline.
PASS LUH2 and DIFF from the baseline as before.

These variables originate in fates, so this renaming requires the same
renaming in fates; I will open the corresponding PR very soon
@slevis-lmwg

slevis-lmwg commented Sep 23, 2025 •

Copy link
Copy Markdown
Contributor Author
OK ./build-namelist_test.pl
OK ./run_sys_tests -s fates -c fates-sci.1.84.0_api.40.0.0-ctsm5.3.066/ --skip-generate
REDO ./run_sys_tests -s aux_clm -c ctsm5.3.066 --skip-generate

Notes:

  • Gnu and nvhpc tests needed a bug-fix that intel didn't catch (next commit).
  • Then the fates test-suite worked (I didn't repeat aux_clm for now)
  • Many tests DIFFer from the baseline.
  • The PRT2 test had the expected NLCOMP change, though no DIFFs from the baseline (even after rebuilding/rerunning):
  BASE: suplnitro = 'ALL'
  COMP: suplnitro = 'NONE'

@slevis-lmwg

slevis-lmwg commented Sep 23, 2025 •

Copy link
Copy Markdown
Contributor Author

Updated the fates paramfile (see next commit) and submitted these two again

./create_test ERS_D_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.derecho_intel.clm-FatesColdLUH2 -c /glade/campaign/cgd/tss/ctsm_baselines/fates-sci.1.84.0_api.40.0.0-ctsm5.3.066
./create_test ERS_D_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.derecho_intel.clm-FatesColdPRT2 -c /glade/campaign/cgd/tss/ctsm_baselines/fates-sci.1.84.0_api.40.0.0-ctsm5.3.066

The first (LUH2) same as before (DIFF from baseline) since nothing changed for it.
The second (ERS_D_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.derecho_intel.clm-FatesColdPRT2.C.20250923_141838_qjxqou) now:

  • DIFF from baseline and
  • FAIL COMPARE_base_rest suggesting variable(s) missing from restart, I suspect

@rosiealice

Copy link
Copy Markdown
Contributor

Hi @ekluzek thanks for this. I just wanted to say that this code does not intersect with LUNA, as Vcmax is an input oarameter in FATES and so we don't for now handle any of the acclimation processes that LUNA predicts. This also goes for FUN and the 'Flex-CN' (I'm unsure if we still call it that) functionality.

@slevis-lmwg slevis-lmwg changed the title ctsm5.4.035: Complete the FATES-CLM nitrogen coupling ctsm5.4.036: Complete the FATES-CLM nitrogen coupling Apr 23, 2026
@slevis-lmwg

Copy link
Copy Markdown
Contributor Author

Note to self: Open new documentation issues to update Technote and User's Guide.

@samsrabin samsrabin changed the title ctsm5.4.036: Complete the FATES-CLM nitrogen coupling ctsm5.4.037: Complete the FATES-CLM nitrogen coupling Apr 23, 2026
@samsrabin samsrabin changed the title ctsm5.4.037: Complete the FATES-CLM nitrogen coupling ctsm5.4.036: Complete the FATES-CLM nitrogen coupling Apr 23, 2026
@slevis-lmwg slevis-lmwg added the blocked: dependency Wait to work on this until dependency is resolved label Apr 23, 2026
@slevis-lmwg

This comment was marked as resolved.

bug fix to the FATES land use driver input code

This PR includes a cherry-picked fix from NorESMhub#209 to address swap in the
order of rangeland and pasture in the reading of the landuse drivers

slevis resolved conflicts:
src/fates

@samsrabin samsrabin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great! Just some minor things agreeing with Erik.

Comment thread src/main/clm_varctl.F90 Resolved
Comment thread src/main/clm_varpar.F90 Resolved
@slevis-lmwg

slevis-lmwg commented Apr 27, 2026 •

Copy link
Copy Markdown
Contributor Author
  • ./run_sys_tests -s aux_clm -c ctsm5.4.035 -g ctsm5.4.036
  • ./run_sys_tests -s fates -c fates-sci.1.92.4_api.45.0.0-ctsm5.4.036 --skip-generate
  • build-namelist_test
  • ChangeLog

@slevis-lmwg slevis-lmwg removed the blocked: dependency Wait to work on this until dependency is resolved label Apr 27, 2026
@slevis-lmwg
slevis-lmwg merged commit e64a767 into ESCOMP:master Apr 28, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from Under Review to Ready to Integrate in FATES Pull Request Planning and Status Apr 28, 2026
@github-project-automation github-project-automation Bot moved this from In progress - master to Done (non release/external) in CTSM: Upcoming tags Apr 28, 2026
@slevis-lmwg
slevis-lmwg deleted the fates-cn branch April 28, 2026 01:06
glemieux added a commit to rgknox/ctsm that referenced this pull request Apr 30, 2026
Complete the FATES-CLM nitrogen coupling

PR ESCOMP#3409. Description:
Intoduce code, namelist option, and tests on the CLM side to accommodate interactive nitrogen with FATES.

Roundoff changes for most cases, though not for Sp and FatesSp.

The FATES side PR is NGEET/fates#1472. Fates got updated from sci.1.92.1_api.44.1.0 to sci.1.92.4_api.45.0.0.

Supporting information (other than in the issue referenced below):
- Nutrient enabled FATES handbook: https://docs.google.com/document/d/1I35fGDfKTkn9_8Z6qXot7HZf3ICSpLONd-iFEErAh0k/edit?usp=drive_link
- FATES CLM N coupling: https://docs.google.com/document/d/1mpBtpCLGJpAGw6R3-nGGY92IWRU3ISvaAUKxvcDVJRw/edit?usp=drive_link

Resolves issue ESCOMP#3378.
glemieux added a commit to mvdebolskiy/fates that referenced this pull request May 8, 2026
Complete the FATES-CLM nitrogen coupling on the FATES side

PR NGEET#1472
PR not yet merged on the CLM side: ESCOMP/CTSM#3409
Issue ESCOMP/CTSM#3378
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement new capability or improved behavior of existing capability investigation Needs to be verified and more investigation into what's going on. science Enhancement to or bug impacting science test: aux_clm Pass aux_clm suite before merging test: fates Pass fates test suite before merging

Projects

Status: Done (non release/external)
Status: Done

Development

Successfully merging this pull request may close these issues.

Completing the FATES-CLM nitrogen coupling

7 participants