Skip to content

Merging soil NO into the new vertical movement scheme for soil nitrate#3341

Open
mvalmartin wants to merge 7 commits intoESCOMP:masterfrom
mvalmartin:ctsm_soilno
Open

Merging soil NO into the new vertical movement scheme for soil nitrate#3341
mvalmartin wants to merge 7 commits intoESCOMP:masterfrom
mvalmartin:ctsm_soilno

Conversation

@mvalmartin
Copy link

@mvalmartin mvalmartin commented Jul 16, 2025

Description of changes

This PR merges the soil NO from #2290 into the NO3 vertical movement scheme in #2992.

The soil NO scheme is based on Parton et al (2001), and includes canopy reduction (Yan et al, 2005) and rain pulses (Yan et al 2005; Hudman et al 2012).

The scheme uses a fixed soil pH value of 6.5, as defined in SoilBiogeochemCompetitionMod.F90

In addition, the scheme does not includes the dependency of the N mineralization-based term on potential nitrification rates proposed in Parton et al. (2001), which is missing in CLM5 as pointed out by Nevison et al., (2022). Although that was implemented in #2290, it is now removed because it substantially affected N plant uptake and the broader carbon cycle.

A more complex version of this scheme, which includes spatially distributed soil pH, weathering effects on denitrification and soil NH3 volatilization, is described and validated in Val Martin et al (2023).

References

Hudman, R. C., Moore, N. E., Mebust, A. K., Martin, R. V., Russell, A. R., Valin, L. C., and Cohen, R. C.: Steps towards a mechanistic model of global soil nitric oxide emissions: implementation and space based-constraints, Atmos. Chem. Phys., 12, 7779–7795, https://doi.org/10.5194/acp-12-7779-2012, 2012.

Nevison, C., Goodale, C., Hess, P., Wieder, W. R., Vira, J., and Groffman, P. M.: Nitrification and Denitrification in the Community Land Model Compared with Observations at Hubbard Brook Forest, Ecol. Appl., 32, e2530, https://doi.org/10.1002/eap.2530, 2022

Parton, W. J., Holland, E. A., Del Grosso, S. J., Hartman, M. D., Martin, R. E., Mosier, A. R., Ojima, D. S., and Schimel, D. S.: Generalized model for NOx and N2O emissions from soils, J. Geophys. Res.-Atmos., 106, 17403–17419, https://doi.org/10.1029/2001JD900101, 2001.

Val Martin, M., Blanc-Betes, E., Fung, K. M., Kantzas, E. P., Kantola, I. B., Chiaravalloti, I., Taylor, L. L., Emmons, L. K., Wieder, W. R., Planavsky, N. J., Masters, M. D., DeLucia, E. H., Tai, A. P. K., and Beerling, D. J.: Improving nitrogen cycling in a land surface model (CLM5) to quantify soil N2O, NO, and NH3 emissions from enhanced rock weathering with croplands, Geosci. Model Dev., 16, 5783–5801, https://doi.org/10.5194/gmd-16-5783-2023, 2023.

Yan, X., Ohara, T., and Akimoto, H.: Statistical modelling of global soil NOx emissions, Global Biogeochem. Cy., 19, GB3019, https://doi.org/10.1029/2004GB002276, 2005.

Specific notes

Contributors other than yourself, if any: @lkemmons, @slevis-lmwg & @wwieder

