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 updates on MEGANv2.1 #2588

Merged
merged 12 commits into from
Aug 12, 2024

Conversation

HuiWangWanderInGitHub
Copy link
Contributor

@HuiWangWanderInGitHub HuiWangWanderInGitHub commented Jun 7, 2024

Description of changes

We added new features to MEGANv2.1 for simulating isoprene emissions based on three recent studies conducted at the BAI lab in the University of California, Irvine. The first one is about the drought impact on isoprene (Wang et al., 2022). The second study investigates the effect of temperature history on the emission factors of boreal broadleaf deciduous shrubs (Wang et al., 2024a). The third study explores a different temperature response curve for C3 Arctic grass (Wang et al., 2024b, under press). These changes improved the model's representation of isoprene emissions during drought and in high-latitude ecosystems.
This work is related to issue #1323 and is based on the old MEGANv2.1 framework, but incorporates new scientific insights.

Specific notes

We modified the impact of drought based on the water stress function (β) in the CLM model. We adopted equation (11) from Wang et al., (2022) as:
image
, where a1 (=-7.45) and b1(=3.26) are empirical parameters. The function “get_gamma_SM” is modified to simulate the change of substrate supply under the water stress.
Second and third modifications are for the high-latitude isoprene emitters including boreal broadleaf deciduous shrubs (BBDS) and C3 Arctic grass (C3AG). These results come from the Biogenic Emission and Aerosol Response on the North Slope (BEAR-oNS) project. These modifications are implemented in “get_gamma_T” function in the code.
For the BBDS, we included the adaptation of isoprene emission factors to the mean temperature of the previous day with the quation as:
image
, where T24 (K) denotes the mean air temperature of the preceding day (Wang et al., 2024a).
For the C3AG, we adopted a dynamic temperature response curve adapted to the record of growing temperature as:
image
. CC3AG is the activation energy for the isoprene temperature response of C3AG and changes with the mean air temperature of the preceding 10 days (T240) as:
image.
The impact of T240 on isoprene emission factor of C3AG is as:
image.

Any User Interface Changes (namelist or namelist defaults changes)?
NO.
Does this create a need to change or add documentation? Did you do so?
I could provide the modification to the scientific document for these changes after they have been added.

Testing performed, if any:
I tested the code on Derecho with the I2000Clm50BgcCrop compsets, and it ran well. The scientific impact of the code for isoprene flux estimations can be found in the corresponding references.

Reference

Wang, H., Lu, X., Seco, R., Stavrakou, T., Karl, T., Jiang, X., et al. (2022). Modeling isoprene emission response to drought and heatwaves within MEGAN using evapotranspiration data and by coupling with the community land model. Journal of Advances in Modeling Earth Systems, 14, e2022MS003174. https://doi.org/10.1029/2022MS003174
Wang, H., Welch, A. M., Nagalingam, S., Leong, C., Kittitananuvong, P., Barsanti, K. C., et al. (2024a). Arctic heatwaves could significantly influence the isoprene emissions from shrubs. Geophysical Research Letters, 51, e2023GL107599. https://doi.org/10.1029/2023GL107599
Wang, H., Welch, A. M., Nagalingam, S., Leong, C., Czimczik, C., Tang, J., et al. (2024b): High temperature sensitivity of Arctic isoprene emissions explained by sedges (accepted by Nature Communications, in press).

@wwieder
Copy link
Contributor

wwieder commented Jun 10, 2024

Thanks for opening this PR @HuiWangWanderInGitHub.

We'll start reviewing this PR, but a quick look seems like this should be straightforward to implement.
In the meantime, I also would like to ask that you open a PR that updates the MEGAN documentation in the CTSM technical note.

Directions for this are posted on the wiki

@olyson, can you help with this?

@wwieder wwieder added this to the CESM3 Capability Freeze milestone Jun 10, 2024
@wwieder wwieder added priority: high High priority to fix/merge soon, e.g., because it is a problem in important configurations tag: enh - new science next this should get some attention in the next week or two. Normally each Thursday SE meeting. labels Jun 10, 2024
@wwieder
Copy link
Contributor

