Write DSSAT v4.8 Soil File
write_soil_dssat.Rd
Function compute Soil information to DSSAT v4.8 soil file.
Usage
write_soil_dssat(
path = ".",
id_name,
soil_data,
salb = 0.13,
evapL = 6,
sldr = 0.6,
slnf = 1,
slpf = 1,
multi = FALSE
)
Arguments
- path
A string indicating path folder or working directory
- id_name
A String. 4 letters string of locality name. (ex. "JR")
- soil_data
A Data frame. Soil data. See
?soil
- salb
Numeric. Albedo, fraction
- evapL
Numeric. Evaporation limit, (mm)
- slnf
Numeric. Mineralization factor, 0 to 1 scale.
- slpf
Numeric. Photosynthesis factor, 0 to 1 scale
- multi
Logical. All soil profiles in the same file
- max_depth
description
Examples
# Write DSSAT v4.8 Soil file
soil_sample = dplyr::group_by(soil, NL) |>
dplyr::sample_n(1) |> dplyr::ungroup()
soil_files_created <- write_soil_dssat(id_name = "soil_dssat", soil_data = soil_sample)
#> Minimun data are available
#> DSSAT soil Files created in . :
#> .soil_dssat.SOL
readLines(soil_files_created[1], n = 15) |> writeLines()
#> *SOILS: AgroclimR DSSAT Soil Input File - by agroclimR
#>
#> *soil_dssat000001 AgroclimRV1 LO 60 AgroClimR soil_dssat
#> @SITE COUNTRY LAT LONG SCS FAMILY
#> soil_dssat AgroclimR -99 -99 USDA Texture: Lo
#> @ SCOM SALB SLU1 SLDR SLRO SLNF SLPF SMHB SMPX SMKE
#> -99 0.13 6 0.6 75 1.00 1.00 IB001 IB001 IB001
#> @ SLB SLMH SLLL SDUL SSAT SRGF SSKS SBDM SLOC SLCL SLSI SLCF SLNI SLHW SLHB SCEC SADC
#> 20 -99 0.318 0.365 0.379 0.810 21.86 1.56 1.32 18.3 39.1 1.5 0.6 6.3 -99 9.6 -99
#> 40 -99 0.245 0.305 0.356 0.640 29.34 1.69 0.65 14.5 37.9 1.5 0.6 6.7 -99 9.7 -99
#> 60 -99 0.275 0.316 0.355 0.490 24.73 1.70 0.50 15.7 40.4 1.5 0.6 6.7 -99 14.0 -99
file.remove(soil_files_created)
#> [1] TRUE