CTSM Issues Fixed (include github issue #): Unknown

Are answers expected to change (and if so in what way)? I don't think so

Any User Interface Changes (namelist or namelist defaults changes)?
The soil NO scheme can be turned on and off within the user_nl_clm as use_soil_nox=.true. or .false.
As indicated by Jinmu Luo, the soil NO3 vertical movement scheme can also be turned on and off, but the switch is hardwire within SoilNitrogenMovementMod.F90

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

Testing performed, if any:
We performed 15-year runs using the new configuration, with the first 5 year treated as a pseudo-spin up, using the compset 2000_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV

For evaluation we analyzed global annual timeseries and spatial distributions including changes between runs. Simulations were:

  1. Control (no NO3 vertical movement and no soil NOx)
  2. NO3VertMov (only soil NO3 vertical movement activated)
  3. NO3VertMov+SoilNOx (both soil NO3 vertical movemennt and soil NOx activated).

The main changes in the N cycle (eg soil NO2, denitrification and nitrfication) are driven by the NO3 vertical movement implementation. No significant changes are noticed in the carbon cycle (eg NPP, TOTECOSYSC).

plot_no3vertmov_soilnox_mvalmartin.pdf

@slevis-lmwg slevis-lmwg added the science Enhancement to or bug impacting science label Jul 17, 2025
@slevis-lmwg slevis-lmwg added the enhancement new capability or improved behavior of existing capability label Jul 17, 2025
@ekluzek
Copy link
Collaborator

ekluzek commented Jul 22, 2025

This is based off of: ctsm5.3.040

There is new work to update this to a newer version of CTSM.

@slevis-lmwg
Copy link
Contributor

This is based off of: ctsm5.3.040

There is new work to update this to a newer version of CTSM.

True and, more precisely, Maria's branch starts from @jinmuluo's branch #2992 that is based off of ctsm5.3.040.

@ekluzek ekluzek added the next this should get some attention in the next week or two. Normally each Thursday SE meeting. label Jul 24, 2025
@ekluzek
Copy link
Collaborator

ekluzek commented Jul 24, 2025

Adding next to make sure we know what is happening with all this work.

@ekluzek ekluzek removed the next this should get some attention in the next week or two. Normally each Thursday SE meeting. label Jul 24, 2025
@ekluzek ekluzek requested review from slevis-lmwg and wwieder July 24, 2025 16:17
@ekluzek ekluzek added this to the ctsm6.1.0 milestone Jul 24, 2025
@ekluzek
Copy link
Collaborator

ekluzek commented Jul 24, 2025

@wwieder and @slevis-lmwg will review. @slevis-lmwg meets with the group Monday, and will get more information then.

@slevis-lmwg
Copy link
Contributor

@wwieder (in case you want to look)
I made a diff file that compares this PR to #2992, because that's where Maria started from. The diff file is:
/glade/work/slevis/git_people/mvalmartin/ctsm_soilno/dif_from_jinmu

Copy link
Contributor

@slevis-lmwg slevis-lmwg left a comment

Choose a reason for hiding this comment

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

@mvalmartin for starters I want to say that your coding here seems to me well organized, so thank you for this.

In my review I think I only made one comment, but you will find that I repeated it a few times.

Another request is this: Could you document in the PR (if you didn't already) how you tested your code changes? What types of simulations you performed (compsets, lengths, resolutions, ...)? What history fields you looked at to confirm model behavior? What model behavior you expected and what model behavior you saw?

if (clmveg == nc3crop .or. clmveg == nc3irrig ) ratio_stai_lai = 0.008_r8
if (clmveg >= npcropmin .and. clmveg <= npcropmax ) ratio_stai_lai = 0.008_r8

crf_drydep(pi)=(exp(-11.6_r8*elai(pi)*ratio_stai_lai)+exp(-0.32_r8*elai(pi)))/2
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be one big new section of code.

A comment for here and elsewhere:
When possible, we avoid hardwiring values without explanation. As a first step, could you name things like -11.6 and -0.32 to variable names?

Copy link
Contributor

Choose a reason for hiding this comment

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

I also wonder if values like ratio_stai_lai should be PFT parameters on the parameter file to make this code easier to read? The only odd part is that values change by season for some PFTs?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the note and apologies for the slow 'action'. Working on your comments now!

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the note and apologies for the slow 'action'. Working on your comments now!

@mvalmartin a heads up that I'm about to update your branch to the latest escomp/master tag. I'm mentioning in case you already started making changes to your local copy. If so, you would

  • "stash" your local changes (git stash)
  • pull my remote changes (git pull)
  • bring forward your local changes (git stash pop)
  • continue making changes as needed (git add, git commit, git push)

I hope all that works without trouble...

Copy link
Contributor

Choose a reason for hiding this comment

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

If you didn't already start making changes, then you can simply skip the "git stash" and "git stash pop" steps. In other words just

  • git pull
  • make changes
  • git add
  • git commit
  • git push

if ( h2osoi_diff(c,j) > 0.005_r8 ) then
! Initialize new pulse factor (dry period hours)
if ( ldry_vr(c,j) > 72._r8 ) then
pfactor_vr(c,j) = 13._r8 *LOG(ldry_vr(c,j)) - 53.6_r8
Copy link
Contributor

Choose a reason for hiding this comment

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

This is another large section of the new code. It would be helpful again here to assign hardwired values to variable names (always with literature references when possible).

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for this comment. In the original code the hardwired values appear as simple scalars in the equations, without variable names or descriptions. I have now added the reference (article and equation number) for each equation to make this clearer.

afps_vr(c,j) = 1._r8-max(min(h2osoi_vol(c,j)/watsat(c,j), 1._r8), 0._r8)
Dr = 0.209_r8*afps_vr(c,j)**(4._r8/3._r8)

nox_n2o_ratio_vr(c,j) = 15.2_r8 + (35.5_r8 * atan(0.68_r8 * rpi * (10.0_r8 * Dr - 1.86_r8))) / rpi
Copy link
Contributor

Choose a reason for hiding this comment

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

This is another area with numerous hardwired values that need some kind of documentation, such as assigning variable names and literature refs to them.

Copy link
Author

Choose a reason for hiding this comment

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

In this case too. In the original code the hardwired values appear as simple scalars in the equations, without variable names or descriptions. I added the reference (article and equation number) for each equation to make this clearer.

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.

I wonder we can rebase this PR can be to Jinmu's branch / PR #2992 so we just see the changes that were made for the NOx scheme? Maybe this will be be easier once Jinmu's PR comes to main?

if (clmveg == nc3crop .or. clmveg == nc3irrig ) ratio_stai_lai = 0.008_r8
if (clmveg >= npcropmin .and. clmveg <= npcropmax ) ratio_stai_lai = 0.008_r8

crf_drydep(pi)=(exp(-11.6_r8*elai(pi)*ratio_stai_lai)+exp(-0.32_r8*elai(pi)))/2
Copy link
Contributor

Choose a reason for hiding this comment

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

I also wonder if values like ratio_stai_lai should be PFT parameters on the parameter file to make this code easier to read? The only odd part is that values change by season for some PFTs?

@slevis-lmwg
Copy link
Contributor

@mvalmartin I will need "collaborator access" to your branch for when I end up working on it. This is how you give me access:

  • At the top of your PR, click on your branch: mvalmartin:ctsm_soilno
  • Now at the top-middle click Settings and then Collaborators and follow the prompts to add me (@slevis-lmwg) as a collaborator

@mvalmartin
Copy link
Author

mvalmartin commented Aug 5, 2025

@slevis-lmwg, I added you as collaborator in the PR, you should have received an invitation. Please let me know if you can't still access it. Thanks!

…_soilno

slevis resolved conflicts:
src/main/controlMod.F90
@slevis-lmwg
Copy link
Contributor

@mvalmartin thank you. I confirmed my access by merging the latest updates from @jinmuluo's branch to your branch here. A few points:

  • I will make such merges a few more times occasionally, including after merging @jinmuluo's branch to master eventually.
  • Do "git pull" in your local copy of ctsm_soilno to have the latest code from here.
  • Then modify ctsm_soilno as necessary (e.g. revisions in response to the code reviews above) and git push back to here, so that I can in turn git pull to my local copy of ctsm_soilno and that way stay up-to-date.

@slevis-lmwg slevis-lmwg moved this from Stalled to In Progress in LMWG: Sprint Planning Board 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
@slevis-lmwg slevis-lmwg moved this from Stalled to In Progress in LMWG: Sprint Planning Board Dec 5, 2025
@slevis-lmwg slevis-lmwg moved this from In Progress to Stalled in LMWG: Sprint Planning Board Dec 23, 2025
@mvalmartin
Copy link
Author

Merge remote-tracking branch 'jinmuluo/n-vertical-movement' into ctsm…

@mvalmartin other activities have lowered this PR's priority for me right now. If you could investigate why tests like SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop fail, that would help move this work forward. To run this test, go to the /cime/scripts directory and run create_test SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop The failure has been in the RUN phase.

UPDATE 2025/12/5 I started the failing test with some write statements included: FAIL SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop.20251205_155955_dcs1wl UPDATE 2025/12/9 I rebuilt + resubmitted with a new initialization but may need to move the latter even further out of if-blocks because the test still failed.

Hi Sam,
Ru and I have been testing ctsm_soilno to look at the test failure. Now I see that my original ctsm_soilno scheme in ctsm5.3.040 was later merged into ctsm5.3.072. The failure is in ~src/biogeochem/VOCEmissionMod.F90 from updates in ctsm5.3.072.

The problem is specifically with the "meg_coef" parameter that didn't exist in the earlier version. I'm not 100% sure what this parameter does, but when we remove it and leave that section of the code as in ctsm5.3.040, the test passes successful.

For reference, this is the change we made:
do imeg = 1,n_meg_comps ! loop over number of megan compounds that make up the nth mechanism compoud
! meg_coef = shr_megan_mechcomps(imech)%megan_comps(imeg)%coeff
ii = shr_megan_mechcomps(imech)%megan_comps(imeg)%ptr%index
! vocflx(p,imech) = vocflx(p,imech) + meg_coef*vocflx_meg(ii)
vocflx(p,imech) = vocflx(p,imech) + vocflx_meg(ii)
enddo
I understand this is not an elegant solution :) but I was wondering if anyone else has run into that issue and found a better fix!

Thanks a lot!

Maria

@jinmuluo
Copy link
Contributor

Merge remote-tracking branch 'jinmuluo/n-vertical-movement' into ctsm…

@mvalmartin other activities have lowered this PR's priority for me right now. If you could investigate why tests like SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop fail, that would help move this work forward. To run this test, go to the /cime/scripts directory and run create_test SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop The failure has been in the RUN phase.
UPDATE 2025/12/5 I started the failing test with some write statements included: FAIL SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop.20251205_155955_dcs1wl UPDATE 2025/12/9 I rebuilt + resubmitted with a new initialization but may need to move the latter even further out of if-blocks because the test still failed.

Hi Sam, Ru and I have been testing ctsm_soilno to look at the test failure. Now I see that my original ctsm_soilno scheme in ctsm5.3.040 was later merged into ctsm5.3.072. The failure is in ~src/biogeochem/VOCEmissionMod.F90 from updates in ctsm5.3.072.

The problem is specifically with the "meg_coef" parameter that didn't exist in the earlier version. I'm not 100% sure what this parameter does, but when we remove it and leave that section of the code as in ctsm5.3.040, the test passes successful.

For reference, this is the change we made: do imeg = 1,n_meg_comps ! loop over number of megan compounds that make up the nth mechanism compoud ! meg_coef = shr_megan_mechcomps(imech)%megan_comps(imeg)%coeff ii = shr_megan_mechcomps(imech)%megan_comps(imeg)%ptr%index ! vocflx(p,imech) = vocflx(p,imech) + meg_coef*vocflx_meg(ii) vocflx(p,imech) = vocflx(p,imech) + vocflx_meg(ii) enddo I understand this is not an elegant solution :) but I was wondering if anyone else has run into that issue and found a better fix!

