Skip to content

Commit

Permalink
Added parameter checking for sapwood allometry 2 and woody pft, remov…
Browse files Browse the repository at this point in the history
…ed crown damage code from grass sapwood allometry
  • Loading branch information
rgknox committed Aug 13, 2024
1 parent 639b3c2 commit 953eb7c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
20 changes: 5 additions & 15 deletions biogeochem/FatesAllometryMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1050,21 +1050,11 @@ subroutine bsap_allom(d,ipft,crowndamage,canopy_trim,elongf_stem, sapw_area,bsap
call bbgw_allom(d,ipft, elongf_stem,bbgw,dbbgwdd)
bsap = bagw + bbgw

! replicate the crown damage code
! Do we really need this for grass? I would think this can be helpful for
! grazing in the future. --XLG
if(crowndamage > 1)then
call GetCrownReduction(crowndamage, crown_reduction)
bsap = elongf_stem * (bsap - (bsap * agb_frac * branch_frac * crown_reduction))
if(present(dbsapdd))then
dbsapdd = elongf_stem * &
(dbagwdd + dbbgwdd - ((dbagwdd + dbbgwdd) * agb_frac * branch_frac * crown_reduction))
end if
else
bsap = elongf_stem * bsap
if (present(dbsapdd))then
dbsapdd = elongf_stem * (dbagwdd + dbbgwdd)
end if
! This is a grass-only functionnal type, no need to run crown-damage effects

bsap = elongf_stem * bsap
if (present(dbsapdd))then
dbsapdd = elongf_stem * (dbagwdd + dbbgwdd)
end if

if(present(dbsapdd))then
Expand Down
13 changes: 13 additions & 0 deletions main/EDPftvarcon.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2183,6 +2183,19 @@ subroutine FatesCheckParams(is_master)
end if


! Check to make sure that if a grass sapwood allometry is used, it is not
! a woody plant.
if ( ( prt_params%allom_smode(ipft)==2 ) .and. (prt_params%woody(ipft)==itrue) ) then
write(fates_log(),*) 'Allometry mode 2 is a mode that is only appropriate'
write(fates_log(),*) 'for a grass functional type. Sapwood allometry is set with'
write(fates_log(),*) 'fates_allom_smode in the parameter file. Woody versus non woody'
write(fates_log(),*) 'plants are set via fates_woody in the parameter file.'
write(fates_log(),*) 'Current settings for pft number: ',ipft
write(fates_log(),*) 'fates_woody: true'
write(fates_log(),*) 'fates_allom_smode: ',prt_params%allom_smode(ipft)
write(fates_log(),*) 'Please correct this discrepancy before re-running. Aborting.'
call endrun(msg=errMsg(sourcefile, __LINE__))
end if

! Check if fraction of storage to reproduction is between 0-1
! ----------------------------------------------------------------------------------
Expand Down

0 comments on commit 953eb7c

Please sign in to comment.