A built-in weather generator simulates the following variables:
If you are curious about the algorithm, please check the code (type
setMet).
To generate a weather dataset, simply use this command:
aprilday <- setMet(richmond, nsteps=12, Tmin=9, Tmax=25, month=6, day=21)Where
richmond is a Yplant location object, generated with
setLocation.The weather object can be plotted: the following command produces a simple built-in graph of PAR, Tair, VPD and fbeam:
plot(aprilday)
Alternatively, the user can input a dataframe (or CSV file) that contains the weather variables (or a subset of them). For example,
mymet <- data.frame(Tair=20, PAR0=seq(5,1000,length=10), fbeam=0, Ca=400)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.
setMet(location = NULL, metdat = NULL, year = 2012, month = NA, day = NA, nsteps = 10, PARday = 22, AtmTrans = 0.76, fbeamday = NA, fbeammethod = c("spitters", "constant"), Tmin = 10, Tmax = 25, VPDmax = NA, maxlag = 0.1, Ca = 390, Patm = 101)setLocation).YplantDay.fbeamday.Tmin).metdata.setLocationSpitters, 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.
setPhy,setLocation