コード例 #1
0
    //For the andales methods of bd
    [EventHandler] void OnTillage(TillageType Till)
    {
        firstTill = true;

        rainAmt = 0.0;
        float depth = Till.tillage_depth;

        for (int i = 0; i < oc.Length; i++)
        {
            depth           -= (float)dlayer[i];
            till_depth_layer = i;
            if (depth <= 0)
            {
                break;
            }
        }
    }
コード例 #2
0
        ///<summary>Perform tillage</summary>
        public void Tillage(TillageType Data)
        {
            if ((Data.cn_red <= 0) || (Data.cn_rain <= 0))
            {
                string message = "tillage:- " + Data.Name + " has incorrect values for " + Environment.NewLine +
                                 "CN reduction = " + Data.cn_red + Environment.NewLine + "Acc rain     = " + Data.cn_red;
                throw new Exception(message);
            }

            double reduction = MathUtilities.Constrain(Data.cn_red, 0.0, CN2Bare);

            runoffModel.TillageCnCumWater    = Data.cn_rain;
            runoffModel.TillageCnRed         = reduction;
            runoffModel.CumWaterSinceTillage = 0.0;

            var line = string.Format("Soil tilled. CN reduction = {0}. Cumulative rain = {1}",
                                     reduction, Data.cn_rain);

            summary.WriteMessage(this, line);
        }