Esempio n. 1
0
        /// <inheritdoc/>
        public void UpdatePartialPressures(AssimilationPathway pathway, TemperatureResponse leaf, AssimilationFunction function)
        {
            var cm = pathway.MesophyllCO2;
            var cc = pathway.ChloroplasticCO2;
            var oc = pathway.ChloroplasticO2;

            UpdateMesophyllCO2(pathway, leaf);
            UpdateChloroplasticO2(pathway);
            UpdateChloroplasticCO2(pathway, function);

            pathway.MesophyllCO2     = (pathway.MesophyllCO2 + cm) / 2.0;
            pathway.ChloroplasticCO2 = (pathway.ChloroplasticCO2 + cc) / 2.0;
            pathway.ChloroplasticO2  = (pathway.ChloroplasticO2 + oc) / 2.0;
        }
Esempio n. 2
0
 /// <summary>
 /// Factory method for accessing the different possible terms for assimilation
 /// </summary>
 public AssimilationFunction GetFunction(AssimilationPathway pathway, TemperatureResponse leaf)
 {
     if (pathway.Type == PathwayType.Ac1)
     {
         return(GetAc1Function(pathway, leaf));
     }
     else if (pathway.Type == PathwayType.Ac2)
     {
         return(GetAc2Function(pathway, leaf));
     }
     else
     {
         return(GetAjFunction(pathway, leaf));
     }
 }
Esempio n. 3
0
        /// <inheritdoc/>
        protected override AssimilationFunction GetAc2Function(AssimilationPathway pathway, TemperatureResponse leaf)
        {
            var a  = 0.1 / (canopy.DiffusivitySolubilityRatio * pathway.Gbs);
            var cc = pathway.ChloroplasticCO2;
            var oc = pathway.ChloroplasticO2;

            var x = new Terms()
            {
                _1 = leaf.VcMaxT,
                _2 = leaf.Kc + canopy.AirO2 * (leaf.Kc / leaf.Ko),
                _3 = 0.0,
                _4 = pathway.Vpr - cc * leaf.VcMaxT / (cc + leaf.Kc * (1 + oc / leaf.Ko)),
                _5 = 0.0,
                _6 = 1.0,
                _7 = a * leaf.Gamma,
                _8 = leaf.Gamma * canopy.AirO2,
                _9 = (leaf.Kc / leaf.Ko) * a
            };


            var func = new AssimilationFunction()
            {
                x = x,

                MesophyllRespiration    = leaf.GmRd,
                BundleSheathConductance = pathway.Gbs,
                Respiration             = leaf.RdT
            };

            return(func);
        }
Esempio n. 4
0
 /// <inheritdoc/>
 protected override void UpdateMesophyllCO2(AssimilationPathway pathway, TemperatureResponse leaf)
 {
     pathway.MesophyllCO2 = pathway.IntercellularCO2 - pathway.CO2Rate / leaf.GmT;
 }
Esempio n. 5
0
        /// <inheritdoc/>
        protected override AssimilationFunction GetAjFunction(AssimilationPathway pathway, TemperatureResponse leaf)
        {
            var a  = 0.1 / (canopy.DiffusivitySolubilityRatio * pathway.Gbs);
            var y  = parameters.MesophyllElectronTransportFraction;
            var z  = parameters.ATPProductionElectronTransportFactor;
            var cc = pathway.ChloroplasticCO2;
            var oc = pathway.ChloroplasticO2;

            var x = new Terms()
            {
                _1 = (1 - y) * z * leaf.J / 3.0,
                _2 = canopy.AirO2 * (7.0 / 3.0) * leaf.Gamma,
                _3 = 0.0,
                _4 = (y * z * leaf.J / parameters.ExtraATPCost) - cc * (1 - y) * z * leaf.J / (3 * cc + 7 * leaf.Gamma * oc),
                _5 = 0.0,
                _6 = 1.0,
                _7 = a * leaf.Gamma,
                _8 = leaf.Gamma * canopy.AirO2,
                _9 = (7.0 / 3.0) * leaf.Gamma * a
            };

            var func = new AssimilationFunction()
            {
                x = x,

                MesophyllRespiration    = leaf.GmRd,
                BundleSheathConductance = pathway.Gbs,
                Respiration             = leaf.RdT
            };

            return(func);
        }
Esempio n. 6
0
 /// <summary>
 /// Retrieves a function describing assimilation along the Ac1 pathway
 /// </summary>
 protected abstract AssimilationFunction GetAc1Function(AssimilationPathway pathway, TemperatureResponse leaf);
Esempio n. 7
0
 /// <summary>
 /// Updates the mesophyll CO2 parameter
 /// </summary>
 protected virtual void UpdateMesophyllCO2(AssimilationPathway pathway, TemperatureResponse leaf)
 { /*C4 & CCM overwrite this.*/
 }
