Example #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;
        }
Example #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));
     }
 }
Example #3
0
        /// <inheritdoc/>
        protected override AssimilationFunction GetAc2Function(AssimilationPathway pathway, TemperatureResponse leaf)
        {
            var x = new double[9];

            x[0] = leaf.VcMaxT;
            x[1] = leaf.Kc / leaf.Ko;
            x[2] = leaf.Kc;
            x[3] = 0.0;
            x[4] = pathway.Vpr;
            x[5] = 0.0;
            x[6] = pathway.ChloroplasticCO2 * leaf.VcMaxT / (pathway.ChloroplasticCO2 + leaf.Kc * (1 + pathway.ChloroplasticO2 / leaf.Ko));
            x[7] = 1.0;
            x[8] = 1.0;

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

                MesophyllRespiration                 = leaf.GmRd,
                HalfRubiscoSpecificityReciprocal     = leaf.Gamma,
                FractionOfDiffusivitySolubilityRatio = 0.1 / canopy.DiffusivitySolubilityRatio,
                BundleSheathConductance              = pathway.Gbs,
                Oxygen      = canopy.AirO2,
                Respiration = leaf.RdT
            };

            return(func);
        }
Example #4
0
 /// <inheritdoc/>
 protected override void UpdateMesophyllCO2(AssimilationPathway pathway, TemperatureResponse leaf)
 {
     pathway.MesophyllCO2 = pathway.IntercellularCO2 - pathway.CO2Rate / leaf.GmT;
 }
Example #5
0
        /// <inheritdoc/>
        protected override AssimilationFunction GetAjFunction(AssimilationPathway pathway, TemperatureResponse leaf)
        {
            var x = new double[9];

            x[0] = (1 - parameters.MesophyllElectronTransportFraction) * parameters.ATPProductionElectronTransportFactor * leaf.J / 3.0;
            x[1] = 7.0 / 3.0 * leaf.Gamma;
            x[2] = 0.0;
            x[3] = 0.0;
            x[4] = parameters.MesophyllElectronTransportFraction * parameters.ATPProductionElectronTransportFactor * leaf.J / parameters.ExtraATPCost;
            x[5] = 0.0;
            x[6] = pathway.ChloroplasticCO2 * (1 - parameters.MesophyllElectronTransportFraction) * parameters.ATPProductionElectronTransportFactor * leaf.J / (3 * pathway.ChloroplasticCO2 + 7 * leaf.Gamma * pathway.ChloroplasticO2);
            x[7] = 1.0;
            x[8] = 1.0;

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

                MesophyllRespiration                 = leaf.GmRd,
                HalfRubiscoSpecificityReciprocal     = leaf.Gamma,
                FractionOfDiffusivitySolubilityRatio = 0.1 / canopy.DiffusivitySolubilityRatio,
                BundleSheathConductance              = pathway.Gbs,
                Oxygen      = canopy.AirO2,
                Respiration = leaf.RdT
            };

            return(func);
        }
Example #6
0
 /// <summary>
 /// Retrieves a function describing assimilation along the Ac2 pathway
 /// </summary>
 protected abstract AssimilationFunction GetAc2Function(AssimilationPathway pathway, TemperatureResponse leaf);
Example #7
0
 /// <summary>
 /// Updates the mesophyll CO2 parameter
 /// </summary>
 protected virtual void UpdateMesophyllCO2(AssimilationPathway pathway, TemperatureResponse leaf)
 { /*C4 & CCM overwrite this.*/
 }
Example #8
0
 /// <inheritdoc/>
 protected override AssimilationFunction GetAc2Function(AssimilationPathway pathway, TemperatureResponse leaf)
 {
     throw new Exception("The C3 model does not use the Ac2 pathway");
 }
Example #9
0
        /// <inheritdoc/>
        protected override AssimilationFunction GetAjFunction(AssimilationPathway pathway, TemperatureResponse leaf)
        {
            var x = new double[9];

            x[0] = leaf.J / 4.0;
            x[1] = 2.0 * leaf.Gamma;
            x[2] = 0.0;
            x[3] = 0.0;
            x[4] = 0.0;
            x[5] = 0.0;
            x[6] = 0.0;
            x[7] = 0.0;
            x[8] = 0.0;

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

                MesophyllRespiration                 = leaf.GmRd,
                HalfRubiscoSpecificityReciprocal     = leaf.Gamma,
                FractionOfDiffusivitySolubilityRatio = 0.0,
                BundleSheathConductance              = 1.0,
                Oxygen      = canopy.AirO2,
                Respiration = leaf.RdT
            };

            return(func);
        }
Example #10
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);
        }
Example #11
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);
        }
Example #12
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);
        }
Example #13
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);
        }
Example #14
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);
        }
Example #15
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);
        }
Example #16
0
 /// <inheritdoc/>
 public void UpdatePartialPressures(AssimilationPathway pathway, TemperatureResponse leaf, AssimilationFunction function)
 {
     UpdateMesophyllCO2(pathway, leaf);
     UpdateChloroplasticO2(pathway);
     UpdateChloroplasticCO2(pathway, function);
 }