Exemplo n.º 1
0
 //---------------------------------------------------------------------------------------------------------
 public void CalcPRate25(LeafCanopy canopy, SunlitShadedCanopy sunlit, PhotosynthesisModel PM)
 {
     for (int i = 0; i < _nLayers; i++)
     {
         VpMax25[i] = canopy.VpMax25[i] - sunlit.VpMax25[i];
     }
 }
Exemplo n.º 2
0
        //--------------------------------------------------------------

        public double calcAj(LeafCanopy canopy, SunlitShadedCanopy s, int layer)
        {
            double x1 = (1 - canopy.CPath.x) * s.J[layer] / 3.0;
            double x2 = 7.0 / 3.0 * s.g_[layer];
            double x3 = 0;
            double x4 = 0;
            double x5 = canopy.CPath.x * s.J[layer] / 2.0;

            double a, b, c, d;

            double Ci = canopy.CPath.CiCaRatio * canopy.Ca;

            double g_m  = s.gm_CO2T[layer];
            double g_bs = s.gbs[layer];
            double α    = canopy.alpha;
            double R_d  = s.RdT[layer];
            double γ_   = s.g_[layer];
            double O_m  = s.Om[layer];
            double R_m  = s.Rm[layer];

            a = -Ci * 0.047 * g_m * g_bs - Ci * 0.047 * g_m * x4 - α * g_m * R_d * x2 - α * g_m * γ_ * x1 - O_m * 0.047 * g_m * g_bs * x2 - 0.047 * g_m * g_bs * x3 +
                0.047 * g_m * R_m + 0.047 * g_m * R_d - 0.047 * g_m * x1 - 0.047 * g_m * x5 + 0.047 * g_bs * R_d -
                0.047 * g_bs * x1 + 0.047 * R_d * x4 - 0.047 * x1 * x4; // Eq   (A56)
            b = (-α * g_m * x2 + 0.047 * g_m + 0.047 * g_bs + 0.047 * x4) *
                (-Ci * 0.047 * g_m * g_bs * R_d + Ci * 0.047 * g_m * g_bs * x1 - Ci * 0.047 * g_m * R_d * x4 + Ci * 0.047 * g_m * x1 * x4 -
                 O_m * 0.047 * g_m * g_bs * R_d * x2 - 0.047 * g_m * g_bs * R_d * x3 - O_m * 0.047 * g_m * g_bs * γ_ * x1 +
                 0.047 * g_m * R_m - 0.047 * g_m * R_m * x1 - 0.047 * g_m * R_d * x5 + 0.047 * g_m * x1 * x5); // Eq	(A57)
            c = Ci * 0.047 * g_m * g_bs + Ci * 0.047 * g_m * x4 + α * g_m * R_d * x2 + α * g_m * γ_ * x1 + O_m * 0.047 * g_m * g_bs * x2 +
                0.047 * g_m * g_bs * x3 - 0.047 * g_m * R_m - 0.047 * g_m * R_d + 0.047 * g_m * x1 + 0.047 * g_m * x5 - 0.047 * g_bs * R_d +
                0.047 * g_bs * x1 - 0.047 * R_d * x4 + 0.047 * x1 * x4;   // Eq(A58)
            d = -α * g_m * x2 + 0.047 * g_m + 0.047 * g_bs + 0.047 * x4;  // Eq (A59)


            return((-1 * Math.Pow((Math.Pow(a, 2) - 4 * b), 0.5) + c) / (2 * d)); //Eq (A55)
        }
Exemplo n.º 3
0
 //---------------------------------------------------------------------------------------------------------
 public void calcElectronTransportRate25(LeafCanopy canopy, SunlitShadedCanopy sunlit, PhotosynthesisModel PM)
 {
     for (int i = 0; i < _nLayers; i++)
     {
         JMax25[i] = canopy.JMax25[i] - sunlit.JMax25[i];
     }
 }
Exemplo n.º 4
0
 //---------------------------------------------------------------------------------------------------------
 public override void calcMaxRates(LeafCanopy canopy, SunlitShadedCanopy counterpart, PhotosynthesisModel PM)
 {
     calcRubiscoActivity25(canopy, counterpart, PM);
     calcElectronTransportRate25(canopy, counterpart, PM);
     calcRdActivity25(canopy, counterpart, PM);
     calcPRate25(canopy, counterpart, PM);
 }
