soil_temperature_function: Core Function for Calculating Soil Temperature

soil_temperature_functionR Documentation

Core Function for Calculating Soil Temperature

Description

This function is called to calculate soil temperature as in \insertCiteBeckman1973;textualTrenchR. 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 \insertCitePorter1973;textualTrenchR and \insertCiteKingsolver1979;textualTrenchR

Usage

soil_temperature_function(j, T_so, params)

Arguments

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, S, T_a, u, rho_a, rho_so, c_a, TimeIn, dt, shade.

Value

Soil temperature profile as a list.

Author(s)

Joseph Grigg

References

\insertAllCited

See Also

Other soil temperature functions: soil_conductivity(), soil_specific_heat(), soil_temperature_equation(), soil_temperature_integrand(), soil_temperature()

Examples

  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, 
                            S          = 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)




trenchproject/TrenchR documentation built on Oct. 10, 2023, 10:12 p.m.