Thanks a lot!

Maria

Merge remote-tracking branch 'jinmuluo/n-vertical-movement' into ctsm…

@mvalmartin other activities have lowered this PR's priority for me right now. If you could investigate why tests like SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop fail, that would help move this work forward. To run this test, go to the /cime/scripts directory and run create_test SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop The failure has been in the RUN phase.
UPDATE 2025/12/5 I started the failing test with some write statements included: FAIL SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop.20251205_155955_dcs1wl UPDATE 2025/12/9 I rebuilt + resubmitted with a new initialization but may need to move the latter even further out of if-blocks because the test still failed.

Hi Sam, Ru and I have been testing ctsm_soilno to look at the test failure. Now I see that my original ctsm_soilno scheme in ctsm5.3.040 was later merged into ctsm5.3.072. The failure is in ~src/biogeochem/VOCEmissionMod.F90 from updates in ctsm5.3.072.

The problem is specifically with the "meg_coef" parameter that didn't exist in the earlier version. I'm not 100% sure what this parameter does, but when we remove it and leave that section of the code as in ctsm5.3.040, the test passes successful.

For reference, this is the change we made: do imeg = 1,n_meg_comps ! loop over number of megan compounds that make up the nth mechanism compoud ! meg_coef = shr_megan_mechcomps(imech)%megan_comps(imeg)%coeff ii = shr_megan_mechcomps(imech)%megan_comps(imeg)%ptr%index ! vocflx(p,imech) = vocflx(p,imech) + meg_coef*vocflx_meg(ii) vocflx(p,imech) = vocflx(p,imech) + vocflx_meg(ii) enddo I understand this is not an elegant solution :) but I was wondering if anyone else has run into that issue and found a better fix!

