Split up soil into materials and soil nodes.

soil_to_param(soil, imodel = "MvG")

Arguments

soil

Data.frame with soil layer boundaries ('upper', 'lower') and hydraulic parameters. When imodel = 'MvG', columns of soil have to be named 'ths', 'thr', 'alpha', 'npar', 'ksat', 'tort', 'gravel'. When imodel = 'CH', columns have to be named thsat , 'thetaf','psif', 'bexp','kf', 'wetinf', 'gravel'.

imodel

Name of the hydraulic model ('MvG' or 'CH')

Value

a list with data.frames 'soil_nodes' and 'soil_materials'

Examples

data(slb1_soil)
soil <- slb1_soil
soil <- cbind(soil, hydpar_wessolek_tab(soil$texture))
str(soil)
#> 'data.frame':	21 obs. of  17 variables:
#>  $ horizon: chr  "I Ah" "I Aeh" "I Aeh" "I Aeh" ...
#>  $ upper  : num  0 -0.01 -0.03 -0.05 -0.08 -0.12 -0.16 -0.22 -0.28 -0.36 ...
#>  $ lower  : num  -0.01 -0.03 -0.05 -0.08 -0.12 -0.16 -0.22 -0.28 -0.36 -0.44 ...
#>  $ texture: chr  "Ut3" "Ut3" "Ut3" "Ut3" ...
#>  $ bd     : num  1 1.1 1.1 1.1 1.4 1.4 1.4 1.4 1.4 1.4 ...
#>  $ gravel : num  0.04 0.04 0.04 0.04 0.04 0.04 0.04 0.04 0.04 0.04 ...
#>  $ sand   : num  11.2 11.2 11.2 11.2 11.2 11.2 11.2 11.2 11.2 11.2 ...
#>  $ silt   : num  74.6 74.6 74.6 74.6 74.6 74.6 74.6 74.6 74.6 74.6 ...
#>  $ clay   : num  14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 14.2 ...
#>  $ c_org  : num  9.55 6.62 6.62 6.62 1.25 1.25 1.25 1.25 1.25 1.25 ...
#>  $ ths    : num  0.403 0.403 0.403 0.403 0.403 ...
#>  $ thr    : num  0.0053 0.0053 0.0053 0.0053 0.0053 0.0053 0.0053 0.0053 0.0053 0.0053 ...
#>  $ alpha  : num  1.68 1.68 1.68 1.68 1.68 ...
#>  $ npar   : num  1.21 1.21 1.21 1.21 1.21 ...
#>  $ mpar   : num  0.171 0.171 0.171 0.171 0.171 ...
#>  $ ksat   : num  277 277 277 277 277 ...
#>  $ tort   : num  -1.2 -1.2 -1.2 -1.2 -1.2 ...

soil_layers_materials <- soil_to_param(soil)
soil_layers_materials
#> $soil_nodes
#>     layer upper lower thick midpoint   mat
#>     <int> <num> <num> <num>    <num> <int>
#>  1:     1  0.00 -0.01    10   -0.005     1
#>  2:     2 -0.01 -0.03    20   -0.020     1
#>  3:     3 -0.03 -0.05    20   -0.040     1
#>  4:     4 -0.05 -0.08    30   -0.065     1
#>  5:     5 -0.08 -0.12    40   -0.100     1
#>  6:     6 -0.12 -0.16    40   -0.140     1
#>  7:     7 -0.16 -0.22    60   -0.190     1
#>  8:     8 -0.22 -0.28    60   -0.250     1
#>  9:     9 -0.28 -0.36    80   -0.320     1
#> 10:    10 -0.36 -0.44    80   -0.400     1
#> 11:    11 -0.44 -0.52    80   -0.480     1
#> 12:    12 -0.52 -0.60    80   -0.560     1
#> 13:    13 -0.60 -0.70   100   -0.650     2
#> 14:    14 -0.70 -0.85   150   -0.775     2
#> 15:    15 -0.85 -1.00   150   -0.925     3
#> 16:    16 -1.00 -1.20   200   -1.100     3
#> 17:    17 -1.20 -1.40   200   -1.300     3
#> 18:    18 -1.40 -1.50   100   -1.450     4
#> 19:    19 -1.50 -1.70   200   -1.600     5
#> 20:    20 -1.70 -1.90   200   -1.800     5
#> 21:    21 -1.90 -2.10   200   -2.000     5
#>     layer upper lower thick midpoint   mat
#> 
#> $soil_materials
#>      mat    ths     thr alpha    npar   ksat   tort gravel
#>    <int>  <num>   <num> <num>   <num>  <num>  <num>  <num>
#> 1:     1 0.4031 0.00530 1.679 1.20668 277.08 -1.198   0.04
#> 2:     2 0.4003 0.00000 2.513 1.19338 404.09 -4.032   0.18
#> 3:     3 0.4003 0.00000 2.513 1.19338 404.09 -4.032   0.38
#> 4:     4 0.4380 0.14920 7.013 1.24572 625.31 -3.180   0.65
#> 5:     5 0.4091 0.07284 6.835 1.20501 982.00 -3.226   0.90
#>