SWAT - soil

mef_agri.models.soil.model_swat.py

Soil Models

class mef_agri.models.soil.model_swat.Soil_V2009(**kwargs)

Herein, soil porosity and water content at saturation are assumed to be equal, which is also stated in [R1] section 2:3.1 in the paragraph above table 2:3-1. Thus, this model only contains self.porosity as soil property (random output) which is computed with self.clay_content (hyper parameter) using saturation_from_clay_content() function (i.e. values from table 2:3-1 [R1]). Equ. 2:3.1.3 from [R1] is not used in this model.

self.field_capacity and self.wilting_point (both random outputs) are also computed using self.clay_content with the functions wilting_point_from_clay_content() and field_capacity_from_clay_content() which are also based on the values contained in table 2:3-1 [R1] .

kwargs \(\rightarrow\) mef_agri.models.base.Model

C_org()

MQ - Random Output

\(s_{\textrm{C-org},k}\ [\frac{kg}{ha}]\)

Returns:

sum of organic carbon (humus) in the soil layers

Return type:

numpy.ndarray

C_res()

MQ - Random Output

\(s_{\textrm{C-res},k}\ [\frac{kg}{ha}]\)

Returns:

sum of carbon contained in crop residues in the soil layers

Return type:

numpy.ndarray

NH4()

MQ - Random Output

\(s_{\textrm{NH}_4^+,k}\ [\frac{kg}{ha}]\)

Returns:

sum of ammonium in the soil layers

Return type:

numpy.ndarray

NO3()

MQ - Random output

\(s_{\textrm{NO}_3^-,k}\ [\frac{kg}{ha}]\)

Returns:

sum of nitrate in the soil layers

Return type:

numpy.ndarray

N_org()

MQ - Random Output

\(s_{\textrm{N-org},k}\ [\frac{kg}{ha}]\)

Returns:

sum of organic nitrogen in the soil layers

Return type:

numpy.ndarray

albedo()

MQ - Random Output

\(s_{\textrm{alb},k}\ [\ ]\)

The actual albedo value is adjusted by soil moisture of the first soil layer. Sand and clay content of the soil are not considered, as the differences are minor (similar values in sand and clay rows of table 1 [R3] )

Returns:

bare soil albedo adjusted by moisture of first soil layer

Return type:

numpy.ndarray

bulk_density()

MQ - Hyper Parameter

\(s_{\textrm{bd},0}\ [\frac{g}{cm^3}]\)

Returns:

bulk density of the soil

Return type:

numpy.ndarray

clay_content()

MQ - Hyper Parameter

\(s_{\textrm{clay},0}\ [\ ]\)

Returns:

clay content of soil as percent of solids

Return type:

numpy.ndarray

curve_number()

MQ - Random Output

\(s_{\textrm{cn},k}\ [\ ]\)

Returns:

curve number considering crops - [R1] table 2:1-1

Return type:

numpy.ndarray

curve_number_bare()

MQ - Random Output

\(s_{\textrm{cnb},0}\ [\ ]\)

Returns:

curve number of bare soil - [R1] table 2:1-1

Return type:

numpy.ndarray

damping_depth()

MQ - Random Output

\(s_{\textrm{T-dd},k}\ [m]\)

Returns:

current damping depth of the soil - [R1] equ. 1:1.3.8

Return type:

numpy.ndarray

decomposition_res_opt()

MQ - Hyper Parameter

\(s_{\textrm{C-rdo},0}\ [\frac{1}{day}]\)

Returns:

optimum decomposition rate of crop residual C-pool in percent per day - [R1] equ. 3:5.1.1.a

Return type:

numpy.ndarray

field_capacity()

MQ - Random Output

\(s_{\textrm{W-fc},0}\ [\ ]\)

Returns:

soil moisture at field capacity - computed with field_capacity_from_clay_content()

Return type:

numpy.ndarray

hydraulic_conductivity_eff()

MQ - Random Output

\(s_{\textrm{W-hce},k}\ [\frac{mm}{day}]\)

Returns:

effective hydraulic conductivity - [R1] equ. 2:1.2.4

Return type:

numpy.ndarray

hydraulic_conductivity_sat()

MQ - Hyper Parameter

\(s_{\textrm{W-hcs},0}\ [\frac{mm}{day}]\)

Returns:

hydraulic conductivity of saturated soil

Return type:

numpy.ndarray

initialize(epoch)

Initialization of quantities and child models. The following random outputs act as hyper-parameters and are also initialized within this method

Parameters:

epoch (datetime.date) – initialization epoch

initialize_supply(epoch)

Method which has to be implemented in a child class of Soil_V2009. It is called in ssc_csm.models.soil.model_swat.Soil_V2009.initialize().

