Ejemplo n.º 1
0
 /// <summary>Called when [harvest].</summary>
 /// <param name="Harvest">The harvest.</param>
 /// <param name="BiomassRemoved">The biomass removed.</param>
 public abstract void OnHarvest(HarvestType Harvest, BiomassRemovedType BiomassRemoved);
Ejemplo n.º 2
0
        /// <summary>Called when [harvest].</summary>
        /// <param name="Harvest">The harvest.</param>
        /// <param name="BiomassRemoved">The biomass removed.</param>
        public override void OnHarvest(HarvestType Harvest, BiomassRemovedType BiomassRemoved)
        {
            double dm_init = MathUtilities.Constrain(InitialWt * Population.Density, double.MinValue, Live.Wt);
            double n_init = MathUtilities.Constrain(dm_init * InitialNConcentration, double.MinValue, Live.N);
            //double p_init = MathUtilities.Constrain(dm_init * SimplePart::c.p_init_conc, double.MinValue, Green.P);

            double retain_fr_green = MathUtilities.Divide(dm_init, Live.Wt, 0.0);
            double retain_fr_sen = 0.0;

            double dlt_dm_harvest = Live.Wt + Dead.Wt - dm_init;
            double dlt_n_harvest = Live.N + Dead.N - n_init;
            //double dlt_p_harvest = Green.P + Senesced.P - p_init;

            Dead = Dead * retain_fr_sen;
            Live.StructuralWt = Live.Wt * retain_fr_green;
            Live.StructuralN = n_init;
            //Green.P = p_init;

            int i = Util.IncreaseSizeOfBiomassRemoved(BiomassRemoved);
            BiomassRemoved.dm_type[i] = Name;
            BiomassRemoved.fraction_to_residue[i] = (float)(1.0 - Harvest.Remove);
            BiomassRemoved.dlt_crop_dm[i] = (float)(dlt_dm_harvest * Conversions.gm2kg / Conversions.sm2ha);
            BiomassRemoved.dlt_dm_n[i] = (float)(dlt_n_harvest * Conversions.gm2kg / Conversions.sm2ha);
            //BiomassRemoved.dlt_dm_p[i] = (float)(dlt_p_harvest * Conversions.gm2kg / Conversions.sm2ha);

            InitialiseAreas();
        }
Ejemplo n.º 3
0
        /// <summary>Event handler for the Harvest event - normally comes from Manager.</summary>
        /// <param name="Harvest">The harvest.</param>
        /// <exception cref="System.Exception">
        /// Harvest remove fraction needs to be between 0 and 1
        /// or
        /// Harvest height needs to be between 0 and 1000
        /// </exception>
        public void OnHarvest(HarvestType Harvest)
        {
            WriteHarvestReport();

            // Tell the rest of the system we are about to harvest
            if (Harvesting != null)
                Harvesting.Invoke(this, new EventArgs());

            // Check some bounds
            if (Harvest.Remove < 0 || Harvest.Remove > 1.0)
                throw new Exception("Harvest remove fraction needs to be between 0 and 1");
            if (Harvest.Height < 0 || Harvest.Height > 1000.0)
                throw new Exception("Harvest height needs to be between 0 and 1000");

            // Set the population denisty if one was provided by user.
            if (Harvest.Plants != 0)
                Population.Density = Harvest.Plants;

            // Call each organ's OnHarvest. They fill a BiomassRemoved structure. We then publish a
            // BiomassRemoved event.
            BiomassRemovedType BiomassRemovedData = new BiomassRemovedType();
            foreach (Organ1 Organ in Organ1s)
                Organ.OnHarvest(Harvest, BiomassRemovedData);
            BiomassRemovedData.crop_type = CropType;
            BiomassRemoved.Invoke(BiomassRemovedData);
            WriteBiomassRemovedReport(BiomassRemovedData);

            // now update new canopy covers
            PlantSpatial.Density = Population.Density;
            PlantSpatial.CanopyWidth = Leaf.width;
            foreach (Organ1 Organ in Organ1s)
                Organ.DoCover();

            foreach (Organ1 Organ in Organ1s)
                Organ.DoNConccentrationLimits();

            foreach (Organ1 Organ in Organ1s)
                Organ.OnHarvest(Harvest, BiomassRemovedData);
        }
