geco-bern / rsofun

Implements the Simulating Optimal FUNctioning framework for site-scale simulations of ecosystem processes, including model calibration. It contains Fortran 90 modules for the P-model, SPLASH, and BiomeE models.
https://geco-bern.github.io/rsofun/
GNU General Public License v3.0
25 stars 29 forks source link

Negative N pools (BiomeE) #255

Closed marcadella closed 1 week ago

marcadella commented 2 weeks ago

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.

marcadella commented 2 weeks 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.

marcadella commented 2 weeks ago

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.

marcadella commented 1 week ago

Solved by using the solution proposed above.