コード例 #1
0
ファイル: SoilWaterSoil.cs プロジェクト: hol353/ApsimX
 /// <summary>
 /// Adds the sub surface irrig to soil.
 /// </summary>
 /// <param name="Irrig">The irrig.</param>
 public void AddSubSurfaceIrrigToSoil(IrrigData Irrig)
 {
     if (Irrig.isSubSurface)
         {
         Layer lyr = GetLayer(Irrig.layer);
         lyr.sw_dep = lyr.sw_dep + Irrig.amount;
         }
 }
コード例 #2
0
ファイル: SoilWater.cs プロジェクト: hut104/ApsimX
        private void OnSimulationCommencing(object sender, EventArgs e)
        {
            SaveModuleConstants();

            //daily inputs
            met = new MetData();
            irrig = new IrrigData();
            canopy = new CanopyData();
            surfaceCover = new SurfaceCoverData();

            //optional daily inputs
            runon = 0.0;
            interception = 0.0;
            residueinterception = 0.0;

            if (Soil.Thickness != null)
                {
                try
                    {
                    SoilObject = new SoilWaterSoil(constants, Soil);  //constructor can throw an Exception
                    surfaceFactory = new SurfaceFactory();
                    surface = surfaceFactory.GetSurface(SoilObject, Clock);  //constructor can throw an Exception (Evap class constructor too)

                //optional inputs (array)
                inflow_lat = null;
                }
                catch (Exception Ex)
                    {
                    throw new ApsimXException(this, Ex.Message);  //catch any constructor Exceptions and rethrow as an ApsimXException.
                    }
                }
            else
                {
                throw new ApsimXException(this, "SoilWater module has detected that the Soil has no layers.");
                }
        }
コード例 #3
0
ファイル: SoilWaterSoil.cs プロジェクト: hol353/ApsimX
        /// <summary>
        /// Adds the solutes due to irrigation.
        /// </summary>
        /// <param name="Irrig">The irrig.</param>
        public void AddSolutesDueToIrrigation(IrrigData Irrig)
        {
            //private void soilwat2_irrig_solute()
            //    {

            //*+  Mission Statement
            //*      Add solutes with irrigation

            //sv- 11 Dec 2012.
            //Since I have allowed irrigations to runoff just like rain (using argument "will_runoff = 1" in apply command)
            //I should really remove a proportion of the solutes that are lost due to some of the irrigation running off.
            //Perhaps something like (irrigation / (rain + irrigation)) * runoff
            //to work out how much of the runoff is caused by irrigation and remove this proportion of solutes from the surface layer.
            //HOWEVER, when rain causes runoff we don't remove solutes from the surface layer of the soil.
            //So why when irrigation causes runoff should we remove solutes.

            Layer lyr = GetLayer(Irrig.layer);

            SoluteInLayer no3 = lyr.GetASolute("NO3");
            SoluteInLayer nh4 = lyr.GetASolute("NH4");
            //SoluteInLayer cl = lyr.GetASolute("cl");

            no3.amount += Irrig.NO3;
            no3.delta += Irrig.NO3;

            nh4.amount += Irrig.NH4;
            nh4.delta += Irrig.NH4;

            //cl.amount += Irrig.CL;
            //cl.delta += Irrig.CL;
        }