Functions/Subroutines | |
real function, public | tempfactor (temp) |
real function, public | halfsatconcfactor (conc, par) |
real function, public | moisturefactor (sm, wp, pw, thickm, satsmf, exp, thetalow, thetaupp) |
real function, public | exponential_moisturefactor (sm, pw, limpar, exp) |
real function, public | simple_rating_curve (wst, k, p, w0) |
real function, public | exponential_decay (timesteps, halflife) |
subroutine, public | sedimentation (depth, conc, vel, lim, delta) |
real function, public | plant_growth (up1, up2, up3, day) |
real function, public | sigmoid_response (x, xs, xe, ys, ye, xm) |
real function, public | linear_response (x, xs, xe, ys, ye) |
General equations that are used by hydrological models.
real function, public general_functions::exponential_decay | ( | real, intent(in) | timesteps, |
real, intent(in) | halflife | ||
) |
Calculates fraction left after exponential decay with a half-life parameter.
[in] | timesteps | in unit of half time |
[in] | halflife | half-life of decay |
real function, public general_functions::exponential_moisturefactor | ( | real, intent(in) | sm, |
real, intent(in) | pw, | ||
real, intent(in) | limpar, | ||
real, intent(in) | exp | ||
) |
Calculates an exponential soil moisture dependence factor.
[in] | sm | soil moisture (mm) |
[in] | pw | total pore wolume (mm) |
[in] | limpar | limitation parameter of moisturefactor (mm) |
[in] | exp | exponent of moisturefactor |
real function, public general_functions::halfsatconcfactor | ( | real, intent(in) | conc, |
real, intent(in) | par | ||
) |
Calculates a concentration dependence factor Based on: half saturation function.
[in] | conc | current concentration |
[in] | par | half saturation concentration |
real function, public general_functions::linear_response | ( | real, intent(in) | x, |
real, intent(in) | xs, | ||
real, intent(in) | xe, | ||
real, intent(in) | ys, | ||
real, intent(in) | ye | ||
) |
Linear function between (xs,ys) and (xe,ye) y = ys + (ye-ys)/(xe-xs))*x with xs <= x < xe.
[in] | x | input variable (e. snow depth, water level, temperature, etc) |
[in] | xs | x value defining the start of the response function (for instance 0.) |
[in] | xe | x value defining the end of the response function (for instance 1.) |
[in] | ys | y value at the start of the response function (for instance 0.) |
[in] | ye | y value at the end of the response function (for instance 1.) |
real function, public general_functions::moisturefactor | ( | real, intent(in) | sm, |
real, intent(in) | wp, | ||
real, intent(in) | pw, | ||
real, intent(in) | thickm, | ||
real, intent(in) | satsmf, | ||
real, intent(in) | exp, | ||
real, intent(in) | thetalow, | ||
real, intent(in) | thetaupp | ||
) |
Calculates a soil moisture dependence factor.
[in] | sm | soil moisture (mm) |
[in] | wp | wilting point pore wolume (mm) |
[in] | pw | total pore wolume (mm) |
[in] | thickm | thickness of soil layer (m) |
[in] | satsmf | saturated moisturefactor (satact) |
[in] | exp | exponent of moisturefactor (thetapow) |
[in] | thetalow | low(?) moisture coefficient (thetalow) |
[in] | thetaupp | high(?) moisture coefficient (thetaupp) |
real function, public general_functions::plant_growth | ( | real, intent(in) | up1, |
real, intent(in) | up2, | ||
real, intent(in) | up3, | ||
real, intent(in) | day | ||
) |
Calculates a logistic growth for plant based on a three-parameter equation from SOILN.
Reference: Eckersten, H., P.-E. Jansson, and H. Johnsson 1994. SOILN model - user's manual 2nd edition, Division of Agricultural Hydrotechnics Communications 94:4, Department of Soil Sciences, Swedish University of AgriculturalSciences, 58pp, Uppsala).
[in] | up1 | parameter 1 |
[in] | up2 | parameter 2 |
[in] | up3 | parameter 3 |
[in] | day | variable |
subroutine, public general_functions::sedimentation | ( | real, intent(in) | depth, |
real, intent(in) | conc, | ||
real, intent(in) | vel, | ||
real, intent(in) | lim, | ||
real, intent(out) | delta | ||
) |
Calculate sedimentation from sinking velocity.
[in] | depth | water depth (m) |
[in] | conc | concentration of substance to sedimentate (mg/L or something) |
[in] | vel | sinking velocity (m/timestep) |
[in] | lim | concentration limit of sedimentation rate (mg/L or ?) |
[out] | delta | sedimented amount (g/m2 or something) |
real function, public general_functions::sigmoid_response | ( | real, intent(in) | x, |
real, intent(in) | xs, | ||
real, intent(in) | xe, | ||
real, intent(in) | ys, | ||
real, intent(in) | ye, | ||
real, intent(in) | xm | ||
) |
Flexible sigmoid function to approximate a response function (for instance a growth or depletion curve) with well defined parameters.
References: Yin et al., Annals of Botany 91: 361-371, 2003, doi:10.1093/aob/mcg029 Pimentel et al., Hydrol. Earth Syst. Sci., 21, 805-820, 2017
The original function by Yin et al is defined using xs=0 and ys=0:
y = ye * (1 + (xe - x)/(xe - xm))(x/xe)^(xe / (xe-xm)), with 0<= xm < xe
We can generalize this to have response y between ys and ye for input variable xs to xe:
y = ys + (ye-ys)*(1 + (xet-xt)/(xet-xmt))*(xt/xet)^(xet/(xet-xmt)), with xt=x-xs, xet=xe-xs, xmt=xm-xs, and xs <= xm < xe
[in] | x | input variable (e. snow depth, water level, temperature, etc) |
[in] | xs | x value defining the start of the response function (for instance 0.) |
[in] | xe | x value defining the end of the response function (for instance 1.) |
[in] | ys | y value at the start of the response function (for instance 0.) |
[in] | ye | y value at the end of the response function (for instance 1.) |
[in] | xm | x value with maximum slope of the response function (any value between xs and xe) |
real function, public general_functions::simple_rating_curve | ( | real, intent(in) | wst, |
real, intent(in) | k, | ||
real, intent(in) | p, | ||
real, intent(in) | w0 | ||
) |
Calculates momentanous flow from current water level with simple rating curve equation: Q = k*(w-w0)**p.
[in] | wst | current water level (m) |
[in] | k | rating curve coefficient |
[in] | p | rating curve exponent |
[in] | w0 | rating curve threshold (m) |
real function, public general_functions::tempfactor | ( | real, intent(in) | temp | ) |
[in] | temp | current temperature |