Exemplo n.º 5
0
        //---------------------------------------------------------------------------------------------------------
        public double calcLeafTemperature(PhotosynthesisModel PM, int layer, double _leafTemp)
        {
            EnvironmentModel EM     = PM.envModel;
            LeafCanopy       canopy = PM.canopy;

            double airTemp = EM.getTemp(PM.time);

            s[layer] = (es[layer] - canopy.es_Ta) / (leafTemp[layer] - EM.maxT);

            gs[layer] = gs_CO2[layer] / canopy.ra;

            rs_H2O[layer] = (1 / gs[layer] - 1.3 * canopy.rb_H_LAIs[layer] - canopy.rts[layer]) / 1.6;

            Sn[layer] = canopy.energyConvRatio * absorbedIrradiance[layer];

            R_[layer] = canopy.Bz * Math.Pow((leafTemp[layer] + 273), 4) * canopy.fvap * canopy.fclear * LAIS[layer] / canopy.LAIs.Sum();

            Rn[layer] = Sn[layer] - R_[layer];

            lE[layer] = (s[layer] * Rn[layer] + canopy.airDensity * canopy.cp * VPD[layer] / (canopy.rb_H_LAIs[layer] + canopy.rts[layer])) /
                        (s[layer] + canopy.g * ((canopy.rb_H2O_LAIs[layer] + canopy.rts[layer] + rs_H2O[layer]) / (canopy.rb_H_LAIs[layer] + canopy.rts[layer])));

            double calcLeafTemp = airTemp + (canopy.rb_H_LAIs[layer] + canopy.rts[layer]) * (Rn[layer] - lE[layer]) / (canopy.airDensity * canopy.cp);

            //return Math.Pow(1 - _leafTemp / calcLeafTemp, 2);
            return(Math.Pow(_leafTemp - calcLeafTemp, 2));
        }
Exemplo n.º 6
0
 //----------------------------------------------------------------------
 public override void calcAbsorbedRadiation(EnvironmentModel EM, LeafCanopy canopy, SunlitShadedCanopy sunlit)
 {
     for (int i = 0; i < _nLayers; i++)
     {
         absorbedIrradiance[i] = canopy.absorbedRadiation[i] - sunlit.absorbedIrradiance[i];
     }
 }
Exemplo n.º 7
0
 //----------------------------------------------------------------------
 public void calcRubiscoActivity25(LeafCanopy canopy, SunlitShadedCanopy sunlit, PhotosynthesisModel PM)
 {
     for (int i = 0; i < _nLayers; i++)
     {
         VcMax25[i] = canopy.VcMax25[i] - sunlit.VcMax25[i];
     }
 }
Exemplo n.º 8
0
 //----------------------------------------------------------------------
 public void CalcRdActivity25(LeafCanopy canopy, SunlitShadedCanopy sunlit, PhotosynthesisModel PM)
 {
     for (int i = 0; i < _nLayers; i++)
     {
         Rd25[i] = canopy.Rd25[i] - sunlit.Rd25[i];
     }
 }
Exemplo n.º 9
0
 //----------------------------------------------------------------------
 public override void CalcIncidentRadiation(EnvironmentModel EM, LeafCanopy canopy, SunlitShadedCanopy sunlit)
 {
     for (int i = 0; i < _nLayers; i++)
     {
         IncidentIrradiance[i] = EM.DiffuseRadiationPAR * canopy.PropnInterceptedRadns[i] / (sunlit.LAIS[i] + LAIS[i]) *
                                 LAIS[i] + 0.15 * (sunlit.IncidentIrradiance[i] * sunlit.LAIS[i]) / (LAIS[i] + (i < (_nLayers - 1) ? LAIS[i + 1] : 0)) * LAIS[i]; //+ *((E70*E44)/(E45+F45)
     }
 }
Exemplo n.º 10
0
 //---------------------------------------------------------------------------------------------------------
 public override void calcIncidentRadiation(EnvironmentModel EM, LeafCanopy canopy, SunlitShadedCanopy shaded)
 {
     for (int i = 0; i < _nLayers; i++)
     {
         incidentIrradiance[i] = EM.directRadiationPAR * canopy.propnInterceptedRadns[i] / LAIS[i] * LAIS[i] +
                                 EM.diffuseRadiationPAR * canopy.propnInterceptedRadns[i] / (LAIS[i] + shaded.LAIS[i]) * LAIS[i];
     }
 }