wwieder commented Jun 10, 2024

Purely samantic question, can we call this PR MEGANv2.2, or is this confusing with broader MEGAN documentation?

Also @lkemmons, can you help clarify the prioritization of this PR in relation to the science code freeze (July 31 deadline) for cam-chem?

@olyson
Copy link
Contributor

olyson commented Jun 11, 2024

There is a more condensed version of how to update the documentation here:

https://docs.google.com/document/d/1aLlu6C6DJiiO2T21qnj54WFCYuSdGw9F/edit

Once you've issued a PR for the new documentation and verified the documentation builds successfully, we can take it from there.

@lkemmons
Copy link

lkemmons commented Jun 13, 2024 via email

@samsrabin samsrabin removed the next this should get some attention in the next week or two. Normally each Thursday SE meeting. label Jun 20, 2024
Bring tmp-branch to master

Bring in changes that came in on the tmp-240620 branch to master now that cesm3_0_beta01 has been made.

The changes are documented in tags and the ChangeLog but include the following tags:

  tmp-240620.n03.ctsm5.2.007 samrabin -- upland hillslope column fsat values to zero
  tmp-240620.n02.ctsm5.2.007 erik ------ Another update of git-fleximod
  tmp-240620.n01.ctsm5.2.007 slevis ---- Merge b4b-dev
@slevis-lmwg
Copy link
Contributor

slevis-lmwg commented Jul 6, 2024

@HuiWangWanderInGitHub
I updated my local copy of this branch to the latest clm tag and tried to push to the PR, but I do not have permissions. Could you add me as collaborator? Instructions:
Click on your branch CLM5_MEGAN_ISOP at the top of this screen, then Settings, then "Collaborators" and you should see a way to add me as a collaborator there.
UPDATE: collaborator access granted, thank you!

./run_sys_tests -s aux_clm -c ctsm5.2.008 --skip-generate
aux_clm test-suite on derecho FAIL (see next post)
aux_clm on izumi FAIL (same as derecho)

@slevis-lmwg
Copy link
Contributor

slevis-lmwg commented Jul 7, 2024

Large number of tests differ from the baseline (see /glade/derecho/scratch/slevis/tests_0706-132231de).

  • Most variables with diffs have the MEG_ prefix or _voc suffix, which seems expected.
  • Some do not, but only in two tests:
ERS_D_Ld15.f45_f45_mg37.I2000Clm50FatesRs.derecho_intel.clm-FatesColdTwoStream
PEM_D_Ld9.ne30pg3_t232.I1850Clm60BgcCropG.derecho_intel.clm-clm60cam6LndTuningMode

The former has diffs in FATES variables (clm file) and in lndImp variables (cpl file).
The latter has diffs in the cism file, which seems somewhat related to #2542.
For now I will let others weigh in with an assessment of these results.

UPDATE 1: Same result on izumi with
ERS_D_Ld15.f45_f45_mg37.I2000Clm50FatesRs.izumi_nag.clm-FatesColdTwoStream
having diffs in FATES variables (clm file) and in lndImp variables (cpl file).

UPDATE 2: I tried the 3 failing tests in vanilla ctsm5.2.008:
All pass against baseline.
The ERS tests fail with COMPARE_base_rest (expected).
The PEM test fails with COMPARE_base_modpes (expected).

UPDATE 3: I backed out my last commit and repeated the 3 tests:
On derecho the PEM test still failed.
On derecho and izumi the ERS test now passed.

This reverts commit d940ee0
because answers were changing from the baseline in tests
ERS_D_Ld15.f45_f45_mg37.I2000Clm50FatesRs.derecho_intel.clm-FatesColdTwoStream
ERS_D_Ld15.f45_f45_mg37.I2000Clm50FatesRs.izumi_nag.clm-FatesColdTwoStream
Relax tolerance for truncating small snocan values in CanopyFluxes

