diff --git a/Models/PMF/Organs/ReproductiveOrgan.cs b/Models/PMF/Organs/ReproductiveOrgan.cs index 9bed9209b4..de87ad16f5 100644 --- a/Models/PMF/Organs/ReproductiveOrgan.cs +++ b/Models/PMF/Organs/ReproductiveOrgan.cs @@ -369,7 +369,25 @@ public double MinNconc { get { - return MinimumNConc.Value(); + // Biomass allocation today + double dmAllocation = potentialDMAllocation.Storage + + potentialDMAllocation.Structural + + potentialDMAllocation.Metabolic; + // Required the minimum nitrogen content according to biomass at the end of day + // and minimum nitrogen concentration + double requiredMinNContent = (Live.Wt + dmAllocation) * MinimumNConc.Value(); + // "requiredMinNContent - Live.N" is the deficit of nitrogen in grain. + // Negative: enough nitrogen for grain + // Positive: no enough nitrogen for grain + // (requiredMinNContent - Live.N) / dmAllocation: Convert to nitrogen concentration + // 0.00001: A small value for minimum nitrogen concentration which cannot + // be zero in the arbitration model + double minNConc = 0.00001; + if (dmAllocation > 0) + { + minNConc = Math.Max(0.00001, (requiredMinNContent - Live.N) / dmAllocation); + } + return minNConc; } }