Skip to content

Conversation

@jinmuluo
Copy link
Contributor

@jinmuluo jinmuluo commented Mar 6, 2025

Hi

This method is proposed to solve the known nitrate leaching issue in CLM. Default CLM lacks the quick aqueous movement of nitrate in soil space, which means most of the soil nitrate keeps a fixed vertical profile across all time. It would cause a low nitrate leaching problem, as identified by Feng et al., 2023 (https://doi.org/10.1038/s41467-023-38803-z), Nevison et al., 2022( https://doi.org/10.1002/eap.2528), and many others.
We have proposed a physical-based method to force soil nitrate travel with the soil water vertically. Unlike the default nitrate leaching scheme in the CLM, where nitrate doesn't move downward and nitrate leaching happens in different layers. This new method can force nitrate to move vertically, and leached nitrate is taken out at the soil column bottom. This new method has been successfully implemented in our branch and can be used as an alternative leaching evaluation scheme in CLM. We are still working on the manuscript.

Description of changes

A new file used to evaluate the nitrate vertical movement: SoilNitrogenMovementMod.F90
Several files are modified to input the variables SoilNitrogenMovementMod.F90 needs.
Nitrate leaching can now be evaluated by our method or the default method by specifying a flag in SoilNitrogenMovementMod.F90

Specific notes

Contributors other than yourself, if any:
@samsrabin @wwieder

CTSM Issues Fixed (include github issue #):
Unknown

Are answers expected to change (and if so in what way)?
Our method increases the nitrate leaching flux and alters the size of other nitrogen fluxes.

Any User Interface Changes (namelist or namelist defaults changes)?
Users can use the flag 'use_nvmovement' to switch from the default method or our method.
This flag hasn't been written into the namelist, but stays in the new file SoilNitrogenMovementMod.F90

Does this create a need to change or add documentation? Did you do so?
it will need to change the documentation, we are still preparing our manuscript.

Testing performed, if any:
One year results are analysis here, I only list the changes of three main components.
Leaching.pdf
SurfaceRunoff.pdf
denitrification.pdf

@samsrabin samsrabin self-assigned this Mar 6, 2025
@samsrabin samsrabin added enhancement new capability or improved behavior of existing capability next this should get some attention in the next week or two. Normally each Thursday SE meeting. science Enhancement to or bug impacting science documentation additions or edits to user-facing documentation or its infrastructure testing additions or changes to tests labels Mar 6, 2025
@samsrabin
Copy link
Member

samsrabin commented Mar 6, 2025

Thanks, Jinmu! I'll plan to add some testing about this, so this checkbox is for me:

  • Add testdefs and tests
  • Check for needed mods in Matrix code?

@wwieder
Copy link
Contributor

wwieder commented Mar 6, 2025

Agreed, thanks for turning this around so, quickly Jinmu. It's very exciting to see this work come through.

From your perspective are there additional code modifications that need to be considered, or is this PR ready for us to start reviewing?

@wwieder
Copy link
Contributor

wwieder commented Mar 6, 2025

So I don't forget, I'm less sure how we may need to make parallel changes in the matrix code, so also going to point @slevis-lmwg to this PR.

@jinmuluo
Copy link
Contributor Author

jinmuluo commented Mar 6, 2025

Mar 6, 2025

I think you can start reviewing this code right now since it has been merged with ctsm5.3.027. I manually left a flag in my code; it works well for me, but is it better to put it into the namelist?

https://github.com/ESCOMP/CTSM/pull/2992/files#diff-65fc5706eb5fa15abc8d2cf9190800786a19536158e24c2d45bf989cbfecbb8dR34:~:text=!%20!!!!!!!%20%20Author%20note,%3D%20.TRUE.

Agreed, thanks for turning this around so, quickly Jinmu. It's very exciting to see this work come through.

From your perspective are there additional code modifications that need to be considered, or is this PR ready for us to start reviewing?

@ekluzek ekluzek removed the next this should get some attention in the next week or two. Normally each Thursday SE meeting. label Mar 20, 2025
@jinmuluo
Copy link
Contributor Author

jinmuluo commented Apr 6, 2025

Two primary tests have been finished.
/glade/derecho/scratch/jinmuluo/archive/ctsm53027_LEACHING_AD
/glade/derecho/scratch/jinmuluo/archive/ctsm53027_LEACHING_hist

@ekluzek ekluzek added this to the ctsm6.1.0 milestone Apr 17, 2025
Jinmu Luo added 2 commits May 6, 2025 14:42
@wwieder
Copy link
Contributor

wwieder commented Jul 8, 2025

Are there namelist changes (use_nvmovement) that preserve b4b results of the current code? If so, I wonder if it would be possible to have this available for the CLM6 release? The features would have to be off by default in CESM3, as the code freeze for science changes has already passed, but merging the PR could be preferable to dragging it out for much longer?

I also don't think we have time to investigate or implement potential changes to matrixCN on this timeline. Maybe that's a deal breaker for merging the PR?

@wwieder wwieder added the next this should get some attention in the next week or two. Normally each Thursday SE meeting. label Jul 8, 2025
@ekluzek ekluzek removed the next this should get some attention in the next week or two. Normally each Thursday SE meeting. label Jul 10, 2025
@wwieder
Copy link
Contributor

wwieder commented Jul 10, 2025

In SE meeting today @slevis-lmwg noted that use_nvmovement flags is just being hard wired in the code and needs to be added to the namelist defaults.

Suggested we add aux_clm test for this, check that when use_nvmovement is off we get b4b results.

Also suggesting we make use_nvmovement = true incomparable with MatrixCN, until we're convinced that matrixCN is compatable with this code change.

Generally SE team was supportive of bringing this into master with the assumption that it will be off by default in CLM6.

@slevis-lmwg can you add use_nvmovement to the namelist defaults and add an aux_clm test for this.

@slevis-lmwg
Copy link
Contributor

slevis-lmwg commented Jul 10, 2025

@wwieder I'm happy to do this, and I have added to my Sprint board.
This has a ctsm6.1.0 milestone. Did we confirm (this morning) whether this was the correct milestone?

Also, here are the notes from this morning's meeting:

start aux_clm testing Jinmu’s #2992, after changing use_nvmovement to a namelist flag and adding a test with it on. Expect no diffs in any existing test, except maybe matrixCN tests. If those have diffs or fail, add them as expected failures, and add a namelist check to prevent use_nvmovement from being used with matrixCN on.

I think this along with Will's post a few lines up means:

  • add aux_clm tests with the flag on (all existing tests already have the flag default off), one with and one without matrix
ERP_D_Ld5.f10_f10_mg37.I1850Clm60BgcCrop.derecho_intel.clm-Nvmovement--clm-matrixcnOn
ERP_D.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-decStart--clm-Nvmovement
  • if flag on with matrix indicates a problem, mark as expected failure and prevent setting the flag on with matrix: DID NOT INDICATE PROBLEM, so I will remove the error check that I already added
    Also, I compared the matrixcnOn case with the matrixcnOff case
    ERP_D_Ld5.f10_f10_mg37.I1850Clm60BgcCrop.derecho_intel.clm-Nvmovement
    and nothing stood out as problematic; however, probably a spinup test will be more definitive.

@ekluzek
Copy link
Collaborator

ekluzek commented Jul 10, 2025

@wwieder I'm happy to do this, and I have added to my Sprint board. This has a ctsm6.1.0 milestone. Did we confirm (this morning) whether this was the correct milestone?

Based on what we said this morning -- it will depend. We will only bring it in earlier than that, if we can verify that it doesn't change answers when turned off. And that we can show that turning it on is at least functional. Also, other cesm3_0 release priorities may trump doing work on this, so we may not be able to get the release out AND do this work. So that could delay it as well. Since, we think of milestones as "the latest" acceptable, that is the correct milestone.

@wwieder
Copy link
Contributor

wwieder commented Jul 11, 2025

@jinmuluo do you think you'd be able to give us an update on your simulations and the changes we could expect from simulations when we turn on this feature?

@jinmuluo
Copy link
Contributor Author

jinmuluo commented Jul 11, 2025

@jinmuluo do you think you'd be able to give us an update on your simulations and the changes we could expect from simulations when we turn on this feature?

@wwieder I have summarized some changes. Should I submit my findings here or copy them to you in email?

some updates on the changes of soil C-N fluxes are listed here
LeachingEvaluation.pptx

@slevis-lmwg slevis-lmwg moved this from In Progress to Stalled in LMWG: Sprint Planning Board Aug 21, 2025
Copy link
Contributor

@wwieder wwieder left a comment

Choose a reason for hiding this comment

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

This is great, @jinmuluo thanks for your work here.
Also thanks to @slevis-lmwg for prepping this merge.

Process question: My biggest concern with the PR is that it doesn't come with documentation. Maybe that's OK, or are we requiring documentaion for PRs like this to come it?

Science question were there other answer changing modifications to the CENTURY nitrif-denitrif scheme that went into the work you presented that altered nitrification rates, @jinmuluo? Or would these come in with @mvalmartin (or your) changes related to soil N2O and NOx (e.g. #3341)?

@slevis-lmwg slevis-lmwg changed the title ctsm5.3.071: Incorporating a new vertical movement scheme for soil nitrate ctsm5.3.072: Incorporating a new vertical movement scheme for soil nitrate Aug 22, 2025
@slevis-lmwg slevis-lmwg moved this from Stalled to In Progress in LMWG: Sprint Planning Board Aug 22, 2025
@jinmuluo
Copy link
Contributor Author

This is great, @jinmuluo thanks for your work here. Also thanks to @slevis-lmwg for prepping this merge.

Process question: My biggest concern with the PR is that it doesn't come with documentation. Maybe that's OK, or are we requiring documentaion for PRs like this to come it?

Science question were there other answer changing modifications to the CENTURY nitrif-denitrif scheme that went into the work you presented that altered nitrification rates, @jinmuluo? Or would these come in with @mvalmartin (or your) changes related to soil N2O and NOx (e.g. #3341)?

I can help with the documentation this fall when i visit NCAR,

For the science part, the CENTURY scheme remained the same; my modifications on nitrification rate and denitrification are not in this PR or in (#3341), I will open another PR to modify the CENTURY nitrif-denitrif scheme; testing is still in progress.

Merge b4b-dev to master

slevis resolved conflicts:
doc/ChangeLog
doc/ChangeSum
@slevis-lmwg slevis-lmwg requested a review from samsrabin August 25, 2025 20:53
@slevis-lmwg
Copy link
Contributor

@samsrabin I re-requested a review since you had requested changes before accepting to approve.

Copy link
Member

@samsrabin samsrabin left a comment

Choose a reason for hiding this comment

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

Looks mostly good, thanks! But there are still some variable names that could use improving. We're not getting charged per character here!

@github-project-automation github-project-automation bot moved this from In progress - master to Stalled (needs review, blocked etc.) in CTSM: Upcoming tags Aug 25, 2025
@slevis-lmwg
Copy link
Contributor

slevis-lmwg commented Aug 25, 2025

./run_sys_tests -s aux_clm -c ctsm5.3.071 -g ctsm5.3.072 worked with all commits up to and including 1cf9859 (two tests still pending on derecho) , so I submitted this as the final test:
./run_sys_tests -s aux_clm -c ctsm5.3.072 --skip-generate

  • izumi
  • derecho

@slevis-lmwg
Copy link
Contributor

@samsrabin I addressed your suggestions and reran aux_clm, so I will re-request your review. Thank you again!

@slevis-lmwg slevis-lmwg requested a review from samsrabin August 26, 2025 16:36
Copy link
Member

@samsrabin samsrabin left a comment

Choose a reason for hiding this comment

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

Perfect, thanks!

@github-project-automation github-project-automation bot moved this from Stalled (needs review, blocked etc.) to In progress - master in CTSM: Upcoming tags Aug 26, 2025
@slevis-lmwg slevis-lmwg merged commit aceafc9 into ESCOMP:master Aug 26, 2025
4 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in LMWG: Sprint Planning Board Aug 26, 2025
@github-project-automation github-project-automation bot moved this from In progress - master to Done (non release/external) in CTSM: Upcoming tags Aug 26, 2025
@slevis-lmwg slevis-lmwg deleted the n-vertical-movement branch August 26, 2025 20:59
slevis-lmwg added a commit to mvalmartin/ctsm that referenced this pull request Aug 26, 2025
Incorporating a new vertical movement scheme for soil nitrate

Work by Jinmu Luo of Cornell University.

use_nvmovement defaults to .false. and can be changed in user_nl_clm.
use_nvmovement cannot be true while use_nitrif_denitrif is false.
 We test the flag as .true. in two new tests:
 ERP_D_Ld5.f10_f10_mg37.I1850Clm60BgcCrop.derecho_intel.clm-nvmovement--clm-matrixcnOn
 ERP_D.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-decStart--clm-nvmovement

PR ESCOMP#2992
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation additions or edits to user-facing documentation or its infrastructure enhancement new capability or improved behavior of existing capability science Enhancement to or bug impacting science testing additions or changes to tests

Projects

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

Development

Successfully merging this pull request may close these issues.

5 participants