See the PR ESCOMP#2457 for details.
@slevis-lmwg
Copy link
Contributor

slevis-lmwg commented Jul 16, 2024

The failing test has changed in ctsm5.2.012 to
PEM_D_Ld9.ne30pg3_t232.I1850Clm60BgcCropG.derecho_intel.clm-clm60cam7LndTuningMode
and it still fails, so I will proceed with troubleshooting.

@slevis-lmwg
Copy link
Contributor

This PR changes the calculation of gamma_sm and of gamma_t. In my troubleshooting I introduced the gamma_sm and the gamma_t changes separately. I also introduced the two new parts of gamma_t (Eopt and gamma_t_LDF) separately.

Regardless, the above PEM test gives new results in these three files. The one I'm concerned about is cism because it seems unexpected, but maybe it's fine:

PEM_D_Ld9.ne30pg3_t232.I1850Clm60BgcCropG.derecho_intel.clm-clm60cam7LndTuningMode.C.20240717_145335_n9yr9j.cism.gris.initial_hist.0001-01-01-00000.nc.base.cprnc.out
PEM_D_Ld9.ne30pg3_t232.I1850Clm60BgcCropG.derecho_intel.clm-clm60cam7LndTuningMode.C.20240717_145335_n9yr9j.clm2.h0.0001-01-10-00000.nc.cprnc.out
PEM_D_Ld9.ne30pg3_t232.I1850Clm60BgcCropG.derecho_intel.clm-clm60cam7LndTuningMode.C.20240717_145335_n9yr9j.cpl.hi.0001-01-10-00000.nc.cprnc.out

@ekluzek
Copy link
Collaborator

ekluzek commented Jul 17, 2024

@slevis-lmwg there's another issue where we know CISM changes answers on processor count. So do the test without CISM which just means dropping the G at the end of the compset.

That will probably mean you have to also run the baseline as well.

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.

Thank you for contributing these changes to the model. I included some comments based on clm's coding practices.

But more important concerns:

  1. As written, the code results in changed answers in a PEM test that I would not have expected (see my corresponding posts about troubleshooting). Am I mistaken? Should we expect changed answers in the cism file?
  2. When I tried introducing _r8 to all the hardwired reals, I started seeing changed answers in an ERS test in FATES variables, that I would not have expected. Should we expect differences in FATES variables just by adding _r8 to hardwired values?

src/biogeochem/VOCEmissionMod.F90 Outdated Show resolved Hide resolved
src/biogeochem/VOCEmissionMod.F90 Outdated Show resolved Hide resolved
@slevis-lmwg
Copy link
Contributor

slevis-lmwg commented Jul 17, 2024

@slevis-lmwg there's another issue where we know CISM changes answers on processor count. So do the test without CISM which just means dropping the G at the end of the compset.

That will probably mean you have to also run the baseline as well.

From master:
./create_test PEM_D_Ld9.ne30pg3_t232.I1850Clm60BgcCrop.derecho_intel.clm-clm60cam7LndTuningMode -g /glade/campaign/cgd/tss/ctsm_baselines/ctsm5.2.012
and from the branch:
./create_test PEM_D_Ld9.ne30pg3_t232.I1850Clm60BgcCrop.derecho_intel.clm-clm60cam7LndTuningMode -c /glade/campaign/cgd/tss/ctsm_baselines/ctsm5.2.012

Now, the diffs from baseline are limited to MEG_ and _voc variables, as expected.

@slevis-lmwg
Copy link
Contributor

slevis-lmwg commented Jul 18, 2024

I now realize my mistake in thinking that the PEM failure was unexpected:
The cism cprnc file (such as the one I posted above) ends in "base.cprnc.out" which is what causes the expected COMPARE_base_modpes failure here and in issue #2542.

This means that, as written, the code passes the aux_clm tests.