Exemplo n.º 11
0
        //--------------------------------------------------------------

        public double calcAc(LeafCanopy canopy, SunlitShadedCanopy s, int layer, double cm_, bool assimilation, bool AC1)
        {
            double x1 = s.VcMaxT[layer];
            double x2 = s.Kc[layer] / s.Ko[layer];
            double x3 = s.Kc[layer];

            double x4, x5;

            if (AC1)
            {
                x4 = s.VpMaxT[layer] / (cm_ + s.Kp[layer]); //Delta Eq (A56)
                x5 = 0;
            }
            else
            {
                x4 = 0;
                x5 = s.Vpr[layer];
            }

            double a, b, c, d;

            double Ci = canopy.CPath.CiCaRatio * canopy.Ca;

            double g_m  = s.gm_CO2T[layer];
            double g_bs = s.gbs[layer];
            double α    = canopy.alpha;
            double R_d  = s.RdT[layer];
            double γ_   = s.g_[layer];
            double O_m  = s.Om[layer];
            double R_m  = s.Rm[layer];

            double value;

            a = -Ci * 0.047 * g_m * g_bs - Ci * 0.047 * g_m * x4 - α * g_m * R_d * x2 - α * g_m * γ_ * x1 - O_m * 0.047 * g_m * g_bs * x2 - 0.047 * g_m * g_bs * x3 +
                0.047 * g_m * R_m + 0.047 * g_m * R_d - 0.047 * g_m * x1 - 0.047 * g_m * x5 + 0.047 * g_bs * R_d -
                0.047 * g_bs * x1 + 0.047 * R_d * x4 - 0.047 * x1 * x4;  // Eq   (A56)
            b = (-α * g_m * x2 + 0.047 * g_m + 0.047 * g_bs + 0.047 * x4) *
                (-Ci * 0.047 * g_m * g_bs * R_d + Ci * 0.047 * g_m * g_bs * x1 - Ci * 0.047 * g_m * R_d * x4 + Ci * 0.047 * g_m * x1 * x4 -
                 O_m * 0.047 * g_m * g_bs * R_d * x2 - 0.047 * g_m * g_bs * R_d * x3 - O_m * 0.047 * g_m * g_bs * γ_ * x1 +
                 0.047 * g_m * R_m - 0.047 * g_m * R_m * x1 - 0.047 * g_m * R_d * x5 + 0.047 * g_m * x1 * x5); // Eq	(A57)
            c = Ci * 0.047 * g_m * g_bs + Ci * 0.047 * g_m * x4 + α * g_m * R_d * x2 + α * g_m * γ_ * x1 + O_m * 0.047 * g_m * g_bs * x2 +
                0.047 * g_m * g_bs * x3 - 0.047 * g_m * R_m - 0.047 * g_m * R_d + 0.047 * g_m * x1 + 0.047 * g_m * x5 - 0.047 * g_bs * R_d +
                0.047 * g_bs * x1 - 0.047 * R_d * x4 + 0.047 * x1 * x4;                // Eq(A58)
            d = -α * g_m * x2 + 0.047 * g_m + 0.047 * g_bs + 0.047 * x4;               // Eq (A59)

            double ass = (-1 * Math.Pow((Math.Pow(a, 2) - 4 * b), 0.5) + c) / (2 * d); //Eq (A55)

            if (assimilation)
            {
                value = ass;
            }
            else
            {
                value = Ci - ass / g_m; //Eq 43
            }
            return(value);
        }
Exemplo n.º 12
0
 //---------------------------------------------------------------------------------------------------------
 void calcAbsorbedRadiationDirect(EnvironmentModel EM, LeafCanopy canopy)
 {
     for (int i = 0; i < _nLayers; i++)
     {
         absorbedRadiationDirect[i] = (1 - canopy.leafScatteringCoeffs[i]) * EM.directRadiationPAR *
                                      ((i == 0 ? 1 : Math.Exp(-canopy.beamExtCoeffs[i] * canopy.LAIAccums[i - 1])) -
                                       Math.Exp(-canopy.beamExtCoeffs[i] * canopy.LAIAccums[i]));
     }
 }
Exemplo n.º 13
0
        //---------------------------------------------------------------------------------------------------------
        public override void CalcLAI(LeafCanopy canopy, SunlitShadedCanopy sunlit)
        {
            LAIS = new double[canopy.NLayers];

            for (int i = 0; i < canopy.NLayers; i++)
            {
                LAIS[i] = canopy.LAIs[i] - sunlit.LAIS[i];
            }
        }
