예제 #1
0
        //--------------------------------------------------------------

        public override double calcPhotosynthesis(PhotosynthesisModel PM, SunlitShadedCanopy s, int layer, double _Cc)
        {
            LeafCanopy canopy = PM.canopy;

            s.calcPhotosynthesis(PM, layer);

            s.Oi[layer] = canopy.oxygenPartialPressure;

            s.Oc[layer] = s.Oi[layer];

            s.r_[layer] = s.g_[layer] * s.Oc[layer];

            s.Ac[layer] = calcAc(canopy, s, layer);
            s.Aj[layer] = calcAj(canopy, s, layer);

            if (s.Ac[layer] < 0 || double.IsNaN(s.Ac[layer]))
            {
                s.Ac[layer] = 0;
            }

            if (s.Aj[layer] < 0 || double.IsNaN(s.Aj[layer]))
            {
                s.Aj[layer] = 0;
            }

            s.A[layer] = Math.Min(s.Aj[layer], s.Ac[layer]);



            if (PM.conductanceModel == PhotosynthesisModel.ConductanceModel.DETAILED)
            {
                // s.Ci[layer] = canopy.Ca - s.A[layer] / s.gb_CO2[layer] - s.A[layer] / s.gs_CO2[layer];
            }
            else
            {
                s.Ci[layer] = canopy.CPath.CiCaRatio * canopy.Ca;
            }

            s.Ccac[layer] = s.Ci[layer] - s.Ac[layer] / s.gm_CO2T[layer];

            s.Ccaj[layer] = s.Ci[layer] - s.Aj[layer] / s.gm_CO2T[layer];

            if (s.Ccac[layer] < 0 || double.IsNaN(s.Ccac[layer]))
            {
                s.Ccac[layer] = 0;
            }
            if (s.Ccaj[layer] < 0 || double.IsNaN(s.Ccaj[layer]))
            {
                s.Ccaj[layer] = 0;
            }

            if (s.Ac[layer] < s.Aj[layer])
            {
                s.Cc[layer] = s.Ac[layer];
            }
            else
            {
                s.Cc[layer] = s.Aj[layer];
            }

            s.Cc[layer] = s.Ci[layer] - s.A[layer] / s.gm_CO2T[layer];
            if (s.Cc[layer] < 0 || double.IsNaN(s.Cc[layer]))
            {
                s.Cc[layer] = 0;
            }


            s.CiCaRatio[layer] = s.Ci[layer] / canopy.Ca;

            return(Math.Pow(s.Cc[layer] - _Cc, 2));
        }
예제 #2
0
        //--------------------------------------------------------------
        public override double calcPhotosynthesis(PhotosynthesisModel PM, SunlitShadedCanopy s, int layer, double _A)
        {
            LeafCanopy canopy = PM.canopy;

            s.calcPhotosynthesis(PM, layer);

            s.Rm[layer] = s.RdT[layer] * 0.5;

            canopy.z = (2 + canopy.fQ - canopy.CPath.fcyc) / (canopy.h * (1 - canopy.CPath.fcyc));

            s.gbs[layer] = canopy.gbs_CO2 * s.LAIS[layer];

            s.Oi[layer] = canopy.oxygenPartialPressure;

            s.Om[layer] = canopy.oxygenPartialPressure;

            s.gs_CO2[layer] = canopy.gs_CO2 * s.LAIS[layer];

            s.Kp[layer] = TempFunctionExp.val(s.leafTemp[layer], canopy.CPath.Kp_P25, canopy.CPath.Kp_c, canopy.CPath.Kp_b);
            //Caculate A's
            s.Aj[layer] = calcAj(canopy, s, layer);
            s.Ac[layer] = calcAc(canopy, s, layer);


            if (s.Ac[layer] < 0 || double.IsNaN(s.Ac[layer]))
            {
                s.Ac[layer] = 0;
            }

            if (s.Aj[layer] < 0 || double.IsNaN(s.Aj[layer]))
            {
                s.Aj[layer] = 0;
            }

            s.A[layer] = Math.Max(0, Math.Min(s.Aj[layer], s.Ac[layer]));

            if (PM.conductanceModel == PhotosynthesisModel.ConductanceModel.DETAILED)
            {
                s.Ci[layer] = canopy.Ca - s.A[layer] / s.gb_CO2[layer] - s.A[layer] / s.gs_CO2[layer];
            }
            else
            {
                s.Ci[layer] = canopy.CPath.CiCaRatio * canopy.Ca;
            }


            s.Cm_ac[layer] = s.Ci[layer] - s.Ac[layer] / s.gm_CO2T[layer];
            s.Cm_aj[layer] = s.Ci[layer] - s.Aj[layer] / s.gm_CO2T[layer];

            double Vp_ac = Math.Min(s.Cm_ac[layer] * s.VpMaxT[layer] / (s.Cm_ac[layer] + s.Kp[layer]), s.Vpr[layer]);
            double Vp_aj = canopy.CPath.x * s.J[layer] / 2;

            s.Oc_ac[layer] = canopy.alpha * s.Ac[layer] / (0.047 * s.gbs[layer]) + s.Om[layer];
            s.Oc_aj[layer] = canopy.alpha * s.Aj[layer] / (0.047 * s.gbs[layer]) + s.Om[layer];

            s.r_ac[layer] = s.g_[layer] * s.Oc_ac[layer];
            s.r_aj[layer] = s.g_[layer] * s.Oc_aj[layer];

            s.Ccac[layer] = s.Cm_ac[layer] + (Vp_ac - s.Ac[layer] - s.Rm[layer]) / s.gbs[layer];
            s.Ccaj[layer] = s.Cm_aj[layer] + (Vp_aj - s.Aj[layer] - s.Rm[layer]) / s.gbs[layer];

            if (s.Ccac[layer] < 0 || double.IsNaN(s.Ccac[layer]))
            {
                s.Ccac[layer] = 0;
            }
            if (s.Ccaj[layer] < 0 || double.IsNaN(s.Ccaj[layer]))
            {
                s.Ccaj[layer] = 0;
            }

            double F_ac = s.gbs[layer] * (s.Ccac[layer] - s.Cm_ac[layer]) / Vp_ac;
            double F_aj = s.gbs[layer] * (s.Ccaj[layer] - s.Cm_aj[layer]) / Vp_aj;

            if (s.Ac[layer] < s.Aj[layer])
            {
                s.Vp[layer] = Vp_ac;
                s.Cc[layer] = s.Ccac[layer];
                s.Cm[layer] = s.Cm_ac[layer];
                s.Oc[layer] = s.Oc_ac[layer];
                s.r_[layer] = s.r_ac[layer];
                s.F[layer]  = F_ac;
            }

            else
            {
                s.Vp[layer] = Vp_aj;
                s.Cc[layer] = s.Ccaj[layer];
                s.Cm[layer] = s.Cm_aj[layer];
                s.Oc[layer] = s.Oc_aj[layer];
                s.r_[layer] = s.r_aj[layer];
                s.F[layer]  = F_aj;
            }

            s.CiCaRatio[layer] = s.Ci[layer] / canopy.Ca;

            //return Math.Pow(s.A[layer] - _A, 2);
            return(0);
        }