View source: R/snowdistfunctions.R
modelsnowdepth | R Documentation |
modelsnowdepth
runs the spatial snow model to derive an
array of snow depths and temperatures for each time increment in weather
and over each grid cell of dtm
modelsnowdepth(
weather,
precd,
snowdepth,
dtm,
pai,
hgt,
STparams,
meltfact = NA,
slr = NA,
apr = NA,
plai = 0.3,
x = 1,
lat = NA,
long = NA,
snowenv = "Taiga",
tpi_radius = 200,
tfact = 10,
snowem = 0.99,
zmin = 0.002,
umin = 0.5,
astc = 1.5,
spatialmelt = FALSE,
Sh = 6.3,
zu = 2,
xyf = NA,
initdepth = 0,
out = "hourly",
clump = 0.2
)
weather |
a data.frame of weather variables (see details). |
precd |
a vector of daily precipitation (mm). |
snowdepth |
a numeric vector of length equal to the number of timesteps (e.g. nrow(weather)) representing average snowdepth, in cm,
across the scene as e.g. returned by |
dtm |
a SpatRast of elevations (m). the x and y dimensions of the raster must also be in metres |
pai |
a single numeric value, SpatRast or array of plant area index values |
hgt |
a SpatRast of vegetation heights |
STparams |
snow temperature model coefficients as derived by |
meltfact |
snow melt coefficient as returned by |
slr |
an optional SpatRast of slope values (Radians). Calculated from dtm if not supplied, but outer cells will be NA. |
apr |
an optional SpatRast of aspect values (Radians). Calculated from dtm if not supplied, but outer cells will be NA. |
plai |
a single numeric value, SpatRast or array of the proprotion of plant area index values that are leaves |
x |
optional single numeric value, SpatRast, matrix or array of leaf distribution coefficients |
lat |
latitude of location (decimal degrees). Derived from |
long |
longitude of location (decimal degrees). Derived from |
snowenv |
one of |
tpi_radius |
radius for applying topographic positioning index when distributing snow as returned by |
tfact |
single numeric value specifying sensitivity of snow distribution to topographic positioning index |
snowem |
optionally, numeric value of snow emissivity |
zmin |
optionally, numeric value of roughness length for momentum transfer of snow surface without vegetation protruding (m) |
umin |
optionally, numeric value indicating minimum wind speed used in conductivity calculations (m/s) |
astc |
optionally, numeric value indicating the temperature at which precipitation falls as snow (deg C) |
spatialmelt |
optional logical indicating whether or not snow melt varies spatially (e.g. greater on sun-facing slopes). Model takes longer to run if |
Sh |
optionally, branch snow load coefficient (kg/m^2). 6.6 for pine and 5.9 kg for spruce. |
zu |
height above ground of wind speed measurement in |
xyf |
number of grid cells over which to smooth vertical wind height profile |
initdepth |
single numeric value or matrix of initial snow depths at start of model run |
out |
optional variable indicating whether to return hourly or daily snow depths (default is hourly) |
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,
( see |
#' @details The format and and units of weather
must follow that in the example
dataset climdata
. The paramater snowenv
is used to compute snow density
following Sturm et al (2010) J Hydrometeorology 11: 1380-1393. The leaf distribution angle
coefficient is the ratio of vertical to horizontal projections of leaf foliage (~1 for decidious woodland).
a list of the following:
gsnowdepth
array of predicted ground snow depth (cm) across the scene
canswe
array of predicted canopy snow water equivalent (mm / m^2) across the scene
snowtempG
array of predicted ground snow surface temperature (deg C) across the scene
# Run snow model with defaults and inbuilt datasets and model coefficients (takes 20 seconds)
snd<-nowdepth$snowdepth # snow depth vector
mout1<-modelsnowdepth(climdata,precd,snd,dtm,pai,hgt,STparams,SDparams$meltfact)
# Run snow model with defaults, but allowing spatially variable snow melt (takes ~100 seconds)
mout2<-modelsnowdepth(climdata,precd,snd,dtm,pai,hgt,STparams,SDparams$meltfact,spatialmelt = TRUE)
# Compare results
msnowdepth1<-apply(mout1$gsnowdepth,c(1,2),mean)
msnowdepth2<-apply(mout2$gsnowdepth,c(1,2),mean)
snowdif<-msnowdepth2-msnowdepth1
par(mfrow=c(2,2))
plot(rast(msnowdepth1))
plot(rast(msnowdepth2))
plot(rast(snowdif))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.