Thus, it is possible to develop different variants of supply mechanisms (water, nutrients) within the same soil model. The reason is, that the supply processes are likely defined in the crop growth models in the literature but logically they belong to the soil model.

Parameters:

epoch (datetime.date) – initialization epoch

layer01()

Child Model

Returns:

first soil layer

Return type:

Layer_V2009

layer02()

Child Model

Returns:

second soil layer

Return type:

Layer_V2009

layer03()

Child Model

Returns:

third soil layer

Return type:

Layer_V2009

layer04()

Child Model

Returns:

fourth soil layer

Return type:

Layer_V2009

layer05()

Child Model

Returns:

fifth soil layer

Return type:

Layer_V2009

mineralization_opt()

MQ - Hyper Parameter

\(s_{\textrm{C-omo},0}\ [\frac{1}{day}]\)

Returns:

optimum mineralization rate from organic C-pool in percent per day - [R1] equ. 3:5.1.7

Return type:

numpy.ndarray

porosity()

MQ - Random Output

\(s_{\textrm{por},0}\ [\ ]\)

Returns:

soil porosity as fraction of total soil volume - computed with saturation_from_clay_content()

Return type:

numpy.ndarray

prec()

RQ - from model with id 'zone.atmoshpere.weather'

\(a_{\textrm{prec},k}\ [\frac{mm}{m^2\cdot day}]\)

Returns:

daily precipitation sum

Return type:

Requirement

rooting_depth_max()

MQ - Hyper Parameter

\(s_{\textrm{rdm},0}\ [m]\)

Returns:

maximum rootable depth of the soil

Return type:

numpy.ndarray

sand_content()

MQ - Hyper Parameter

\(s_{\textrm{sand},0}\ [\ ]\)

Returns:

sand content of soil as percent of solids

Return type:

numpy.ndarray

surface()

Child Model

Returns:

soil surface model

Return type:

Surface_V2009

update(epoch)

The following computations are performed

Parameters:

epoch (datetime.date) – current evaluation epoch

update_supply(epoch)

Method which has to be implemented in a child class of Soil_V2009. It is called in ssc_csm.models.soil.model_swat.Soil_V2009.update().

Thus, it is possible to develop different variants of supply mechanisms (water, nutrients) within the same soil model. The reason is, that the supply processes are likely defined in the crop growth models in the literature but logically they belong to the soil model.

Parameters:

epoch (datetime.date) – current evaluation epoch

water_balance()

MQ - Random Output

\(s_{\textrm{W-bal},k}\ [mm]\)

Returns:

quantity to control water computations

Return type:

numpy.ndarray

water_change()

MQ - Random Output

\(s_{\textrm{W-}\Delta\textrm{ta},k}\ [\frac{mm}{day}]\)

Returns:

change of the overall water amount at current day

Return type:

np.ndarray

water_evaporated()

MQ - Random Output

\(s_{\textrm{W-evp},k}\ [\frac{mm}{day}]\)

Returns:

water that evaporated from the soil profile at current day (i.e. water loss)

Return type:

np.ndarry

water_loss()

MQ - Random Output

\(s_{\textrm{W-l},k}\ [\frac{mm}{day}]\)

Returns:

water losses from the soil (surface-runoff + evaporation + percolation + crop-uptake)

Return type:

numpy.ndarray

water_overall()

MQ - Random Output

\(s_{\textrm{W-ta},k}\ [mm]\)

Returns:

current overall water amount (soil profile + canopy)

Return type:

np.ndarray

water_percolated()

MQ - Random Output

\(s_{\textrm{W-per},k}\ [\frac{mm}{day}]\)

Returns:

water that percolated from the soil profile into deeper layers at current day (i.e. water loss)

Return type:

np.ndarray

water_soil()

MQ - Random Output

\(s_{\textrm{W-a},k}\ [mm]\)

Returns:

current water amount in the soil profile

Return type:

np.ndarray

wcan()

RQ - from model with id 'zone.soil.surface.water'

\(s_{\textrm{W-c},k}\ [mm]\)

Returns:

amount of water stored in the canopy

Return type:

Requirement

wilting_point()

MQ - Random Output

\(s_{\textrm{W-wp},0}\ [\ ]\)

Returns:

soil moisture at wilting point - computed with wilting_point_from_clay_content()

Return type:

numpy.ndarray

wro()

RQ - from model with id 'zone.soil.surface.water'

\(s_{\textrm{W-ro},k}\ [\frac{mm}{day}]\)

Returns:

runoff rate at current day

Return type:

Requirement

wupt()

RQ - from model with id 'crop.uptake'

\(c_{\textrm{W-upt},k}\ [\frac{mm}{day}]\)

Returns:

uptake of water at current day

Return type:

Requirement

class mef_agri.models.soil.model_swat.Soil_V2009_EPIC(**kwargs)

Soil_V2009 model which implements the supply process from the EPIC crop growth model [R2].

kwargs \(\rightarrow\) ssc_csm.models.base.Model

initialize_supply(epoch)

Initializes water_use_distribution_factor if not already set and calls ssc_csm.models.soil.supply.model_epic.Supply.initialize().

Parameters:

epoch (datetime.date) – initialization epoch

supply()

Child Model

Returns:

model to determine supplied water, nutrients, … for the crop

Return type:

ssc_csm.models.soil.supply.model_epic.Supply

update_supply(epoch)

Calls ssc_csm.models.soil.supply.model_epic.Supply.update().

Parameters:

epoch (datetime.date) – current evaluation epoch

water_use_distribution_factor()

MQ - Hyper-Parameter

\(s_{\textrm{W-udf},0}\ [\ ]\) [R2] equ. 19 - 22

Returns:

water use distribution factor

Return type:

numpy.ndarray

Default values for soil models

class mef_agri.models.soil.model_swat.DEFAULT_VALUES

Class which contains default values for quantities needed in Soil_V2009.

Bare soil albedo

Albedo values are taken from [R3] table 1 (row with Fields, bare). The max. value is a little bit decreased (compared to table 1) to be closer to values in the sand and clay rows of table 1.

Included default values (class variables):

  • ALBEDO_DRY \(= 0.22\ [\ ]\)

  • ALBEDO_WET \(= 0.12\ [\ ]\)

  • ALBEDO_MEAN \(= 0.17\ [\ ]\)

Soil properties

Included default values (class variables):

  • PARTICLE_DENSITY \(= 2.65\ [\frac{g}{cm^3}]\) - [R1] pp. 147

  • CLAYVALS \(= [0.03,\ 0.22,\ 0.47]\ [\ ]\) - [R1] table 2:3-1

  • WPVALS \(= [0.02,\ 0.05,\ 0.2]\ [\ ]\) - [R1] table 2:3-1

  • FCVALS \(= [0.06,\ 0.29,\ 0.41]\ [\ ]\) - [R1] table 2:3-1

  • SATVALS \(= [0.4,\ 0.5,\ 0.6]\ [\ ]\) - [R1] table 2:3-1

PARTICLE_DENSITY is used in the porosity_from_bulk_density() function. The other values are of type numpy.ndarray and are used to interpolate the wilting point, field capacity and/or saturation from given clay content (i.e. CLAYVALS corresponds to the x-values and WPVALS, FCVALS and SATVALS are three variants of the y-values in interpolation algorithms).

Utility functions

mef_agri.models.soil.model_swat.porosity_from_bulk_density(bulk_dens)

Compute soil porosity from bulk density - [R1] equ. 2:3.1.3

Parameters:

bulk_dens (float or numpy.ndarray) – soil bulk density \(s_{\textrm{bd},0}\ [\frac{g}{cm^3}]\)

Returns:

soil porosity \(s_{\textrm{por},0}\ [\ ]\) (fraction of total soil volume)

Return type:

float or numpy.ndarray

mef_agri.models.soil.model_swat.wilting_point_from_clay_content(clay_cont)

Compute water content at wilting point \(s_{\textrm{wp},0}\ [\ ]\) from given clay content with linear interpolation (numpy.interp()) using the values from [R1] table 2:3-1.

Parameters:

clay_cont (float or numpy.ndarray) – soil clay content \(s_{\textrm{clay},0}\ [\ ]\) (percent of solids)

Returns:

water content at wilting point \(s_{\textrm{wp},0}\ [\ ]\) (fraction of total soil volume)

Return type:

float or numpy.ndarray

mef_agri.models.soil.model_swat.field_capacity_from_clay_content(clay_cont)

Compute water content at field capacity \(s_{\textrm{fc},0}\ [\ ]\) from given clay content with linear interpolation (numpy.interp()) using the values from [R1] table 2:3-1.

Parameters:

clay_cont (float or numpy.ndarray) – soil clay content \(s_{\textrm{clay},0}\ [\ ]\) (percent of solids)

Returns:

water content at field capacity \(s_{\textrm{fc},0}\ [\ ]\) (fraction of total soil volume)

Return type:

float or numpy.ndarray

mef_agri.models.soil.model_swat.saturation_from_clay_content(clay_cont)

Compute saturated water content which equals soil porosity \(s_{\textrm{por},0}\ [\ ]\) from given clay content with linear interpolation (numpy.interp()) using the values from [R1] table 2:3-1.

Parameters:

clay_cont (float or numpy.ndarray) – soil clay content \(s_{\textrm{clay},0}\ [\ ]\) (percent of solids)

Returns:

saturation/porosity \(s_{\textrm{por},0}\ [\ ]\) (fraction of total soil volume)

Return type:

float or numpy.ndarray