Exemplo n.º 14
0
 //---------------------------------------------------------------------------------------------------------
 public override void calcLAI(LeafCanopy canopy, SunlitShadedCanopy counterpart)
 {
     LAIS = new double[canopy.nLayers];
     for (int i = 0; i < canopy.nLayers; i++)
     {
         LAIS[i] = ((i == 0 ? 1 : Math.Exp(-canopy.beamExtCoeffs[i] * canopy.LAIAccums[i - 1])) -
                    Math.Exp(-canopy.beamExtCoeffs[i] * canopy.LAIAccums[i])) * 1 / canopy.beamExtCoeffs[i];
     }
 }
Exemplo n.º 15
0
        //--------------------------------------------------------------

        public override double calcAj(double Cc, LeafCanopy canopy, SunlitShadedCanopy s, int layer)
        {
            if (Cc == 0)
            {
                return(0);
            }
            return((1 - s.r_aj[layer] / Cc) * (1 - canopy.x) *
                   s.J[layer] / (3 * (1 + 7 * s.r_[layer] / (3 * Cc))) -
                   s.RdT[layer]);
        }
Exemplo n.º 16
0
        //---------------------------------------------------------------------------------------------------------
        public override void CalcConductanceResistance(PhotosynthesisModel PM, LeafCanopy canopy)
        {
            for (int i = 0; i < canopy.NLayers; i++)
            {
                Gbh[i] = 0.01 * Math.Pow((canopy.Us[i] / canopy.LeafWidth), 0.5) *
                         (1 - Math.Exp(-1 * (0.5 * canopy.Ku + canopy.Kb) * canopy.LAI)) / (0.5 * canopy.Ku + canopy.Kb);
            }

            base.CalcConductanceResistance(PM, canopy);
        }
Exemplo n.º 17
0
 //----------------------------------------------------------------------
 public void CalcRdActivity25(LeafCanopy canopy, SunlitShadedCanopy shaded, PhotosynthesisModel PM)
 {
     for (int i = 0; i < _nLayers; i++)
     {
         Rd25[i] = canopy.LAI * canopy.CPath.PsiRd * (canopy.LeafNTopCanopy - canopy.CPath.StructuralN) *
                   ((i == 0 ? 1 : Math.Exp(-(canopy.BeamExtCoeffs[i] + canopy.NAllocationCoeff / canopy.LAI) * canopy.LAIAccums[i - 1])) -
                    Math.Exp(-(canopy.BeamExtCoeffs[i] + canopy.NAllocationCoeff / canopy.LAI) * canopy.LAIAccums[i])) /
                   (canopy.NAllocationCoeff + canopy.BeamExtCoeffs[i] * canopy.LAI);
     }
 }
Exemplo n.º 18
0
 //---------------------------------------------------------------------------------------------------------
 public void calcPRate25(LeafCanopy canopy, SunlitShadedCanopy shaded, PhotosynthesisModel PM)
 {
     for (int i = 0; i < _nLayers; i++)
     {
         VpMax25[i] = canopy.LAI * canopy.CPath.psiVp * (canopy.leafNTopCanopy - canopy.CPath.structuralN) *
                      ((i == 0 ? 1 : Math.Exp(-(canopy.beamExtCoeffs[i] + canopy.NAllocationCoeff / canopy.LAI) * canopy.LAIAccums[i - 1])) -
                       Math.Exp(-(canopy.beamExtCoeffs[i] + canopy.NAllocationCoeff / canopy.LAI) * canopy.LAIAccums[i])) /
                      (canopy.NAllocationCoeff + canopy.beamExtCoeffs[i] * canopy.LAI);
     }
 }
Exemplo n.º 19
0
 //---------------------------------------------------------------------------------------------------------
 void calcAbsorbedRadiationDiffuse(EnvironmentModel EM, LeafCanopy canopy)
 {
     for (int i = 0; i < _nLayers; i++)
     {
         absorbedRadiationDiffuse[i] = (1 - canopy.diffuseReflectionCoeffs[i]) * EM.diffuseRadiationPAR *
                                       ((i == 0 ? 1 : Math.Exp(-(canopy.diffuseScatteredDiffuses[i] + canopy.beamExtCoeffs[i]) * canopy.LAIAccums[i - 1])) -
                                        Math.Exp(-(canopy.diffuseScatteredDiffuses[i] + canopy.beamExtCoeffs[i]) * canopy.LAIAccums[i])) * (canopy.diffuseScatteredDiffuses[i] /
                                                                                                                                            (canopy.diffuseScatteredDiffuses[i] + canopy.beamExtCoeffs[i]));
     }
 }
