To run Yplant, a weather object needs to be constructed, that contains solar
position data, radiation, air temperature, and so on. This function generates
a daily diurnal weather dataset using a fairly standard weather generator, or
constructs the weather object with user-specified data. See Details.
A built-in weather generator simulates the following variables:
altitude,azimuth
Position of the sun (degrees).
PAR
Photosynthetically active radiation (mu mol m-2 s-1).
fbeam
Fraction direct beam of PAR (-).
Tair
Air temperature
(deg C).
VPD
Vapor pressure deficit.
The following two variables
are user input, and have no within-day variation:
Ca
Atmospheric CO2 concentration (ppm). (Default = 390ppm).
Patm
Atmospheric pressure (kPa). (Default = 1.01kPa).
If you are curious about the algorithm, please check the code (type
setMet).
To generate a weather dataset, simply use this command:
The names
of the variables need to be *exactly* as described above (and are
case-sensitive!).
If solar altitude and azimuth are not provided, they will be calculated from
the location object. In the case that fbeam = 0, though, the solar
position has no effect and is ignored, and not calculated.
A Yplant location object (class 'yplocation', see
setLocation).
metdat
Optionally, a dataframe (or name of CSV file) with standard
weather variables.
year
Optional (slight effects on solar path).
month
1-12
day
day of month
nsteps
number of steps (will affect number of simulation steps in
YplantDay.
PARday
Total daily PAR on a horizontal surface (MJ m-2 d-1).
AtmTrans
Atmospheric transmission.
fbeamday
Daily beam fraction.
fbeammethod
If 'Spitters', uses the Spitters algorithm to estimate
fbeam by timestep, otherwise it is constant (and given by fbeamday.
Tmin, Tmax
Daily minimum and maximum temperature (deg C).
VPDmax
Optional. Daily maximum VPD (if not given, estimated from
Tmin).
maxlag
Lag of temperature maximum behind solar maximum (fraction of
day).
Ca
Atmospheric CO2 concentration (ppm).
Patm
Atmospheric pressure (kPa).
Value
An object of class 'ypmet', a list with the following components:
dat
A dataframe with the weather variables (see Details for
a description).
method
Either 'generated' (weather generator was
used), or 'input' when user provided metdata.
daylength
in hours
sunset,sunrise
in hours
location
A Yplant location object (class 'yplocation', see setLocation
Author(s)
Remko Duursma. Solar path and diffuse partitioning code borrowed
from Maestra (thanks to Belinda Medlyn).
References
For fraction diffuse radiation, uses the 'Spitters algorithm':
Spitters, C.J.T., Toussaint, H.A.J.M., Goudriaan, J., 1986, Separating the
diffuse and direct component of global radiation and its implications for
modeling canopy photosynthesis. Part I. Components of incoming radiation, Ag.
For. Meteorol., 38:217-229.