Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature: Implementation of an extended nitrogen cycle in iHAMOCC #147

Closed
jmaerz opened this issue Mar 11, 2022 · 13 comments · Fixed by #269
Closed

New feature: Implementation of an extended nitrogen cycle in iHAMOCC #147

jmaerz opened this issue Mar 11, 2022 · 13 comments · Fixed by #269
Assignees
Labels
enhancement New feature or request iHAMOCC Issue mainly concerns the iHAMOCC code base

Comments

@jmaerz
Copy link
Collaborator

jmaerz commented Mar 11, 2022

An extended nitrogen cycle in iHAMOCC

Within the EU-ESM2025 project, we are implementing an extended nitrogen cycle in the ocean biogeochemistry model iHAMOCC as part of NorESM. The aim is to explicitly represent the major and climate-relevant nitrogen species and the processes affecting these species. Namely, iHAMOCC will be enhanced by nitrite and ammonium in both, the water column and the sediment. The eventual aim is to enable, run and analyse coupled NorESM simulations with the extended nitrogen cycle.

Details on the implementation:

  • The current plan is to enable switching on and off the extended nitrogen cycle via preprocessor flags (extNcycle).
  • The implementation will be done in a step-wise manner - first the water column followed by the sediment.
  • For questions, suggestions or discussion (also related to details on process descriptions) get in touch with [email protected]

It's an ongoing project and the new feature branch will presumably enter the master branch at some point.

@TomasTorsvik TomasTorsvik added the enhancement New feature or request label Apr 1, 2022
@jmaerz
Copy link
Collaborator Author

jmaerz commented Aug 30, 2022

Hi @JorgSchwinger , @TomasTorsvik , @tjiputra , is anyone of you currently or in the near future working on new developments for the sediment? I ask since I would like to avoid too many potential (git) conflicts in the sediment part of iHAMOCC in the course of further developments.

@JorgSchwinger
Copy link
Contributor

I have no plans to touch the sediment code in the foreseeable future.

@TomasTorsvik
Copy link
Contributor

I don't plan to touch any sediment code any time soon.

@jmaerz jmaerz added the iHAMOCC Issue mainly concerns the iHAMOCC code base label Sep 6, 2022
@jmaerz
Copy link
Collaborator Author

jmaerz commented Mar 20, 2023

Dear @DirkOlivie and @oyvindseland , in preparation for the air-sea coupling task for N2O and NH3, I prepared a BLOM/iHAMOCC branch:
https://github.com/jmaerz/BLOM/tree/extNcoupling
which includes the extended nitrogen cycle and is (almost) ahead of BLOM master & feature-hamocc_beyond-CMIP6 branch (I might update with the latest minor changes of master - irrelevant for the coupling procedure). This will be the branch that I will be working on the upcoming days. As discussed, let's first focus on N2O and NH3 gaseous exchange and thereafter potentially on wet and dry deposition of N species (NH3/NH4,NO2,NO3).

Here the scheme in mind, while units need to be checked/adjusted:

classDiagram
Atmosphere <|--|> iHAMOCC : Calculated, coupled air-sea fluxes
InputFields --|> iHAMOCC : uni-directional flux to ocean

Atmosphere : Gaseous forms
Atmosphere : N2O (pptv)
Atmosphere : NH3 (pptv)
Atmosphere : (at present, set globally constant in iHAMOCC)

InputFields : Wet and dry deposition 
InputFields : wet NH4,NO2,NO3 (kmol/m2/yr)
InputFields : dry NH4,NO2,NO3 (kmol/m2/yr)
InputFields : (NH4+NO2+NO3 at present handled as climatological NO3 input in iHAMOCC, still requires split)

iHAMOCC : Tracers
iHAMOCC : NO3 (kmol/m3)
iHAMOCC : NO2 (kmol/m3)
iHAMOCC : N2O (kmol/m3)
iHAMOCC : N2 (kmol/m3)
iHAMOCC : NH3/NH4 (kmol/m3)
Loading

@DirkOlivie
Copy link
Contributor

Hi @jmaerz @oyvindseland,
for CAM and CIME, I prepared the following branches :
https://github.com/DirkOlivie/cime/tree/feature-ozone
https://github.com/DirkOlivie/cam/tree/feature-ozone
Together these allow to run the full-chemistry+VSLS. They can be a starting point to also include N2O and NH3 fluxes.

@DirkOlivie
Copy link
Contributor

Hi @jmaerz @oyvindseland,
I have now introduced modifications related to N2O and NH3 coupling in the following branches (started from the branches mentioned earlier) :
https://github.com/DirkOlivie/CAM/tree/feature-ozone-n2o
https://github.com/DirkOlivie/CIME/tree/feature-ozone-n2o
I haven't run any tests with it yet - so there are possibly errors in it.

@DirkOlivie
Copy link
Contributor

DirkOlivie commented Mar 23, 2023

Hi @jmaerz

I have now made a branch of NorESM with a suitable compset :
https://github.com/DirkOlivie/NorESM/tree/feature-noresm2.0.2_ozone-n2o.
The compset name is N1850vslsn2onh3_tropstratchem_prep.

Before checking out the component repositories, the External.cfg file has to be modified (for CAM, CIME and BLOM) to my and your clones.

One has to add in the case-directory the file : chem_mech.in (it can be copied from one of my cases).

@jmaerz
Copy link
Collaborator Author

jmaerz commented Mar 27, 2023

@DirkOlivie wrt deposition fluxes: there are the coupler fields indices on the BLOM side:

    integer :: index_x2o_Faxa_nhx        ! nitrogen deposition (nhx) flux from atm (kgNm2/sec)
    integer :: index_x2o_Faxa_noy        ! nitrogen deposition (noy) flux from atm (kgNm2/sec)

Are they addressed and written properly on the CAM side? On the ocean side, they are thus far not further handled/used, but we could make use of them.

Another question in that respect is, how CAM simulates these fluxes compared to so far used climatological fields:
/cluster/shared/noresm/inputdata/ocn/blom/bndcon/ndep_1850_CMIP6_tnx1v4_20171106.nc

@jmaerz
Copy link
Collaborator Author

jmaerz commented Aug 9, 2023

@mvertens , @DirkOlivie, @TomasTorsvik , @JorgSchwinger , this comment is meant as an update and to bring us on the same page: I filed a draft pull request #269 for my BLOM feature branch for the extended nitrogen cycle (including the MCT coupling and other features) to enable a preview for @mvertens on what will be needed to adopt the coupling through the nuopc cap (for gaseous -N2O and NH3- and deposition -NOy and NHx- fluxes, similar to the bromophorme fluxes) and to eventually bring in the N-cycle developments into the common branches (BLOM feature-hamocc_beyond-CMIP6 and eventually master). The current coupling through the MCT coupler was carried out with the following branches for the other NorESM components (summarized from the conversation above):

https://github.com/DirkOlivie/CAM/tree/feature-ozone-n2o
https://github.com/DirkOlivie/CIME/tree/feature-ozone-n2o
https://github.com/DirkOlivie/NorESM/tree/feature-noresm2.0.2_ozone-n2o
@DirkOlivie : current land developments?

There will be a number of changes of iHAMOCC code through #259, #263, #264. As long as these don't break the MCT coupling (to be tested), I will keep my own feature branch up-to-date with the BLOM feature-hamocc_beyond-CMIP6 branch (holding answer-changing bug fixes in iHAMOCC) that is thus far regularly updated with developments in master (mainly via pull request filed through myself or @TomasTorsvik). I guess, my main question is, when and how to best update the code to support the nuopc cap, while keeping the N-cycle relevant branches of NorESM components ready to be coupled and not too far diverging in case that e.g. BLOM master doesn't support MCT coupling any further.

@jmaerz
Copy link
Collaborator Author

jmaerz commented Sep 15, 2023

Hi @JorgSchwinger and @TomasTorsvik , thus far, the nitrogen deposition was only carried out via nitrate (as a sum of dry+wet deposition of NHx and NOy, $F_\mathrm{OLD}(\mathrm{NO3})$). In the extended nitrogen cycle, both ammonium and nitrate are represented and input data for the fluxes $F_i$ of these two species are available via: https://esgf-node.llnl.gov/search/input4mips/
I tried to recover the nitrogen deposition file for pi-Ctrl simulations today and got with cdo conservative remapping decent, but not 100% identical results - the figure is showing the

$$\mathrm{error}=\frac{\sum_i F_i}{F_\mathrm{old}(\mathrm{NO3})}-1$$

hence 0 means the same value and larger zero overestimation and smaller zero underestimation:
n-deposition

First, is there a script for processing the input4MPIs data available that could aid in even better reproduce the fluxes so far used, when doing the remapping? - otherwise, I would for now use the generated file for ocean-only spinup (later online deposition by CAM will be applied, Dirk and me also thought about generating a climatological map derived from NorESM output for a smoother transition, while I wouldn't expect too much of a shock, when changing the applied fluxes).

Second, related to discussion NorESMhub/NorESM#346 , how to best handle i) such scripts and ii) original input data for iHAMOCC in the future (potentially useful for re-gridding to different grids, etc.)? - for now, I could provide the script via the internal gitlab repo, but of course a longer term strategy would be beneficial.

@JorgSchwinger
Copy link
Contributor

I have the scripts that created the input files for N-deposition. Should be straightforward to split this into different species. The scripts are in matlab/octave though. Maybe easiest to have a short chat?

@jmaerz
Copy link
Collaborator Author

jmaerz commented Sep 19, 2023

Hi @JorgSchwinger , thanks for your feedback yesterday, I now programmed iHAMOCCs N-deposition in such a way that either the sum of all nitrogen deposition can be provided as before (default) or via the split in NHx and NOy (extended nitrogen cycle switched on). This provides some degree of freedom in how the input provided by input4MIPs can be processed and provided to iHAMOCC.

@jmaerz
Copy link
Collaborator Author

jmaerz commented Nov 7, 2023

Dear @DirkOlivie , the current default branch to link for a NorESM2.0.x build when using the extended nitrogen cycle is: https://github.com/jmaerz/BLOM/tree/extNcycle-M4AGO - I suspect that it is safe to assume that this is the branch for the next weeks - I will provide an update, once this changes.

@gold2718 gold2718 moved this to Todo in NorESM Development Dec 12, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in NorESM Development May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request iHAMOCC Issue mainly concerns the iHAMOCC code base
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants