RUFAS.routines.field.soil.soil_temp module#
- class RUFAS.routines.field.soil.soil_temp.SoilTemp(soil_data: SoilData | None, field_size: float | None = None)#
Bases:
object
Manages and simulates soil temperature based on the “Soil Temperature” section (1:1.3.3) of the Soil and Water Assessment Tool (SWAT) documentation.
Parameters#
- soil_dataSoilData, optional
The SoilData object used by this module to track the temperatures within the soil profile, creates new one if one is not provided.
- field_sizefloat, optional
Used to initialize a SoilData object for this module to work with, if a pre-configured SoilData object is not provided (ha).
- daily_soil_temperature_update(solar_radiation: float, avg_temp: float, min_temp: float, max_temp: float, plant_cover: float, snow_cover: float, avg_annual_air_temp: float) None #
Update the soil temperature.
Parameters#
- solar_radiationfloat
Solar radiation reaching the ground on the current day (MJ per square meter per day).
- avg_tempfloat
Average temperature of the current day (degrees C).
- min_tempfloat
Minimum temperature of the current day (degrees C).
- max_tempfloat
Maximum temperature of the current day (degrees C).
- plant_coverfloat
Total aboveground plant biomass and residue on the current day (kg per hectare).
- snow_coverfloat
Water content of the snow cover on the current day (mm).
- avg_annual_air_tempfloat
Average annual air temperature (degrees C).
Notes#
SWAT does not specify how to start the simulation i.e. it does not specify what to do on day 0, when there is no previous day’s temperature. Currently, the implementation just uses the temperature that the soil starts (it sets the previous day’s temperature equal to the current day’s temperature). This assumption is fairly reasonable due to temporal auto-correlation, but does not account for the random fluctuations that can occur throughout the year.
References#
SWAT Theoretical documentation eqn. 1:1.3.3
- static _determine_maximum_damping_depth(bulk_density: float) float #
Calculate the maximum damping depth of a soil profile based on bulk density.
Parameters#
- bulk_densityfloat
The soil profile bulk density (Mg per cubic meter).
Returns#
- float
The maximum damping depth (mm).
References#
SWAT Theoretical documentation eqn. 1:1.3.6
- static _determine_scaling_factor(soil_water_content: float, bulk_density: float, bottom_depth: float) float #
Calculate the scaling factor for use in calculating the damping depth.
Parameters#
- soil_water_contentfloat
Amount of water in the soil profile expressed as depth of water in profile (mm).
- bulk_densityfloat
Bulk density of the soil profile (Mg per cubic meter).
- bottom_depthfloat
Depth from the soil surface of the bottom of the soil profile (mm).
Returns#
- float
The scaling factor for calculating damping depth (unitless).
References#
SWAT Theoretical documentation eqn. 1:1.3.7
- static _determine_damping_depth(max_damping_depth: float, scaling_factor: float) float #
Calculate the daily value for the damping depth.
Parameters#
- max_damping_depthfloat
Maximum damping depth (mm).
- scaling_factorfloat
Scaling factor for soil water (unitless).
Returns#
- float
Damping depth for the day (mm).
References#
SWAT Theoretical documentation eqn. 1:1.3.8
- static _determine_depth_factor(center_depth: float, damping_depth: float) float #
Calculate the depth factor for a given layer of soil.
Parameters#
- center_depthfloat
Depth of the center of a given soil layer (mm).
- damping_depthfloat
Damping depth of the soil profile (mm).
Returns#
- float
The depth factor for this layer of soil (unitless).
References#
SWAT Theoretical documentation eqn. 1:1.3.4, 5
- static _determine_radiation_factor(solar_radiation: float, albedo: float) float #
Calculate the radiation term for use in calculating the bare soil surface temperature.
Parameters#
- solar_radiationfloat
Solar radiation reaching the ground on the current day (MJ per square meter per day).
- albedofloat
Proportion of solar radiation that is reflected by the soil surface (unitless).
Returns#
- float
The radiation factor for the day (unitless).
References#
SWAT Theoretical documentation eqn. 1:1.3.10
- static _determine_bare_soil_surface_temp(radiation_factor: float, avg_temp: float, min_temp: float, max_temp: float) float #
Calculate the temperature at the surface of bare soil.
Parameters#
- radiation_factorfloat
Radiation factor for a given day (unitless).
- avg_tempfloat
Average temperature of the current day (degrees C).
- min_tempfloat
Minimum temperature of the current day (degrees C).
- max_tempfloat
Maximum temperature of the current day (degrees C).
Returns#
- float
Bare soil surface temperature (degrees C).
References#
SWAT Theoretical documentation eqn. 1:1.3.9
- static _determine_cover_weighting_factor(plant_cover: float, snow_cover: float) float #
Calculate the weighting factor for use in calculating the soil surface temperature.
Parameters#
- plant_coverfloat
Total aboveground plant biomass and residue on the current day (kg per hectare).
- snow_coverfloat
Water content of the snow cover on the current day (mm).
Returns#
- float
Weighting factor based on either snow or plant matter soil cover (unitless).
References#
SWAT Theoretical documentation eqn. 1:1.3.11
- static _determine_soil_surface_temp(cover_weighting_factor: float, previous_top_soil_layer_temp: float, bare_soil_surface_temp: float) float #
Calculate the soil surface temperature for a given day.
Parameters#
- cover_weighting_factorfloat
Weighting factor for soil cover impacts (unitless).
- previous_top_soil_layer_tempfloat
Temperature of the first layer of soil on the previous day (degrees C).
- bare_soil_surface_tempfloat
Temperature of the bare soil surface (degrees C).
Returns#
- float
Soil surface temperature for the current day (degrees C).
References#
SWAT Theoretical documentation eqn. 1:1.3.12
- static _determine_average_soil_temperature(prev_temperature_effect: float, previous_day_soil_temp: float, depth_factor: float, avg_annual_air_temp: float, soil_surface_temp: float) float #
Calculate the daily average soil temperature at the center of a given soil layer.
Parameters#
- prev_temperature_effectfloat
Coefficient that controls the influence of the previous day’s temperature on the current day’s temperature (unitless).
- previous_day_soil_tempfloat
Soil temperature in the layer from the previous day (degrees C).
- depth_factorfloat
Factor that quantifies the influence of depth below the surface on soil temperature (unitless).
- avg_annual_air_tempfloat
Average annual air temperature (degrees C).
- soil_surface_tempfloat
Soil surface temperature on the current day (degrees C).
Returns#
- float
Soil temperature at the given depth on the current day (degrees C).
References#
SWAT Theoretical documentation eqn. 1:1.3.3