Closed marcadella closed 1 week ago
@stineb Negative psoil_sl%n%n14
comes from Recover_N_balance()
where you correct if vegn%totN != vegn%initialN0
. You seemed to assumed that the discrepancy came from vegn%psoil_sl%n%n14
exclusively but it might be that other pools have issues too, leading to an over-correction of psoil_sl
.
I am afraid the only way to fix the issue is therefore to fix the underlying model so that the N pools are correct in the first place.
A simple alternative quick fix would be to spread evenly the deltaN over all the pools (proportionally to the pool sizes). Still a hack, but at least it would preserve positive values in the pools.
Solved by using the solution proposed above.
On master using either p-model or gs leuning, some N pools are negative. It was true before the big master update from last week.
N_yrMin < 0
from day one, because:vegn%annualN < 0
inSOMdecomposition()
because:N_loss
is not compensated by the other fluxes and we start at 0.soilN < 0
after a couple of days because:vegn%psoil_sl%n%n14 < 0
because of the correction done inRecover_N_balance()
.annualfixedN = 0
since it is only updated byvegn%annualfixedN = vegn%annualfixedN + cc%annualfixedN * cc%nindivs
, but since it is initialized to 0, it stays at 0.n_deadtrees
,c_deadtrees
, andm_turnover
are all zero because their update happens afterannual_diagnostics()
.N_P2S_yr
is probably only partially filled too.do_closedN_run = True
, the C:N ratio in soils is > 300...