Thanks a lot!

Maria

Hi Maria,

Just my personal guess, did you update the submodule in your code repository? like the CMEP (your_ctsmc_ode/components/cmeps), please check the newest updates for the MEGAN emission coefficient in shr_megan_mod.F90 (commits below), you should find that the "coeff" has been moved to a new type in the newest ctsm.

ESCOMP/CMEPS@17810f3

@ekluzek
Copy link
Collaborator

ekluzek commented Jan 15, 2026

Yes, MEGAN needs to be coordinated with the components/cmeps submodule. So run the following just to check if something needs to be updated (without actually changing anything):

./bin/git-fleximod status

It'll report if the submodules are all correct or not. If not you can run the above with "update" rather than "status" to get it in sync.

@mvalmartin
Copy link
Author

create_test SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop

Yes, MEGAN needs to be coordinated with the components/cmeps submodule. So run the following just to check if something needs to be updated (without actually changing anything):

./bin/git-fleximod status

It'll report if the submodules are all correct or not. If not you can run the above with "update" rather than "status" to get it in sync.

Hello @jinmuluo and @ekluzek, Thanks a lot for your feedback. That was the issue.
@slevis-lmwg, the test is successful. We will then proceed with the spin up and compare it with your baseline and jinmu's run unless we hear otherwise. I believe we need to follow this NCAR/LMWG_dev#91 and use a clm6 parameter.
Thanks again everyone!
Maria

