NGEET / fates

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

Potentially incorrect allocation to fine roots in PRTAllometricCarbonMod.F90? #784

Open mpaiao opened 3 years ago

mpaiao commented 3 years ago

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?

       leaf_c_flux    = min(leaf_c_demand, &
                        carbon_balance*(leaf_c_demand/total_c_demand))
       fnrt_c_flux    = min(fnrt_c_demand, &
                            carbon_balance*(fnrt_c_demand/total_c_demand))
       leaf_c(iexp_leaf) = leaf_c(iexp_leaf) + leaf_c_flux
       fnrt_c         = fnrt_c + fnrt_c_flux
       carbon_balance = carbon_balance - leaf_c_flux - fnrt_c_flux
mpaiao commented 3 years ago

And I think the same rationale applies to the block a few lines above.

https://github.com/NGEET/fates/blob/70a3e133244877f325652f2cf40e637d785b3aa7/parteh/PRTAllometricCarbonMod.F90#L485-L506

rgknox commented 3 years ago

I agree @mpaiao

rgknox commented 3 years ago

yeah, we should not be updating the carbon balance until both pools have calculated their fluxes

jkshuman commented 3 years ago

I also agree with you @mpaiao good catch.

mpaiao commented 3 years ago

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).

mpaiao commented 3 years ago

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)

https://github.com/mpaiao/fates/blob/bdd5efc377be5f681ce0266fad423787771741b8/parteh/PRTAllometricCarbonMod.F90#L928

Do you think this approach makes sense?

rgknox commented 3 years ago

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