`R/TsoilFunctions.R`

`soil_temperature_function.Rd`

This function is called to calculate soil temperature as in Beckman et al. (1973) . Parameters are passed as a list to facilitating solving the equations. This function is not intended to be called directly. The energy balance equations are from Porter et al. (1973) and Kingsolver (1979)

`soil_temperature_function(j, T_so, params)`

- j
`numeric`

the number of the iteration of running the model.- T_so
`numeric`

the initial soil temperature profile in C.- params
`list`

containing the following param, which are described or calculated in`soil_temperature`

:`SSA, epsilon_so, k_so, c_so, dz, z_r, z0, H, T_a, u, rho_a, rho_so, c_a, TimeIn, dt, shade`

.

Soil temperature profile as a `list`

.

Beckman WA, Mitchell JW, Porter WP (1973).
“Thermal Model for Prediction of a Desert Iguana's Daily and Seasonal Behavior.”
*Journal of Heat Transfer*, **95**(2), 257-262.
doi:10.1115/1.3450037
.

Kingsolver JG (1979).
“Thermal and hydric aspects of environmental hetergeneity in the pitcher plant mosquito.”
*Ecological Monographs*, **49**, 357-376.

Porter WP, Mitchell JW, Bekman A, DeWitt CB (1973).
“Behavioral implications of mechanistic ecology: thermal and behavioral modeling of desert ectotherms and their microenvironments.”
*Oecologia*, **13**, 1-54.

Other soil temperature functions:
`soil_conductivity()`

,
`soil_specific_heat()`

,
`soil_temperature_equation()`

,
`soil_temperature_integrand()`

,
`soil_temperature()`

```
set.seed(123)
temp_vector <- runif(96, min = -10, max = 10)
wind_speed_vector <- runif(96, min = 0, max = 0.4)
time_vector <- rep(1:24, 4)
solrad_vector <- rep(c(rep(0, 6),
seq(10, 700, length.out = 6),
seq(700, 10, length.out = 6),
rep(0, 6)),
4)
params <- list(SSA = 0.7,
epsilon_so = 0.98,
k_so = 0.293,
c_so = 800,
dz = 0.05,
z_r = 1.5,
z0 = 0.02,
H = solrad_vector,
T_a = temp_vector,
u = wind_speed_vector,
rho_a = 1.177,
rho_so = 1620,
c_a = 1006,
TimeIn = time_vector,
dt = 60 * 60,
shade = FALSE)
soil_temperature_function(j = 1,
T_so = rep(20,13),
params = params)
#> [[1]]
#> [1] -32.88469 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
#> [8] 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
#>
```