HYPE
Functions/Subroutines
general_functions Module Reference

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, halftime)
 
subroutine, public sedimentation (depth, conc, vel)
 
real function, public plant_growth (up1, up2, up3, day)
 
real function, public sigmoid_response (x, xs, xe, ys, ye, xm)
 

Detailed Description

General equations that are used by hydrological models.

Function/Subroutine Documentation

§ exponential_decay()

real function, public general_functions::exponential_decay ( real, intent(in)  timesteps,
real, intent(in)  halftime 
)

Calculates factor of exponential decay from halftime.

Parameters
[in]timestepsin unit of half time
[in]halftimehalf time of decay
+ Here is the caller graph for this function:

§ exponential_moisturefactor()

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.

Parameters
[in]smsoil moisture (mm)
[in]pwtotal pore wolume (mm)
[in]limparlimitation parameter of moisturefactor (mm)
[in]expexponent of moisturefactor
+ Here is the caller graph for this function:

§ halfsatconcfactor()

real function, public general_functions::halfsatconcfactor ( real, intent(in)  conc,
real, intent(in)  par 
)

Calculates a concentration dependence factor Based on: half saturation function.

Parameters
[in]conccurrent concentration
[in]parhalf saturation concentration
+ Here is the caller graph for this function:

§ moisturefactor()

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.

Parameters
[in]smsoil moisture (mm)
[in]wpwilting point pore wolume (mm)
[in]pwtotal pore wolume (mm)
[in]thickmthickness of soil layer (m)
[in]satsmfsaturated moisturefactor (satact)
[in]expexponent of moisturefactor (thetapow)
[in]thetalowlow(?) moisture coefficient (thetalow)
[in]thetaupphigh(?) moisture coefficient (thetaupp)
+ Here is the caller graph for this function:

§ plant_growth()

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).

Parameters
[in]up1parameter 1
[in]up2parameter 2
[in]up3parameter 3
[in]dayvariable
+ Here is the caller graph for this function:

§ sedimentation()

subroutine, public general_functions::sedimentation ( real, intent(in)  depth,
real, intent(inout)  conc,
real, intent(in)  vel 
)

Calculate sedimentation from sinking velocity.

Parameters
[in]depthwater depth (m)
[in,out]concconcentration of substance to sedimentate (mg/L or something)
[in]velsinking velocity (m/timestep)
+ Here is the caller graph for this function:

§ sigmoid_response()

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

Parameters
[in]xinput variable (e. snow depth, water level, temperature, etc)
[in]xsx value defining the start of the response function (for instance 0.)
[in]xex value defining the end of the response function (for instance 1.)
[in]ysy value at the start of the response function (for instance 0.)
[in]yey value at the end of the response function (for instance 1.)
[in]xmx value with maximum slope of the response function (any value between xs and xe)
+ Here is the caller graph for this function:

§ simple_rating_curve()

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.

Parameters
[in]wstcurrent water level (m)
[in]krating curve coefficient
[in]prating curve exponent
[in]w0rating curve threshold (m)
+ Here is the caller graph for this function:

§ tempfactor()

real function, public general_functions::tempfactor ( real, intent(in)  temp)
Parameters
[in]tempcurrent temperature
+ Here is the caller graph for this function: