NorESMhub / CTSM

Community Terrestrial Systems Model (includes the Community Land Model of CESM)
http://www.cesm.ucar.edu/models/cesm2.0/land/
Other
2 stars 9 forks source link

Getting MEGAN to work in FATES #36

Open rosiealice opened 9 months ago

rosiealice commented 9 months ago

This is a copy of this issue on CTSM.

MEGAN doesn't work with FATES, just because it never was plugged in. This will be the subject of Adele's PhD so we at CICERO likely have an interest in making this work.

https://github.com/ESCOMP/CTSM/issues/1784

rosiealice commented 3 months ago

Just going to flesh out some background on this while my head is in a coding space...

MEGAN code for CTSM currently lives here:

https://github.com/NorESMhub/CTSM/blob/clm-Nor-dev/src/biogeochem/VOCEmissionMod.F90

The basic form of the model is that there is an emission factor, defined by PFT and location, which is multiplied by a series of 'gamma' factors, representing the limitation on emission from a bunch of daily averaged conditions, (e.g. light, co2, lai, temperature, soil moisture). These factors are fed averaged drivers from CTSM.

The model itself is almost one line, and most of the code is dedicated to the calculation of the factors and the extraction of the correct emissions factor.

In essence, we face here the same dilemma as for the fire emissions code. E.g.

All the same arguments apply as before. E.g.

A couple of additional considerations apply in addition. In favour of #2...

And in favour of #1

Lastly, MEGAN III is under development. We should communicate with them to get a handle on how this would affect our path...

rosiealice commented 2 months ago

So, I have made a v0 attempt to get MEGAN and FATES to work together, using 'option 2' above (passing a MEGAN PFT index into FATES).

The FATES side changes are here; https://github.com/rosiealice/fates/tree/megan_branch_from_ffe and the CTSM changes are here: https://github.com/rosiealice/ctsm/tree/megan_ctsm

Both of these are forked from the NorESMhub fates-fire-emissions feature branches, because I couldnt figure out how to create branches from the beginnings of those branches and I wanted to work in the same codebase. Hence we might have to pull the fire emissions changes in first?

https://github.com/NorESMhub/fates/tree/feature/fates-fire-emission

Here is the comparison of the fire branch with the fates megan branch https://github.com/NorESMhub/fates/compare/feature/fates-fire-emission...rosiealice:fates:megan_branch_from_ffe

and here is the mapping between the PFTs: https://docs.google.com/spreadsheets/d/1GlCReDhTAUf7sOYRO_bvKr66mx8qe9l5OVj8B-TcgHY/edit#gid=0

This code compiles and runs and produces MEGAN output (for which I had to remove the 'no-megan' option in the env_run.xml file. So we might need to change how fates compsets work with megan?

This is potentially NOT our intended long term solution for MEGAN and FATES, as it breaks the FATES logic that all PFT parameters should be in the PFT file, but it will allow for NorESM to do the coupled chemistry experiments in the NOCOMP configuration.

Interactions with MEGAN3, full competitive FATES mode and potential modifications to the physioology of MEGAN are all possible in future iterations, more likely in the event that @adelezaini is interested in pursuing any of those leads later in her thesis :)