View source: R/microclimatemodel.R
snowmodelin | R Documentation |
The function snowmodelin
creates an object of class microsnowin
which unpacks various component inputs and reformats as required
for running the model in hourly timesteps. Here it is assumed that the input
weather data are a data.frame - i.e. not spatially variable.
snowmodelin(
weather,
precd,
snow,
STparams,
dtm,
pai,
hgt,
x,
clump,
windhgt = 2
)
weather |
a data.frame of weather variables (see details) |
precd |
a vector of daily precipitation |
snow |
an object of class |
STparams |
now temperature model coefficients as derived by |
dtm |
PackedSpatRaster or SpatRast object of elevations (see details) |
pai |
a single numeric value, matrix, SpatRast or array of plant area idex values. |
hgt |
ackedSpatRaster or SpatRast of vegetation heights |
x |
optional single numeric value, SpatRast, matrix or array of leaf angle coefficients (see details) |
clump |
a single numeric value or array of values between 0 and 1 indicating the fraction of radiation passing through larger gaps in the canopy, |
windhgt |
height above round of wind speed measurement (m) |
The format and and units of weather
must follow that in the example
dataset climdata
. The x,y and z units of dtm
must be all be in
metres and the coordinate reference system must be defined. Canopy heights
are assumed time-invariant over the period the model is run, and must
be supplied as a SpatRast with coordinates and extent matching dtm
.
pai
, x
and clump
can either be assumed spatially and temporally invariant(supplied as single numeric values), temporally invariant (supplied as matrices or SpatRasts with extent and coordinate reference system matching
dtmor spatially and temporally variant - x & y dims must match
dtmz dim must of length
weather$temp'
). The coefficient x represents the ratio of of vertical to horizontal projections of
leaf foliage (see Campbell 1986 Agric For Meteorol, 36: 317-21 for details). As
not all wind measurements are at reference height, the height of the wind speed measurement
must be specified if not 2 m. To enable calculation of below-canopy wind profiles
in tall canopy, the wind speed is adjusted to give values for a height 2 m above
the maximum vegetation height, using the wind-height profile for a reference grass
surface.
an object of class microsnowin
used by runmicrosnow_hr()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.