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

cam6_4_028: Dust emissions #1104

Merged
merged 23 commits into from
Sep 4, 2024
Merged

Conversation

fvitt
Copy link

@fvitt fvitt commented Jul 24, 2024

Mods needed for the new dust scheme

closes #651
closes #141

	modified:   bld/namelist_files/namelist_definition.xml
	modified:   src/chemistry/modal_aero/dust_model.F90
        modified:   src/chemistry/bulk_aero/dust_model.F90
        modified:   src/chemistry/modal_aero/dust_model.F90
@fvitt fvitt requested a review from cacraigucar July 24, 2024 22:43
@fvitt fvitt self-assigned this Jul 24, 2024
@fvitt
Copy link
Author

fvitt commented Jul 24, 2024

@ekluzek This is the new CAM PR for the new dust emission scheme coming into CTSM.

We need to think about how to coordinate namelist settings when the new scheme is turned on...

Copy link

@ekluzek ekluzek left a comment

Choose a reason for hiding this comment

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

@fvitt thanks for working on this. I suppose this was just back porting the previous PR that was done before the dust emission namelist was worked out in CMEPS.

The namelist read needs to be redone so that it uses the dust emission settings in the drv_flds_in namelist file and uses the components/cmeps/cesm/nuopc_cap_share/shr_dust_emis_mod.F90 module to determine if CAM needs to modify dust emissions from CLM with the soil erodibility file.

What needs to happen in CAM will be similar to what happens in the CTSM branch being pointed to.

        modified:   src/chemistry/bulk_aero/dust_model.F90
        modified:   src/chemistry/modal_aero/dust_model.F90
        modified:   bld/namelist_files/namelist_definition.xml
@ekluzek
Copy link

ekluzek commented Jul 25, 2024

For CAM I think you should do the following when coupled to CAM:

Set the XML variable:
LND_SETS_DUST_EMIS_DRV_FLDS==FALSE

dust_emis_method=="Zender_2003" for all CAM physics versions other than CAM7 which will be
dust_emis_method=="Leung_2023"

Later you could let CTSM control these, but initially I think you should transition to above.

This does mean if you had clm5_0 physics, with cam7.0 -- it would still get you Leung_2023 which is a little confusing from CTSM's perspective.

Copy link

@ekluzek ekluzek left a comment

Choose a reason for hiding this comment

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

@fvitt thanks for the updates. I ask for a couple changes.

I think you also need to add the new fields to the namelist_defintion file for drv_flds, unless I'm missing something. And you need to add a call for the shr_dust_emis_readnl() (CTSM has this in lnd_import_export.F90).

src/chemistry/bulk_aero/dust_model.F90 Show resolved Hide resolved
src/chemistry/bulk_aero/dust_model.F90 Outdated Show resolved Hide resolved
src/chemistry/bulk_aero/dust_model.F90 Outdated Show resolved Hide resolved
src/chemistry/modal_aero/dust_model.F90 Show resolved Hide resolved
        modified:   src/chemistry/bulk_aero/dust_model.F90
        modified:   src/chemistry/modal_aero/dust_model.F90
        modified:   bld/build-namelist
        modified:   bld/namelist_files/namelist_defaults_cam.xml
        modified:   bld/namelist_files/namelist_definition.xml
	modified:   bld/build-namelist
	modified:   src/chemistry/bulk_aero/dust_model.F90
	modified:   src/chemistry/modal_aero/dust_model.F90
@ekluzek
Copy link

ekluzek commented Jul 30, 2024

@fvitt note, the CTSM tag that allows CAM and CTSM to work together on dust emission settings is complete and it's ctsm5.2.017.

It doesn't yet allow turning on Leung_2023, but it uses the new XML variable LND_SETS_DUST_EMIS_DRV_FLDS to determine if CTSM or CAM are doing the dust settings and uses the dust_emis_inparm namelist in drv_flds_in to determine the dust settings and when Zender_2003 is on, to determine if CAM or CTSM will be setting the Zender soil erodibility file.

