Skip to content

Commit

Permalink
Merge pull request #1016 from swensosc/heat_storage_biomass
Browse files Browse the repository at this point in the history
Heat storage biomass
  • Loading branch information
ekluzek committed Jan 13, 2021
2 parents 65a9319 + a1c0b5f commit 10ea6ee
Show file tree
Hide file tree
Showing 33 changed files with 848 additions and 261 deletions.
6 changes: 5 additions & 1 deletion bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2063,7 +2063,6 @@ sub error_if_set {
}
}


#-------------------------------------------------------------------------------

sub setup_logic_soilstate {
Expand Down Expand Up @@ -3676,6 +3675,11 @@ sub setup_logic_canopyfluxes {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_undercanopy_stability' );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'itmax_canopy_fluxes',
'structure'=>$nl_flags->{'structure'});
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_biomass_heat_storage',
'use_fates'=>$nl_flags->{'use_fates'}, 'phys'=>$nl_flags->{'phys'} );
if ( &value_is_true($nl->get_value('use_biomass_heat_storage') ) && &value_is_true( $nl_flags->{'use_fates'}) ) {
$log->fatal_error('use_biomass_heat_storage can NOT be set to true when fates is on');
}
}

#-------------------------------------------------------------------------------
Expand Down
11 changes: 7 additions & 4 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<use_bedrock phys="clm5_0" >.true.</use_bedrock>
<use_bedrock phys="clm4_5" >.false.</use_bedrock>


<!-- Rooting profile namelist defaults -->
<rooting_profile_method_water phys="clm5_1" >1</rooting_profile_method_water>
<rooting_profile_method_water phys="clm5_0" >1</rooting_profile_method_water>
Expand Down Expand Up @@ -312,6 +311,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<use_undercanopy_stability phys="clm5_0" >.false.</use_undercanopy_stability>
<use_undercanopy_stability phys="clm4_5" >.true.</use_undercanopy_stability>

<use_biomass_heat_storage phys="clm5_1" >.true.</use_biomass_heat_storage>
<use_biomass_heat_storage phys="clm5_1" use_fates=".true.">.false.</use_biomass_heat_storage>
<use_biomass_heat_storage >.false.</use_biomass_heat_storage>

<itmax_canopy_fluxes structure="standard">40</itmax_canopy_fluxes>
<itmax_canopy_fluxes structure="fast" >3</itmax_canopy_fluxes>

Expand Down Expand Up @@ -470,9 +473,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<!-- The default filenames are given relative to the root directory
for the CLM2 data in the CESM distribution -->
<!-- Plant function types (relative to {csmdata}) -->
<paramfile phys="clm5_1" >lnd/clm2/paramdata/ctsm51_params.c200905.nc</paramfile>
<paramfile phys="clm5_0" >lnd/clm2/paramdata/clm50_params.c200905.nc</paramfile>
<paramfile phys="clm4_5" >lnd/clm2/paramdata/clm45_params.c200905.nc</paramfile>
<paramfile phys="clm5_1" >lnd/clm2/paramdata/ctsm51_params.c210112.nc</paramfile>
<paramfile phys="clm5_0" >lnd/clm2/paramdata/clm50_params.c210112.nc</paramfile>
<paramfile phys="clm4_5" >lnd/clm2/paramdata/clm45_params.c210112.nc</paramfile>

<!-- ================================================================== -->
<!-- FATES default parameter file -->
Expand Down
4 changes: 4 additions & 0 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ Intercept of free living Nitrogen fixation with zero annual ET
If TRUE use the undercanopy stability term used with CLM4.5 (Sakaguchi&amp;Zeng, 2008)
</entry>

<entry id="use_biomass_heat_storage" type="logical" category="clm_physics"
group="canopyfluxes_inparm" valid_values="" >
If TRUE, include biomass heat storage in canopy energy balance.

