Update to pyrealm 2.0.0rc2, add reproductive tissue and carbon servicing#811
Update to pyrealm 2.0.0rc2, add reproductive tissue and carbon servicing#811
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #811 +/- ##
===========================================
+ Coverage 94.15% 94.18% +0.02%
===========================================
Files 74 74
Lines 5285 5311 +26
===========================================
+ Hits 4976 5002 +26
Misses 309 309 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…orate-pyrealm-update Add plant reproductive tissue and gpp topslice integration.
…orate-pyrealm-update Split up plant RT turnover into propagule and non-propagule.
…anch-fruit-production
|
I guess that An alternative approach would be to just have animals eat from the relevant litter pools (i.e. above ground metabolic litter for fallen fruits). But this might not be differentiated enough for the animal model. We could also use a similar approach as the one used in |
Thank you for this comment @jacobcook1995, this problem isn't going to go away so it's great to think through now what makes sense. @TaranRallings what do you think about these options? |
There was a problem hiding this comment.
Note
Edited to fix silly mistakes in reproductive tissue partitioning, thanks @sallymatson
This is looking good but I think we do need to add more detail in the propagules. I've thought if this is something that can be post Easter, but I think critically we need number of propagules (not just mass) for recruitment.
I think what we need here for now are two partitioning parameters for reproductive tissue:
- the proportion allocation of reproductive mass to propagules
- the actual carbon mass per propagule
That then gives us (using absurdly long names):
canopy_n_propagules: NDArray[np.int_] = np.floor(
(reproductive_tissue_carbon_allocation * reproductive_tissue_mass_propagule_proportion)
/ carbon_mass_per_propagule
)
canopy_non_propagule_reproductive_tissue_mass: NDArray[np.float64] = (
reproductive_tissue_carbon_allocation
- (canopy_n_propagules * carbon_mass_per_propagule)
)When canopy_non_propagule_reproductive_tissue_mass is turned over, @TaranRallings and I agree that we can simply add it to the litter pool, so we'll need to get @jacobcook1995 to average another pile of mass with its own stochiometry into that pool.
Ideally, we'd have those two parameters as PFT specific things, but I think we live with one propagule size class for now! I think we need to take a look at creating a VE specific submodule of pyrealm to maybe isolate our changes, or perhaps to look at how to make the model more extensible, but that's for another day!
The turned over propagules then need some changes:
-
The parameter in the pyrealm PFT is an overall RT mass turnover. I think we just take the same approach as above to split the turned over mass into non-propagule mass that heads into litter and number of turned over propagules. I'm sure that is going to introduce a bias, but we don't care for now.
-
The number of turned over propagules then needs to go into a CellID x PFT array - we need to know the number of propagules per PFT for recruitment. I think ideally we want propagules to be in two different pools (surface accessible vs a more protected seedbank), but I think that is for another PR.
I don't think we need ground_propagule_c_mass and fallen_propagule_c_mass. Once we have the propagule numbers, we can add a germination rate and that introduces new cohorts into the tree part of the model. So for the moment, propagules are either on the tree, on the ground or convert into a new cohort.
I think we will need a separate mechanism to expose seedling mortality alongside the ground vegetation, but that isn't handled here.
| community.stem_allometry.foliage_mass / community.stem_traits.tau_f | ||
|
|
||
| # Sum of turnover from all cohorts in a grid cell | ||
| # TODO: Pyrealm provides annual turnover values. Divide by 12 to get monthly |
There was a problem hiding this comment.
We should use the updates_per_year attribute that came in with #747 rather than hardcoding N/12.
| self.data["propagule_c_mass"] = xr.full_like(self.data["elevation"], 0) | ||
| self.data["non_propagule_c_mass"] = xr.full_like(self.data["elevation"], 0) |
There was a problem hiding this comment.
We could partition this across the vertical canopy layers, but @TaranRallings only cares about canopy/non-canopy and realistically I think we'd be making unwarranted assumptions about the vertical distribution of fruit within the canopy. So maybe we should note here that we are deliberately (for now and maybe permanently) not partitioning the vertical structure of this.
|
Okay, I've now updated the PR to distinguish between |
…productive tissue pools
…ropagules Dividing propagules by PFT and other issues
| # TODO - This is wrong. Reproductive tissue mass can't simply move backwards | ||
| # and forwards between these two classes. |
There was a problem hiding this comment.
One final comment on my end, @davidorme can you clarify what this means? I guess it is just because we're recalculating the mass each update, but the wording is confusing me!
There was a problem hiding this comment.
Yeah - it isn't very clear.
Say we've got a propagule mass of 5g, a propagule proportion of 0.6 and the reproductive tissue mass at time 1 is
Damn. That example doesn't work. Well. It kind of does, because the allocation of the extra mass at time 2 is actually 5g to propagules and 1.7g to non-propagule, so the proportions are averaged through time in a weird way. I think there might be cases were non-propagule mass decreases. I think we might want a fruit lifecycle model, but that's way more complex and we end up with cohorts of fruit on cohorts of trees.
Description
This PR incorporates the updates to the T Model in pyrealm, which enable us to produce reproductive tissue (yay fruit!!) and gpp topslicing (yay root exudates and fungi!). More specifically...
propagule_c_massnon_propagule_c_massfallen_propagule_c_massfallen_non_propagule_c_massfallen_propagule_c_massandfallen_non_propagule_c_mass) have replacedplant_reproductive_tissue_turnover- @jacobcook1995 I made minor tweaks in your models to account for this, but wanted to flag.root_exudatesandplant_symbiote_carbon_supplyFor clarity's sake, the following table shows the different variables that the plants model needs to populate for RT (at least in the most basic version.) The RT growing on the ground will be incorporated to the basic grass model that @davidorme is planning to work on soon. If anyone has better/clearer ideas for these names, please let me know!! Now is the best time to choose them!
Type of change
Key checklist
pre-commitchecks:$ pre-commit run -a$ poetry run pytestFurther checks