@fvitt
Copy link
Author

fvitt commented Aug 6, 2024

@ekluzek Is there a CTSM tag for the Leung_2023 scheme, or is this still in progress?

@ekluzek
Copy link

ekluzek commented Aug 9, 2024

@fvitt the CTSM tag with Leung is still in process, but it's

ESCOMP/CTSM#1897

and will be ctsm5.2.019. It is almost completed. I plan to have it completed over the weekend before Derecho goes down on Monday.

@ekluzek
Copy link

ekluzek commented Aug 11, 2024

Ok the needed CTSM tag is done ctsm5.2.019

@fvitt
Copy link
Author

fvitt commented Aug 12, 2024

@ekluzek
When using the old Zender method with the new CTSM tag I get the following build-namelist error message:

ERROR: Command /data/terminator-data1/home/fvitt/camdev/dust_emissions/components/clm/bld/build-namelist failed rc=255
out=
err=Warning : CLM build-namelist::CLMBuildNamelist::setup_logic_prigent_roughness() : use_prigent_roughness does NOT need to on without dust_emis_method being Leung_2023, it simply won't be used
 -- Add -ignore_warnings option to CLM_BLDNML_OPTS to ignore this warning

Why is this ERROR needed for the old Zender method? I see I can add -ignore_warnings option to CLM_BLDNML_OPTS to get around this. I don't see how to append to CLM_BLDNML_OPTS automatically from the CAM side.

@fvitt
Copy link
Author

fvitt commented Aug 12, 2024

@ekluzek
I get the same error as above with

 dust_emis_method  = 'Leung_2023'

@ekluzek
Copy link

ekluzek commented Aug 12, 2024

@fvitt the thing that is missing here is that when you are running CAM you need CAM to specify the namelist settings and NOT have CLM modify any of them. The problem seems to be having them both trying to mess with them at the same time.

So you need to set the XML variable LND_SETS_DUST_EMIS_DRV_FLDS to false

./xmlchange LND_SETS_DUST_EMIS_DRV_FLDS=FALSE

I'm not sure where that should go in CAM, but for now it should always be done for CAM compsets that use CLM.

@fvitt
Copy link
Author

fvitt commented Aug 12, 2024

@ekluzek
These problems occur with LND_SETS_DUST_EMIS_DRV_FLDS=FALSE.

@ekluzek
Copy link

ekluzek commented Aug 12, 2024

@fvitt thanks for pointing that out. I'll try checking out this branch and reproduce it to figure out what's wrong.

	modified:   .gitmodules
	modified:   bld/build-namelist
	modified:   bld/namelist_files/namelist_defaults_cam.xml
	modified:   cime_config/config_compsets.xml
@fvitt
Copy link
Author

fvitt commented Aug 12, 2024

@ekluzek I just pushed up my latest changes. Try to build namelists for FHIST and FLTHIST compsets. Thanks.

@ekluzek
Copy link

ekluzek commented Aug 13, 2024

@fvitt thanks for pointing this out. I've replicated the problem with your branch.

I also see what's going on, and why I didn't think of this issue before. I'll have to think about how to fix it though. I'll add an issue on the CTSM side regarding this. We'll include it in an upcoming CTSM tag and I'll update this when we have that.

A workaround that I verified is you can add this to your user_nl_clm for CAM:

use_prigent_roughness = .false.

You could add that temporarily while we get a CTSM tag with a fix and then remove it when we get the CTSM in place for CAM to use.

@fvitt
Copy link
Author

fvitt commented Aug 13, 2024

@fvitt thanks for pointing this out. I've replicated the problem with your branch.

I also see what's going on, and why I didn't think of this issue before. I'll have to think about how to fix it though. I'll add an issue on the CTSM side regarding this. We'll include it in an upcoming CTSM tag and I'll update this when we have that.

A workaround that I verified is you can add this to your user_nl_clm for CAM:

use_prigent_roughness = .false.

