//---------------------------------------------------------------------- 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]; } }
//--------------------------------------------------------------------------------------------------------- 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)); }
//----------------------------------------------------------------------- void CalcAbsorbedRadiation(EnvironmentModel em) { // double[] radiation = new double[_nLayers]; for (int i = 0; i < _nLayers; i++) { //radiation[i] = (1 - beamReflectionCoeffs[i]) * beamScatteredBeams[i] * em.directRadiation * Math.Exp(-beamScatteredBeams[i] * LAIAccums[i]) + //(1 - diffuseReflectionCoeffs[i]) * diffuseScatteredDiffuses[i] * em.diffuseRadiation * Math.Exp(-diffuseScatteredDiffuses[i] * LAIAccums[i]); AbsorbedRadiation[i] = (1 - BeamReflectionCoeffs[i]) * em.DirectRadiationPAR * ((i == 0 ? 1 : Math.Exp(-BeamScatteredBeams[i] * LAIAccums[i - 1])) - Math.Exp(-BeamScatteredBeams[i] * LAIAccums[i])) + (1 - DiffuseReflectionCoeffs[i]) * em.DiffuseRadiationPAR * ((i == 0 ? 1 : Math.Exp(-DiffuseScatteredDiffuses[i] * LAIAccums[i - 1])) - Math.Exp(-DiffuseScatteredDiffuses[i] * LAIAccums[i])); DirectPAR = em.DirectRadiationPAR / 0.5 / 4.56 / 1000000 * 0.5 * 1000000; DiffusePAR = em.DiffuseRadiationPAR / 0.5 / 4.25 / 1000000 * 0.5 * 1000000; DirectNIR = em.DirectRadiationPAR / 0.5 / 4.56 / 1000000 * 0.5 * 1000000; DiffuseNIR = em.DiffuseRadiationPAR / 0.5 / 4.25 / 1000000 * 0.5 * 1000000; AbsorbedRadiationPAR[i] = (1 - BeamReflectionCoeffs[i]) * DirectPAR * ((i == 0 ? 1 : Math.Exp(-BeamScatteredBeams[i] * LAIAccums[i - 1])) - Math.Exp(-BeamScatteredBeams[i] * LAIAccums[i])) + (1 - DiffuseReflectionCoeffs[i]) * DiffusePAR * ((i == 0 ? 1 : Math.Exp(-DiffuseScatteredDiffuses[i] * LAIAccums[i - 1])) - Math.Exp(-DiffuseScatteredDiffuses[i] * LAIAccums[i])); AbsorbedRadiationNIR[i] = (1 - BeamReflectionCoeffsNIR[i]) * DirectNIR * ((i == 0 ? 1 : Math.Exp(-BeamScatteredBeamsNIR[i] * LAIAccums[i - 1])) - Math.Exp(-BeamScatteredBeamsNIR[i] * LAIAccums[i])) + (1 - DiffuseReflectionCoeffsNIR[i]) * DiffuseNIR * ((i == 0 ? 1 : Math.Exp(-DiffuseScatteredDiffusesNIR[i] * LAIAccums[i - 1])) - Math.Exp(-DiffuseScatteredDiffusesNIR[i] * LAIAccums[i])); } //TrapezoidLayer.integrate(_nLayers, absorbedRadiation, radiation, LAIs); }
//---------------------------------------------------------------------- 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 void run(PhotosynthesisModel PM, EnvironmentModel EM) { calcAbsorbedRadiation(EM); calcLeafNitrogenDistribution(PM); calcConductanceResistance(); calcLeafTemperature(PM, EM); calcTotalLeafNitrogen(PM); }
//----------------------------------------------------------------------- void calcAbsorbedRadiation(EnvironmentModel em) { for (int i = 0; i < _nLayers; i++) { absorbedRadiation[i] = (1 - beamReflectionCoeffs[i]) * em.directRadiationPAR * ((i == 0 ? 1 : Math.Exp(-beamScatteredBeams[i] * LAIAccums[i - 1])) - Math.Exp(-beamScatteredBeams[i] * LAIAccums[i])) + (1 - diffuseReflectionCoeffs[i]) * em.diffuseRadiationPAR * ((i == 0 ? 1 : Math.Exp(-diffuseScatteredDiffuses[i] * LAIAccums[i - 1])) - Math.Exp(-diffuseScatteredDiffuses[i] * LAIAccums[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]; } }
//--------------------------------------------------------------------------------------------------------- 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])); } }
//--------------------------------------------------------------------------------------------------------- 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])); } }
public void Run(PhotosynthesisModel PM, EnvironmentModel EM) { //calcCanopyStructure(EM.sunAngle.rad); CalcAbsorbedRadiation(EM); CalcLeafNitrogenDistribution(PM); CalcConductanceResistance(PM); CalcLeafTemperature(PM, EM); CalcTotalLeafNitrogen(PM); }
//--------------------------------------------------------------------------------------------------------- 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 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]; } }
//--------------------------------------------------------------------------------------------------------- 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)); } } }
public void CalcLeafTemperature(PhotosynthesisModel PM, EnvironmentModel EM) { //double airTemp = EM.getTemp(PM.time); //fvap = 0.56 - 0.079 * Math.Pow(10 * Vair, 0.5); //fclear = 0.1 + 0.9 * Math.Max(0, Math.Min(1, (EM.atmTransmissionRatio - 0.2) / 0.5)); //g = (cp * Math.Pow(10, -6)) * p / (l * mwRatio); //es_Ta = 5.637E-7 * Math.Pow(airTemp, 4) + 1.728E-5 * Math.Pow(airTemp, 3) + 1.534E-3 * // Math.Pow(airTemp, 2) + 4.424E-2 * airTemp + 6.095E-1; //a2 = CPath.F2 * (1 - CPath.fcyc) / (CPath.F2 / CPath.F1 + (1 - CPath.fcyc)); }
//--------------------------------------------------------------------------- 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; }
//--------------------------------------------------------------------------- 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; }
public virtual void calcAbsorbedRadiation(EnvironmentModel EM, LeafCanopy canopy, SunlitShadedCanopy counterpart) { }
//--------------------------------------------------------------------------------------------------------- public virtual void CalcIncidentRadiation(EnvironmentModel EM, LeafCanopy canopy, SunlitShadedCanopy counterpart) { }