-
Notifications
You must be signed in to change notification settings - Fork 317
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
Move the dust emission source function soil erodibility for the Zender scheme from CAM to CTSM #1967
Conversation
…streams (dmleung 12 Mar 2023)
Awesome to see this PR coming in, Danny. I'm sure we'll be in touch as we review this code and as you continue to develop / finalize the code Thanks for these contributions to CESM! |
Thanks Will! Keep in touch :) |
…st emission (dmleung 20 Mar 2023)
Hi @fvitt, @ekluzek and I would like to ask you a question:
|
I think, that there are people out there that still use different model configurations, like CAM4/WACCM4 (like Chuck for CARMA), and maybe CAM5 (I am not sure). I am not sure if people can run CAM4 using the CAM6 erodibility file, I don't know how those files differ from each other. |
Okay, thank you @fvitt and @tilmes for the reply. I don't think the erod files used across different CAM versions are that different (the values differ slightly). I will look at the erod files again, think about it and discuss with people further. |
One thing to add here is the global dust tuning parameter to the CTSM namelist. |
@dmleung Louisa @tilmes @wwieder @fvitt and I met to discuss this. We decided:
The issue about the dust emission method for CMEPS is now here: |
…he global tuning factor. We will keep the global tuning factor in CAM. dmleung 5 Apr 2023
Rework handling of evaporation constraint in SoilFluxes Occasionally, h2osoi_ice was going significantly negative in UpdateState_TopLayerFluxes - see ESCOMP#1979. As noted in that issue, this seems to be due to h2osoi_ice having a very different magnitude from h2osoi_liq, leading to greater-than-roundoff-level differences from zero final state in a relative sense (i.e., relative to the magnitude of h2osoi_ice) - I think because of the appearance of the sum (h2osoi_ice + h2osoi_liq) in the equations that limit fluxes. To try to deal with this, I have reworked the handling of the evaporation constraint to directly limit both the liqevap and solidevap, so that both of them should result in the equivalent liq or ice states going to 0 within roundoff. To do that, I needed to move the partitioning of the total flux into liquid and solid to earlier in the subroutine and then recalculate those partitioning fluxes in conditions where we're applying an evaporation constraint. Note that I applied a max of 0 to the new fluxes because many initial conditions files have roundoff-level negative H2OSOI_LIQ, so without this limit, we were getting roundoff-level negative fluxes. Resolves ESCOMP#1979
I've added a little design document about how to do this in CMEPS here: https://docs.google.com/document/d/18nZ3LJF5W-YF9iBhqed6s_NWeKOvSSL2-k0Lye1nnLg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several changes that I'll be working on. I actually accidentally left these comments as pending, and didn't realize it from a long time ago. But, it remembered them and let me complete the review now.
The design doc for the CMEPS shr_ part of this is in: https://docs.google.com/document/d/18nZ3LJF5W-YF9iBhqed6s_NWeKOvSSL2-k0Lye1nnLg |
… gets to the soil eroditability file
I met with @dmleung and went over the current plans. I had proposed that CAM4, and CAM5 soil erodibility files be kept in CAM because of the effort needed to convert them to use in CTSM with streams. But, then he pointed out that he had already done this. So the files are already converted. Here is the list of files in CAM right now... <!-- soil erodibility factors -->
<soil_erod_file >atm/cam/dst/dst_source2x2tunedcam6-2x2-04062017.nc </soil_erod_file>
<soil_erod_file phys="cam5" >atm/cam/dst/dst_source2x2_cam5.4_c150327.nc</soil_erod_file>
<soil_erod_file phys="cam4" >atm/cam/dst/dst_source2x2tuned-cam4-06132012.nc</soil_erod_file>
<soil_erod_file phys="cam4" hgrid="0.9x1.25">atm/cam/dst/dst_source1x1tuned-cam4-06202012.nc</soil_erod_file> I can move these to CTSM, but need to use LND_TUNING_MODE to set whether CAM4, CAM5, or other version of CAM physics is being used. We currently don't have LND_TUNING_MODE settings for CAM4 or CAM5, but I can add them in. I will at the same time have to add those settings for the other fields that are tuned for CTSM, but will base them on the currently tuned values. |
@ekluzek We can do either one of them, depending on which approach is easier for you and for the model. For record, the path to the converted soil erodibility files are in The stream file,
But we can add more entries for CTSM to use CAM5 and CAM4 soil erodibility files by detecting the CAM version (or physics) in an F case. |
OK some strange things about testing with ne30 grids. If I run with too few processors it will fail with what I think are memory issues. With enough though it scales backwards so that more processors takes more overall run time, and 24 nodes causes it to hang. This is looking at total run time in the TestStatus file, so not accurate, but here it is... SMS_D_Ln9.ne30pg3_t232.I1850Clm51Sp.derecho_intel.clm-clm51cam6LndTuningModeZDustSoilErod.GC.ctsm51d169zenddelist/TestStatus:PASS SMS_D_Ln9.ne30pg3_t232.I1850Clm51Sp.derecho_intel.clm-clm51cam6LndTuningModeZDustSoilErod RUN time=85 This is validated with the timing file, for model throughput. But, probably more testing needs to be done... SMS_D_Ln9.ne30pg3_t232.I1850Clm51Sp.derecho_intel.clm-clm51cam6LndTuningModeZDustSoilErod.GC.ctsm51d169zenddelist/timing/cesm_timing.SMS_D_Ln9.ne30pg3_t232.I1850Clm51Sp.derecho_intel.clm-clm51cam6LndTuningModeZDustSoilErod.GC.ctsm51d169zenddelist.3607734.desched1.240228-152003: Model Throughput: 6.40 simulated_years/day |
I thought maybe the problem with the ERI test was that the baselines had been messed up somehow. So I reran the baseline from ctsm5.1.dev169 and expected it to differ from the existing baselines. However, it compared exactly and showed no problems. The difference in the test does seem like it's comparing different parts of the testing which would make it fail. But, I probably need to do more work to track down what it's doing. Since, other tests are showing identical results. Including these ERI tests... ERI_C2_Ld9.f10_f10_mg37.I2000Clm51BgcCrop.derecho_gnu.clm-default I'm also wondering if this is something that we can ignore as an odd glitch... |
Changes to improve vegetation health at high latitudes Details in PR ESCOMP#2348 Conflicts: bld/unit_testers/build-namelist_test.pl
… test will work
I was having trouble with the following test on izumi: SMS_Ln9.f10_f10_mg37.I2000Clm45Sp.izumi_gnu.clm-clm45cam4LndTuningModeZDustSoilErod It turned out that running with NAG found a legit problem! diff --git a/src/cpl/share_esmf/ZenderSoilErodStreamType.F90 b/src/cpl/share_esmf/ZenderSoilErodStreamType.F90
index 1755a32f7..0d5a7653d 100644
--- a/src/cpl/share_esmf/ZenderSoilErodStreamType.F90
+++ b/src/cpl/share_esmf/ZenderSoilErodStreamType.F90
@@ -90,8 +90,8 @@ subroutine Init(this, bounds, NLFilename)
character(len=*), parameter :: stream_name = 'zendersoilerod'
!-----------------------------------------------------------------------
- call this%InitAllocate( bounds )
call control%ReadNML( bounds, NLFileName )
+ call this%InitAllocate( bounds )
if ( this%useStreams() )then ! is this a namelist input and is it set in namelist default Without this change an array doesn't get properly allocated! So this was a critical fix and it only showed up with the Nag compiler on izumi! The cesm.log file showed the following:
@briandobbins this is an example of how using the Nag compiler can help us with our code. |
I realized the continuing to fail ERI test is because of the finidat/use_init_interp settings that apparently was only showing up for this one test. Some changes in namelist_defaults_ctsm.xml should allow it to work. |
…t_interp, this gets the ERI_D.ne30pg3_t232.I1850Clm51BgcCrop.derecho_intel.clm-clm51cam6LndTuningMode test giving identical answers as baseline
…e is a izumi_nag test
Description of changes
We have proposed in #1836 and ESCOMP/CAM#651 to move the dust namelist options in CAM (under group 'dust_nl' in CAM) to CTSM to enable the switch between the two dust emission schemes (per #1897) in the future CTSM versions. We use CTSM's streams capability to read in and interpolate the soil erodibility files. The files were originally read in by CAM from /glade/p/cesmdata/cseg/inputdata/atm/cam/dst/. I have rewritten the files so that CTSM can read them in.
For now this branch is capable of reading Zender's erodibility file in CAM6: dst_source2x2tunedcam6-2x2-04062017.nc
Later we may probably add in the capability of reading other erodibility files for older versions of CAM
(dst_source2x2_cam5.4_c150327.nc, dst_source2x2tuned-cam4-06132012.nc, dst_source1x1tuned-cam4-06202012.nc...)
This code also read in the global tuning factor (dust_emis_fact) to tune the global total dust emission. We note that in CAM's convention, all grids of dust emissions are divided by dust_emis_fact instead of multiplied by the factor. So, here in CLM we follow the convention (for now?), and so the larger the factor the smaller the CLM dust emissions.
Changes in files mainly include:
src/biogeochem/DUSTMod.F90
src/cpl/share_esmf/ZenderSoilErodStreamType.F90 (new file)
src/main/clm_inst.F90
bld/namelist_files/namelist_defaults_ctsm.xml
bld/CLMBuildNamelist.pm
bld/namelist_files/namelist_definition_ctsm.xml
Specific notes
This PR is proposed here and on CAM GitHub (to not read in the dust namelist options in CAM); see ESCOMP/CAM#748.
This PR needs to be modified to combine with the recent PR #1897 and ESCOMP/CAM#748.
Contributors other than yourself, if any:
@ekluzek
CTSM Issues Fixed (include github issue #):
Fixes #2117
Addresses #2149
Addressed part of #1836
Helps with ESCOMP/CAM#651
Are answers expected to change (and if so in what way)?
The stream interpolation will possibly slightly change the dust emission flux being used in CAM.
Any User Interface Changes (namelist or namelist defaults changes)?
Yes,
bld/namelist_files/namelist_definition_ctsm.xml
bld/namelist_files/namelist_defaults_ctsm.xml
bld/CLMBuildNamelist.pm