UpdateASW <-
function (state, weather, site, parms, general.info)
{
Rain <- weather[["Rain"]]
MonthIrrig <- weather[["MonthIrrig"]]
ASW <- state[["ASW"]]
LAI <- state[["LAI"]]
ASWrain <- ASW + Rain + MonthIrrig
LAImaxIntcptn <- parms[["LAImaxIntcptn"]]
MaxIntcptn <- parms[["MaxIntcptn"]]
RainIntcptn <- MaxIntcptn * ifelse(LAImaxIntcptn <= 0, 1,
min(1, LAI/LAImaxIntcptn)) * Rain
Qa <- parms[["Qa"]]
Qb <- parms[["Qb"]]
month <- weather[["Month"]]
latitude <- site[["latitude"]]
RAD.day <- state[["RAD.day"]]
h <- GetDayLength(Lat = latitude, month = month)
netRad <- Qa + Qb * (RAD.day * 1e+06/h)
MinCond <- parms[["MinCond"]]
MaxCond <- parms[["MaxCond"]]
LAIgcx <- parms[["LAIgcx"]]
fCg0 <- parms[["fCg0"]]
CO2 <- site[["CO2"]]
PhysMod <- state[["PhysMod"]]
fCg <- fCg0/(1 + (fCg0 - 1) * CO2/350)
CanCond <- (MinCond + (MaxCond - MinCond) * (min(1, LAI/LAIgcx))) *
PhysMod * fCg
CanCond <- ifelse(CanCond == 0, 1e-04, CanCond)
e20 <- parms[["e20"]]
rhoAir <- parms[["rhoAir"]]
lambda <- parms[["lambda"]]
VPDconv <- parms[["VPDconv"]]
BLcond <- parms[["BLcond"]]
VPD <- weather[["VPD"]]
Etransp <- (e20 * netRad + rhoAir * lambda * VPDconv * VPD *
BLcond)/(1 + e20 + BLcond/CanCond)
CanTransp <- Etransp/lambda * h
Transp <- general.info$daysinmonth[month] * CanTransp
EvapTransp <- min(Transp + RainIntcptn, ASWrain)
MaxASW <- site[["MaxASW"]]
excessSW <- max(ASWrain - EvapTransp - MaxASW, 0)
state[["ASW"]] <- ASWrain - EvapTransp - excessSW
scaleSW <- EvapTransp/(Transp + RainIntcptn)
GPP <- state[["GPP"]]
NPP <- state[["NPP"]]
state[["GPP"]] <- GPP * scaleSW
state[["NPP"]] <- NPP * scaleSW
state[c("RainIntcptn", "netRad", "CanCond", "Etransp", "CanTransp",
"Transp", "EvapTransp", "excessSW", "scaleSW")] <- c(RainIntcptn,
netRad, CanCond, Etransp, CanTransp, Transp, EvapTransp,
excessSW, scaleSW)
return(state)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.