fnc_depth_disc: Create depth discretisation for soil data frame

View source: R/fnc_depth_disc.R

fnc_depth_discR Documentation

Create depth discretisation for soil data frame

Description

This function takes a soil data frame that contains the depth and thickness of the soil horizons and creates a soil data frame that creates n modelling nodes with thick_1 distance from the top to disk_gr1, n2 nodes with thick_2 distance from the top to disk_gr2, and n3 nodes with thick_3 distance below disk_gr2, while at the same time keeping the position of the soil horizons. Distances between nodes and soil horizon depths that do not add up to another layer are added to the layer above.

Usage

fnc_depth_disc(
  df,
  limit_bodtief = NA,
  thick_1 = 5,
  thick_2 = 10,
  thick_3 = 20,
  disk_gr1 = 50,
  disk_gr2 = 100
)

Arguments

df

data frame containing mandatory depth information on horizon number (mat), upper and lower as columns. Information of soil physics are optional and will be kept and returned.

limit_bodtief

max soil depth, default is NA and uses max soil depth as defined in df.LEIT. If not NA soil-dfs are created down to the depth specified here as depth in m, negative. Might be used to give room for different maxrootdepth - settings in fnc_get_params. In this case, soil depth may be reduced significantly.

thick_1

first set distance between nodes the function will build down to disk_gr1

thick_2

second set distance between nodes the function will build down to disk_gr2

thick_3

third set distance between nodes the function will build below disk_gr2

disk_gr1

border of the first thickness change form thick_1 to thick_2

disk_gr2

border of the second thickness change form thick_2 to thick_3

Value

A soil - data frame with a set position of soil nodes.

Examples

df.soil <- data.frame(
  "mat" = 1:4,
  "upper" = c(0,13,60,101),
  "lower" = c(13,60,101,135),
  "texture" = c("Ls2", "Ls3", "Ls3", "Lts")
)

df <- df.soil
fnc_depth_disc(df = df.soil)


rhabel/modLWFB90 documentation built on Nov. 21, 2024, 3:28 a.m.