Soil Utilities

mef_agri.models.utils_soil.py

mef_agri.models.utils_soil.init_layer_dimensions(smdl, rdm)

Method which determines layer dimensions (i.e. depth and thickness) such that the layers are equally spaced from zero (i.e. surface) to the max. depth (i.e. the max. rootable depth rdm).

Parameters:
Raises:

ValueError – if smdl does not have a layers-attribute containing the layer model instances

Returns:

soil model

Return type:

mef_agri.models.base.Model

mef_agri.models.utils_soil.distribute_nutrient_amount(nl, mode='linear')

Possible values for mode

  • linear

linearly decreasing partitioning such that a virtual amount of 0 is assigned to the (n + 1)th layer.

Parameters:
  • nl (int) – number of soil layers

  • mode (str, optional) – distribution mode, defaults to 'linear'

Returns:

fractions partitioning and assigning nutrient amount to the corresponding layers

Return type:

numpy.ndarray