snowmodelin: Create object of class microsnowin

View source: R/microclimatemodel.R

snowmodelinR Documentation

Create object of class microsnowin

Description

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.

Usage

snowmodelin(
  weather,
  precd,
  snow,
  STparams,
  dtm,
  pai,
  hgt,
  x,
  clump,
  windhgt = 2
)

Arguments

weather

a data.frame of weather variables (see details)

precd

a vector of daily precipitation

snow

an object of class snow as created by modelsnowdepth()

STparams

now temperature model coefficients as derived by fitsnowtemp()

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)

Details

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⁠dtm⁠or spatially and temporally variant - x & y dims must match⁠dtm⁠z 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.

Value

an object of class microsnowin used by runmicrosnow_hr()


ilyamaclean/microsnow documentation built on April 7, 2023, 8:55 a.m.