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:
smdl (
mef_agri.models.base.Model
) – soil modelrdm (float or numpy.ndarray) – max. rootable depth of the soil
- Raises:
ValueError – if
smdl
does not have alayers
-attribute containing the layer model instances- Returns:
soil model
- Return type:
- 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