@slevis-lmwg
Copy link
Contributor

@mvalmartin and Ru, just to be clear, by "the test is successful" do you mean the same test that was failing for me before in the RUN phase? If so, please push your updates to this PR, so that I may rerun the full aux_clm.

@mvalmartin
Copy link
Author

@mvalmartin and Ru, just to be clear, by "the test is successful" do you mean the same test that was failing for me before in the RUN phase? If so, please push your updates to this PR, so that I may rerun the full aux_clm.

Yes, your test ~cime/script/create_test SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop
We also run short test cases with use_soil_nox=true/false and use_nvmovement = true/false and they worked too.

I have just pushed the updates. I hope this helps!
Maria

@slevis-lmwg
Copy link
Contributor

slevis-lmwg commented Jan 22, 2026

I have just pushed the updates. I hope this helps! Maria

Thank you, Maria. The last commit that I see here in the PR is your commit from Sep 1st. Could you try pushing again. I wonder if you committed but did not push.

@mvalmartin
Copy link
Author

I have just pushed the updates. I hope this helps! Maria

Thank you, Maria. The last commit that I see here in the PR is your commit from Sep 1st. Could you try pushing again. I wonder if you committed but did not push.

Hi Sam, Sorry for the confusion!! I think I mixed up “updating my local checkout for testing” with “pushing changes to the PR”. I did run some git commands (including commit/push), assuming the git-fleximod sync work would show up in the PR, but after checking I can confirm the PR branch hasn’t changed (both my local branch and the gitgub branch still point to the same commit (8fac120), and git diff is clean.)

So any git-fleximod updates I did were just to get my local environment in sync for testing and did not end up as new PR commits.

Ru is looking at starting the spin-up. Will recommended to follow this case NCAR/LMWG_dev#91 but we wanted to check with you as that was last summer and things may have changed since then.
Thanks a lot! Maria

@slevis-lmwg
Copy link
Contributor

slevis-lmwg commented Jan 24, 2026

Thank you, Maria. Your explanation helped me see that my tests ran with fa6a80a, which is one commit before the last one (8fac120). So I updated and started aux_clm again:
./run_sys_tests -s aux_clm -c ctsm5.3.073 --skip-generate

  • derecho
  • izumi

@mvalmartin
Copy link
Author

Thank you, Maria. Your explanation helped me see that my tests ran with fa6a80a, which is one commit before the last one (8fac120). So I updated and started aux_clm again: ./run_sys_tests -s aux_clm -c ctsm5.3.073 --skip-generate

  • derecho
  • izumi

Perfect, Sam. For testing the scheme, is there a case we can clone or follow? Ru is looking at this link shared by @wwieder NCAR/LMWG_dev#91
but that was last summer and we wanted to double check with you that things haven't changed since then. Thanks again, Maria

@slevis-lmwg
Copy link
Contributor

@mvalmartin I don't know what we're doing differently, but the same test returned:
FAIL SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop RUN with this traceback:

