dssat_soil_print: Creates a DSSAT .SOL (soil input) file

Description Usage Arguments Details Examples

View source: R/dssat_soil_utilities.R

Description

Creates a DSSAT .SOL (soil input) file

Usage

1
2
3
4
5
6
7
dssat_soil_print(
  soildt,
  filename,
  headstring = "SOIL file",
  overwrite = FALSE,
  tier4 = FALSE
)

Arguments

soildt

A data.table containing, at a minimum, the critical variable set (see details)

filename

Output file name, including path (ideally to DSSATXX/SOIL). See details regarding naming convention.

headstring

An optional description for the top of the file.

overwrite

TRUE or FALSE (default) to overwrite existing file.

tier4

TRUE or FALSE (default) to write fourth tier of soil parameters. These contain data that are usually not available.

Details

This function takes an entire soil input data.table and writes it out into a DSSAT .SOL soil input file. The input data.table must contain, at a minimum, the variables listed in ds_solcritvars, named exactly as specified. These, and any other additional variables passed in through soildt should be named according to the dtnames column in ds_solkey. The corresponding DSSAT variable names are in the dssatnames columns. In creating the file, note that DSSAT soil input files should have a name that matches the first two characters of the profile names within it, otherwise the model will not be able to find the soil profile. So if the profiles begin with AB, the soil file should be named AB.SOL. The soil profile name itself should be 10 characters long, beginning with the two character common prefix, following by additional characters and numbers, e.g. ABAA000001, AB00000001. The file should be written or transferred into the DSSATXX/SOIL directory. For large area applications, it might be preferable to create several soil files, perhaps one for each district, province or state.

Examples

1
2
3
4
5
6
# Not run
# data("soildat")
# dssat_dir <- "~/DSSAT46/Soil/"  # replace with path to your DSSATXX/Soil
# soildat
# dssat_soil_print(soildat, filename = file.path(dssat_dir, "TX"),
#                  overwrite = TRUE)

ldemaz/rcropmod documentation built on Feb. 29, 2020, 10:17 p.m.