Exemplo n.º 20
0
        //---------------------------------------------------------------------------------------------------------

        public override void calcAbsorbedRadiation(EnvironmentModel EM, LeafCanopy canopy, SunlitShadedCanopy shaded)
        {
            calcAbsorbedRadiationDirect(EM, canopy);
            calcAbsorbedRadiationDiffuse(EM, canopy);
            calcAbsorbedRadiationScattered(EM, canopy);

            for (int i = 0; i < _nLayers; i++)
            {
                absorbedIrradiance[i] = absorbedRadiationDirect[i] + absorbedRadiationDiffuse[i] + absorbedRadiationScattered[i];
            }
        }
Exemplo n.º 21
0
        //---------------------------------------------------------------------------------------------------------
        public void calcPhotosynthesis(PhotosynthesisModel PM, int layer)
        {
            LeafCanopy canopy = PM.canopy;

            leafTemp[layer] = PM.envModel.getTemp(PM.time);

            double vpd = PM.envModel.getVPD(PM.time);

            canopy.CPath.CiCaRatio = canopy.CPath.CiCaRatioSlope * vpd + canopy.CPath.CiCaRatioIntercept;

            VcMaxT[layer] = TempFunctionExp.val(leafTemp[layer], VcMax25[layer], canopy.CPath.VcMax_c, canopy.CPath.VcMax_b);
            RdT[layer]    = TempFunctionExp.val(leafTemp[layer], Rd25[layer], canopy.CPath.Rd_c, canopy.CPath.Rd_b);
            JMaxT[layer]  = TempFunction.val(leafTemp[layer], JMax25[layer], canopy.CPath.JMax_TOpt, canopy.CPath.JMax_Omega);
            VpMaxT[layer] = TempFunctionExp.val(leafTemp[layer], VpMax25[layer], canopy.CPath.VpMax_c, canopy.CPath.VpMax_b);

            Vpr[layer] = canopy.Vpr_l * LAIS[layer];

            //TODO: I2 = canopy.ja * absorbedIrradiance[layer]
            canopy.ja = (1 - canopy.f) / 2;

            J[layer] = (canopy.ja * absorbedIrradiance[layer] + JMaxT[layer] - Math.Pow(Math.Pow(canopy.ja * absorbedIrradiance[layer] + JMaxT[layer], 2) -
                                                                                        4 * canopy.θ * JMaxT[layer] * canopy.ja * absorbedIrradiance[layer], 0.5)) / (2 * canopy.θ);

            Kc[layer]   = TempFunctionExp.val(leafTemp[layer], canopy.CPath.Kc_P25, canopy.CPath.Kc_c, canopy.CPath.Kc_b);
            Ko[layer]   = TempFunctionExp.val(leafTemp[layer], canopy.CPath.Ko_P25, canopy.CPath.Ko_c, canopy.CPath.Ko_b);
            VcVo[layer] = TempFunctionExp.val(leafTemp[layer], canopy.CPath.VcMax_VoMax_P25, canopy.CPath.VcMax_VoMax_c, canopy.CPath.VcMax_VoMax_b);

            ScO[layer] = Ko[layer] / Kc[layer] * VcVo[layer];

            g_[layer] = 0.5 / ScO[layer];

            canopy.Sco = ScO[layer]; //For reporting ???

            K_[layer] = Kc[layer] * (1 + canopy.oxygenPartialPressure / Ko[layer]);

            es[layer] = 5.637E-7 * Math.Pow(leafTemp[layer], 4) + 1.728E-5 * Math.Pow(leafTemp[layer], 3) + 1.534E-3 *
                        Math.Pow(leafTemp[layer], 2) + 4.424E-2 * leafTemp[layer] + 6.095E-1;

            canopy.airDensity = 1.295 * Math.Exp(-3.6E-3 * PM.envModel.getTemp(PM.time));

            canopy.ra = canopy.airDensity * 1000.0 / 28.966;


            VPD[layer] = PM.envModel.getVPD(PM.time);

            fVPD[layer] = canopy.a / (1 + VPD[layer] / canopy.Do);

            gs[layer] = fVPD[layer];

            gm_CO2T[layer] = LAIS[layer] * TempFunction.val(leafTemp[layer], canopy.CPath.gm_P25, canopy.CPath.gm_TOpt, canopy.CPath.gm_Omega);

            gb_CO2[layer] = 1 / canopy.rb_CO2s[layer] * LAIS[layer] * canopy.ra;
        }
