fnc_compare_soil: Soil comparison

View source: R/fnc_compare_soil.R

fnc_compare_soilR Documentation

Soil comparison

Description

This function enables the user to visually compare modelling options. As the soil input is likely to be very influencial for the model's output, this is also a reason to check for potentially confusing results.

The two main options are comparing the soil data itself, and comparing what the PTFs do with the data at hand.

Usage

fnc_compare_soil(
  df.ids,
  testgebiet = "BDS",
  what_to_test = "PTF",
  depths_to_test = c(-0.15, -0.3, -0.6),
  soiloptions_to_test = "STOK",
  MvG_own_vals = F,
  PTF_to_use = "HYPRES",
  PTF_to_test = "HYPRES",
  soiloption_to_use = "STOK",
  limit_MvG = F,
  df.soils = NULL,
  output_path,
  bze_buffer = NA,
  meta.out = NA
)

Arguments

df.ids

a data frame containing the following columns:

  • ID_custom - a unique ID-column for assignment that all intermediate products as well as the output will be assigned to

  • easting and northing - coordinates in UTM EPSG:32632

testgebiet

at the current stage of development, we're working with test areas that have to be named here as BDS for Bodensee/07b, or NPS for National Park Schwarzwald. Eventually, this should be replaced by a BW-wide option. This parameter might be useful if a spatial pre-selection should be included for performance optimization...

what_to_test

sets the main selection, whether soil data or PTF behaviour should be investigated.
Must be one of SOILDATA or PTFs.

MvG_own_vals

if what_to_test is SOILDATA and soiloption_to_test includes OWN:
will MvG parameters be provided (i.e. from lab analyses) or shall the PTF in PTF_to_use also be applied to the soil data in df.soils

PTF_to_use

which PTF should be applied for creating hydraulic information from soil data in soiloption_to_test. Must be one of HYPRES, PTFPUH2, or WESSOLEK.

PTF_to_test

if what_to_test is PTFs:
which PTFs should be compared. Must be any combination of HYPRES, PTFPUH2, or WESSOLEK and can include OWN_PARMS if own MvG parameters are given in df.soils

soiloption_to_use

which soil data should the PTFs in PTF_to_test be applied to. Must be one of STOK, BZE, or OWN if data is supplied at df.soils

limit_MvG

should the hydraulic parameters limited to "reasonable" ranges as described in fnc_limit. Default is FALSE.

df.soils

if OWN is selected in soiloptions_to_test, or OWN_PARMS is selected in PTF_to_test, these information must be provided here as a dataframe that contains the following columns:

  • ID_custom - a unique custom ID matching the ID_custom of df.ids

  • mat - number of soil layer starting with 1 counting upwards

  • upper and lower - upper and lower boundaries of soil layers in cm

  • humus - thickness of the humuslayer in m

Caution:
If PTFs are to be applied here, the columns sand, silt, clay, oc.pct in %, and bd in g m-1 must be provided.
Else, if PTF_to_test includes OWN_PARMS, the following columns must be provided NA-free: ths, thr, alpha, npar, mpar, ksat, and tort.

output_path

path to the folder where images shall be printed to

bze_buffer

whether buffer should be used in extracting points from BZE raster files if NAs occur in m, default is NA

depth_to_test

the depth in which comparisons should be made in m negative downwards from the surface. Default is c(-0.15, -0.30, -0.60).

soiloption_to_test

if what_to_test is SOILDATA:
which datasets should be compared. At least two of STOK, BZE, or OWN if own soil data is available.

Value

Returns one image for each ID in df.ids, showing water retention and conductivity curves if PTFs are investigated. If soil data is compared, soil texture triangle, bd, oc.pct and gravel are also shown.

Examples

# create folder for testfiles
dir.create("./testfiles/SOIL/", recursive = T)
dir.create("./testfiles/PTF/", recursive = T)
output1 <- paste0(getwd(), "/testfiles/SOIL/")
output2 <- paste0(getwd(), "/testfiles/PTF/")

# comparing the different soil data provided by STOK, BZE and OWN with HYPRES as PTF
fnc_compare_soil(df.ids = test.ids.bds,
                 testgebiet = "BDS",
                 what_to_test = "SOILDATA",
                 depths_to_test = c(-0.15, -0.30, -0.60),

                 soiloptions_to_test = c("STOK", "BZE", "OWN"),
                 MvG_own_vals = F,
                 PTF_to_use = "HYPRES",

                 limit_MvG = F,
                 df.soils = df.own.test,
                 output_path = output1)

# comparing how the three PTF options implemented in LWFBrook90 perform with the soil data from STOK
fnc_compare_soil(df.ids = test.ids.bds,
                 testgebiet = "BDS",
                 what_to_test = "PTFs",
                 depths_to_test = c(-0.15, -0.30, -0.60, -0.9),

                 PTF_to_test = c("HYPRES", "PTFPUH2", "WESSOLEK"),
                 soiloption_to_use = "BZE",

                 limit_MvG = F,
                 df.soils = NULL,
                 output_path = output2)

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