dec0242.hsn.de.hpc.ucar.edu 47: forrtl: severe (174): SIGSEGV, segmentation fault occurred
dec0242.hsn.de.hpc.ucar.edu 47: Image              PC                Routine            Line        Source
dec0242.hsn.de.hpc.ucar.edu 47: libc.so.6          0000146AB7442900  Unknown               Unknown  Unknown
dec0242.hsn.de.hpc.ucar.edu 47: cesm.exe           000000000076EA9A  subgridavemod_mp_         316  subgridAveMod.F90
dec0242.hsn.de.hpc.ucar.edu 47: cesm.exe           0000000000CB449B  soilbiogeochemcom         309  SoilBiogeochemCompetitionMod.F90
dec0242.hsn.de.hpc.ucar.edu 47: cesm.exe           0000000000FCEC0C  cndrivermod_mp_cn         478  CNDriverMod.F90
dec0242.hsn.de.hpc.ucar.edu 47: cesm.exe           000000000094252A  cnvegetationfacad        1033  CNVegetationFacade.F90
dec0242.hsn.de.hpc.ucar.edu 47: cesm.exe           00000000005FA889  clm_driver_mp_clm        1058  clm_driver.F90
dec0242.hsn.de.hpc.ucar.edu 47: cesm.exe           00000000005A0001  lnd_comp_nuopc_mp         904  lnd_comp_nuopc.F90

The test gets submitted from here:
/glade/derecho/scratch/slevis/tests_0123-172152de/SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop.C.0123-172152de_int and the run directory is
/glade/derecho/scratch/slevis/tests_0123-172152de/SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop.C.0123-172152de_int/run
We may need to get on a call to figure out how you got the same test to pass.

@mvalmartin
Copy link
Author

Yes, MEGAN needs to be coordinated with the components/cmeps submodule. So run the following just to check if something needs to be updated (without actually changing anything):

./bin/git-fleximod status

It'll report if the submodules are all correct or not. If not you can run the above with "update" rather than "status" to get it in sync.

Hi @slevis-lmwg, did you sync the components/cmeps submodule as pointed out by Erik? The only thing i did on my version was running ./bin/git-fleximod status
and then since some submodules were not correct, running ./bin/git-fleximod update. I hope this helps. Happy to meet and discuss if this is not the piece missing :)

@slevis-lmwg
Copy link
Contributor

slevis-lmwg commented Jan 26, 2026

This doesn't seem to be the problem. The status command returns this before and after I run the update:
./bin/git-fleximod status

                 fates at tag sci.1.87.0_api.41.0.0
               tools/landusedata at tag v0.1.1
                  cism at tag cismwrap_2_2_006
                     source_cism at tag cism_main_2.01.013
                   rtm at tag rtm1_0_89
                mosart at tag mosart1.1.12
             mizuRoute at tag cesm-coupling.n03_v2.2.0
            ccs_config at tag ccs_config_cesm1.0.56
                  cime at tag cime6.1.113
          e    CIME/non_py/cprnc has no fxtag defined in .gitmodules, module at 0b326fd
                 cmeps at tag cmeps1.1.5
                 cdeps at tag cdeps1.0.79
                             fox at tag 4.1.2.2
                          genf90 at hash 4816965
                 share at tag share1.1.9
            parallelio at tag pio2_6_6
            mpi-serial at tag MPIserial_2.5.4
e          doc-builder not checked out, aligned at tag v2.2.6 (optional)
    testfails = 0, local mods = 0, needs updates 1

Cime and doc-builder almost always show these errors. When I go in /cime, git describe says cime6.1.113.

@slevis-lmwg
Copy link
Contributor

Just in case something got corrupted with my version, I will start with a clean checkout and test again.

@slevis-lmwg
Copy link
Contributor

Still fails for me...

20260126_155520_b8qljv: 1 test
  SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop (Overall: FAIL) details:
    PASS SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop CREATE_NEWCASE
    PASS SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop XML
    PASS SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop SETUP
    PASS SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop SHAREDLIB_BUILD time=200
    PASS SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop NLCOMP
    PASS SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop MODEL_BUILD time=46
    PASS SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop SUBMIT
    FAIL SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop RUN

here, same traceback:
/glade/derecho/scratch/slevis/SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop.C.20260126_155520_b8qljv/run

@jinmuluo
Copy link
Contributor