Esempio n. 8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="CP"></param>
        /// <param name="PP"></param>
        /// <param name="DOY"></param>
        /// <param name="latitude"></param>
        /// <param name="maxT"></param>
        /// <param name="minT"></param>
        /// <param name="radn"></param>
        /// <param name="rpar"></param>
        /// <returns></returns>
        public static DCAPSTModel SetUpModel(
            ICanopyParameters CP,
            IPathwayParameters PP,
            int DOY,
            double latitude,
            double maxT,
            double minT,
            double radn,
            double rpar)
        {
            // Model the solar geometry
            var SG = new SolarGeometry
            {
                Latitude  = latitude.ToRadians(),
                DayOfYear = DOY
            };

            // Model the solar radiation
            var SR = new SolarRadiation(SG)
            {
                Daily = radn,
                RPAR  = rpar
            };

            // Model the environmental temperature
            var TM = new Temperature(SG)
            {
                MaxTemperature      = maxT,
                MinTemperature      = minT,
                AtmosphericPressure = 1.01325
            };

            // Model the pathways
            var SunlitAc1 = new AssimilationPathway(CP, PP);
            var SunlitAc2 = new AssimilationPathway(CP, PP);
            var SunlitAj  = new AssimilationPathway(CP, PP);

            var ShadedAc1 = new AssimilationPathway(CP, PP);
            var ShadedAc2 = new AssimilationPathway(CP, PP);
            var ShadedAj  = new AssimilationPathway(CP, PP);

            // Model the canopy
            IAssimilation A;

            if (CP.Type == CanopyType.C3)
            {
                A = new AssimilationC3(CP, PP);
            }
            else if (CP.Type == CanopyType.C4)
            {
                A = new AssimilationC4(CP, PP);
            }
            else
            {
                A = new AssimilationCCM(CP, PP);
            }

            var sunlit = new AssimilationArea(SunlitAc1, SunlitAc2, SunlitAj, A);
            var shaded = new AssimilationArea(ShadedAc1, ShadedAc2, ShadedAj, A);
            var CA     = new CanopyAttributes(CP, PP, sunlit, shaded);

            // Model the transpiration
            var WI = new WaterInteraction(TM);
            var TR = new TemperatureResponse(CP, PP);
            var TS = new Transpiration(CP, PP, WI, TR);

            // Model the photosynthesis
            var DM = new DCAPSTModel(SG, SR, TM, PP, CA, TS)
            {
                B = 0.409
            };

            return(DM);
        }
Esempio n. 9
0
        /// <inheritdoc/>
        protected override AssimilationFunction GetAjFunction(AssimilationPathway pathway, TemperatureResponse leaf)
        {
            var x = new Terms()
            {
                _1 = leaf.J / 4.0,
                _2 = 2.0 * leaf.Gamma * canopy.AirO2,
                _3 = 0.0,
                _4 = 0.0,
                _5 = 0.0,
                _6 = 0.0,
                _7 = 0.0,
                _8 = canopy.AirO2 * leaf.Gamma,
                _9 = 0.0
            };

            var func = new AssimilationFunction()
            {
                x = x,

                MesophyllRespiration    = leaf.GmRd,
                BundleSheathConductance = 1.0,
                Respiration             = leaf.RdT
            };

            return(func);
        }
Esempio n. 10
0
 /// <inheritdoc/>
 protected override AssimilationFunction GetAc2Function(AssimilationPathway pathway, TemperatureResponse leaf)
 {
     throw new Exception("The C3 model does not use the Ac2 pathway");
 }
Esempio n. 11
0
        /// <inheritdoc/>
        protected override AssimilationFunction GetAc1Function(AssimilationPathway pathway, TemperatureResponse leaf)
        {
            var x = new Terms()
            {
                _1 = leaf.VcMaxT,
                _2 = leaf.Kc + canopy.AirO2 * leaf.Kc / leaf.Ko,
                _3 = 0.0,
                _4 = 0.0,
                _5 = 0.0,
                _6 = 0.0,
                _7 = 0.0,
                _8 = canopy.AirO2 * leaf.Gamma,
                _9 = 0.0
            };

            var param = new AssimilationFunction()
            {
                x = x,
                MesophyllRespiration    = leaf.GmRd,
                BundleSheathConductance = 1.0,
                Respiration             = leaf.RdT
            };

            return(param);
        }
Esempio n. 12
0
        /// <inheritdoc/>
        protected override AssimilationFunction GetAjFunction(AssimilationPathway pathway, TemperatureResponse leaf)
        {
            var alpha = 0.1 / (canopy.DiffusivitySolubilityRatio * pathway.Gbs);
            var x     = new Terms()
            {
                _1 = (1.0 - parameters.MesophyllElectronTransportFraction) * leaf.J / 3.0,
                _2 = canopy.AirO2 * (7.0 / 3.0) * leaf.Gamma,
                _3 = 0.0,
                _4 = parameters.MesophyllElectronTransportFraction * leaf.J / parameters.ExtraATPCost,
                _5 = 1.0,
                _6 = 1.0,
                _7 = alpha * leaf.Gamma,
                _8 = leaf.Gamma * canopy.AirO2,
                _9 = (7.0 / 3.0) * leaf.Gamma * alpha
            };

            var func = new AssimilationFunction()
            {
                x = x,

                MesophyllRespiration    = leaf.GmRd,
                BundleSheathConductance = pathway.Gbs,
                Respiration             = leaf.RdT
            };

            return(func);
        }
Esempio n. 13
0
        /// <inheritdoc/>
        protected override AssimilationFunction GetAc1Function(AssimilationPathway pathway, TemperatureResponse leaf)
        {
            var alpha = 0.1 / (canopy.DiffusivitySolubilityRatio * pathway.Gbs);
            var x     = new Terms()
            {
                _1 = leaf.VcMaxT,
                _2 = leaf.Kc + canopy.AirO2 * (leaf.Kc / leaf.Ko),
                _3 = leaf.VpMaxT / (pathway.MesophyllCO2 + leaf.Kp),
                _4 = 0.0,
                _5 = 1.0,
                _6 = 1.0,
                _7 = alpha * leaf.Gamma,
                _8 = leaf.Gamma * canopy.AirO2,
                _9 = (leaf.Kc / leaf.Ko) * alpha
            };

            var func = new AssimilationFunction()
            {
                x = x,

                MesophyllRespiration    = leaf.GmRd,
                BundleSheathConductance = pathway.Gbs,
                Respiration             = leaf.RdT
            };

            return(func);
        }