# Example 1: printing information about the 'BioCro' module library's
# 'c3_assimilation' module to the R console
module_info('BioCro:c3_assimilation')
# Example 2: getting the inputs to the 'BioCro' module library's
# 'thermal_time_linear' module, generating a default input list, and using it to
# run the module
info <- module_info('BioCro:thermal_time_linear', verbose = FALSE)
inputs <- quantity_list_from_names(info$inputs) # All inputs will be set to 1
outputs <- evaluate_module('BioCro:thermal_time_linear', inputs)
# Example 3: calculating the temperature response of light saturated net
# assimilation at several values of relative humidity in the absence of water
# stress using the 'BioCro' module library's 'c3_assimilation' module and
# the default soybean parameters. Here, the leaf temperature and humidity values
# are independent of each other, so we use the `expand.grid` function to form a
# data frame of all possible combinations of their values. Then we set the
# ambient temperature equal to the leaf temperature.
rc <- module_response_curve(
'BioCro:c3_assimilation',
within(soybean$parameters, {Qabs = 2000; StomataWS = 1; gbw = 1.2}),
within(
expand.grid(
Tleaf = seq(from = 0, to = 40, length.out = 201),
rh = c(0.2, 0.5, 0.8)
),
{temp = Tleaf}
)
)
caption <- paste(
"Response curves calculated with several RH\nvalues and Q =",
unique(rc$Qp),
"micromol / m^2 / s\nusing the",
unique(rc$module_name),
"module"
)
lattice::xyplot(
Assim ~ Tleaf,
group = rh,
data = rc,
auto = TRUE,
type = 'l',
main = caption
)
Run the code above in your browser using DataLab