42 const double LeafWidth = 0.04;
43 const double kappa = 0.41;
44 const double WindSpeedHeight = 5;
45 const double dCoef = 0.77;
46 const double tau = 0.2;
47 const double ZetaCoef = 0.026;
48 const double ZetaMCoef = 0.13;
49 const double LeafReflectance = 0.2;
50 const double SpecificHeat = 1010;
52 double Tair, WindSpeedTopCanopy;
53 double DdryA, LHV, SlopeFS, SWVC;
54 double LayerRelativeHumidity, LayerWindSpeed, totalradiation;
55 double LayerConductance, DeltaPVa, PsycParam, ga;
56 double BoundaryLayerThickness, DiffCoef,LeafboundaryLayer;
57 double d, Zeta, Zetam, ga0, ga1, ga2;
60 double TopValue, BottomValue;
61 double EPen, TransR,EPries;
62 double OldDeltaT, rlc, ChangeInLeafTemp;
65 WindSpeedTopCanopy = WindSpeed;
66 Tair = Airtemperature;
68 if(CanopyHeight < 0.1)
80 Zeta = ZetaCoef * CanopyHeight;
81 Zetam = ZetaMCoef * CanopyHeight;
82 d = dCoef * CanopyHeight;
89 LayerRelativeHumidity = RH * 100;
90 if(LayerRelativeHumidity > 100)
91 error(
"LayerRelativehumidity > 100");
93 if(WindSpeed < 0.5) WindSpeed = 0.5;
95 LayerWindSpeed = WindSpeed;
98 totalradiation = Itot * 0.235;
100 tmpc3 =
c3photoC(Rad,Airtemperature,RH,vcmax2,jmax2,Rd2,b02,b12,Catm2,O2,theta2,StomWS,ws);
101 LayerConductance = tmpc3.Gs;
110 LayerConductance = LayerConductance * 1e-6 * 24.39;
115 if(LayerConductance <=0)
116 LayerConductance = 0.01;
122 DeltaPVa = SWVC * (1 - LayerRelativeHumidity / 100);
124 PsycParam =(DdryA * SpecificHeat) / LHV;
130 Ja = (2 * totalradiation * ((1 - LeafReflectance - tau) / (1 - tau)));
133 ga0 = pow(kappa,2) * LayerWindSpeed;
134 ga1 = log((WindSpeedHeight + Zeta - d)/Zeta);
135 ga2 = log((WindSpeedHeight + Zetam - d)/Zetam);
140 error(
"ga is less than zero");
142 DiffCoef = (2.126 * 1e-5) + ((1.48 * 1e-7) * Airtemperature);
143 BoundaryLayerThickness = 0.004 * sqrt(LeafWidth / LayerWindSpeed);
144 LeafboundaryLayer = DiffCoef / BoundaryLayerThickness;
172 ChangeInLeafTemp = 10;
175 while( (ChangeInLeafTemp > 0.5) && (Counter <= 10))
180 rlc = (4 * (5.67*1e-8) * pow(273 + Airtemperature, 3) * Deltat);
185 TopValue = PhiN * (1 / ga + 1 / LayerConductance) - LHV * DeltaPVa;
186 BottomValue = LHV * (SlopeFS + PsycParam * (1 + ga / LayerConductance));
187 Deltat = TopValue / BottomValue;
188 if(Deltat > 5) Deltat = 5;
189 if(Deltat < -5) Deltat = -5;
192 ChangeInLeafTemp = OldDeltaT - Deltat;
193 if(ChangeInLeafTemp <0)
194 ChangeInLeafTemp = -ChangeInLeafTemp;
202 TransR = (SlopeFS * PhiN + (LHV * PsycParam * ga * DeltaPVa)) / (LHV * (SlopeFS + PsycParam * (1 + ga / LayerConductance)));
204 EPries = 1.26 * ((SlopeFS * PhiN) / (LHV * (SlopeFS + PsycParam)));
206 EPen = (((SlopeFS * PhiN) + LHV * PsycParam * ga * DeltaPVa)) / (LHV * (SlopeFS + PsycParam));
219 tmp.TransR = TransR * 1e6 / 18;
220 tmp.EPenman = EPen * 1e6 / 18;
221 tmp.EPriestly = EPries * 1e6 / 18;
223 tmp.LayerCond = LayerConductance * 1e6 * (1/24.39);
struct c3_str c3photoC(double Qp, double Tleaf, double RH, double Vcmax0, double Jmax, double Rd0, double bb0, double bb1, double Ca, double O2, double thet, double StomWS, int ws)
Definition: c3photo.c:119
double TempToDdryA(double Temp)
Definition: AuxBioCro.c:179
double TempToSFS(double Temp)
Definition: AuxBioCro.c:193
double TempToSWVC(double Temp)
Definition: AuxBioCro.c:200
double TempToLHV(double Temp)
Definition: AuxBioCro.c:186
Definition: AuxBioCro.h:32