runbioclim: Generates microclimate equivalent of bioclim variables

View source: R/Cppwrappers.R

runbioclimR Documentation

Generates microclimate equivalent of bioclim variables

Description

The function 'runbioclim' runs the microclimate model to produce a list of SpatRasters each equivalent to the 19 bioclimate variables produced by www.worldclim.org.

Usage

runbioclim(
  climdata,
  reqhgt,
  vegp,
  soilc,
  dtm,
  dtmc = NA,
  tme = NA,
  temp = "air",
  zref = 2,
  windhgt = zref,
  soilm = NA,
  runchecks = TRUE,
  altcorrect = 0,
  pai_a = NA,
  tfact = 1.5,
  out = rep(TRUE, 19),
  vegpisannual = TRUE
)

Arguments

climdata

a data.frame or list of arrays of weather variables as for [runpointmodel()] or [runpointmodela()]. Can be for more than one year.

reqhgt

height (m) for which microclimate variables are needed (<0 if below ground)

vegp

an object of class vegparams as returned by [vegpfromhab()] (see details)

soilc

an object of class soilcharac as returned by [soilcfromtype()]

dtm

a SpatRaster of elevations for the study area

dtmc

a SpatRaster object giving the resolution, spatial extent, and projection of the climate data used when running [micropointa()]. Ignored if climate data are provided as a data.frame. Must give elevations in metres if 'altcorrect' > 0 or if setting runchecks to TRUE.

tme

POSIXlt object giving the dates and times for each weather variable. Used only if 'climdata' provided as arrays.

temp

one of 'air' or 'leaf' indicating whether outputs represent leaf or air temperatures.

zref

height above ground (m) of temperature measurements in climdata

windhgt

height above ground (m) of wind speed data inclimdata.

soilm

optional vector of soil moisture values in upper 10 cm of the soil (calculated if not supplied)

runchecks

optional logical indicating whether to call [checkinputs()] to run

altcorrect

a single numeric value indicating whether to apply an elevational lapse rate correction to temperatures (0 = no correction, 1 = fixed lapse rate correction, 2 = humidity-dependent variable lapse rate correction, see [runmicro()]).

pai_a

an array of plant area index values above 'reqhgt'. Determined from total 'pai' if not supplied.

tfact

coefficient determining sensitivity of soil moisture to variation in topographic wetness (see [soilmdistribute()])

out

optional vector of logicals indicating which bioclim variables to return. Default all 19.

vegpisannual

optional logical used when vegetation varies temporally to indicate whether vegetation data correspond to values for a full annual cycle. Relevent if 'climdata' represent data for more than one year.

Details

To enhance computational efficiency the microclimate model is run for selected days only. Thus, to compute mean annual temperature, the mean ambient temperature of each day in the input weather data is calculated, the day with median temperatures in each month selected and the mean across months calculated. This is not, strictly speaking, the same as the mean temperature, but differences are likely to be minor, and for each year of data supplied, there is an approximately 30-fold gain in computational efficiency by calculating BIO1 in this way. Similarly, to calculate maximum temperature (BIO5), the day of the year with the hottest ambient temperature is selected, and microclimate temperatures calculated on this day only. This ignores the possibility that on a slightly cooler, but sunnier day, microclimate temperatures may be hotter hotter at certain locations. If 'hourly = TRUE' all hours within a given day are selected and calculations performed on hourly data. If If 'hourly = FALSE' only the hours corresponding to times when hourly temperatures are at their daily maximum and minimum and selected. This results in a c. 10-fold increase in computational efficiency, but cannot pick out areas where terrain results in near-ground temperatures reaching a maximum later in the afternoon than the peak in ambient temperature. If weather data for more than one year are supplied, only one set of median, maximum and minimum monthly temperature data are selected representing an average across years. Resultant, there is little computational penalty if providing data for multiple years in comparison to one year of data.

Value

a multilayer SpatRast of the following:

BIO1

Mean of monthy median temperatures (degrees C)

BIO2

Mean diurnal temperature range (degrees C)

BIO3

Isothermality (BIO2/BIO7) (×100)

BIO4

Temperature Seasonality (standard deviation of monthly median temperatures × 100)

BIO5

Maximum temperature (degrees C)

BIO6

Minimum temperature (degrees C)

BIO7

Temperature Annual Range (BIO5-BIO6) (degrees C)

BIO8

Mean of monthly median temperatures in wettest three months (degrees C)

BIO9

Mean of monthly median temperatures in driest three months (degrees C)

BIO10

Mean of monthly median temperatures in warmest three months (degrees C)

BIO11

Mean of monthly median temperatures in coldest three months (degrees C)

BIO12

Mean of monthly soil moistures (m^3 / m^3)

BIO13

Wettest soil moisture of days with median temperature (m^3 / m^3)

BIO14

Driest soil moisture of days with median temperature(m^3 / m^3)

BIO15

Soil moisture seasonality (Coefficient of Variation) on day in each month with median temperature

BIO16

Mean soil moisture of wettest three months (m^3 / m^3)

BIO17

Mean soil moisture of driest three months (m^3 / m^3)

BIO18

Mean soil moisture of warmest three months (m^3 / m^3)

BIO19

Mean soil moisture of coldest three months (m^3 / m^3)

Examples

# Run bioclim model with default inputs
bioclim <- runbioclim(climdata, 0.05, vegp, soilc, dtm)
plot(bioclim[[1]]) # mean annual temperature

ilyamaclean/microclimf documentation built on Sept. 28, 2024, 4:55 p.m.