Skip to content

Commit

Permalink
Correct VPD unit when not read from meteo + carbon lack is now remove…
Browse files Browse the repository at this point in the history
…d from organs depending on their relative biomass
  • Loading branch information
VEZY committed Jun 6, 2019
1 parent 16e4ed0 commit 40a4d7e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 4 additions & 2 deletions R/1-Meteo.R
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,16 @@ Meteorology= function(file=NULL, Period=NULL,Parameters= Import_Parameters()){
if(!is.null(MetData$VPD)){
bigleaf::pressure.from.elevation(elev = Parameters$Elevation,
Tair = MetData$Tair,
VPD = MetData$VPD)
VPD = MetData$VPD)*10
# Return in kPa
warn.var(Var= "Pressure",
replacement=paste("Elevation, Tair and VPD",
"using bigleaf::pressure.from.elevation"),
type='warn')
}else{
bigleaf::pressure.from.elevation(elev = Parameters$Elevation,
Tair = MetData$Tair)
Tair = MetData$Tair)*10
# Return in kPa
warn.var(Var= "Pressure",
replacement=paste("Elevation and Tair",
"using bigleaf::pressure.from.elevation"),
Expand Down
13 changes: 9 additions & 4 deletions R/2-Coffee_DCM.R
Original file line number Diff line number Diff line change
Expand Up @@ -851,20 +851,25 @@ mainfun= function(cy,Direction,Meteo,Parameters){

# Biomass -----------------------------------------------------------------

CM_tot=
S$Sim$CM_Leaf[previous_i(i,1)] + S$Sim$CM_Shoot[previous_i(i,1)] +
S$Sim$CM_SCR[previous_i(i,1)] + S$Sim$CM_FRoot[previous_i(i,1)]

S$Sim$CM_Leaf[i]/CM_tot
S$Sim$CM_Leaf[i]= S$Sim$CM_Leaf[previous_i(i,1)]+
S$Sim$NPP_Leaf[i]-S$Sim$Mortality_Leaf[i]-
S$Sim$Carbon_Lack_Mortality[i]*0.25
S$Sim$Carbon_Lack_Mortality[i]*S$Sim$CM_Leaf[previous_i(i,1)]/CM_tot
S$Sim$CM_Shoot[i]= S$Sim$CM_Shoot[previous_i(i,1)]+
S$Sim$NPP_Shoot[i]-S$Sim$Mortality_Shoot[i]-
S$Sim$Carbon_Lack_Mortality[i]*0.25
S$Sim$Carbon_Lack_Mortality[i]*S$Sim$CM_Shoot[previous_i(i,1)]/CM_tot
S$Sim$CM_Fruit[i]=S$Sim$CM_Fruit[previous_i(i,1)]+
S$Sim$NPP_Fruit[i]-S$Sim$Overriped_Fruit[i]
S$Sim$CM_SCR[i]= S$Sim$CM_SCR[previous_i(i,1)]+
S$Sim$NPP_SCR[i]-S$Sim$Mortality_SCR[i]-
S$Sim$Carbon_Lack_Mortality[i]*0.25
S$Sim$Carbon_Lack_Mortality[i]*S$Sim$CM_SCR[previous_i(i,1)]/CM_tot
S$Sim$CM_FRoot[i]= S$Sim$CM_FRoot[previous_i(i,1)]+
S$Sim$NPP_FRoot[i]-S$Sim$Mortality_FRoot[i]-
S$Sim$Carbon_Lack_Mortality[i]*0.25
S$Sim$Carbon_Lack_Mortality[i]*S$Sim$CM_FRoot[previous_i(i,1)]/CM_tot
S$Sim$CM_RE[i]=S$Sim$CM_RE[previous_i(i,1)]+S$Sim$NPP_RE[i]-
S$Sim$Consumption_RE[i]

Expand Down

0 comments on commit 40a4d7e

Please sign in to comment.