@slevis-lmwg
Copy link
Contributor

slevis-lmwg commented Jul 18, 2024

@HuiWangWanderInGitHub I'm happy to make the revisions in response to my review; however,

  • could you provide me with names for the various constants/coefficients that currently appear without names?

I used this test to confirm same answers:
./create_test ERS_D_Ld15.f45_f45_mg37.I2000Clm50FatesRs.derecho_intel.clm-FatesColdTwoStream -c /glade/campaign/cgd/tss/ctsm_baselines/ctsm5.2.012
This test had indicated differences with an earlier commit that
I subsequently reverted.
@HuiWangWanderInGitHub

This comment was marked as duplicate.

@HuiWangWanderInGitHub
Copy link
Contributor Author

HuiWangWanderInGitHub commented Jul 22, 2024

@HuiWangWanderInGitHub I'm happy to make the revisions in response to my review; however,

  • could you provide me with names for the various constants/coefficients that currently appear without names?

Hi @slevis-lmwg ,

Thank you so much for your help and sorry for accidentally closing the issue. Here are the names of the unnamed variables:
bet_arc_c3: activity factor for temperature of Arctic C3 grass
bet_arc_c3_max: Maximum value for the activity factor for temperature of Arctic C3 grass.
Please let me know if other variables need to be named.

Thank you.

@slevis-lmwg
Copy link
Contributor

@HuiWangWanderInGitHub I will post a new code review with the constants/coefficients that I would prefer ideally to be named.

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.

@HuiWangWanderInGitHub thank you for your help trying to resolve these issues.

src/biogeochem/VOCEmissionMod.F90 Outdated Show resolved Hide resolved
src/biogeochem/VOCEmissionMod.F90 Outdated Show resolved Hide resolved
src/biogeochem/VOCEmissionMod.F90 Outdated Show resolved Hide resolved
src/biogeochem/VOCEmissionMod.F90 Outdated Show resolved Hide resolved
Dust emissions control moved to cmeps

Remove the dust emissions namelist items from CTSM and use the namelist in the drv_flds_in for CMEPS.