Exemplo n.º 22
0
        //---------------------------------------------------------------------------------------------------------

        public override void CalcAbsorbedRadiation(EnvironmentModel EM, LeafCanopy canopy, SunlitShadedCanopy shaded)
        {
            CalcAbsorbedRadiationDirect(EM, canopy);
            CalcAbsorbedRadiationDiffuse(EM, canopy);
            CalcAbsorbedRadiationScattered(EM, canopy);

            for (int i = 0; i < _nLayers; i++)
            {
                AbsorbedIrradiance[i]    = AbsorbedRadiationDirect[i] + AbsorbedRadiationDiffuse[i] + AbsorbedRadiationScattered[i];
                AbsorbedIrradiancePAR[i] = AbsorbedRadiationDirectPAR[i] + AbsorbedRadiationDiffusePAR[i] + AbsorbedRadiationScatteredPAR[i];
                AbsorbedIrradianceNIR[i] = AbsorbedRadiationDirectNIR[i] + AbsorbedRadiationDiffuseNIR[i] + AbsorbedRadiationScatteredNIR[i];
            }
        }
Exemplo n.º 23
0
        //---------------------------------------------------------------------------------------------------------

        void CalcAbsorbedRadiationScattered(EnvironmentModel EM, LeafCanopy canopy)
        {
            for (int i = 0; i < _nLayers; i++)
            {
                if (canopy.BeamScatteredBeams[i] + canopy.BeamExtCoeffs[i] == 0)
                {
                    AbsorbedRadiationScattered[i] = 0;
                }
                else
                {
                    AbsorbedRadiationScattered[i] = EM.DirectRadiationPAR * (((1 - canopy.BeamReflectionCoeffs[i]) *
                                                                              ((i == 0 ? 1 : Math.Exp(-(canopy.BeamExtCoeffs[i] + canopy.BeamScatteredBeams[i]) * canopy.LAIAccums[i - 1])) -
                                                                               Math.Exp(-(canopy.BeamExtCoeffs[i] + canopy.BeamScatteredBeams[i]) * canopy.LAIAccums[i])) *
                                                                              (canopy.BeamScatteredBeams[i] / (canopy.BeamScatteredBeams[i] + canopy.BeamExtCoeffs[i]))) -
                                                                             ((1 - canopy.LeafScatteringCoeffs[i]) *
                                                                              ((i == 0 ? 1 : Math.Exp(-2 * canopy.BeamExtCoeffs[i] * canopy.LAIAccums[i - 1])) -
                                                                               Math.Exp(-2 * canopy.BeamExtCoeffs[i] * canopy.LAIAccums[i])) / 2));
                }

                if (canopy.BeamScatteredBeams[i] + canopy.BeamExtCoeffs[i] == 0)
                {
                    AbsorbedRadiationScattered[i] = 0;
                }
                else
                {
                    AbsorbedRadiationScatteredPAR[i] = canopy.DirectPAR * (((1 - canopy.BeamReflectionCoeffs[i]) *
                                                                            ((i == 0 ? 1 : Math.Exp(-(canopy.BeamExtCoeffs[i] + canopy.BeamScatteredBeams[i]) * canopy.LAIAccums[i - 1])) -
                                                                             Math.Exp(-(canopy.BeamExtCoeffs[i] + canopy.BeamScatteredBeams[i]) * canopy.LAIAccums[i])) *
                                                                            (canopy.BeamScatteredBeams[i] / (canopy.BeamScatteredBeams[i] + canopy.BeamExtCoeffs[i]))) -
                                                                           ((1 - canopy.LeafScatteringCoeffs[i]) *
                                                                            ((i == 0 ? 1 : Math.Exp(-2 * canopy.BeamExtCoeffs[i] * canopy.LAIAccums[i - 1])) -
                                                                             Math.Exp(-2 * canopy.BeamExtCoeffs[i] * canopy.LAIAccums[i])) / 2));
                }

                if (canopy.BeamScatteredBeamsNIR[i] + canopy.BeamExtCoeffsNIR[i] == 0)
                {
                    AbsorbedRadiationScatteredNIR[i] = 0;
                }
                else
                {
                    AbsorbedRadiationScatteredNIR[i] = canopy.DirectNIR * (((1 - canopy.BeamReflectionCoeffsNIR[i]) *
                                                                            ((i == 0 ? 1 : Math.Exp(-(canopy.BeamExtCoeffsNIR[i] + canopy.BeamScatteredBeamsNIR[i]) * canopy.LAIAccums[i - 1])) -
                                                                             Math.Exp(-(canopy.BeamExtCoeffsNIR[i] + canopy.BeamScatteredBeamsNIR[i]) * canopy.LAIAccums[i])) *
                                                                            (canopy.BeamScatteredBeamsNIR[i] / (canopy.BeamScatteredBeamsNIR[i] + canopy.BeamExtCoeffsNIR[i]))) -
                                                                           ((1 - canopy.LeafScatteringCoeffsNIR[i]) *
                                                                            ((i == 0 ? 1 : Math.Exp(-2 * canopy.BeamExtCoeffsNIR[i] * canopy.LAIAccums[i - 1])) -
                                                                             Math.Exp(-2 * canopy.BeamExtCoeffsNIR[i] * canopy.LAIAccums[i])) / 2));
                }
            }
        }
