Soil utils functions

AUTHORS: Julien Ruffault (julien.ruff@gmail.com), Nicolas Martin-StPaul (nicolas.martin@inrae.fr)

source

compute_b

 compute_b (lv:float)

Calculate b used to compute the B of the Gardnar-Cowen model

Type Details
lv float length of fine root per unit volume
Returns float

source

compute_b_gc

 compute_b_gc (la:float, b:float, root_radius:float)

Calculate B Gardner cowen thhe scaling factor for soil conductance

Type Details
la float Unknown parameter definition
b float Unknown parameter definition
root_radius float Calculated using the compute_b function
Returns float

source

compute_k_soil

 compute_k_soil (rew:float, i_vg:float, n_vg:float, k_sat_vg:float,
                 b_gc:float)
Type Details
rew float Unknown parameter definition
i_vg float Unknown parameter definition
n_vg float Unknown parameter definition
k_sat_vg float Unknown parameter definition
b_gc float Calculated using the compute_b_gc function
Returns float

source

compute_k_soil_camp

 compute_k_soil_camp (sws:float, tsc:float, b_camp:float,
                      k_sat_campbell:float)
Type Details
sws float Unknown parameter definition
tsc float Unknown parameter definition
b_camp float Unknown parameter definition
k_sat_campbell float Unknown parameter definition
Returns float

source

compute_p_soil

 compute_p_soil (rew:float, alpha_vg:float, n_vg:float)
Type Details
rew float Unknown parameter definition
alpha_vg float Unknown parameter definition
n_vg float Unknown parameter definition
Returns float

source

compute_p_soil_camp

 compute_p_soil_camp (sws:float, tsc:float, b_camp:float, psie:float)
Type Details
sws float Unknown parameter definition
tsc float Unknown parameter definition
b_camp float Unknown parameter definition
psie float Unknown parameter definition
Returns float

source

compute_theta_at_given_p_soil

 compute_theta_at_given_p_soil (psi_target:float, theta_res:float,
                                theta_sat:float, alpha_vg:float,
                                n_vg:float)
Type Details
psi_target float Unknown parameter definition
theta_res float Unknown parameter definition
theta_sat float Unknown parameter definition
alpha_vg float Unknown parameter definition
n_vg float Unknown parameter definition
Returns float

Example: Compute theta parameter

compute_theta_at_given_p_soil(
    psi_target=2, theta_res=3, theta_sat=4, alpha_vg=5, n_vg=1.1
)
3.316227675107904
compute_theta_at_given_p_soil(
    psi_target=np.array([1.5, 2]),
    theta_res=np.array([3, -2]),
    theta_sat=np.array([-6, -7]),
    alpha_vg=np.array([9.02, 2.9]),
    n_vg=np.array([-1.5, 0.001]),
)
array([-5.99999970e+000, -6.51316634e+303])

source

compute_theta_at_given_p_soil_camp

 compute_theta_at_given_p_soil_camp (theta_sat:float, psi_target:float,
                                     psie:float, b_camp:float)
Type Details
theta_sat float Unknown parameter definition
psi_target float Unknown parameter definition
psie float Unknown parameter definition
b_camp float Unknown parameter definition
Returns float

Example: Compute theta parameter for Campbell formulation

compute_theta_at_given_p_soil_camp(
    psi_target=-1.5, theta_sat=0.39, psie=-0.025, b_camp=-4.0
)
0.14012860366560284
compute_theta_at_given_p_soil_camp(
    psi_target=np.array([-1.5, -2]),
    theta_sat=np.array([0.70]),
    psie=np.array([-0.025, -4]),
    b_camp=np.array([-4.0, -6]),
)
array([0.25151288, 0.78572343])

source

read_soil_file

 read_soil_file (file_path:pathlib.Path, modeling_options:Dict=None,
                 sep:str=';')

Function for reading a data frame containing information about soil characteristics

Type Default Details
file_path Path Path to a csv file containing parameter values i.e path/to/file_name.csv
modeling_options typing.Dict None Dictionary created using the create_modeling_options function
sep str ; CSV file separator can be ‘,’ or ‘;’
Returns typing.Dict

source

SoilFile

 SoilFile (*args, **kwargs)

Schema for validating the input soil parameter file

Example: Read CSV file with Soil parameters

modeling_options_dict = create_modeling_options(
    time_step_for_evapo=2,
    reset_swc=True,
    avoid_water_soil_transfer=True,
    constant_climate=False,
    defoliation=True,
    soil_evapo=True,
    threshold_mortality=51,
    etp_formulation="pt",
    rn_formulation="linear",
    comp_options_for_evapo="custom",
    stomatal_reg_formulation="turgor",
    transpiration_model="jarvis",
    numerical_scheme="implicit",
    pedo_transfer_formulation="vg",
)
read_soil_file(
    "./sample_data/soil_example.csv",
    modeling_options=modeling_options_dict,
    sep=";",
)
defaultdict(list,
            {'rfc_1': 75.0,
             'rfc_2': 82.0,
             'rfc_3': 94.0,
             'wilting_point': 0.12379,
             'alpha_vg': 0.0005,
             'n_vg': 1.55,
             'i_vg': 0.5,
             'ksat_vg': 10.0,
             'saturation_capacity_vg': 1.0,
             'residual_capacity_vg': 0.098,
             'g_soil_0': 30.0,
             'depth_1': 0.2,
             'depth_2': 1.0,
             'depth_3': 4.0})