Skip to content

Conversation

@slevis-lmwg
Copy link
Contributor

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

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)?

Any User Interface Changes (namelist or namelist defaults changes)?

Does this create a need to change or add documentation? Did you do so?

  • [ ] 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

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
@slevis-lmwg
Copy link
Contributor Author

slevis-lmwg commented Aug 13, 2025

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
Copy link
Contributor Author

slevis-lmwg commented Aug 26, 2025

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
Copy link
Contributor Author

slevis-lmwg commented Sep 20, 2025

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
Copy link
Contributor Author

slevis-lmwg commented Sep 23, 2025

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
Copy link
Contributor Author

slevis-lmwg commented Sep 23, 2025

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

@slevis-lmwg
Copy link
Contributor Author

slevis-lmwg commented Oct 18, 2025

Submitted the same 2 tests

./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

now with the error check suggested in NGEET/fates#1454 (see corresponding commit NGEET/fates@97839f1 in NGEET/fates#1472)

  • PRT2 same behavior: variable(s) missing from restart?
  • LUH2 FAIL triggered the new error message (turns out it shouldn't have, yet, becase fates_parteh_mode was 1):
hlm_name cannot be CLM while prescribed_puptake == 0, because the CLM does not do prognostic phosphorus. Exiting.
ERROR in FatesInterfaceMod.F90 at line 919

UPDATE Repeating with 2025/12/10 updates:

  • PRT2 same behavior: COMPARE_base_rest
  • LUH2 didn't trigger the new error message in its new location and passed, as expected; when I added fates_parteh_mode = 2, another similar error got triggered, and Ryan and I decided to keep the latter and remove the former
  • Test on izumi 2025/12/16 while derecho is down (gnu, intel, nag):
    ERS_D_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.izumi_*.clm-FatesColdLUH2 FAILs in RUN as per FATES landuse default fluh_timeseries crashes FatesColdLUH test on izumi #2653, so I tried
    PASS ERS_D_Mmpi-serial_Ld5.1x1_brazil.I2000Clm50FatesRs.izumi_nag.clm-FatesCold with parteh_mode = 1
    FAIL ERS_D_Mmpi-serial_Ld5.1x1_brazil.I2000Clm50FatesRs.izumi_nag.clm-FatesCold with parteh_mode = 2 as expected
  • Troubleshoot restart issue (SL, but also Ryan offered to look into it)
    • FAIL ERS_D_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesColdPRT2 as expected FATES PRT2 test failing on izumi_nag #3183 but it may work if I shorten the test to Ld10
    • Return to derecho: UPDATED my fates-cn branches to ctsm5.4.004/sci.1.88.0_api.42.0.0
      LUH2 DIFF from latest baseline fates-sci.1.88.0_api.42.0.0-ctsm5.4.001 EXPECTED due to update to .004
      PRT2 FAIL COMPARE_base_rest
    • The first post mentioning the restart problem made me think of rerunning the original PRT2 against the latest baseline fates-sci.1.89.0_api.43.0.0-ctsm5.4.005 without 391a023 and that PASSed despite the NLCOMP change of suplnitro from 'ALL' to 'NONE'.
  • Add new tests (from meeting with Ryan 2025/12/16):
    • PRT2_synthN (nuptake = 10) to reproduce what used to happen before coupling
    • PRT2_suplnAll that swaps namelist setting suplnitro to suplnAll. Initially I tested this in the existing PRT2 test, and it exited with an expected namelist error:
ERROR : CLMBuildNamelist::setup_logic_supplemental_nitrogen() : supplemental Nitrogen (suplnitro) is NOT set to NONE, FATES is on, and FATES-SP is not active, but fates_parteh_mode is 2, so Nitrogen is active; change suplnitro back to NONE

@slevis-lmwg
Copy link
Contributor Author

The reason for the last commit is explained in #2653 (comment).

Update crop parameters and maturity requirements

slevis resolved conflicts:
src/fates <-- So far I have not changed .gitmodules to point to my branch
src/soilbiogeochem/SoilBiogeochemCompetitionMod.F90
FATES JSON parameter files

These changes accommodate a JSON format to the FATES parameter file.

Documentation has been updated in the FATES User's Guide:
https://fates-users-guide.readthedocs.io/en/latest/user/Parameter-File.html

fates was updated from sci.1.88.0_api.42.0.0 to sci.1.89.0_api.43.0.0

ESCOMP and NGEET PRs:
ESCOMP#3570
NGEET/fates#1493

slevis resolved conflicts:
cime_config/testdefs/testmods_dirs/clm/FatesColdPRT2/shell_commands
cime_config/testdefs/testmods_dirs/clm/FatesColdPRT2/user_nl_clm
src/fates
@slevis-lmwg
Copy link
Contributor Author

slevis-lmwg commented Dec 20, 2025

After the latest updates, I'm submitting these tests with ./create_test:

PASS ERS_D_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.derecho_intel.clm-FatesColdPRT2_synthN
BASELINE ERS_D_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.derecho_intel.clm-FatesColdLUH2
COMPARE_base_rest ERS_D_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.derecho_intel.clm-FatesColdPRT2

LUH2 diffs from fates-sci.1.89.0_api.43.0.0-ctsm5.4.005:
FATES_HET_RESP 7.5810E-16 NORMALIZED 2.1208E-07
FATES_NEP 7.5810E-16 NORMALIZED 2.8903E-07

PRT2 diffs in the same 38 fields in base.cprnc.out as in cprnc.out.

  • Ryan thinks that the restart problem comes from the FATES side because the problem appears when nitrogen becomes interactive
  • For troubleshooting, it may help to run 2 time steps in single-point, possibly turning off pieces of code, e.g. any litter generation and exudation
  • @rgknox offered to start some of this troubleshooting

Comment on lines +3359 to +3362
if ( ($parteh_mode == 2) && ($suplnitro !~ /NONE/) && not &value_is_true( $nl_flags->{'use_fates_sp'}) ) {
$log->fatal_error("supplemental Nitrogen (suplnitro) is NOT set to NONE, FATES is on, " .
"and FATES-SP is not active, but fates_parteh_mode is 2, so Nitrogen is active; " .
"change suplnitro back to NONE");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove this new check because in parteh_mode = 2 we want to allow either NONE or ALL suplnitro.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or replace check with not allowing parteh_mode = 2 and sp mode together.

Comment on lines +3352 to +3357

my $parteh_mode = $nl->get_value('fates_parteh_mode');
if ( ($parteh_mode == 1) && ($suplnitro !~ /ALL/) && not &value_is_true( $nl_flags->{'use_fates_sp'}) ) {
$log->fatal_error("supplemental Nitrogen (suplnitro) is NOT set to ALL, FATES is on, " .
"and FATES-SP is not active, but fates_parteh_mode is 1, so Nitrogen is not active. " .
"Change suplnitro back to ALL");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here remove the sp condition because irrelevant.

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

None yet

Development

Successfully merging this pull request may close these issues.

Completing the FATES-CLM nitrogen coupling

1 participant