//Constructor public NormalEvaporation(SoilWaterSoil SoilObject, Clock Clock) { cons = SoilObject.Constants; salb = SoilObject.Salb; summerCona = SoilObject.SummerCona; summerU = SoilObject.SummerU; summerDate = SoilObject.SummerDate; winterCona = SoilObject.WinterCona; winterU = SoilObject.WinterU; winterDate = SoilObject.WinterDate; // soilwat2_soil_property_param() //u - can either use (one value for summer and winter) or two different values. // (must also take into consideration where they enter two values [one for summer and one for winter] but they make them both the same) if ((Double.IsNaN(summerU) || (Double.IsNaN(winterU)))) { throw new Exception("A single value for u OR BOTH values for summeru and winteru must be specified"); } //if they entered two values but they made them the same if (summerU == winterU) { u = summerU; //u is now no longer null. As if the user had entered a value for u. } //cona - can either use (one value for summer and winter) or two different values. // (must also take into consideration where they enter two values [one for summer and one for winter] but they make them both the same) if ((Double.IsNaN(summerCona)) || (Double.IsNaN(winterCona))) { throw new Exception("A single value for cona OR BOTH values for summercona and wintercona must be specified"); } //if they entered two values but they made them the same. if (summerCona == winterCona) { cona = summerCona; //cona is now no longer null. As if the user had entered a value for cona. } //summer and winter default dates. if (summerDate == "not_read") { summerDate = "1-oct"; } if (winterDate == "not_read") { winterDate = "1-apr"; } InitialiseAccumulatingVars(SoilObject, Clock); }
//Constructor public NormalRunoff(SoilWaterSoil SoilObject) { cons = SoilObject.Constants; _cn2_bare = SoilObject.cn2_bare; coverCnRed = SoilObject.cn_red; coverCnCov = SoilObject.cn_cov; //soilwat2_soil_property_param() if (coverCnRed >= _cn2_bare) { coverCnRed = _cn2_bare - 0.00009; } }
private bool using_ks; //! flag to determine if Ks has been chosen for use. //sv- set in soilwat2_init() by checking if mwcon exists #endregion Fields #region Constructors //Constructor /// <summary> /// Initializes a new instance of the <see cref="SoilWaterSoil"/> class. /// </summary> /// <param name="Consts">The consts.</param> /// <param name="Soil">The soil.</param> /// <exception cref="System.Exception">Constructor for SoilWaterSoil failed because there are no layers</exception> public SoilWaterSoil(Constants Consts, Soil Soil) { //add all the layers if (Soil.Thickness != null) { layers = new List<Layer>(); for (int i = 0; i < Soil.Thickness.Count(); i++) { Layer lyr = new Layer(); layers.Add(lyr); } } else { throw new Exception("Constructor for SoilWaterSoil failed because there are no layers"); } Constants = Consts; UseStartingValuesToInitialise(Soil); }
//Reset /// <summary> /// Resets the soil. /// </summary> /// <param name="Consts">The consts.</param> /// <param name="Soil">The soil.</param> public void ResetSoil(Constants Consts, Soil Soil) { Constants = Consts; UseStartingValuesToInitialise(Soil); }