% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{spwb_day}
\alias{spwb_day}
\title{Single-day soil-plant water balance}
\usage{
spwb_day(
  x,
  date,
  meteovec,
  latitude,
  elevation,
  slope = NA_real_,
  aspect = NA_real_,
  runon = 0,
  lateralFlows = NULL,
  waterTableDepth = NA_real_,
  modifyInput = TRUE
)
}
\arguments{
\item{x}{An object of class \code{\link{spwbInput}} or \code{\link{growthInput}}.}

\item{date}{Date as string "yyyy-mm-dd".}

\item{meteovec}{A named numerical vector with weather data. See variable names in parameter \code{meteo} of \code{\link{spwb}}.}

\item{latitude}{Latitude (in degrees).}

\item{elevation, slope, aspect}{Elevation above sea level (in m), slope (in degrees) and aspect (in degrees from North).}

\item{runon}{Surface water amount running on the target area from upslope (in mm).}

\item{lateralFlows}{Lateral source/sink terms for each soil layer (interflow/to from adjacent locations) as mm/day.}

\item{waterTableDepth}{Water table depth (in mm). When not missing, capillarity rise will be allowed if lower than total soil depth.}

\item{modifyInput}{Boolean flag to indicate that the input \code{x} object is allowed to be modified during the simulation.}
}
\value{
Function \code{spwb_day()} returns a list of class \code{spwb_day} with the
following elements:
\itemize{
\item{\code{"cohorts"}: A data frame with cohort information, copied from \code{\link{spwbInput}}.}
\item{\code{"topography"}: Vector with elevation, slope and aspect given as input.}
\item{\code{"weather"}: A vector with the input weather.}
\item{\code{"WaterBalance"}: A vector of water balance components (rain, snow, net rain, infiltration, ...) for the simulated day, equivalent to one row of 'WaterBalance' object given in \code{\link{spwb}}.}
\item{\code{"EnergyBalance"}: Energy balance of the stand (only returned when \code{transpirationMode = "Sperry"} or  \code{transpirationMode = "Sureau"}; see \code{\link{transp_transpirationSperry}}).}
\item{\code{"Soil"}: A data frame with results for each soil layer:
\itemize{
\item{\code{"Psi"}: Soil water potential (in MPa) at the end of the day.}
\item{\code{"HerbTranspiration"}: Water extracted by herbaceous plants from each soil layer (in mm).}
\item{\code{"HydraulicInput"}: Water entering each soil layer from other layers, transported via plant roots (in mm).}
\item{\code{"HydraulicOutput"}: Water leaving each soil layer (going to other layers or the transpiration stream) (in mm).}
\item{\code{"PlantExtraction"}: Water extracted by woody plants from each soil layer (in mm).}
}
}
\item{\code{"Stand"}: A named vector with with stand values for the simulated day, equivalent to one row of 'Stand' object returned by \code{\link{spwb}}.}
\item{\code{"Plants"}: A data frame of results for each plant cohort (see \code{\link{transp_transpirationGranier}} or \code{\link{transp_transpirationSperry}}).}
}

The following additional items are only returned when \code{transpirationMode = "Sperry"} or  \code{transpirationMode = "Sureau"}:
\itemize{
\item{\code{"RhizoPsi"}: Minimum water potential (in MPa) inside roots, after crossing rhizosphere, per cohort and soil layer.}
\item{\code{"SunlitLeaves"} and \code{"ShadeLeaves"}: For each leaf type, a data frame with values of LAI, Vmax298 and Jmax298 for leaves of this type in each plant cohort.}
\item{\code{"ExtractionInst"}: Water extracted by each plant cohort during each time step.}
\item{\code{"PlantsInst"}: A list with instantaneous (per time step) results for each plant cohort (see \code{\link{transp_transpirationSperry}}).}
\item{\code{"LightExtinction"}: A list of information regarding radiation balance through the canopy, as returned by function \code{\link{light_instantaneousLightExtinctionAbsortion}}.}
\item{\code{"CanopyTurbulence"}: Canopy turbulence (see \code{\link{wind_canopyTurbulence}}).}
}
}
\description{
Function \code{spwb_day} performs water balance for a single day.
}
\details{
Detailed model description is available in the medfate book.

Soil-plant water balance simulations allow using different sub-models for bulk soil water flows and different sub-models of transpiration and photosynthesis:

(1) Sub-models of transpiration and photosynthesis (control parameter \code{transpirationMode}):
\itemize{
\item{The sub-model corresponding to 'Granier' transpiration mode is illustrated by internal function \code{\link{transp_transpirationGranier}} and was described in De Caceres et al. (2015),
and implements an approach originally described in Granier et al. (1999).}
\item{The sub-model corresponding to 'Sperry' transpiration mode is illustrated by internal function \code{\link{transp_transpirationSperry}} and was described in De Caceres et al. (2021), and
implements a modelling approach originally described in Sperry et al. (2017).}
\item{The sub-model corresponding to 'Sureau' transpiration mode is illustrated by internal function \code{\link{transp_transpirationSureau}} and was described for model SurEau-Ecos v2.0 in Ruffault et al. (2022).}
}
Simulations using the 'Sperry' or 'Sureau' transpiration mode are computationally much more expensive than 'Granier' because they
include explicit plant hydraulics and canopy/soil energy balance at subdaily time steps.

(2) Sub-models of bulk soil water flows (control parameter \code{soilDomains}; see internal function \code{\link{hydrology_soilWaterBalance}}):
\itemize{
\item{The submodel corresponding to 'buckets' is a multi-bucket model adds/substracts water to each layer and if content is above field capacity the excess percolates to the layer below.}
\item{The submodel corresponding to 'single' is a single-domain solving 1D Richards equation (Bonan et al. 2019).}
\item{The submodel corresponding to 'dual' is a dual-permeability model from MACRO 5.0 (Jarvis et al. 1991; Larsbo et al. 2005)}
}
}
\examples{
#Load example daily meteorological data
data(examplemeteo)

#Load example plot plant data
data(exampleforest)

#Default species parameterization
data(SpParamsMED)

#Define soil parameters
examplesoil <- defaultSoilParams(4)

# Day to be simulated
d <- 100
meteovec <- unlist(examplemeteo[d,-1])
date <- as.character(examplemeteo$dates[d])

#Simulate water balance one day only (Granier mode)
control <- defaultControl("Granier")
x1 <- spwbInput(exampleforest,examplesoil, SpParamsMED, control)
sd1 <- spwb_day(x1, date, meteovec,  
                latitude = 41.82592, elevation = 100, slope=0, aspect=0) 

#Simulate water balance for one day only (Sperry mode)
control <- defaultControl("Sperry")
x2 <- spwbInput(exampleforest, examplesoil, SpParamsMED, control)
sd2 <-spwb_day(x2, date, meteovec,
              latitude = 41.82592, elevation = 100, slope=0, aspect=0)

#Simulate water balance for one day only (Sureau mode)
control <- defaultControl("Sureau")
x3 <- spwbInput(exampleforest, examplesoil, SpParamsMED, control)
sd3 <-spwb_day(x3, date, meteovec,
              latitude = 41.82592, elevation = 100, slope=0, aspect=0)


}
\references{
Bonan, G. (2019). Climate change and terrestrial ecosystem modeling. Cambridge University Press, Cambridge, UK.

De \enc{Cáceres}{Caceres} M, \enc{Martínez}{Martinez}-Vilalta J, Coll L, Llorens P, Casals P, Poyatos R, Pausas JG, Brotons L. (2015) Coupling a water balance model with forest inventory data to predict drought stress: the role of forest structural changes vs. climate changes. Agricultural and Forest Meteorology 213: 77-90 (doi:10.1016/j.agrformet.2015.06.012).

De \enc{Cáceres}{Caceres} M, Mencuccini M, Martin-StPaul N, Limousin JM, Coll L, Poyatos R, Cabon A, Granda V, Forner A, Valladares F, \enc{Martínez}{Martinez}-Vilalta J (2021) Unravelling the effect of species mixing on water use and drought stress in holm oak forests: a modelling approach. Agricultural and Forest Meteorology 296 (doi:10.1016/j.agrformet.2020.108233).

Granier A, \enc{Bréda}{Breda} N, Biron P, Villette S (1999) A lumped water balance model to evaluate duration and intensity of drought constraints in forest stands. Ecol Modell 116:269–283. https://doi.org/10.1016/S0304-3800(98)00205-1.

Jarvis, N.J., Jansson, P‐E., Dik, P.E. & Messing, I. (1991). Modelling water and solute transport in macroporous soil. I. Model description and sensitivity analysis. Journal of Soil Science, 42, 59–70.

Larsbo, M., Roulier, S., Stenemo, F., Kasteel, R. & Jarvis, N. (2005). An Improved Dual‐Permeability Model of Water Flow and Solute Transport in the Vadose Zone. Vadose Zone Journal, 4, 398–406.

Ruffault J, Pimont F, Cochard H, Dupuy JL, Martin-StPaul N (2022)
SurEau-Ecos v2.0: a trait-based plant hydraulics model for simulations of plant water status and drought-induced mortality at the ecosystem level.
Geoscientific Model Development 15, 5593-5626 (doi:10.5194/gmd-15-5593-2022).

Sperry, J. S., M. D. Venturas, W. R. L. Anderegg, M. Mencuccini, D. S. Mackay, Y. Wang, and D. M. Love. 2017. Predicting stomatal responses to the environment from the optimization of photosynthetic gain and hydraulic cost. Plant Cell and Environment 40, 816-830 (doi: 10.1111/pce.12852).
}
\seealso{
\code{\link{spwbInput}}, \code{\link{spwb}},  \code{\link{plot.spwb_day}},
\code{\link{growth_day}}
}
\author{
\itemize{
\item{Miquel De \enc{Cáceres}{Caceres} Ainsa, CREAF}
\item{Nicolas Martin-StPaul, URFM-INRAE}
}
}