Exemplo n.º 24
0
        //---------------------------------------------------------------------------------------------------------
        public void CalcElectronTransportRate25(LeafCanopy canopy, SunlitShadedCanopy shaded, PhotosynthesisModel PM)
        {
            for (int i = 0; i < _nLayers; i++)
            {
                //J2Max25[i] = canopy.LAI * canopy.CPath.PsiJ2 * (canopy.LeafNTopCanopy - canopy.CPath.StructuralN) *
                //    ((i == 0 ? 1 : Math.Exp(-(canopy.BeamExtCoeffs[i] + canopy.NAllocationCoeff / canopy.LAI) * canopy.LAIAccums[i - 1])) -
                //    Math.Exp(-(canopy.BeamExtCoeffs[i] + canopy.NAllocationCoeff / canopy.LAI) * canopy.LAIAccums[i])) /
                //    (canopy.NAllocationCoeff + canopy.BeamExtCoeffs[i] * canopy.LAI);

                JMax25[i] = canopy.LAI * canopy.CPath.PsiJ * (canopy.LeafNTopCanopy - canopy.CPath.StructuralN) *
                            ((i == 0 ? 1 : Math.Exp(-(canopy.BeamExtCoeffs[i] + canopy.NAllocationCoeff / canopy.LAI) * canopy.LAIAccums[i - 1])) -
                             Math.Exp(-(canopy.BeamExtCoeffs[i] + canopy.NAllocationCoeff / canopy.LAI) * canopy.LAIAccums[i])) /
                            (canopy.NAllocationCoeff + canopy.BeamExtCoeffs[i] * canopy.LAI);
            }
        }
Exemplo n.º 25
0
        //---------------------------------------------------------------------------------------------------------
        public double calcAj(LeafCanopy canopy, SunlitShadedCanopy s, int layer)
        {
            double x1 = s.J[layer] / 4;
            double x2 = 2 * s.r_[layer];

            double a, b, c, d;

            a = -1 * canopy.CPath.CiCaRatio * canopy.Ca * s.gm_CO2T[layer] - s.gm_CO2T[layer] * x2 + s.RdT[layer] - x1; //Eq	(A56)
            b = -1 * canopy.CPath.CiCaRatio * canopy.Ca * s.gm_CO2T[layer] * s.RdT[layer] + canopy.CPath.CiCaRatio * canopy.Ca * s.gm_CO2T[layer] * x1 -
                s.gm_CO2T[layer] * s.RdT[layer] * x2 - s.gm_CO2T[layer] * s.r_[layer] * x1;                             // Eq	(A57)
            c = canopy.CPath.CiCaRatio * canopy.Ca * s.gm_CO2T[layer] + s.gm_CO2T[layer] * x2 - s.RdT[layer] + x1;      // Eq (A58)
            d = 1;


            return((-1 * Math.Pow((Math.Pow(a, 2) - 4 * b), 0.5) + c) / (2 * d)); //Eq (A55)
        }
