Learn R Programming

YplantQMC (version 0.6-6)

YplantDay: Run a simulation over a day with YplantQMC

Description

Interface to daily simulations with YplantQMC. Two objects are required to run the simulation: a plant3d object, containing the plant structure information, and a met object, containing weather data, solar position, and number of timesteps.

Optionally, a phy object is used which contains the leaf gas exchange model for the simulation, to calculate photosynthesis (and possibly transpiration rate) from light capture and other weather variables.

Also optional is the use of a hemi object, which specifies shading by a canopy.

If you don't know where to start, run the example at the bottom of this page.

See the arguments list above for the functions that are used to generate each of the four objects. Note that the plant and met objects are required, and phy and hemi are optional.

This function is a user-friendly wrapper for runYplant. That function should be used for all advanced simulations.

Usage

YplantDay(x, ...)
"YplantDay"(x, met, phy = NULL, hemi = NULL, ...)
"YplantDay"(x, ...)
"YplantDay"(x, met, phy = NULL, hemi = NULL, quiet = FALSE, writePSR = TRUE, PSRsuffix = "", writeOUT = FALSE, ...)

Arguments

x
An object of class 'plant3d' or 'plant3dlist' (see constructplant and readplantlist).
met
An object of class 'ypmet', see setMet
phy
An object of class 'ypphy', see setPhy
hemi
An object of class 'yphemi', see setHemi
quiet
If TRUE, does not write messages to the console.
writePSR
If TRUE, writes a PSR output file.
PSRsuffix
A suffix to be added to the PSR files that are written to disk.
writeOUT
If TRUE, writes an OUT output file.
...
Further arguments passed to runYplant

Value

The YplantDay functions returns a list of class yplantsim, which has print and plot methods (see Examples).The list has the following components:
plant
The plant object used in the simulation
phy
If provided, the phy object used in the simulation
hemi
If provided, the hemi object used in the simulation
outdata
A very lengthy dataframe with all results (see below)
nsteps
Number of timesteps
psrdata
Totals and averages by timestep (dataframe), see psrdata
met
The met object used in the simulation
The outdata dataframe in the yplantsim object lists results for individual leaves, has the following variables.
timeofday
Time of day for current timestep (hours)
leafnr
Leaf number
timestep
Length of current timestep (seconds)
PAR0
Above-canopy PAR
PARleaf
Total PAR absorption
PARdir
Direct solar radiation PAR absorption
PARdiff
Diffuse PAR absorption
reldiff
Relative diffuse radiation absorption (0-1).
reldir
Relative direct radiation absorption (0-1).
LA
Individual leaf area (mm2)
LAproj
Projected leaf area (mm2)
LAsunlit
Sunlit, or 'displayed' 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 unshaded leaf (mu mol m-2 s-1)
Where PAR is photosynthetically active radiation (mu mol m-2 s-1).The absorptions reldiff and reldir are relative to an unshaded horizontal surface.To extract relative diffuse radiation absorption from an yplantsim object, for example:
 
mysim <- YplantDay(myplant, mymet)
reldif<- mysim$outdata$reldiff 

See Also

runYplant,ypreport

Examples

Run this code


## Not run: 
# # Set location,
# southernfrance <- setLocation(lat=44)
# 
# # A daily weather object, use a constant beam fraction of 0.4.
# sunnyday <- setMet(southernfrance, month=6, day=21, nsteps=12, Tmin=9, Tmax=29, PARday=22,
# fbeamday=0.4, fbeammethod="constant")
# 
# # Light response curve:
# toonalrc <- setPhy("lightresponse", 
# leafpars=list(Amax=14.5, Rd=1.4, phi=0.05, theta=0.5, reflec=0.1, transmit=0.05))
# 
# # Run YplantQMC for a day. Use the built-in 'largegap' hemiphoto.
# toonarun <- YplantDay(toona, sunnyday, toonalrc, largegap)
# ## End(Not run)


Run the code above in your browser using DataLab