This updates CTSM to use the namelist control in CMEPS (in ESCOMP/CMEPS#429). So the CMEPS external needs to be updated, and the
namelist control in CTSM changed to use CMEPS rather than the internal CTSM control settings and the CTSM ones removed.

The new XML variable:

   LND_SETS_DUST_EMIS_DRV_FLDS

controls whether dust emission settings are set by CTSM or by CAM. Only one or the other can set them, and it's required so when CAM
and CTSM are running together they need to know which one will select.

This required some changes for LILAC. The drv_flds_in namelist file is now required for LILAC, and read for dust emissions
(and dust emissions only) at the LILAC lnd_comp_esmf.F90 level.

Add a unit test for the CMEPS code to make sure it's working correctly. This validates the code both for CAM and CTSM.

Fix the cidinahoBR test in the build-namelist unit tester.
@slevis-lmwg
Copy link
Contributor

slevis-lmwg commented Aug 1, 2024

I will submit aux_clm once more to consider this PR ready:
./run_sys_tests -s aux_clm -c ctsm5.2.017 --skip-generate

@HuiWangWanderInGitHub
it would be great if you could look at my changes to your PR and let me know if you approve or have concerns. Thanks!

@slevis-lmwg slevis-lmwg added the PR status: ready PR: this is ready to merge in, with all tests satisfactory and reviews complete label Aug 1, 2024
@slevis-lmwg
Copy link
Contributor

aux_clm results
izumi OK
derecho FAIL but I'm inclined to consider OK unless I get pushback:

  1. Expected failures: the two FATES tests with strange diffs from the baseline (variable FATES_TRANSITION_MATRIX_LULU) due to issue History variable FATES_TRANSITION_MATRIX_LULU contains garbage for FatesColdDryDepSatPhen and FatesColdMeganSatPhen #2656
  2. Two other tests show diffs from the baseline that I think are NOT expected; however, they are the two matrixcn tests that change answers with threading. I'm inclined to ignore these as not worthy of investigation unless I get pushback. These are the diffs I see:
ERP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int/ERP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int.clm2.h0.1851-02-01-00000.nc.cprnc.out: RMS LIT_CELN_Cap_vr                  1.2211E-03            NORMALIZED  3.8576E-04
ERP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int/ERP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int.clm2.h0.1851-02-01-00000.nc.cprnc.out: RMS SOM_ACTN_Cap_vr                  1.4807E-18            NORMALIZED  1.3685E-19
ERP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int/ERP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int.clm2.h0.1851-02-01-00000.nc.cprnc.out: RMS SOM_PASN_Cap_vr                  9.1732E-01            NORMALIZED  3.6759E-03
ERP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int/ERP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int.clm2.h0.1851-02-01-00000.nc.cprnc.out: RMS SOM_SLON_Cap_vr                  4.6046E-17            NORMALIZED  2.2842E-19
ERP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int/ERP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int.clm2.h0.1851-02-01-00000.nc.cprnc.out: RMS LIT_LIGC_Cap_vr                  1.3700E-01            NORMALIZED  1.6987E-03
ERP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int/ERP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int.clm2.h0.1851-02-01-00000.nc.cprnc.out: RMS LIT_METC_Cap_vr                  1.1999E-01            NORMALIZED  4.2125E-03
ERP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int/ERP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int.clm2.h0.1851-02-01-00000.nc.cprnc.out: RMS SOM_ACTC_Cap_vr                  1.1375E+01            NORMALIZED  1.0767E-01
ERP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int/ERP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int.clm2.h0.1851-02-01-00000.nc.cprnc.out: RMS SOM_SLOC_Cap_vr                  2.2510E-17            NORMALIZED  8.2173E-21
REP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int/REP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int.clm2.h0.1851-02-01-00000.nc.cprnc.out: RMS CWDC_Cap_vr                      9.3301E-03            NORMALIZED  6.7713E-06
REP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int/REP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int.clm2.h0.1851-02-01-00000.nc.cprnc.out: RMS LIT_CELC_Cap_vr                  5.6365E-14            NORMALIZED  3.2327E-16
REP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int/REP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int.clm2.h0.1851-02-01-00000.nc.cprnc.out: RMS SOM_ACTC_Cap_vr                  9.7547E-20            NORMALIZED  9.2266E-22
REP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int/REP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings.C.0801-165723de_int.clm2.h0.1851-02-01-00000.nc.cprnc.out: RMS SOM_SLOC_Cap_vr                  3.1215E-18            NORMALIZED  1.1395E-21

@ekluzek
Copy link
Collaborator

ekluzek commented Aug 2, 2024

@slevis-lmwg this looks to me to be the same as what I saw in my earlier tag here:

#2545 (comment)

So yes this is good from a testing perspective.

@samsrabin samsrabin added enhancement new capability or improved behavior of existing capability science Enhancement to or bug impacting science and removed enh - new science labels Aug 8, 2024
slevis resolved conflicts:
doc/ChangeLog
doc/ChangeSum
@slevis-lmwg
Copy link
Contributor

slevis-lmwg commented Aug 12, 2024

In preparation for the merge, I have updated to ctsm5.2.019 and submitted aux_clm: OK (same behavior reported earlier in this PR)

@slevis-lmwg slevis-lmwg merged commit cc73d14 into ESCOMP:master Aug 12, 2024
2 checks passed
@slevis-lmwg slevis-lmwg deleted the CLM5_MEGAN_ISOP branch August 12, 2024 22:28
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 PR status: ready PR: this is ready to merge in, with all tests satisfactory and reviews complete priority: high High priority to fix/merge soon, e.g., because it is a problem in important configurations science Enhancement to or bug impacting science
Projects
Status: Ready to eat (Done!)
Status: Done (non release/external)
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants