apsimx_soil_profile: Create APSIM-X Soil Profiles

View source: R/apsimx_soil_profile.R

apsimx_soil_profileR Documentation

Create APSIM-X Soil Profiles

Description

Generates a soil profile that can then replace the existing one in an ‘.apsimx’ or ‘.apsim’ simulation file

plotting function for a soil profile, it requires ‘ggplot2’

checking an apsimx soil profile for reasonable values

Usage

apsimx_soil_profile(
  nlayers = 10,
  Depth = NULL,
  Thickness = NULL,
  BD = NULL,
  AirDry = NULL,
  LL15 = NULL,
  DUL = NULL,
  SAT = NULL,
  KS = NULL,
  crop.LL = NULL,
  crop.KL = NULL,
  crop.XF = NULL,
  Carbon = NULL,
  SoilCNRatio = NULL,
  FOM = NULL,
  FOM.CN = NULL,
  FBiom = NULL,
  FInert = NULL,
  NO3N = NULL,
  NH4N = NULL,
  PH = NULL,
  ParticleSizeClay = NULL,
  ParticleSizeSilt = NULL,
  ParticleSizeSand = NULL,
  soil.bottom = 150,
  water.table = 200,
  soil.type = 0,
  crops = c("Maize", "Soybean", "Wheat"),
  metadata = NULL,
  soilwat = NA,
  swim = NA,
  initialwater = NA,
  solutes = NA,
  soilorganicmatter = NA,
  dist.parms = list(a = 0, b = 0.2),
  check = TRUE
)

## S3 method for class 'soil_profile'
plot(
  x,
  ...,
  property = c("all", "water", "initialwater", "BD", "AirDry", "LL15", "DUL", "SAT",
    "KS", "Carbon", "SoilCNRatio", "FOM", "FOM.CN", "FBiom", "FInert", "NO3N", "NH4N",
    "PH", "ParticleSizeClay", "ParticleSizeSilt", "ParticleSizeSand", "texture")
)

check_apsimx_soil_profile(x, particle.density = 2.65)

Arguments

nlayers

Number of soil layers (default = 10)

Depth

specific depths for each soil layer (cm)

Thickness

thickness for each soil layer (mm)

BD

bulk density for each soil layer (g/cc) – ‘cc’ is cubic cm

AirDry

air dry for each soil layer (mm/mm)

LL15

lower limit (15 bar) for each soil layer (mm/mm)

DUL

drainage upper limit (0.33 bar) for each soil layer (mm/mm)

SAT

saturation (0 bar) for each soil layer (mm/mm)

KS

saturated hydraulic conductivity (mm/day)

crop.LL

lower limit for a specific crop

crop.KL

root ability to extract water for a specific crop

crop.XF

soil root exploration for a specific crop

Carbon

organic carbon (percent)

SoilCNRatio

organic carbon C:N ratio

FOM

fresh organic matter (kg/ha)

FOM.CN

fresh organic matter C:N ratio

FBiom

Fraction of microbial biomass (0-1)

FInert

Fraction of inert carbon (0-1)

NO3N

nitrate nitrogen (Chemical) (ppm)

NH4N

ammonium nitrogen (Chemical) (ppm)

PH

soil pH

ParticleSizeClay

particle size clay (in percent)

ParticleSizeSilt

particle size silt (in percent)

ParticleSizeSand

particle size sand (in percent)

soil.bottom

bottom of the soil profile (cm)

water.table

water table level (not used at the moment) (cm)

soil.type

might use it in the future for auto filling missing information

crops

name of crops being grown

metadata

list with soil metadata. For possible parameters and values see an example of inspect_apsimx with soil.child = “Metadata”.

soilwat

optional ‘list’ of class ‘soilwat_parms’

swim

optional ‘list’ of class ‘swim_parms’

initialwater

optional ‘list’ of class ‘initialsoilwater_parms’

solutes

optional ‘list’ of class ‘solutes_parms’

soilorganicmatter

optional ‘list’ of class ‘soilorganicmatter_parms’

dist.parms

parameter values for creating a profile. If a == 0 and b == 0 then
a constant value of 1 is used. If a == 0 and b != 0, then an exponential decay is used.
If a != 0 and b != 0 then the equation is a*soil.layer*exp(-b*soil.layer).

check

whether to check for reasonable values using check_apsimx_soil_profile

x

object of class ‘soil_profile’ or the ‘soil’ component within an object of class ‘soil_profile’.

...

additional plotting arguments (none use at the moment).

property

“all” for plotting all soil properties, “water” for just SAT, DUL and LL15

particle.density

default value for soil particle density (2.65 g/cm3)

Details

Soil Profiles

Real soils might have discontinuities, but for APSIM it might be beneficial to be able to create a soil profile with an arbitrary number of layers and have flexibility in the distribution of soil physical and chemical properties. Steps:

1. apsimx_soil_profile is a function which can create a soil matrix with many layers
2. It allows for creating a smooth distribution for Physical (or Water), Chemical, InitialWater, Analysis, InitialN, Organic or SoilOrganicMatter
3. The distribution can be specified with the ‘a’ and ‘c’ parameter of an exponential decay function, using a list. E.g. DUL = list(0.35, 0, -0.1). This means that the top value for DUL will be 0.35 and it will decay with a rate of -0.1.
4. If an increase and then a decay is needed the Ricker function can be used. See ‘SSricker’ in the ‘nlraa’ package.

The value of soil particle density (2.65 g/cm3) is hard coded in APSIM. https://en.wikipedia.org/wiki/Bulk_density

Value

a soil profile with class ‘soil_profile’ with elements ‘soil’, ‘crops’, ‘metadata’, ‘soilwat’ and ‘swim’.

it produces a plot

It does not produce output unless potential issues are found. Only warnings are produced and it returns an object of class ‘soil_profile’.

Examples


 sp <- apsimx_soil_profile()
 require(ggplot2)
 plot(sp)
 


apsimx documentation built on Sept. 11, 2024, 5:42 p.m.