Learn R Programming

YplantQMC (version 0.6-6)

runYplant: A single simulation of YplantQMC

Description

Runs the YplantQMC model for one timestep. Runs the QuasiMC raytracer to estimate absorbed PAR for every leaf on the plant, given diffuse and direct radiation (set by fbeam, see below), the position of the sun, and reflectance and transmittance of the foliage material.

Required is a 3D plant object (see constructplant). Optionally, a leaf gas exchange model is used (not needed if only light absorption is calculated) to calculate photosynthesis (and optionally, transpiration rate). Also optionally, a hemiphoto object is used to calculate shading by the overstorey canopy.

Output is not as easy to use as the more user-friendly YplantDay. If you are only interested in diurnal simulations (and plant totals by timestep), use that function. The runYplant function is available for programming purposes (and more advanced custom simulations).

The arguments intern, debug, delfiles and rewriteplantfile should not be set by the user, unless you really know what you are doing. These arguments exist for testing, and are used by YplantDay.

The arguments reldiff and reldir can be supplied if they are already known (from a previous simulation, when the solar angle was the same, in particular). If you are not sure, please do not set these arguments!

Usage

runYplant(x, ...)
"runYplant"(x, ...)
"runYplant"(x, phy = NULL, hemi = NULL, reldiff = NULL, reldir = NULL, altitude = 90, azimuth = 0, fbeam = 1, VPD = 1.5, PAR0 = 1, PARwhere = c("above", "below"), Ca = 390, Tair = 25, Patm = 101, reflec = c(0.1, 0.1), transmit = c(0.1, 0.1), runphoto = TRUE, intern = TRUE, debug = FALSE, delfiles = TRUE, rewriteplantfile = TRUE, ...)

Arguments

x
An object of class 'plant3d', see constructplant
phy
An object of class 'ypphy', see setPhy
hemi
An object of class 'yphemi', see setHemi
reldiff
Optional. A vector of relative diffuse absorption, same length as number of leaves. See Details.
reldir
Optional. A vector of relative direct absorption, same length as number of leaves. See Details.
altitude, azimuth
Solar altitude and azimuth (degrees).
fbeam
Beam fraction (0-1). If 0, only diffuse interception is calculated, if 1, only direct.
VPD
Vapor pressure deficit (kPa)
PAR0
Incident PAR on a horizontal surface (mu mol m-2 s-1).
PARwhere
If 'above', PAR0 is given as an above-canopy value. If 'below', it is below the canopy. See Details.
Ca
Atmospheric CO2 concentration (ppm).
Tair
Air temperature (deg C).
Patm
Atmospheric pressure (kPa).
reflec
Leaf reflectance (top, bottom of leaf).
transmit
Leaf transmittance (top, bottom of leaf).
runphoto
Whether to run leaf gas exchange model (default TRUE, or FALSE when no phy object given).
intern
If FALSE, returns output of QuasiMC to the console.
debug
If TRUE, opens the QuasiMC debug window (for testing).
delfiles
If TRUE, deletes intermediate files, and QuasiMC in/output files.
rewriteplantfile
If TRUE, writes the plant QuasiMC input file.
...
Further arguments passed to writecfg.

Value

This returns a dataframe with one row per leaf. The variables included are (PAR is in units mu mol m-2 s-1):
PAR0
Incident PAR on a horizontal surface *above* the canopy
PARinc
Incident PAR on a horizontal surface *below* the canopy
PARleaf
Absorbed PAR (for each leaf)
PARdir
Absorbed direct PAR
PARdiff
Absorbed diffuse PAR
reldiff
Relative diffuse absorbed PAR (0 - 1)
reldir
Relative direct absorbed PAR (0 - 1)
LA
Leaf area (mm2)
LAproj
Projected leaf area (mm2)
LAsunlit
Sunlit leaf area (mm2)
A
CO2 assimilation rate (mu mol m-2 s-1)
E
Transpiration rate (mmol m-2 s-1)
gs
Stomatal conductance (mol m-2 s-1)
A0
CO2 assimilation rate for a horizontal leaf *below* the canopy.

See Also

YplantDay, setPhy, setHemi.

Examples

Run this code


## Not run: 
# 
# # Compare diffuse only to direct only
# run_dir <- runYplant(pilularis, fbeam=1, altitude=90, azimuth=0, reflec=0.15, transmit=0.1)
# run_diff <- runYplant(pilularis, fbeam=0, reflec=0.15, transmit=0.1)
# 
# # Compare density functions of absorbed PAR by leaf:
# plot(density(run_dir$PARleaf, from=0, to=1), xlim=c(0,1), main="", lwd=2, col="blue",
# xlab="Absorbed PAR (relative units)")
# lines(density(run_diff$PARleaf, from=0, to=1), lwd=2, col="red")
# legend("topright",c("Diffuse","Direct"), lwd=2, col=c("red","blue"))
# ## End(Not run)

Run the code above in your browser using DataLab