From a001c7150ed7536af8eee2c6c4120c2cb9e9fc30 Mon Sep 17 00:00:00 2001 From: Xiulin Gao Date: Wed, 23 Oct 2024 10:28:52 -0700 Subject: [PATCH 1/5] add subroutine to calculate sapwood cross-sectional area for grass PFT --- biogeochem/FatesAllometryMod.F90 | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/biogeochem/FatesAllometryMod.F90 b/biogeochem/FatesAllometryMod.F90 index 3cf1ab36a4..99a15de626 100644 --- a/biogeochem/FatesAllometryMod.F90 +++ b/biogeochem/FatesAllometryMod.F90 @@ -93,6 +93,7 @@ module FatesAllometryMod use FatesConstantsMod, only : fates_unset_r8 use FatesConstantsMod, only : itrue use FatesConstantsMod, only : nearzero + use FatesConstantsMod, only : pi_const use shr_log_mod , only : errMsg => shr_log_errMsg use FatesGlobals , only : fates_log use FatesGlobals , only : endrun => fates_endrun @@ -1045,8 +1046,10 @@ subroutine bsap_allom(d,ipft,crowndamage,canopy_trim,elongf_stem, sapw_area,bsap ! dead woody biomass. So bsap = bagw. Might remove the bsap and bdead for grass ! in the future as there is no need to distinguish the two for grass above- and belowground biomass + call sapwood_area_grass(d,sapw_area) call bagw_allom(d,ipft,crowndamage,elongf_stem,bagw,dbagwdd) call bbgw_allom(d,ipft, elongf_stem,bbgw,dbbgwdd) + bsap = bagw + bbgw ! This is a grass-only functionnal type, no need to run crown-damage effects @@ -1411,6 +1414,46 @@ subroutine bsap_ltarg_slatop(d,h,dhdd,bleaf,dbleafdd,ipft, & return end subroutine bsap_ltarg_slatop + + +! ============================================================================ + ! Area of sap wood cross-section specifically for grass PFT + ! ============================================================================ + + subroutine sapwood_area_grass(d,sapw_area) + !--------------------------------------------------------------------------- + ! This function calculates sapwood cross-sectional area specifically for grass + ! PFT using basal diameter (cm) of the entire plant as size reference, + ! assume basal area as the sum of cross-sectional area of each grass tiller + ! so that water transport through sapwood can be seen as a collective behavior + ! of all tillers + ! No reference. Might update this to more theoretical-based approach once there + ! is empirical evidence + !---------------- + ! Input arguments + !---------------- + ! d -- basal diameter [cm] + + !---------------- + ! Output variables + !---------------- + ! sapw_area -- sapwood cross-sectional area [m2] + + !---Arguments + real(r8), intent(in) :: d ! plant basal diameter [ cm] + real(r8), intent(out) :: sapw_area ! sapwood cross-sectional area [ m2] + + ! Calculate sapwood cross-sectional area assuming sapwood geometry as a + ! cylinder and basal diameter is the diameter of the cylinder + sapw_area = (pi_const * (d / (2.0_r8)**2.0_r8)) / cm2_per_m2 + + return + + end subroutine sapwood_area_grass + + + + ! ============================================================================ ! Specific storage relationships ! ============================================================================ From 862706823d734664c30f4dfc7287931f62906bbb Mon Sep 17 00:00:00 2001 From: Xiulin Gao Date: Wed, 23 Oct 2024 15:54:55 -0700 Subject: [PATCH 2/5] correct area calculation --- biogeochem/FatesAllometryMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biogeochem/FatesAllometryMod.F90 b/biogeochem/FatesAllometryMod.F90 index 99a15de626..7b18ef9498 100644 --- a/biogeochem/FatesAllometryMod.F90 +++ b/biogeochem/FatesAllometryMod.F90 @@ -1445,7 +1445,7 @@ subroutine sapwood_area_grass(d,sapw_area) ! Calculate sapwood cross-sectional area assuming sapwood geometry as a ! cylinder and basal diameter is the diameter of the cylinder - sapw_area = (pi_const * (d / (2.0_r8)**2.0_r8)) / cm2_per_m2 + sapw_area = (pi_const * ((d / 2.0_r8)**2.0_r8)) / cm2_per_m2 return From 0628cb76b1df8dc6a99a31799439de1a9a9609bf Mon Sep 17 00:00:00 2001 From: Xiulin Gao Date: Wed, 23 Oct 2024 15:58:08 -0700 Subject: [PATCH 3/5] update in-code documentation --- biogeochem/FatesAllometryMod.F90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/biogeochem/FatesAllometryMod.F90 b/biogeochem/FatesAllometryMod.F90 index 7b18ef9498..9951af1ded 100644 --- a/biogeochem/FatesAllometryMod.F90 +++ b/biogeochem/FatesAllometryMod.F90 @@ -1424,8 +1424,9 @@ subroutine sapwood_area_grass(d,sapw_area) !--------------------------------------------------------------------------- ! This function calculates sapwood cross-sectional area specifically for grass ! PFT using basal diameter (cm) of the entire plant as size reference, - ! assume basal area as the sum of cross-sectional area of each grass tiller - ! so that water transport through sapwood can be seen as a collective behavior + ! assume sapwood area of the entire plant as the sum of the cross-sectional area + ! of each grass tiller + ! such that water transport through sapwood can be seen as a collective behavior ! of all tillers ! No reference. Might update this to more theoretical-based approach once there ! is empirical evidence From 2202c461b5fb6fa1aa9398a5b19624771a3169f9 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 13 Nov 2024 15:30:18 -0800 Subject: [PATCH 4/5] update subroutine case to PascalCase --- biogeochem/FatesAllometryMod.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/biogeochem/FatesAllometryMod.F90 b/biogeochem/FatesAllometryMod.F90 index 9951af1ded..359836e664 100644 --- a/biogeochem/FatesAllometryMod.F90 +++ b/biogeochem/FatesAllometryMod.F90 @@ -1046,7 +1046,7 @@ subroutine bsap_allom(d,ipft,crowndamage,canopy_trim,elongf_stem, sapw_area,bsap ! dead woody biomass. So bsap = bagw. Might remove the bsap and bdead for grass ! in the future as there is no need to distinguish the two for grass above- and belowground biomass - call sapwood_area_grass(d,sapw_area) + call SapwoodAreaGrass(d,sapw_area) call bagw_allom(d,ipft,crowndamage,elongf_stem,bagw,dbagwdd) call bbgw_allom(d,ipft, elongf_stem,bbgw,dbbgwdd) @@ -1420,7 +1420,7 @@ end subroutine bsap_ltarg_slatop ! Area of sap wood cross-section specifically for grass PFT ! ============================================================================ - subroutine sapwood_area_grass(d,sapw_area) + subroutine SapwoodAreaGrass(d,sapw_area) !--------------------------------------------------------------------------- ! This function calculates sapwood cross-sectional area specifically for grass ! PFT using basal diameter (cm) of the entire plant as size reference, @@ -1450,7 +1450,7 @@ subroutine sapwood_area_grass(d,sapw_area) return - end subroutine sapwood_area_grass + end subroutine SapwoodAreaGrass From 1365dee1ccdc99710d563dcef95a2f1065065764 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 13 Nov 2024 15:33:11 -0800 Subject: [PATCH 5/5] formatting space alignment --- biogeochem/FatesAllometryMod.F90 | 60 +++++++++++++++----------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/biogeochem/FatesAllometryMod.F90 b/biogeochem/FatesAllometryMod.F90 index 359836e664..dfd04793cf 100644 --- a/biogeochem/FatesAllometryMod.F90 +++ b/biogeochem/FatesAllometryMod.F90 @@ -1416,44 +1416,42 @@ end subroutine bsap_ltarg_slatop -! ============================================================================ + ! ============================================================================ ! Area of sap wood cross-section specifically for grass PFT ! ============================================================================ subroutine SapwoodAreaGrass(d,sapw_area) - !--------------------------------------------------------------------------- - ! This function calculates sapwood cross-sectional area specifically for grass - ! PFT using basal diameter (cm) of the entire plant as size reference, - ! assume sapwood area of the entire plant as the sum of the cross-sectional area - ! of each grass tiller - ! such that water transport through sapwood can be seen as a collective behavior - ! of all tillers - ! No reference. Might update this to more theoretical-based approach once there - ! is empirical evidence - !---------------- - ! Input arguments - !---------------- - ! d -- basal diameter [cm] - - !---------------- - ! Output variables - !---------------- - ! sapw_area -- sapwood cross-sectional area [m2] - - !---Arguments - real(r8), intent(in) :: d ! plant basal diameter [ cm] - real(r8), intent(out) :: sapw_area ! sapwood cross-sectional area [ m2] - - ! Calculate sapwood cross-sectional area assuming sapwood geometry as a - ! cylinder and basal diameter is the diameter of the cylinder - sapw_area = (pi_const * ((d / 2.0_r8)**2.0_r8)) / cm2_per_m2 - return - - end subroutine SapwoodAreaGrass + !--------------------------------------------------------------------------- + ! This function calculates sapwood cross-sectional area specifically for grass + ! PFT using basal diameter (cm) of the entire plant as size reference, + ! assume sapwood area of the entire plant as the sum of the cross-sectional area + ! of each grass tiller + ! such that water transport through sapwood can be seen as a collective behavior + ! of all tillers + ! No reference. Might update this to more theoretical-based approach once there + ! is empirical evidence + !---------------- + ! Input arguments + !---------------- + ! d -- basal diameter [cm] + + !---------------- + ! Output variables + !---------------- + ! sapw_area -- sapwood cross-sectional area [m2] + + !---Arguments + real(r8), intent(in) :: d ! plant basal diameter [ cm] + real(r8), intent(out) :: sapw_area ! sapwood cross-sectional area [ m2] + + ! Calculate sapwood cross-sectional area assuming sapwood geometry as a + ! cylinder and basal diameter is the diameter of the cylinder + sapw_area = (pi_const * ((d / 2.0_r8)**2.0_r8)) / cm2_per_m2 - + return + end subroutine SapwoodAreaGrass ! ============================================================================ ! Specific storage relationships