Skip to content

Commit

Permalink
Update metamodels
Browse files Browse the repository at this point in the history
  • Loading branch information
VEZY committed May 31, 2018
1 parent 473ab71 commit 328f016
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion R/0-Soil.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ soil= function(){
fo = 1360.917, # Maximum infiltration capacity (mmd-1), = fc*alpha
kB = 0.038079, # Discharge coefficient for surface runoff from surface reservoir (d-1)
k_Rn = 0.283, # Radiation extinction coefficient. Source: Shuttleworth and wallace, 1985, p. 851
Soil_LE_p = 0.66, # Partitioning of the available energy between LE and H for the soil
Soil_LE_p = 0.70, # Partitioning of the available energy between LE and H for the soil. Source: MAESPA simulation
PSIE = -0.0002580542, # Average PSIE, used for soil water potential through Campbell (1974) equation, (MPa).
PoreFrac = 0.4, # Average pore fraction of the soil, IDEM
B = 4.71, # Average b of the soil, IDEM
Expand Down
10 changes: 7 additions & 3 deletions R/2-Coffee_DCM.R
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,9 @@ DynACof= function(Period=NULL, WriteIt= F,...,

# Metamodel Transpiration Coffee, and filter out for negative values
S$Sim$T_Cof[i]=
-0.42164 + 0.03467*S$Met_c$VPD[i] + 0.10559*S$Sim$LAI[i] + 0.11510*PARcof
# -0.42164 + 0.03467*S$Met_c$VPD[i] + 0.10559*S$Sim$LAI[i] + 0.11510*PARcof
-0.72080 + 0.07319*S$Met_c$VPD[i] -0.76984*(1-S$Met_c$FDiff[i]) +
0.13646*S$Sim$LAI[i] + 0.12910*PARcof
S$Sim$T_Cof[i][S$Sim$T_Cof[i]<0]= 0
#Plot transpiration
S$Sim$T_tot[i]= S$Sim$T_Tree[i]+S$Sim$T_Cof[i]
Expand All @@ -391,8 +393,10 @@ DynACof= function(Period=NULL, WriteIt= F,...,

# Metamodel for H :
S$Sim$H_Coffee[i]=
-1.80160 + 0.03139*S$Met_c$Tair[i] - 0.06046*S$Met_c$VPD[i]+
1.93064*(1-S$Met_c$FDiff[i]) + 0.58368*PARcof+0.25838*S$Sim$LAI[i]
-0.82010 - 0.04864*S$Met_c$Tair[i] - 0.12400*S$Met_c$VPD[i]+
0.72856*(1-S$Met_c$FDiff[i]) + 0.84231*PARcof[i]+0.10764*S$Sim$LAI[i]
# -1.80160 + 0.03139*S$Met_c$Tair[i] - 0.06046*S$Met_c$VPD[i]+
# 1.93064*(1-S$Met_c$FDiff[i]) + 0.58368*PARcof+0.25838*S$Sim$LAI[i]

S$Sim$Rn_Coffee[i]=
S$Sim$H_Coffee[i] + S$Sim$LE_Coffee[i]
Expand Down
15 changes: 10 additions & 5 deletions R/3-Metamodels.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,18 @@ Metamodels= function(S,i){
0.03390*S$Met_c$VPD[i] - 0.24565*S$Met_c$PAR[i]

S$Sim$T_Tree[i]=
0.021820*S$Met_c$VPD[i] - 0.016112*S$Met_c$Tair[i] + 0.942021*S$Sim$APAR_Tree[i]-
1.397349*(1-S$Met_c$FDiff[i]) + 0.004328*S$Sim$LAI_Tree[i]
-0.50236 + 0.02240*S$Met_c$VPD[i] + 0.01321*S$Met_c$Tair[i] +
0.72191*S$Sim$APAR_Tree[i] - 0.86182*(1-S$Met_c$FDiff[i]) + 0.07139*S$Sim$LAI_Tree[i]
# 0.021820*S$Met_c$VPD[i] - 0.016112*S$Met_c$Tair[i] + 0.942021*S$Sim$APAR_Tree[i]-
# 1.397349*(1-S$Met_c$FDiff[i]) + 0.004328*S$Sim$LAI_Tree[i]
S$Sim$T_Tree[i][S$Sim$T_Tree[i]<0]= 0 #to discard negative values

S$Sim$H_Tree[i]=
0.34975 + 0.81448*S$Sim$APAR_Dir_Tree[i] + 0.29321*S$Sim$APAR_Dif_Tree[i]-
0.75987*S$Sim$LAI_Tree[i] - 0.55724*S$Sim$T_Tree[i] -
0.02898*S$Met_c$VPD[i]
0.34062 + 0.82001*S$Sim$APAR_Dir_Tree[i] + 0.32883*S$Sim$APAR_Dif_Tree[i]-
0.75801*S$Sim$LAI_Tree[i] - 0.57135*S$Sim$T_Tree[i] -
0.03033*S$Met_c$VPD[i]
# 0.34975 + 0.81448*S$Sim$APAR_Dir_Tree[i] + 0.29321*S$Sim$APAR_Dif_Tree[i]-
# 0.75987*S$Sim$LAI_Tree[i] - 0.55724*S$Sim$T_Tree[i] -
# 0.02898*S$Met_c$VPD[i]
}

0 comments on commit 328f016

Please sign in to comment.