Multi-rate Simulation
PlantSimEngine uses Dates.Period values for model cadence and temporal input windows. The same scene can run leaf biophysics hourly and a summary model daily.
daily = ModelSpec(
DailySummary();
name=:daily_summary,
on=One(scale=:Leaf),
inputs=(
:assimilation => One(
within=Self(),
application=:energy_balance,
var=:A,
policy=Integrate(),
window=Day(1),
),
:temperature => One(
within=Self(),
application=:energy_balance,
var=:Tₗ,
policy=Aggregate(),
window=Day(1),
),
),
every=ClockSpec(24.0, 24.0),
)Hourly applications use every=Hour(1). At compilation, PlantSimEngine resolves the source application and creates typed temporal streams. The daily consumer receives integrated assimilation and mean temperature without changing either producer model.
every=Day(1) runs every 24 hourly steps with the default phase. Use ClockSpec(24.0, 24.0) when the daily consumer should run at the end of each 24-hour window.
Available policies are HoldLast, Interpolate, Integrate, and Aggregate. Use MaxReducer() or MinReducer() with Aggregate for daily extrema.
PlantBiophysics also declares timestep hints:
using PlantBiophysics, PlantSimEngine, Dates
(energy=PlantSimEngine.timestep_hint(Monteith()),
photosynthesis=PlantSimEngine.timestep_hint(Fvcb()))(energy = (required = (Dates.Minute(1), Dates.Hour(2)), preferred = Dates.Hour(1)), photosynthesis = (required = (Dates.Minute(1), Dates.Hour(6)), preferred = Dates.Hour(1)))Scenario-level every=... is authoritative; hints validate whether an inferred cadence is scientifically supported.