Learn R Programming

medfate (version 2.8.0)

spwb_sensitivity: Sensitivity analysis for soil plant water balance simulations

Description

Performs a set of calls to spwb with the aim to determine the sensitivity to particular parameters.

Usage

spwb_sensitivity(x, soil, meteo, 
                 paramType = "above", paramName = "LAI_live", cohort = 1,
                 p_change = c(-80,-40,-20,0,20,40,80), 
                 summary.fun = NULL, simplify=TRUE,...)

Value

If summary.fun = NULL the function returns a list whose elements are the result of calling spwb. Otherwise, the function applies summary.fun to each simulation result and returns these summaries (actually, a call to sapply is done).

Arguments

x

An object of class spwbInput.

soil

A list containing the description of the soil (see soil).

meteo

A data frame with daily meteorological data series (see spwb).

paramType

Data frame of x to modify.

paramName

Name of the parameter to modify.

cohort

Integer with the cohort to modify.

p_change

Numerical vector with percentages of change.

summary.fun

Summary function to be applied to the results of each simulation.

simplify

Whether the result of summary.fun should be simplified (see sapply).

...

Additional parameters to function spwb.

Author

Miquel De Cáceres Ainsa, CREAF

Details

Due to parameter dependence, modifying some parameters affects others:

  • Setting paramName = "Z50/Z95" affects belowLayers$V, belowLayers$VCroot_kmax and belowLayers$VGrhizo_kmax.

  • Modifying LAI_live also affects LAI_expanded.

  • Modifying VCroot_kmax from paramsTranspiration affects both VCroot_kmax and belowLayers$VCroot_kmax.

  • Modifying WaterStorage affects simultaneously Vleaf and Vsapwood from paramsWaterStorage.

  • Modifying c from paramsTranspiration affects simultaneously VCleaf_c, VCstem_c and VCroot_c.

  • Modifying d from paramsTranspiration affects simultaneously VCleaf_d, VCstem_d and VCroot_d.

  • Modifying Plant_kmax from paramsTranspiration affects VCleaf_kmax, VCstem_kmax, VCroot_kmax and belowLayers$VCroot_kmax.

  • Modifying Al2As from paramsAnatomy affects Vsapwood in paramsWaterStorage, VCstem_kmax and VCroot_kmax of paramsTranspiration and belowLayers$VCroot_kmax.

  • Setting paramName = "Vmax298/Jmax298" affects both Vmax298 and Jmax298 from paramsTranspiration.

See Also

spwb, summary.spwb

Examples

Run this code
if (FALSE) {
#Load example data and species parameters
data(examplemeteo)
data(exampleforestMED)
data(SpParamsMED)

#Initialize input
examplesoil = soil(defaultSoilParams(2))
control = defaultControl("Granier")
x = forest2spwbInput(exampleforestMED,examplesoil, SpParamsMED, control)

#Perform sensitivity analysis
res = spwb_sensitivity(x, examplesoil, examplemeteo, latitude = 41, elevation = 100)
}

Run the code above in your browser using DataLab