Open mpaiao opened 3 years ago
And I think the same rationale applies to the block a few lines above.
I agree @mpaiao
yeah, we should not be updating the carbon balance until both pools have calculated their fluxes
I also agree with you @mpaiao good catch.
I changed the code to set the fluxes of all pools before changing carbon balance. You can check the changes in my local commit: https://github.com/mpaiao/fates/commit/bdd5efc377be5f681ce0266fad423787771741b8
I should just note that this causes a substantial difference in the dynamics. In my tests for the semi-arid site in Brazil, just switching this order caused evergreens to go nearly extinct during an extreme drought year (not necessarily a problem because I was running a tropical moist forest evergreen in a semi-arid site).
I also had the impression that the carbon allocation routine is rather complex. I wrote a simplified version that simply allocates the available carbon (storage + carbon balance) towards all pools, proportionally to the deficit of each pool, and if there is any remaining carbon then it allocates to growth. I put this subroutine as an option in PRTAllometricCarbonMod.F90 (link below)
Do you think this approach makes sense?
I like simple, seems fine to have the alternative. In the N & P enabled allocation scheme, we allow the user to define the order in which replace tissues. We could potentially merge our ideas and create a c-only version: https://github.com/NGEET/fates/blob/master/parteh/PRTAllometricCNPMod.F90#L615
I was looking at this code and it seems to me that allocation to fine roots would be underestimated:
https://github.com/NGEET/fates/blob/70a3e133244877f325652f2cf40e637d785b3aa7/parteh/PRTAllometricCarbonMod.F90#L543-L555
Carbon balance is subtracted after finding leaf_c_flux, and then scaled by fnrt_c_demand/total_c_demand, so the relative demand of fine root demand is applied in a lower carbon balance value. Shouldn't the code be something like the one below?