You could add that temporarily while we get a CTSM tag with a fix and then remove it when we get the CTSM in place for CAM to use.

The problem with this is I don't see a way to set this namelist in user_nl_clm out-of-the-box for all the CAM compsets, which what is needed for the regression tests.

@ekluzek
Copy link

ekluzek commented Aug 23, 2024

@fvitt I have another updated CTSM version for you to try out:
786252bb012172e53ced93b40b9730d11f8d6efe
I ran
SMS_Ln9.f19_f19_mg17.FHIST.derecho_intel.cam-outfrq9s_nochem
with it and it passed. Note that Danny noticed a problem with your sandbox that gave problems for him that you likely need to handle before this works here (it's all given in comments above).

I tried this version of CTSM. This allows CAM to set the namelist settings. However, with dust_emis_method = 'Leung_2023', the dust emission fluxes seem to be all zeros.

Hmmm. That's not something I can explain by any of the code changes that have happened. Danny has also been doing his own F cases while we've gone along.

Before diving into this -- can you let me know about what period it's all zeros? Is that the first time-step for example? If you run longer does it become non-zero after awhile? Zero is valid, it would just be unusual over the entire globe, but maybe possible, but over time it obviously needs to be non-zero.

@fvitt
Copy link
Author

fvitt commented Aug 23, 2024

@fvitt I have another updated CTSM version for you to try out:
786252bb012172e53ced93b40b9730d11f8d6efe
I ran
SMS_Ln9.f19_f19_mg17.FHIST.derecho_intel.cam-outfrq9s_nochem
with it and it passed. Note that Danny noticed a problem with your sandbox that gave problems for him that you likely need to handle before this works here (it's all given in comments above).

I tried this version of CTSM. This allows CAM to set the namelist settings. However, with dust_emis_method = 'Leung_2023', the dust emission fluxes seem to be all zeros.

Hmmm. That's not something I can explain by any of the code changes that have happened. Danny has also been doing his own F cases while we've gone along.

Before diving into this -- can you let me know about what period it's all zeros? Is that the first time-step for example? If you run longer does it become non-zero after awhile? Zero is valid, it would just be unusual over the entire globe, but maybe possible, but over time it obviously needs to be non-zero.

I ran for a day and output fluxes each time step. Fluxes seem to zeros all time steps everywhere.

	modified:   bld/build-namelist
	modified:   bld/build-namelist
	modified:   src/chemistry/modal_aero/dust_model.F90
@fvitt
Copy link
Author

fvitt commented Aug 23, 2024

@ekluzek I fixed a bug on the CAM side. The Leung dust emissions schemes seems to be working now.

@cacraigucar cacraigucar marked this pull request as ready for review August 27, 2024 15:15
Comment on lines 2535 to 2538
<!-- dust emissions method -->
<dust_emis_method>Zender_2003</dust_emis_method>
<dust_emis_method phys='cam7'>Leung_2023</dust_emis_method>
<zender_soil_erod_source>atm</zender_soil_erod_source>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could these lines get spread out a little more for readability? Also, just a reminder that cam7 is going to default to the old setting for now.

Copy link
Author

Choose a reason for hiding this comment

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

Default is now Zender_2003 for all configurations.

Copy link

Choose a reason for hiding this comment

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

@cacraigucar I assume that means there will be a follow on CAM tag where Leung is turned on for CAM7? Or will we just be in experimental mode for awhile and then change the default much later? Just curious how this is going to go...

Copy link
Collaborator

Choose a reason for hiding this comment

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

@ekluzek - When(if) the scientists tell us that they want to change the default setting, we will do so. This will be part of the tunings that will be happening and I suspect that we'll be adjusting quite a few settings/defaults, not just this one.

bld/namelist_files/namelist_definition.xml Outdated Show resolved Hide resolved
.gitmodules Outdated
Comment on lines 181 to 182
url = https://github.com/ekluzek/CTSM
fxtag = 786252bb0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a reminder (more for me than you) to update this to the official CTSM tag when it is ready

Copy link

Choose a reason for hiding this comment

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

This can now be replaced with ctsm5.2.027

Copy link
Author

Choose a reason for hiding this comment

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

Thanks @ekluzek
Updating to from ctsm5.2.009 to ctsm5.2.027 changes answers for the F compsets, even when Zender scheme is used. Is this expected? I see several namelist changes in lnd_in.

Copy link

Choose a reason for hiding this comment

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

Yes, this is expected. There's several rounds of answer changes between 009 and 027. I can map out what they are if you like and that would help.

Is it OK for your CAM tag to have CLM answer changes in it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We typically update answer changing externals for CAM runs in their own tag, so I'd like to pull it in separate. @fvitt - would you be willing to do this, or do we need to do this on the AMP side?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The exception to this is if @fvitt has independently already run the regression tests with his changes and they are BFB except for the test(s) which use the dust. If this has been done, he can document in the ChangeLog that he has independently tested that "the code changes were independently tested and were non-answer changing for all but the dust configurations. All answer changes to non-dust runs are due to updating CLM". If these tests haven't been run, then it probably makes sense to just split it into two CAM tags.

Copy link
Author

Choose a reason for hiding this comment

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

@cacraigucar Yes I can do the update of CTSM in a separate CAM tag.
@ekluzek Can you provide a summary of the ctsm changes that affect F compsets?

Copy link

Choose a reason for hiding this comment

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

Here's the list of things I expected to affect CAM F compsets in a substantial way:

  • ctsm5.2.016 -- changes answers for clm6_0 for crop grid cells
  • ctsm5.2.020 -- changes answers for all physics options for MEGAN BGVOC's which will affect CAM-Chem simulations
  • ctsm5.2.026 -- change answers for clm6_0 over urban grid cells

There's a few others that still might affect CAM F compsets, but I expect them to be much smaller. Go to the bottom of this wiki page to see a full description of CTSM answer changing tags:

https://github.com/ESCOMP/CTSM/wiki/Answer-changing-tags

	modified:   .gitmodules
	modified:   bld/namelist_files/namelist_defaults_cam.xml
	modified:   bld/namelist_files/namelist_definition.xml
        modified:   cime_config/testdefs/testlist_cam.xml
        new file:   cime_config/testdefs/testmods_dirs/cam/outfrq9s_Leung_dust/shell_commands
        new file:   cime_config/testdefs/testmods_dirs/cam/outfrq9s_Leung_dust/user_nl_cam
        new file:   cime_config/testdefs/testmods_dirs/cam/outfrq9s_Leung_dust/user_nl_clm
@fvitt fvitt requested a review from cacraigucar August 29, 2024 22:17
Comment on lines 2535 to 2538
<!-- dust emissions method -->
<dust_emis_method>Zender_2003</dust_emis_method>
<dust_emis_method phys='cam7'>Leung_2023</dust_emis_method>
<zender_soil_erod_source>atm</zender_soil_erod_source>
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ekluzek - When(if) the scientists tell us that they want to change the default setting, we will do so. This will be part of the tunings that will be happening and I suspect that we'll be adjusting quite a few settings/defaults, not just this one.

Copy link

@ekluzek ekluzek left a comment

Choose a reason for hiding this comment

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

All of my suggestions were appropriately handled. So this is good to go from my perspective. Thanks for working on this and getting it done @fvitt!

@cacraigucar cacraigucar changed the title Dust emissions cam6_4_028: Dust emissions Sep 3, 2024
        modified:   cime_config/testdefs/testlist_cam.xml
…raft

        modified:   doc/ChangeLog
        modified:   src/chemistry/bulk_aero/dust_model.F90
        modified:   bld/namelist_files/use_cases/sd_waccm_ma_cam4.xml
@fvitt
Copy link
Author

fvitt commented Sep 4, 2024

@ekluzek
I am getting a lot of test failures in F compsets when LND_SETS_DUST_EMIS_DRV_FLDS=FALSE.
See in CLM build-namelist failures in the following cases in
/glade/derecho/scratch/fvitt/aux_cam_intel_20240903232235

  PEND ERP_Ld3.f09_f09_mg17.FWHIST.derecho_intel.cam-reduced_hist1d
  PEND ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s
  PEND ERP_Ln9.ne30pg3_ne30pg3_mg17.FCnudged.derecho_intel.cam-outfrq9s
  PEND ERP_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s
  PEND ERS_Ln9.f09_f09_mg17.FX2000.derecho_intel.cam-outfrq9s
  PEND ERS_Ln9.f19_f19_mg17.FXSD.derecho_intel.cam-outfrq9s
  PEND SMS_D_Ln9.f09_f09_mg17.FCts2nudged.derecho_intel.cam-outfrq9s_leapday
  PEND SMS_D_Ln9.f09_f09_mg17.FCvbsxHIST.derecho_intel.cam-outfrq9s
  PEND SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s
  PEND SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s_waccm_ma_mam4
  PEND SMS_D_Ln9.f19_f19_mg17.FXHIST.derecho_intel.cam-outfrq9s_amie
  PEND SMS_D_Ln9.ne16pg3_ne16pg3_mg17.FX2000.derecho_intel.cam-outfrq9s
  PEND SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s
  PEND SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d
  PEND SMS_Ld1.f09_f09_mg17.FW2000climo.derecho_intel.cam-outfrq1d
  PEND SMS_Ld1.ne30pg3_ne30pg3_mg17.FC2010climo.derecho_intel.cam-outfrq1d
  PEND SMS_Lh12.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h
  PEND SMS_Ln9.f09_f09_mg17.FW1850.derecho_intel.cam-reduced_hist3s
  PEND SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_rrtmgp

        modified:   cime_config/config_compsets.xml
        modified:   bld/namelist_files/use_cases/sd_waccm_ma_cam4.xml
@@ -906,7 +906,7 @@

<entry id="LND_SETS_DUST_EMIS_DRV_FLDS">
<values match="first">
<value compset="_CAM.*_CLM">FALSE</value>
<value compset="_CAM7.*_CLM6">FALSE</value>
Copy link

Choose a reason for hiding this comment

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

@fvitt I was concerned about this at first in case it meant that the CAM Zender soil erodibility files were NOT being used. But, it looks like that is NOT the case. So this should be fine. I'm looking at it more closely. I'm glad you figured this workaround out.

Copy link

Choose a reason for hiding this comment

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

This is also probably fine since longer term we want to always make this TRUE and even remove it entirely. So that just brings us closer to the long term solution.

Copy link

Choose a reason for hiding this comment

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

The only bad thing here is that it means that the way you change dust emission settings will be different for the CAM7 with CAM6 than for anything else. But, it's unlikely that people will be messing with the dust settings for previous CAM physics.

@@ -79,7 +79,10 @@

<!-- turn on clm MEGAN VOC emis -->
<megan_mapped_emisfctrs>.false.</megan_mapped_emisfctrs>
<megan_specifier>'CH2O = formaldehyde','CO = carbon_monoxide'</megan_specifier>
<megan_specifier>
Copy link

Choose a reason for hiding this comment

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

I'm surprised you had to do this. But, of course it's a change that's perfectly fine to do. I'll see if I can look into why you had to change it...

@fvitt fvitt merged commit d125217 into ESCOMP:cam_development Sep 4, 2024
2 checks passed
gold2718 pushed a commit to gold2718/CAM that referenced this pull request Oct 16, 2024
Merge pull request ESCOMP#1104 from fvitt/dust_emissions

cam6_4_028: Dust emissions

ESCOMP commit: d125217
gold2718 pushed a commit to gold2718/CAM that referenced this pull request Oct 16, 2024
Merge pull request ESCOMP#1104 from fvitt/dust_emissions

cam6_4_028: Dust emissions

ESCOMP commit: d125217
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Tag
Development

Successfully merging this pull request may close these issues.

3 participants