One difference between Maria's case and Sam's case would be the 'use_soil_nox' activated or not? Sam's case broken at the point when CLM tried to map the patch level canopy reduction factor to column level in SoilBiogeochemCompetitionMod.F90 which is associated with Maria's nox emission, and in Sam's case, use_soil_nox is false.

@mvalmartin
Copy link
Author

mvalmartin commented Jan 27, 2026

One difference between Maria's case and Sam's case would be the 'use_soil_nox' activated or not? Sam's case broken at the point when CLM tried to map the patch level canopy reduction factor to column level in SoilBiogeochemCompetitionMod.F90 which is associated with Maria's nox emission, and in Sam's case, use_soil_nox is false.

Thanks a lot, @jinmuluo! My version also runs with use_soil_nox=false although I see I left dry deposition active as it is needed for soil nox emissions.
@slevis-lmwg, would you mind trying your case with drydep on? "CLM_BLDNML_OPTS" value="-bgc bgc -crop -fire_emis -drydep" If it works, i guess that may not be ideal for the default version?

@slevis-lmwg slevis-lmwg moved this from Stalled to In Progress in LMWG: Sprint Planning Board Jan 27, 2026
@slevis-lmwg
Copy link
Contributor

GOOD NEWS: I added -drydep to the same test and executed the following commands:

./case.setup --reset
./case.build --clean
./case.build
./case.submit

and it passed. You're correct @mvalmartin that we need to have all this working for the default version, as well.

@slevis-lmwg slevis-lmwg moved this from In Progress to Stalled in LMWG: Sprint Planning Board Feb 3, 2026
@slevis-lmwg
Copy link
Contributor

Follow-up thought: I did not think of it this way earlier. Is it that we need to make -drydep the default?

@mvalmartin
Copy link
Author

Follow-up thought: I did not think of it this way earlier. Is it that we need to make -drydep the default?

I guess we do? I don't know how to code that though. If it is not necessary for other processes in clm5 (i guess that was the reason it went to off by default) , users just need to be aware that use_soil_nox=true needs to have 'drydep' on.? Thanks!

@wwieder
Copy link
Contributor

wwieder commented Feb 4, 2026

In an I case I don't think we need Drydep on, do we?

@mvalmartin
Copy link
Author

In an I case I don't think we need Drydep on, do we?

drydep needs to be on in the I cases for use_soil_nox=true because the canopy reduction factor is calculated there but it doesnt need to be on for use_soil_nox=false

@slevis-lmwg
Copy link
Contributor

In an I case I don't think we need Drydep on, do we?

drydep needs to be on in the I cases for use_soil_nox=true because the canopy reduction factor is calculated there but it doesnt need to be on for use_soil_nox=false

@mvalmartin you expect use_soil_nox = .false. to work without -drydep, but currently it does not work. I confirmed this by trying the same test as above but confirming that use_soil_nox = .false. by adding it to my user_nl_clm:

cd cime/scripts
./create_test SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop --no-build
cd /glade/derecho/scratch/slevis/SMS.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop.20260213_152228_ez42cy

I added use_soil_nox = .false. to user_nl_clm and made sure that -drydep did not appear in env_run.xml.

./case_build
./case_submit

Same failure as before.

@slevis-lmwg
Copy link
Contributor

[...] Sam's case broken at the point when CLM tried to map the patch level canopy reduction factor to column level in SoilBiogeochemCompetitionMod.F90 which is associated with Maria's nox emission, and in Sam's case, use_soil_nox is false.

This was @jinmuluo's assessment of the bug.

@mvalmartin
Copy link
Author

[...] Sam's case broken at the point when CLM tried to map the patch level canopy reduction factor to column level in SoilBiogeochemCompetitionMod.F90 which is associated with Maria's nox emission, and in Sam's case, use_soil_nox is false.

This was @jinmuluo's assessment of the bug.

Hi, apologies for the delay. I realized that the canopy reduction factor was outside the use_soil_nox constraint and therefore required dry deposition to be turned on. I have now added an IF statement so that dry deposition is no longer required. (When I checked my test script, I noticed that I had left dry deposition turned on, which is why it appeared to work before.)

I have committed the updated F90 module to the PR. Please let me know if anything else is needed from my end.

I would also like to run a spin-up to show that the soil NOx addition does not affect the carbon cycle. Could someone point me to a case I could clone for this comparison?

Thanks!

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 science Enhancement to or bug impacting science

Projects

Status: Stalled

Development

Successfully merging this pull request may close these issues.

5 participants