runmicrosnow_hr: Run snow microclimate model (hourly)

View source: R/microclimatemodel.R

runmicrosnow_hrR Documentation

Run snow microclimate model (hourly)

Description

Run snow microclimate model in hourly time increments

Usage

runmicrosnow_hr(
  microsnow,
  reqhgt,
  pai_a = NA,
  xyf = 1,
  zf = NA,
  slr = NA,
  apr = NA,
  hor = NA,
  wsa = NA,
  gmn = 0.3
)

Arguments

microsnow

an object of class microsnowin as returned by snowmodelin()

reqhgt

specified height (m) above or below ground for which microclimate outputs are required. Negative below ground

pai_a

total plant area index above reqhgt. Estimated if not supplied (see details).

xyf

optional input for called function snowwind()

zf

optional input for called function wind()

slr

an optional SpatRaster object of slope values (Radians). Calculated from dtm if not supplied.

apr

an optional SpatRaster object of aspect values (Radians). Calculated from dtm if not supplied.

hor

an optional array of the tangent of the angle to the horizon in 24 directions. Calculated from dtm if not supplied.

wsa

an optional array of wind shelter coefficients in 8 directions. Calculated from dtm if not supplied.

gmn

optional minimum convective conductance value (mol/m^2/s). See snowwind())

Details

pai_a is used to calculate the radiation intercepted by leaves at reqhgt if below canopy. If not supplied it is calculated from total plant area index by assuming a realistic shape to the vertical profile foliage within the canopy. Wind speed and radiation values are only returned when reqhgt > 0. To derive radiation values when reqhgt = 0, set pai_a to microsnow$pai. If supplied, pai_a must have the same dimensions as microsnow$pai. I.e. with the same x and y dims as the the supplied dtm and values for each hour as the z dimension.

Value

an object of class microsnowout with the following components:

Tz Array of air temperatures at height reqhgt (deg C). Identical to T0 if reqhgt = 0.

tleaf Array of leaf temperatures at height reqhgt (deg C). NA if reqhgt greater than canopy height or reqhgt <= 0.

T0 Array of ground surface temperatures (deg C)

relhum Array of relative humidities at height reqhgt (percentage). NA if reqhgt <= 0.

windspeed Array of wind speeds at height reqhgt (m/s). NA if reqhgt <= 0.

Rdirdown Array of downward direct shortwave radiation incident on horizontal surface (W/m^2)

Rdifdown Array of downward diffuse shortwave radiation incident on horizontal surface (W/m^2)

Rlwdown Array of downward longwave radiation incident on horizontal surface (W/m^2)

Rswup Array of upward shortwave radiation (assumed diffuse) incident on underside of horizontal surface (W/m^2)

Rlwup Array of upward longwave radiation incident on underside of horizontal surface (W/m^2)

Examples

## Not run: 
if(interactive()){
 require(NicheMapR)
 require(terra)
 require(abind)
 # Derive estimates of snow melt temperature parameters using NicheMapR
 nmrout<-runNMRSnow(climdata,precd,66.215,29.293,ALTT = 360)
 STparams<-fitsnowtemp(climdata,precd,nmrout$SNOWDEP,nmrout$SNOWTEMP)
 meltfact<-fitsnowdepth(climdata,nmrout$SNOWDEP,precd,STparams=STparams)$meltfact
 # Run snow model in spatial mode (takes ~3 mins)
 snowdepth<-nmrout$SNOWDEP
 snow<-modelsnowdepth(climdata,precd,snowdepth,dtm,pai,hgt,STparams,meltfact,spatial=T)
 # Prepare microclimate model inputs
 microsnow<-snowmodelin(climdata,precd,snow,STparams,dtm,pai,hgt,x=1,clump=0.2,soiltype=7,windhgt=2)
 mout<-runmicrosnow_hr(microsnow, reqhgt = 0.05)
 plot(rast(mout$Tz[,,500])) # Air temperature, 500th hour
 }

## End(Not run)

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