ptf_estimate: Estimate 'SWRC' parameters from soil texture with a...

View source: R/sw_Pedotransfer_Functions.R

ptf_estimateR Documentation

Estimate SWRC parameters from soil texture with a pedotransfer function

Description

Estimate SWRC parameters from soil texture with a pedotransfer function

Usage

ptf_estimate(
  sand,
  clay,
  fcoarse,
  bdensity = NULL,
  swrc_name,
  ptf_name,
  fail = FALSE,
  ...
)

Arguments

sand

A numeric value or vector. Sand content of the matric soil component (< 2 mm fraction; units of ⁠[g/g]⁠) of each soil layer.

clay

A numeric value or vector. Clay content of the matric soil component (< 2 mm fraction; units of ⁠[g/g]⁠) of each soil layer.

fcoarse

A numeric value or vector. Coarse fragments, e.g., gravel, (> 2 mm; units of ⁠[m3/m3]⁠) relative to the whole soil of each soil layer. fcoarse is required, for instance, to translate between values relative to the matric soil component (< 2 mm fraction) and relative to the whole soil (matric soil plus coarse fragments).

bdensity

A numeric value or vector. Density of the whole soil (matric soil plus coarse fragments; units ⁠[g/cm3]⁠).

swrc_name

An character string or vector. The selected SWRC name (one of swrc_names(), with default "Campbell1974").

ptf_name

An character string or vector. The selected PTF name (one of ptf_names(), with default "Cosby1984AndOthers").

fail

A logical value. Issue a warning (FALSE, default) or throw an error (TRUE) if request fails.

...

Additional parameters passed to selected PTF function.

Value

swrcp, i.e,. a numeric matrix where rows represent soil (layers) and columns represent a fixed number of SWRC parameters. The interpretation is dependent on the selected SWRC, see SOILWAT2 input file swrc_param.in ( system.file("extdata", "example1", "Input", "swrc_params.in", package = "rSOILWAT2") ).

Notes

swrc_names() lists implemented SWRCs; ptf_names() lists implemented PTFs; and check_ptf_availability() checks availability of PTFs.

The soil parameters sand, clay, fcoarse, and bdensity must be of the same length, i.e., represent one soil (length 1) or multiple soil (layers) (length > 1); however, bdensity may be NULL. The arguments selecting SWRC (swrc_name) and PTF (ptf_name) are recycled for multiple soil layers.

References

Cosby, B. J., G. M. Hornberger, R. B. Clapp, & T. R. Ginn. 1984. A statistical exploration of the relationships of soil moisture characteristics to the physical properties of soils. Water Resources Research, 20:682-690, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1029/WR020i006p00682")}

Examples

ptf_estimate(sand = c(0.5, 0.3), clay = c(0.2, 0.1), fcoarse = c(0, 0))

soils <- swSoils_Layers(rSOILWAT2::sw_exampleData)

# Use PTF "Cosby1984" to estimate parameters of SWRC "Campbell1974"
ptf_estimate(
  sand = soils[, "sand_frac"],
  clay = soils[, "clay_frac"],
  fcoarse = soils[, "gravel_content"],
  swrc_name = "Campbell1974",
  ptf_name = "Cosby1984"
)

# Use PTF "Rosetta3" to estimate parameters of SWRC "vanGenuchten1980"
if (check_ptf_availability("Rosetta3")) {
  ptf_estimate(
    sand = soils[, "sand_frac"],
    clay = soils[, "clay_frac"],
    fcoarse = soils[, "gravel_content"],
    bdensity = soils[, "bulkDensity_g/cm^3"],
    swrc_name = "vanGenuchten1980",
    ptf_name = "Rosetta3"
  )
}

# Use PTF "neuroFX2021" to estimate parameters of SWRC `FXW`
## Not run: 
# Set neuroFX2021 file path, see details in `ptf_neuroFX2021_for_FXW()`
options(RSW2_FILENEUROFX2021 = "path/to/sscbd.RData")

## End(Not run)

if (check_ptf_availability("neuroFX2021")) {
  ptf_estimate(
    sand = soils[, "sand_frac"],
    clay = soils[, "clay_frac"],
    fcoarse = soils[, "gravel_content"],
    bdensity = soils[, "bulkDensity_g/cm^3"],
    swrc_name = "FXW",
    ptf_name = "neuroFX2021"
  )
}


Burke-Lauenroth-Lab/Rsoilwat documentation built on Dec. 9, 2023, 12:41 a.m.