View source: R/microclimatemodel.R
| runmicrosnow_hr | R Documentation |
Run snow microclimate model in hourly time increments
runmicrosnow_hr(
microsnow,
reqhgt,
pai_a = NA,
xyf = 1,
zf = NA,
slr = NA,
apr = NA,
hor = NA,
wsa = NA,
gmn = 0.3
)
microsnow |
an object of class microsnowin as returned by |
reqhgt |
specified height (m) above or below ground for which microclimate outputs are required. Negative below ground |
pai_a |
total plant area index above |
xyf |
optional input for called function |
zf |
optional input for called function |
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 |
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.
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)
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.