21 real (c_float),
intent(inout) :: net_infiltration
22 real (c_double),
intent(inout) :: soil_storage
23 real (c_double),
intent(inout) :: actual_et_soil
24 real (c_float),
intent(inout) :: runoff
25 real (c_float),
intent(inout) :: delta_soil_storage
26 real (c_double),
intent(in) :: reference_et0
27 real (c_float),
intent(in) :: soil_storage_max
28 real (c_float),
intent(in) :: infiltration
30 real (c_float),
parameter :: near_zero = 1.0e-6_c_float
34 real (c_double) :: new_soil_storage
37 new_soil_storage = soil_storage + infiltration - actual_et_soil
40 if ( soil_storage_max < near_zero )
then
42 actual_et_soil = min( reference_et0, infiltration )
43 net_infiltration = 0.0_c_float
46 runoff = max( 0.0_c_float, infiltration + runoff - actual_et_soil )
47 soil_storage = 0.0_c_float
48 delta_soil_storage = 0.0_c_float
51 elseif ( new_soil_storage > soil_storage_max )
then
53 net_infiltration = new_soil_storage - soil_storage_max
56 delta_soil_storage = soil_storage_max - soil_storage
58 soil_storage = soil_storage_max
63 delta_soil_storage = new_soil_storage - soil_storage
64 soil_storage = new_soil_storage
65 net_infiltration = 0.0_c_float
elemental subroutine, public calculate_soil_mass_balance(net_infiltration, soil_storage, actual_et_soil, runoff, delta_soil_storage, reference_et0, soil_storage_max, infiltration)