NGEET / fates

repository for the Functionally Assembled Terrestrial Ecosystem Simulator (FATES)
Other
105 stars 92 forks source link

Add a function to get aboveground biomass of a grass cohort #1267

Open samsrabin opened 1 month ago

samsrabin commented 1 month ago

There are several places in the code where the aboveground biomass of a grass cohort is calculated like

currentCohort%prt%GetState(leaf_organ,element_id) + &
currentCohort%prt%GetState(sapw_organ,element_id) + &
currentCohort%prt%GetState(struct_organ,element_id)

This is really verbose and, more importantly, susceptible to errors. It would be better to have a cohort-level function like GrassAbovegroundBiomass(element_id) that we call wherever needed.