Ejemplo n.º 4
0
        /// <summary>Called when [harvest].</summary>
        /// <param name="Harvest">The harvest.</param>
        /// <param name="BiomassRemoved">The biomass removed.</param>
        public override void OnHarvest(HarvestType Harvest, BiomassRemovedType BiomassRemoved)
        {
            // Some biomass is removed according to harvest height
            FractionHeightRemoved = MathUtilities.Divide(Harvest.Height, Height, 0.0);

            double chop_fr_green = (1.0 - RetainFraction.Value);
            double chop_fr_sen = (1.0 - RetainFraction.Value);

            double dlt_dm_harvest = Live.Wt * chop_fr_green
                                 + Dead.Wt * chop_fr_sen;

            double dlt_n_harvest = Live.N * chop_fr_green
                                + Dead.N * chop_fr_sen;

            //double dlt_p_harvest = Green.P * chop_fr_green
            //                    + Senesced.P * chop_fr_sen;

            Dead = Dead * RetainFraction.Value;
            Live = Live * RetainFraction.Value;

            Height = MathUtilities.Constrain(Harvest.Height, 1.0, double.MaxValue);

            int i = Util.IncreaseSizeOfBiomassRemoved(BiomassRemoved);
            BiomassRemoved.dm_type[i] = Name;
            BiomassRemoved.fraction_to_residue[i] = (float)(1.0 - Harvest.Remove);
            BiomassRemoved.dlt_crop_dm[i] = (float)(dlt_dm_harvest * Conversions.gm2kg / Conversions.sm2ha);
            BiomassRemoved.dlt_dm_n[i] = (float)(dlt_n_harvest * Conversions.gm2kg / Conversions.sm2ha);
            //BiomassRemoved.dlt_dm_p[i] = (float)(dlt_p_harvest * Conversions.gm2kg / Conversions.sm2ha);
        }
Ejemplo n.º 5
0
        /// <summary>Called when [harvest].</summary>
        /// <param name="Harvest">The harvest.</param>
        /// <param name="BiomassRemoved">The biomass removed.</param>
        public override void OnHarvest(HarvestType Harvest, BiomassRemovedType BiomassRemoved)
        {
            Biomass Dead;
            Dead = Live * DieBackFraction;

            // however dead roots have a given N concentration
            Dead.StructuralN = Dead.Wt * NSenescenceConcentration;

            Live = Live - Dead;
            Dead = Dead + Dead;

            int i = Util.IncreaseSizeOfBiomassRemoved(BiomassRemoved);

            // Unlike above ground parts, no roots go to surface residue module.
            BiomassRemoved.dm_type[i] = Name;
            BiomassRemoved.fraction_to_residue[i] = 0.0F;
            BiomassRemoved.dlt_crop_dm[i] = 0.0F;
            BiomassRemoved.dlt_dm_n[i] = 0.0F;
            BiomassRemoved.dlt_dm_p[i] = 0.0F;
        }
Ejemplo n.º 6
0
        /// <summary>Called when [harvest].</summary>
        /// <param name="Harvest">The harvest.</param>
        /// <param name="BiomassRemoved">The biomass removed.</param>
        public override void OnHarvest(HarvestType Harvest, BiomassRemovedType BiomassRemoved)
        {
            int i = Util.IncreaseSizeOfBiomassRemoved(BiomassRemoved);
            BiomassRemoved.dm_type[i] = "meal";
            BiomassRemoved.fraction_to_residue[i] = 0.0F;
            BiomassRemoved.dlt_crop_dm[i] = (float)((Live.Wt + Dead.Wt) * Conversions.gm2kg / Conversions.sm2ha);
            BiomassRemoved.dlt_dm_n[i] = (float)((Live.N + Dead.N) * Conversions.gm2kg / Conversions.sm2ha);
            //BiomassRemoved.dlt_dm_p[i] = (float)((Green.P + Senesced.P) * Conversions.gm2kg / Conversions.sm2ha);

            Live.Clear();
            Dead.Clear();
        }