/// <summary> /// Instantiates an AQUATOX Nutrients model given a valid JSON input, checks data requirements, integrates, and saves results back to the JSON as iTimeSeries. /// Valid JSON inputs must include an AQUATOX segment with a set of Organic Matter state variables attached, and a valid site record and morphometry data, and PSETUP record. /// Example valid JSON inputs and documentation including a discussion of data requirements may be found in the OrganicMatter\DOCS directory. /// </summary> /// <param name="json"></param> string, passed by reference: a valid json input that is replaced by the model's json output including model results /// <param name="errmsg"></param> string, passed by reference: if blank, no error occured and simulation completed successfully, otherwise error details are provided within the string /// <param name="RunModel"></param> bool, if true, the model is run and results saved back to the json string parameter passed by reference. public AQTOrganicMatter(ref string json, ref string errmsg, bool RunModel) { AQSim = new AQTSim(); errmsg = AQSim.Instantiate(json); if (errmsg == "") { errmsg = CheckDataRequirements(); if ((errmsg == "") && RunModel) { errmsg = AQSim.Integrate(); if (errmsg == "") { errmsg = AQSim.SaveJSON(ref json); } } } }
/// <summary> /// Instantiates an AQUATOX Volume model given an existing AQUATOX Simulation insim. Used for testing multi-purpose models. /// </summary> /// <param name="insim"></param> AQTSim. The AQUATOX simulation being cast or tested as an AQUATOX Volume Model public AQTVolumeModel(AQTSim insim) { AQSim = insim; }