CTSM icon indicating copy to clipboard operation
CTSM copied to clipboard

Add soil NO fluxes into the N cycle.

Open mvalmartin opened this issue 2 years ago • 19 comments

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

It is not connected to soil pH from the surface file, that is, it considers the fixed soil pH value of 6.5 given in SoilBiogeochemCompetitionMod.F90

It also includes the dependency of the N mineralization-based term on potential nitrification rates that was implemented in Parton et al. (2001), which was missing from previous versions of CLM5 as pointed out by Nevison et al., (2022).

This scheme -with more complexity as it is linked to spatially distributed soil pH and considers weathering effect on denitrification and NH3 volatilization- is described and evaluated 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.

Description of changes

Specific notes

Contributors other than yourself, if any:

CTSM Issues Fixed (include github issue #):

Are answers expected to change (and if so in what way)?

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

Testing performed, if any: (List what testing you did to show your changes worked as expected) (This can be manual testing or running of the different test suites) (Documentation on system testing is here: https://github.com/ESCOMP/ctsm/wiki/System-Testing-Guide) (aux_clm on cheyenne for intel/gnu and izumi for intel/gnu/nag/pgi is the standard for tags on master)

NOTE: Be sure to check your coding style against the standard (https://github.com/ESCOMP/ctsm/wiki/CTSM-coding-guidelines) and review the list of common problems to watch out for (https://github.com/ESCOMP/CTSM/wiki/List-of-common-problems).

mvalmartin avatar Dec 13 '23 04:12 mvalmartin

Thanks for making this PR, @mvalmartin ! We'll start reviewing the code from a scientific and software perspective to see how to move forward. This may be a bit slow with AGU and the holidays.

Can you remind me if you've tried spinning these case up from bare ground and creating new initial conditions? I'm curious how much we should expect these nitrogen-focused changes to influence carbon stocks / fluxes?

wwieder avatar Dec 14 '23 19:12 wwieder

Hi, for the testing I used the spin-up file from Val Martin et al (2023). The changes in the N cycling are not exactly the same but I thought the spin-up file could be used as a good approximation to assess at the spatial distribution, magnitude and seasonality of soil NOx and compared them to other estimates. Perhaps a new spin-up would be necessary to check on the carbon stocks/pools? Maria

mvalmartin avatar Dec 21 '23 09:12 mvalmartin

Hi @mvalmartin,

I wanted to let you know that @samsrabin is going to review this PR from the software side. I'll look at it from the science side. Realistically I don't think this with be addressed until after the Feb WG meetings, but it sounds like the the CAMChem group wants this for CESM3 (e.g. before June 2024). Hopefully this timeline is OK with @tilmes?

wwieder avatar Jan 11 '24 17:01 wwieder

@mvalmartin and @samsrabin, what's our best plan moving forward? Some of the requests are easy (remove your name and date from line changes). Others may be more challenging (adding parameters to parameters to the parameter file and using namelist flags)?

We're pretty swamped with SE needs for CESM3, so any work your group can contribute would be appreciated, Maria. That said, some of this may be simpler for someone who's more familiar with CTSM coding conventions? Happy to hear your thoughts on this.

wwieder avatar Jan 12 '24 17:01 wwieder

I have to admit that some of my coding practices are rustic :) I can modify some of the code in the next days -before I start lecturing again. I'm not fully familiar with the CTSM coding conventions so may need some help, specially about adding the namelist or parameters in the file. I'll do my best though.

mvalmartin avatar Jan 15 '24 17:01 mvalmartin

Definitely feel free to ping me if you need help with the parameter file! Or anything else for that matter. You can mention me here or send me an email.

samsrabin avatar Jan 16 '24 16:01 samsrabin

@samlevis will you look at how this may integrate with #640? I'm assuming Matrix will come in before this PR is ready.

wwieder avatar Jan 18 '24 17:01 wwieder

Hi @mvalmartin , One more question that came up in a conversation with @ekluzek and @tilmes was that we don't have the rest of the CESM PR here, but can you also open a PR on CMEPS for passing these fluxes through the coupler?

wwieder avatar Feb 07 '24 16:02 wwieder

Thanks! I added it into my to do list!

mvalmartin avatar Feb 12 '24 09:02 mvalmartin

Hi @slevis-lmwg, @wwieder and @samsrabin, Apologies I'm slow working on this and on top of that my ctsm with soil NOx version was implemented in cheyenne and had a hard time to make it run in derecho. I also need to admit that github is not my forte and need some guidance here....

So, I started transfering the soil NOx code while addressing the previous comments from @wwieder and @samsrabin (eg remove my 'mvm' notes, etc) in a new version that works in derecho /glade/derecho/scratch/mariavm/derecho_ctsm/ Is that a good approach? I see @slevis-lmwg requested some additional modifications, so are those on top of @wwieder and @samsrabin comments or those previous ones have already been addressed?

I still need to open the a PR on CMEPS for passing these fluxes through the coupler but wanted to get everything sorted in ctsm_soilnox sorted first but should I go ahead and request it?

Thanks a lot!

Maria

mvalmartin avatar Apr 04 '24 10:04 mvalmartin

@mvalmartin please view my two suggestions as additional to prior comments, though I entered this discussion late and do not necessarily know what's going on. And my review's 5-point task list indicates requirements for getting code into "main" without indicating or making assumptions about who will complete each step.

Seems fine to me that you made a new version that works on derecho, though keep in mind that /scratch has a scrubber, so you may lose work on that disk. That version will need to come to github to this or a follow-up PR, right?

slevis-lmwg avatar Apr 04 '24 22:04 slevis-lmwg

Hi @wwieder, @samsrabin, @slevis-lmwg, @ekluzek and @tilmes, I have implemented the soil NOx scheme in a new version of ctsm as I couldn't make my old version run in derecho for testing. It is in here: /glade/work/mariavm/derecho_ctsm_soilnox

I have also incorporated most of your modifications except 'creating a namelist variable to define the method by which N gases are calculated (e.g., Koven2013 vs. Valmartin2023)' as that was beyond my current expertise and time available to learn!

The only thing left is to couple soil_nox_atmos from CTSM to CAM.

Do you need to push this version to github?

Thanks a lot and apologies for the delay!

Maria

mvalmartin avatar May 22 '24 10:05 mvalmartin

@mvalmartin It sounds like you have a new branch, right? And the one in this PR is not being used anymore? In that case, I think it would be best to close this pull request, then submit a new one with your new branch (including a link to this PR).

samsrabin avatar May 22 '24 15:05 samsrabin

I'd agree, letting us see your update would be helpful. That's likely easiest if you just open a new PR.

wwieder avatar May 22 '24 16:05 wwieder

It seems worth including some of our email discussion with @lkemmons & @tilmes. Louisa wrote: Hi Will, I think it would be great if we could get the soil NO emissions included in CESM3. It sounds like Maria is just stuck with making a pull request, etc. Can we help get this done?

@wwieder responded: Hi Louisa, This is a scientific feature I'd like to be able to support. We can try, but I think it's unlikely we'll be able to integrate a yet to be completed PR by a June 30th deadline with other priorities that the CTSM software team is trying to tackle. Moreover, this PR also needs to be scientifically vetted (e.g. does the change in soil N cycling feedback onto the terrestrial C cycle, which I don't think Maria ever evaluated). This isn't a show stopper, but it will take some additional time.

If you can provide SE support, especially for the technical bits that Maria's struggling with, that would be excellent and certainly help us out. Could Francis (of someone else) help move this PR through the pipeline?

I think the prioritization of somewhat comes down to the CAM-Chem group and Dave (@dlawrenncar). Can we delay the science freeze to accommodate this request? How high a priority is it for the science you'd like to do with CESM3.0 (as opposed to CESM3.1)?

wwieder avatar May 23 '24 16:05 wwieder

After further discussing this PR at our SE meeting today I think it's clear that the LMWG will not be able to get this PR onto main by the June 30 code freeze. I'm happy to outline what needs to happen to bring in this work and make it available to the community, but it's a larger discussion about deadlines and priorities for the default configuration of CESM3.

wwieder avatar May 23 '24 16:05 wwieder

After further discussing this PR at our SE meeting today I think it's clear that the LMWG will not be able to get this PR onto main by the June 30 code freeze. I'm happy to outline what needs to happen to bring in this work and make it available to the community, but it's a larger discussion about deadlines and priorities for the default configuration of CESM3.

Thanks for the update. We will work on implementing and fully evaluating this after the freeze.

lkemmons avatar May 23 '24 19:05 lkemmons

I had previously promised to add the page on how to add namelist items to CLM. I just found where that is, so I'm posting here in case it's helpful. As one thing we had talked about was putting namelist control around this new feature.

https://wiki.ucar.edu/display/ccsm/Adding+New+Namelist+Items+to+CLM

ekluzek avatar Jun 12 '24 19:06 ekluzek

@lkemmons thanks for offering to pick up this work. I don't know if it's easiest to merge the latest work you referenced in your comment here into this PR, or close this PR and open a new one? Either way, it would be nice to see where comments from the previous code review were addressed.

Separately, I want to emphasize that besides the logistics of merging the PR we also need to:

  1. link to a CMEPs PR that passes soil NO fluxes to the mediator
  2. Bring the changes across in to the Matrix-CN solution.
  3. Scientifically evaluate the changes on terrestrial C and and N cycles from these changes.

Accomplishing these additional tasks seems unlikely on a July 31 timeline, but we can't even begin to evaluate this until we see an updated PR on the core of the soil BGC work.

wwieder avatar Jun 17 '24 21:06 wwieder

@lkemmons you were going to work on this one have you made any progress on it? This seems like something that will need to come in later after the current "chill" activity happens.

ekluzek avatar Jul 25 '24 16:07 ekluzek

@ekluzek Sorry, I have not found time to work on this. I think Maria's code (/glade/work/mariavm/derecho_ctsm_soilnox/) is in ctsm5.1.dev157. Can I start a new PR with it? Or should I incorporate those changes into a newer version?

lkemmons avatar Jul 25 '24 19:07 lkemmons