Open ZacharyRobbins opened 3 years ago
Currently this is handled via an ApplicationException on Line 211:
if (totalCFlow > this.Carbon) { string mesg = string.Format("Error: Decompose Structural totalCFlow > this.Carbon: totalCFlow={0}, DecayFactor={1}, Anerb={2}", totalCFlow, SiteVars.DecayFactor[site], anerb); throw new ApplicationException(mesg); }
The point is that if that circumstance arises, something is SO WRONG that it would be best to look at all parameters before proceeding. Sometimes correcting an error simply passes the underlying problem off to later function. Does that make sense? Or are you thinking of a different instance?
Z, The line in there "throw new ApplicationException" will stop the model run, and so the problem does not move off to a later function. Is that sufficient?
The Decompose Structural Carbon as calculated in ln 189 in Layer.cs, can result in more carbon being decayed than exists for accepted values of SOM1 surface decay rates. I would suggest that if totalCflow >this.carbon, then totalCFlow=this.carbon. I don't know what this impacts up or down stream.