<entry id="itmax_canopy_fluxes" type="integer" category="clm_physics"
group="canopyfluxes_inparm">
Max number of iterations used in subr. CanopyFluxes. For many years, 40 was the hardwired default value.
Expand Down
31 changes: 22 additions & 9 deletions bld/unit_testers/build-namelist_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ sub make_config_cache {
#
# Figure out number of tests that will run
#
my $ntests = 1513;
my $ntests = 1550;
if ( defined($opts{'compare'}) ) {
$ntests += 1017;
$ntests += 1044;
}
plan( tests=>$ntests );

Expand Down Expand Up @@ -837,6 +837,11 @@ sub make_config_cache {
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_0",
},
"useFATESWbMH" =>{ options=>"-bgc fates -envxml_dir . -no-megan",
namelst=>"use_biomass_heat_storage=.true.",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
},
"createcropFalse" =>{ options=>"-bgc bgc -envxml_dir . -no-megan",
namelst=>"create_crop_landunit=.false.",
GLC_TWO_WAY_COUPLING=>"FALSE",
Expand Down Expand Up @@ -1413,22 +1418,30 @@ sub make_config_cache {
&cleanup();
# Run FATES mode for several resolutions and configurations
my $clmoptions = "-bgc fates -envxml_dir . -no-megan";
my @clmres = ( "1x1_brazil", "5x5_amazon", "10x15", "1.9x2.5" );
my @clmres = ( "1x1_brazil", "5x5_amazon", "4x5", "1.9x2.5" );
foreach my $res ( @clmres ) {
$options = "-res $res";
my @edoptions = ( "-use_case 2000_control", "", "-namelist \"&a use_lch4=.true.,use_nitrif_denitrif=.true./\"", "-clm_accelerated_spinup on" );
$options = "-res $res -clm_start_type cold";
my @edoptions = ( "-use_case 2000_control",
"-use_case 1850_control",
"",
"-namelist \"&a use_lch4=.true.,use_nitrif_denitrif=.true./\"",
"-clm_accelerated_spinup on"
);
foreach my $edop (@edoptions ) {
if ( $res eq "5x5_amazon" && ($edop =~ /1850_control/) ) {
next;
}
&make_env_run( );
eval{ system( "$bldnml $options $clmoptions $edop > $tempfile 2>&1 " ); };
is( $@, '', "$options $edop" );
$cfiles->checkfilesexist( "$options $edop", $mode );
$cfiles->checkfilesexist( "$options $clmoptions $edop", $mode );
$cfiles->shownmldiff( "default", "standard" );
if ( defined($opts{'compare'}) ) {
$cfiles->doNOTdodiffonfile( "$tempfile", "$options $edop", $mode );
$cfiles->comparefiles( "$options $edop", $mode, $opts{'compare'} );
$cfiles->doNOTdodiffonfile( "$tempfile", "$options $clmoptions $edop", $mode );
$cfiles->comparefiles( "$options $clmoptions $edop", $mode, $opts{'compare'} );
}
if ( defined($opts{'generate'}) ) {
$cfiles->copyfiles( "$options $edop", $mode );
$cfiles->copyfiles( "$options $clmoptions $edop", $mode );
}
&cleanup();
}
Expand Down
11 changes: 11 additions & 0 deletions cime_config/config_compsets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@
<science_support grid="f19_g17"/>
</compset>

<compset>
<alias>I1850Clm51BgcCrop</alias>
<lname>1850_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV</lname>
</compset>

<compset>
<alias>I1850Clm51Sp</alias>
<lname>1850_DATM%GSWP3v1_CLM51%SP_SICE_SOCN_MOSART_SGLC_SWAV</lname>
Expand Down Expand Up @@ -238,6 +243,12 @@
<science_support grid="f19_g17"/>
</compset>

<compset>
<alias>I1850Clm51Bgc</alias>
<lname>1850_DATM%GSWP3v1_CLM50%BGC_SICE_SOCN_MOSART_SGLC_SWAV</lname>
</compset>


<compset>
<alias>I1850Clm51SpNoAnthro</alias>
<lname>1850_DATM%GSWP3v1_CLM51%SP-NOANTHRO_SICE_SOCN_MOSART_SGLC_SWAV</lname>
Expand Down
3 changes: 2 additions & 1 deletion cime_config/testdefs/testlist_clm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1973,12 +1973,13 @@ for ERS test as otherwise it won't work for a sub-day test (no need to run this
<option name="wallclock">00:20:00</option>
</options>
</test>
<test name="SMS_D_Ld5" grid="f45_f45_mg37" compset="I2000Clm50Fates" testmods="clm/FatesColdDef">
<test name="SMS_D_Ld5" grid="f45_f45_mg37" compset="I2000Clm51Fates" testmods="clm/FatesColdDef">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
</machines>
<options>
<option name="wallclock">00:20:00</option>
<option name="comment" >Run a Fates test with latest Clm5_1</option>
</options>
</test>
<test name="SMS_D_Lm6" grid="f45_f45_mg37" compset="I2000Clm45Fates" testmods="clm/FatesColdDef">
Expand Down
129 changes: 129 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,133 @@
===============================================================
Tag name: ctsm5.1.dev021
Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326)
Date: Tue Jan 12 20:21:52 MST 2021
One-line Summary: Add option for biomass heat storage (BHS) to clm5_1 physics

Purpose of changes
------------------

Add heat stored in biomass (for trees and shrubs) to the surface energy balance calculation. Add
a switch for it and turn it on by default for clm5_1 physics. It's turned off for clm4_5, clm5_0
physics and when FATES is turned on. Those cases are identical to before, answers only change
when it's turned on.

Papers describing BHS simulations:
R. Meier, Davin, E., Swenson, S., Lawrence, D., and Schwaab, Jo. (2019). Biomass heat
storage dampens diurnal temperature variations
in forests. Environmental Research Letters. 14. 084026. 10.1088/1748-9326/ab2b4e.

S.C. Swenson, Burns, S. P., and Lawrence, D. M. ( 2019). The impact of biomass heat storage
on the canopy energy balance and atmospheric stability in the community land model, Journal
of Advances in Modeling Earth Systems, 11, 83– 98.
https://doi.org/10.1029/2018MS001476


Bugs fixed or introduced
------------------------

Issues fixed (include CTSM Issue #):
#342 --- set medlynslope to C4 appropriate value for millet and sorghum
(had already been done for miscanthus and switchgrass)
#1246 -- Make spinup_factor_deadwood a variable rather than hardcoded constant

Known bugs introduced in this tag (include github issue ID):
#1247 -- FATES doesn't work with BHS

Significant changes to scientifically-supported configurations
--------------------------------------------------------------

Does this tag change answers significantly for any of the following physics configurations?
(Details of any changes will be given in the "Answer changes" section below.)

[Put an [X] in the box for any configuration with significant answer changes.]

[X] clm5_1

[ ] clm5_0

[ ] ctsm5_0-nwp

[ ] clm4_5

Notes of particular relevance for users
---------------------------------------

Caveats for users (e.g., need to interpolate initial conditions):
New variables are added on the restart files (stem/leaf biomass and stem Temp)
Testing didn't show this as a problem, but theoretically could require
updating initial conditions

Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): New compsets, new hist fields
I1850Clm51BgcCrop
I1850Clm51Bgc
History fields: AGSB, AGLB, FSH_STEM, DHDT_CANOPY, RAH1, RAH2, RAW1, RAW2, USTAR, UM, UAF, UM, UAF,
TAF, QAF, OBU, ZETA, VPD, num_iter, RB, TSTEM
DHSDT_CANOPY, TSTEM are default active

Changes made to namelist defaults (e.g., changed parameter values): New use_biomass_heat_storage
New namelist item: use_biomass_heat_storage to turn on or off (by default only on for clm5_1
physics for both SP and BGC modes)

Changes to the datasets (e.g., parameter, surface or initial files): New parameter datasets
All of the params files were updated. New terms were BHS parameters and taper
stocking is now set as "nstem" on the parameter file
taper is now on the parameter file

Substantial timing or memory changes: Doesn't seem to
Only one short test failed the TPUTCOMP test
Longer tests were not significantly different

Notes of particular relevance for developers: (including Code reviews and testing)
---------------------------------------------
NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide

Caveats for developers (e.g., code that is duplicated that requires double maintenance):
Setting of leaf/stem biomass should be refactored and removed from CanopyFluxes (as described in #1247)
There's a change in CNGapMortality that could change for DV when AD mode is on
Stability cap (zera) is different for BHS on than off

Changes to tests or testing: New CLM51 FATES test

CTSM testing: regular

[PASS means all tests PASS and OK means tests PASS other than expected fails.]

build-namelist tests:

cheyenne - OK (462 comparisons fail because of new namelist and params files)

python testing (see instructions in python/README.md; document testing done):

cheyenne -- PASS

regular tests (aux_clm):

cheyenne ---- OK
izumi ------- OK

If the tag used for baseline comparisons was NOT the previous tag, note that here:


Answer changes
--------------

Changes answers relative to baseline: Yes!

Summarize any changes to answers, i.e.,
- what code configurations: clm5_1
- what platforms/compilers: all
- nature of change: new climate for tree and shrubs

Detailed list of changes
------------------------

Pull Requests that document the changes (include PR ids):
(https://github.com/ESCOMP/ctsm/pull)
#1016 -- Heat Storage biomass

===============================================================
===============================================================
Tag name: ctsm5.1.dev020
Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326)
Date: Wed Dec 30 00:42:16 MST 2020
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeSum
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Tag Who Date Summary
============================================================================================================================
ctsm5.1.dev021 erik 01/12/2021 Add option for biomass heat storage (BHS) to clm5_1 physics
ctsm5.1.dev020 erik 12/30/2020 Potential roundoff changes in preparation for bio-mass heat storage option
ctsm5.1.dev019 sacks 12/19/2020 Fix ndep from coupler
ctsm5.1.dev018 slevis 12/08/2020 Add ACTIVE (T/F) column to master hist fields table and alphabetize
Expand Down
13 changes: 7 additions & 6 deletions src/biogeochem/CNDVLightMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ subroutine Light(bounds, num_natvegp, filter_natvegp, &
slatop => pftcon%slatop , & ! Input: specific leaf area at top of canopy, projected area basis (m2/gC)
dsladlai => pftcon%dsladlai , & ! Input: dSLA/dLAI, projected area basis (m2/gC)
woody => pftcon%woody , & ! Input: woody patch or not
tree => pftcon%tree , & ! Input: tree patch or not

is_tree => pftcon%is_tree , & ! Input: tree patch or not
is_shrub => pftcon%is_shrub , & ! Input: shrub patch or not

deadstemc => cnveg_carbonstate_inst%deadstemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C
leafcmax => cnveg_carbonstate_inst%leafcmax_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C storage

Expand Down Expand Up @@ -132,11 +133,11 @@ subroutine Light(bounds, num_natvegp, filter_natvegp, &
fpc_inc(p) = max(0._r8, fpcgrid(p) - fpcgrid_old)

if (woody(ivt(p)) == 1._r8) then
if (tree(ivt(p)) == 1) then
if (is_tree(ivt(p))) then
numtrees(g) = numtrees(g) + 1
fpc_tree_total(g) = fpc_tree_total(g) + fpcgrid(p)
fpc_inc_tree(g) = fpc_inc_tree(g) + fpc_inc(p)
else ! if shrubs
else if (is_shrub(ivt(p))) then
fpc_shrub_total(g) = fpc_shrub_total(g) + fpcgrid(p)
end if
else ! if grass
Expand All @@ -162,7 +163,7 @@ subroutine Light(bounds, num_natvegp, filter_natvegp, &

! light competition

if (woody(ivt(p))==1._r8 .and. tree(ivt(p))==1._r8) then
if (woody(ivt(p))==1._r8 .and. is_tree(ivt(p))) then

if (fpc_tree_total(g) > fpc_tree_max) then

Expand Down Expand Up @@ -200,7 +201,7 @@ subroutine Light(bounds, num_natvegp, filter_natvegp, &

end if

else if (woody(ivt(p))==1._r8 .and. tree(ivt(p))==0._r8) then ! shrub
else if (woody(ivt(p))==1._r8 .and. is_shrub(ivt(p))) then ! shrub

if (fpc_shrub_total(g) > fpc_shrub_max(g)) then

Expand Down
4 changes: 2 additions & 2 deletions src/biogeochem/CNDVType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ subroutine InitAllocate(this, bounds)
use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=)
use clm_varpar , only : maxveg
use pftconMod , only : allom1s, allom2s, allom1, allom2, allom3, reinickerp
use pftconMod , only : ntree, nbrdlf_dcd_brl_shrub
use pftconMod , only : nbrdlf_dcd_brl_shrub
use pftconMod , only : pftcon
!
! !ARGUMENTS:
Expand Down Expand Up @@ -148,7 +148,7 @@ subroutine InitAllocate(this, bounds)
dgv_ecophyscon%allom2(m) = allom2
dgv_ecophyscon%allom3(m) = allom3
! modification for shrubs by X.D.Z
if (m > ntree .and. m <= nbrdlf_dcd_brl_shrub ) then
if (pftcon%is_shrub(m)) then
dgv_ecophyscon%allom1(m) = allom1s
dgv_ecophyscon%allom2(m) = allom2s
end if
Expand Down
9 changes: 3 additions & 6 deletions src/biogeochem/CNFireBaseMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module CNFireBaseMod
use atm2lndType , only : atm2lnd_type
use CNDVType , only : dgvs_type
use CNVegStateType , only : cnveg_state_type
use CNVegCarbonStateType , only : cnveg_carbonstate_type
use CNVegCarbonStateType , only : cnveg_carbonstate_type, spinup_factor_deadwood
use CNVegCarbonFluxType , only : cnveg_carbonflux_type
use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type
use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type
Expand Down Expand Up @@ -441,7 +441,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte
!
! !USES:
use clm_time_manager , only: get_step_size_real,get_days_per_year,get_curr_date
use clm_varctl , only: use_cndv, spinup_state
use clm_varctl , only: use_cndv
use clm_varcon , only: secspday
use pftconMod , only: nc3crop
use dynSubgridControlMod , only: run_has_transient_landcover
Expand Down Expand Up @@ -718,10 +718,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte
! apply this rate to the patch state variables to get flux rates
! biomass burning
! carbon fluxes
m = 1._r8
if (spinup_state == 2) then
m = 10._r8
end if
m = spinup_factor_deadwood

m_leafc_to_fire(p) = leafc(p) * f * cc_leaf(patch%itype(p))
m_leafc_storage_to_fire(p) = leafc_storage(p) * f * cc_other(patch%itype(p))
Expand Down
Loading

0 comments on commit 10ea6ee

Please sign in to comment.