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

Optional decoupling of fine root biomass from canopy trim logic #354

Merged
merged 2 commits into from
Apr 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions biogeochem/EDPhysiologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,12 @@ subroutine trim_canopy( currentSite )
endif

call bleaf(currentcohort%dbh,ipft,currentcohort%canopy_trim,tar_bl)
call bfineroot(currentcohort%dbh,ipft,currentcohort%canopy_trim,tar_bfr)

bfr_per_bleaf = tar_bfr/tar_bl
if ( int(EDPftvarcon_inst%allom_fmode(ipft)) .eq. 1 ) then
! only query fine root biomass if using a fine root allometric model that takes leaf trim into account
call bfineroot(currentcohort%dbh,ipft,currentcohort%canopy_trim,tar_bfr)
bfr_per_bleaf = tar_bfr/tar_bl
Copy link
Contributor

Choose a reason for hiding this comment

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

@ckoven

In cases where allom_fmode is not 1, will this generate an un-initialized variable? Should this be outside the filter?

Copy link
Contributor

Choose a reason for hiding this comment

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

bfr_per_bleaf that is

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, i see now, the if clause is used later on, so the variable is only used inside those clauses.

endif

!Leaf cost vs netuptake for each leaf layer.
do z = 1,nlevleaf
Expand All @@ -207,18 +210,27 @@ subroutine trim_canopy( currentSite )


currentCohort%leaf_cost = 1._r8/(EDPftvarcon_inst%slatop(ipft)*1000.0_r8)
currentCohort%leaf_cost = currentCohort%leaf_cost + &
1.0_r8/(EDPftvarcon_inst%slatop(ipft)*1000.0_r8) * &
bfr_per_bleaf / EDPftvarcon_inst%root_long(ipft)

if ( int(EDPftvarcon_inst%allom_fmode(ipft)) .eq. 1 ) then
! if using trimmed leaf for fine root biomass allometry, add the cost of the root increment
! to the leaf increment; otherwise do not.
currentCohort%leaf_cost = currentCohort%leaf_cost + &
1.0_r8/(EDPftvarcon_inst%slatop(ipft)*1000.0_r8) * &
bfr_per_bleaf / EDPftvarcon_inst%root_long(ipft)
endif

currentCohort%leaf_cost = currentCohort%leaf_cost * &
(EDPftvarcon_inst%grperc(ipft) + 1._r8)
else !evergreen costs
currentCohort%leaf_cost = 1.0_r8/(EDPftvarcon_inst%slatop(ipft)* &
EDPftvarcon_inst%leaf_long(ipft)*1000.0_r8) !convert from sla in m2g-1 to m2kg-1
currentCohort%leaf_cost = currentCohort%leaf_cost + &
1.0_r8/(EDPftvarcon_inst%slatop(ipft)*1000.0_r8) * &
bfr_per_bleaf / EDPftvarcon_inst%root_long(ipft)
if ( int(EDPftvarcon_inst%allom_fmode(ipft)) .eq. 1 ) then
! if using trimmed leaf for fine root biomass allometry, add the cost of the root increment
! to the leaf increment; otherwise do not.
currentCohort%leaf_cost = currentCohort%leaf_cost + &
1.0_r8/(EDPftvarcon_inst%slatop(ipft)*1000.0_r8) * &
bfr_per_bleaf / EDPftvarcon_inst%root_long(ipft)
endif
currentCohort%leaf_cost = currentCohort%leaf_cost * &
(EDPftvarcon_inst%grperc(ipft) + 1._r8)
endif
Expand Down
13 changes: 10 additions & 3 deletions biogeochem/FatesAllometryMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,9 @@ module FatesAllometryMod
public :: StructureResetOfDH ! Method to set DBH to sync with structure biomass
public :: CheckIntegratedAllometries


logical , parameter :: verbose_logging = .false.
character(len=*), parameter :: sourcefile = __FILE__


! If testing b4b with older versions, do not remove sapwood
! Our old methods with saldarriaga did not remove sapwood from the
! bdead pool. But newer allometries are providing total agb
Expand Down Expand Up @@ -621,14 +619,23 @@ subroutine bfineroot(d,ipft,canopy_trim,bfr,dbfrdd)
real(r8) :: slascaler

select case(int(EDPftvarcon_inst%allom_fmode(ipft)))
case(1) ! "constant proportionality with bleaf"
case(1) ! "constant proportionality with TRIMMED target bleaf"

call blmax_allom(d,ipft,blmax,dblmaxdd)
call bfrmax_const(d,blmax,dblmaxdd,ipft,bfrmax,dbfrmaxdd)
bfr = bfrmax * canopy_trim
if(present(dbfrdd))then
dbfrdd = dbfrmaxdd * canopy_trim
end if
case(2) ! "constant proportionality with UNTRIMMED target bleaf"

call blmax_allom(d,ipft,blmax,dblmaxdd)
call bfrmax_const(d,blmax,dblmaxdd,ipft,bfrmax,dbfrmaxdd)
bfr = bfrmax
if(present(dbfrdd))then
dbfrdd = dbfrmaxdd
end if

case DEFAULT
write(fates_log(),*) 'An undefined fine root allometry was specified: ', &
EDPftvarcon_inst%allom_fmode(ipft)
Expand Down