//--------------------------------------------------------------------------------------------------------- public void CalcPRate25(LeafCanopy canopy, SunlitShadedCanopy sunlit, PhotosynthesisModel PM) { for (int i = 0; i < _nLayers; i++) { VpMax25[i] = canopy.VpMax25[i] - sunlit.VpMax25[i]; } }
//-------------------------------------------------------------- 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) }
//--------------------------------------------------------------------------------------------------------- public void calcElectronTransportRate25(LeafCanopy canopy, SunlitShadedCanopy sunlit, PhotosynthesisModel PM) { for (int i = 0; i < _nLayers; i++) { JMax25[i] = canopy.JMax25[i] - sunlit.JMax25[i]; } }
//--------------------------------------------------------------------------------------------------------- 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); }
//---------------------------------------------------------------------- public void CalcRdActivity25(LeafCanopy canopy, SunlitShadedCanopy sunlit, PhotosynthesisModel PM) { for (int i = 0; i < _nLayers; i++) { Rd25[i] = canopy.Rd25[i] - sunlit.Rd25[i]; } }
//---------------------------------------------------------------------- public void calcRubiscoActivity25(LeafCanopy canopy, SunlitShadedCanopy sunlit, PhotosynthesisModel PM) { for (int i = 0; i < _nLayers; i++) { VcMax25[i] = canopy.VcMax25[i] - sunlit.VcMax25[i]; } }
//--------------------------------------------------------------------------------------------------------- public virtual void run(int nlayers, PhotosynthesisModel PM, SunlitShadedCanopy counterpart) { _nLayers = nlayers; initArrays(_nLayers); calcIncidentRadiation(PM.envModel, PM.canopy, counterpart); calcAbsorbedRadiation(PM.envModel, PM.canopy, counterpart); calcMaxRates(PM.canopy, counterpart, PM); }
//-------------------------------------------------------------- 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); }
//--------------------------------------------------------------------------------------------------------- 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]; } }
//--------------------------------------------------------------------------------------------------------- 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]; } }
//--------------------------------------------------------------------------------------------------------- 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); } }
//-------------------------------------------------------------- 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]); }
//---------------------------------------------------------------------- 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); } }
//--------------------------------------------------------------------------------------------------------- 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); } }
//--------------------------------------------------------------------------------------------------------- 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) }
//--------------------------------------------------------------------------------------------------------- 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) }
//-------------------------------------------------------------- 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)); }
//---------------------------------------------------------------------- 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) } }
//---------------------------------------------------------------------- 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]; AbsorbedIrradianceNIR[i] = canopy.AbsorbedRadiationNIR[i] - sunlit.AbsorbedIrradianceNIR[i]; AbsorbedIrradiancePAR[i] = canopy.AbsorbedRadiationPAR[i] - sunlit.AbsorbedIrradiancePAR[i]; } }
//-------------------------------------------------------------- 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)); }
//--------------------------------------------------------------------------------------------------------- public override double calcAj(double Cc, LeafCanopy canopy, SunlitShadedCanopy s, int layer) { return((Cc - s.r_[layer]) * s.J[layer] / (4 * (Cc + 2 * s.r_[layer])) - s.RdT[layer]); }
public virtual void calcAbsorbedRadiation(EnvironmentModel EM, LeafCanopy canopy, SunlitShadedCanopy counterpart) { }
public virtual void calcMaxRates(LeafCanopy canopy, SunlitShadedCanopy counterpart, PhotosynthesisModel EM) { }
//--------------------------------------------------------------------------------------------------------- public virtual void calcLAI(LeafCanopy canopy, SunlitShadedCanopy counterpart) { }
//--------------------------------------------------------------------------------------------------------- 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]; } }
public abstract double calcPhotosynthesis(PhotosynthesisModel PM, SunlitShadedCanopy s, int layer, double _Cc);
//--------------------------------------------------------------------------------------------------------- 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]; } }
//--------------------------------------------------------------------------------------------------------- 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]; } }
//--------------------------------------------------------------------------------------------------------- public virtual void CalcIncidentRadiation(EnvironmentModel EM, LeafCanopy canopy, SunlitShadedCanopy counterpart) { }
//--------------------------------------------------------------------------------------------------------- public abstract double calcAj(double Cc, LeafCanopy canopy, SunlitShadedCanopy s, int layer);