Exemplo n.º 26
0
        //---------------------------------------------------------------------------------------------------------
        public double calcAc(LeafCanopy canopy, SunlitShadedCanopy s, int layer)
        {
            double x1 = s.VcMaxT[layer];
            double x2 = s.Kc[layer] * (1 + canopy.oxygenPartialPressure / s.Ko[layer]);


            double a, b, c, d;

            a = -1 * canopy.CPath.CiCaRatio * canopy.Ca * s.gm_CO2T[layer] - s.gm_CO2T[layer] * x2 + s.RdT[layer] - x1; //Eq	(A56)
            b = -1 * canopy.CPath.CiCaRatio * canopy.Ca * s.gm_CO2T[layer] * s.RdT[layer] + canopy.CPath.CiCaRatio * canopy.Ca * s.gm_CO2T[layer] * x1 -
                s.gm_CO2T[layer] * s.RdT[layer] * x2 - s.gm_CO2T[layer] * s.r_[layer] * x1;                             // Eq	(A57)
            c = canopy.CPath.CiCaRatio * canopy.Ca * s.gm_CO2T[layer] + s.gm_CO2T[layer] * x2 - s.RdT[layer] + x1;      // Eq (A58)
            d = 1;


            return((-1 * Math.Pow((Math.Pow(a, 2) - 4 * b), 0.5) + c) / (2 * d)); //Eq (A55)
        }
Exemplo n.º 27
0
        //--------------------------------------------------------------


        public double calcAc(LeafCanopy canopy, SunlitShadedCanopy s, int layer)
        {
            int    iteration = 1;
            double cm_       = 160;

            while (iteration <= 4)
            {
                cm_ = calcAc(canopy, s, layer, cm_, false, true);
                iteration++;
            }

            s.Cm_ac[layer] = cm_;

            double Ac1 = calcAc(canopy, s, layer, cm_, true, true);
            double Ac2 = calcAc(canopy, s, layer, cm_, true, false);

            return(Math.Min(Ac1, Ac2));
        }
Exemplo n.º 28
0
        ////---------------------------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// <param name="PM"></param>
        /// <param name="canopy"></param>
        public virtual void CalcConductanceResistance(PhotosynthesisModel PM, LeafCanopy canopy)
        {
            for (int i = 0; i < canopy.NLayers; i++)
            {
                //gbh[i] = 0.01 * Math.Pow((canopy.us[i] / canopy.leafWidth), 0.5) *
                //    (1 - Math.Exp(-1 * (0.5 * canopy.ku + canopy.kb) * canopy.LAI)) / (0.5 * canopy.ku + canopy.kb);

                Gbw[i] = Gbh[i] / 0.92; //This 0.92 changed from 0.93 29/06

                Rbh[i] = 1 / Gbh[i];

                Rbw[i] = 1 / Gbw[i];

                Gbw_m[i] = PM.EnvModel.ATM * PM.Canopy.Rair * Gbw[i];

                GbCO2[i] = Gbw_m[i] / 1.37;
            }
        }
Exemplo n.º 29
0
        //---------------------------------------------------------------------------
        public PhotosynthesisModel()
        {
            EnvModel       = new EnvironmentModel();
            Canopy         = new LeafCanopy();
            Canopy.NLayers = 1;
            //sunlit = new SunlitCanopy();
            //shaded = new ShadedCanopy();

            //canopy.notifyChanged += runDaily;
            photoPathwayChanged += Canopy.PhotoPathwayChanged;

            //envModel.notify += runDaily;
            Parameters            = new List <string>();
            Variables             = new List <string>();
            SunlitShadedVariables = new List <string>();
            CanopyVariables       = new List <string>();

            //canopy.layerNumberChanged += sunlit.initArrays;
            //canopy.layerNumberChanged += shaded.initArrays;
        }
Exemplo n.º 30
0
        //---------------------------------------------------------------------------
        public PhotosynthesisModel()
        {
            envModel       = new EnvironmentModel();
            canopy         = new LeafCanopy();
            canopy.nLayers = 1;
            sunlit         = new SunlitCanopy();
            shaded         = new ShadedCanopy();

            canopy.notifyChanged += runDaily;
            photoPathwayChanged  += canopy.photoPathwayChanged;

            envModel.notify      += runDaily;
            parameters            = new List <string>();
            variables             = new List <string>();
            sunlitShadedVariables = new List <string>();
            canopyVariables       = new List <string>();

            canopy.layerNumberChanged += sunlit.initArrays;
            canopy.layerNumberChanged += shaded.initArrays;
        }