HYPE
Functions/Subroutines | Variables
soil_processes Module Reference

Functions/Subroutines

subroutine, public initiate_soil_water_state (soilstate)
 
subroutine, public initiate_soil_water ()
 
subroutine calculate_porevolumes (wp, fc, ep)
 
subroutine, public calculate_snow (i, j, subid, iluse, snowfall, csnowfall, temp, wind, melt, cmelt, swrad, frozenstate, epot, evap, cevap, effcov, snowtemp, snowsurftemp, srunoff, scalingfactor)
 
subroutine, public calculate_snowmelt (iluse, i, temp, swrad, snow, snowage, effcov, melt, snowliq, refreeze)
 
real function, public snowalbedo_function (snowage, albmin, albmax, kexp)
 
subroutine calculate_fractional_snowcover (iluse, elevstd, snow, snowage, snowmax, fsc)
 
subroutine, public calculate_snowdepth (iluse, snow, oldsnow, snowfall, temp, wind, snowdensdt, snowage, snowdepth)
 
subroutine calculate_snowheat_processes (iluse, airtemp, snowmass, snowdepth, snowheat, snowtemp, surftemp, fracmelt, snowliq)
 
real function snow_thermal_conductivityfunction (snowdensity)
 
subroutine, public calculate_glacier_melt (iluse, gtype, temp, swrad, epot, area, glacvol, snowage, snowcov, melt, epotglac, evap)
 
subroutine, public set_evaporation_concentrations (conc, cevap)
 
subroutine, public calculate_actual_soil_evapotranspiration (i, j, maxevaplayers, water, temp, epot, wp, fc, epotfrac, barefrac, liqfrac, soilstate, evap, evapflows, cevap)
 
subroutine, public calculate_tile_drainage (i, j, isoil, subid, water, ep_org, sdepth, sthick, tdepth, rrcscorr, liqfrac, soilstate, runoffd, crunoffd, cweights)
 
subroutine, public calculate_soil_runoff (i, j, isoil, subid, water, ep_org, ddepth, liqfrac, soilstate, soilrunoff, csoilrunoff)
 
subroutine calculate_pressurelevel_soillayer_runoff (i, j, sl, plevel, water, ep, sthick, soilstate, runoff, crunoff, status)
 
subroutine, public calculate_infiltration_flow_diversion (i, j, isoil, wp, fc, ep, ginfilt, cginfilt, temp, tmin, tmax, infilt, cinfilt, surfaceflow, csurfaceflow, macroflow, cmacroflow, frozenstate, soilstate)
 
subroutine, public add_infiltration (i, j, iluse, infilt, cinfilt, soilstate, no_nutrred)
 
subroutine, public flood_infiltration (i, j, pw, infilt, outfilt, cinfilt, soilstate)
 
subroutine, public calculate_surface_runoff (i, j, iluse, subid, wetland, rrcscorr, pwmm, qexcess, cexcess, frozenvol, liqfrac, soilstate, surfaceflow, csrunoff)
 
subroutine, public percolation (i, j, isoil, subid, wp, fc, pw, sthick, liqfrac, percflow, cpercflow, soilstate, percred)
 
subroutine, public add_macropore_flow (i, j, macroflow, cmacroflow, ep, pw, sdepth, sthick, slmacroflows, soilstate)
 
subroutine, public calculate_groundwater_table (j, soil, epvol, soildep, thickness, gwat)
 
subroutine, public calculate_soiltemp (n, airtemp, snowdepth, soilmemdeep, soilmemlayer, deeptemp, soiltemp)
 
subroutine calculate_weighted_temperature (temp1, weight1, temp2, weight2, soiltemp)
 
subroutine, public calculate_unfrozen_soil_water (i, j, isoil, airtemp, wp, fc, ep, soilstate, frozenvol, liqfrac)
 
subroutine calculate_linearly_interp_soil_temperature (i, j, k, n, airtemp, soilstate, temp)
 
subroutine, public calculate_liquid_water_fraction (i, j, soilstate, frozenvol, liqfrac)
 
subroutine, public calculate_frostdepth (fc, wp, cfrost, sfrost, soil, frostdepth, soiltemp, thickness)
 
subroutine, public calculate_soil_moisture_deficit (soil, wpvol, fcvol, thickness, smdef)
 
logical function water_is_above_field_capacity (sl, j, water)
 
real function water_above_field_capacity (sl, j, water)
 
logical function water_is_above_wilting_point (sl, j, water)
 
real function water_above_wilting_point (sl, j, water)
 
real function unfrozen_water_above_field_capacity (sl, j, water, liqfrac)
 
real function water_relative_porevolume (sl, j, water)
 

Variables

character(len=80), dimension(13) errstring
 

Detailed Description

Water processes in soil in HYPE and some more.

Function/Subroutine Documentation

◆ add_infiltration()

subroutine, public soil_processes::add_infiltration ( integer, intent(in)  i,
integer, intent(in)  j,
integer, intent(in)  iluse,
real, intent(in)  infilt,
real, dimension(numsubstances), intent(inout)  cinfilt,
type(soilstatetype), intent(inout)  soilstate,
logical, intent(in), optional  no_nutrred 
)

Add infiltration to the upper soillayer soil, including transfering of IN in infiltration to solid ON in soil.

Parameters
[in]iindex of current subbasin
[in]jindex of current class
[in]iluseindex of landuse
[in]infiltinfiltration (mm/timestep)
[in,out]cinfiltconcentration of infiltration
[in,out]soilstatesoil states
[in]no_nutrredflag for turning off nutrient processes

Add infiltration to the upper soillayer soil

Possibly transfer of (atmospheric) IN in infiltration to solid ON (fastN) in soil

+ Here is the caller graph for this function:

◆ add_macropore_flow()

subroutine, public soil_processes::add_macropore_flow ( integer, intent(in)  i,
integer, intent(in)  j,
real, intent(in)  macroflow,
real, dimension(numsubstances), intent(in)  cmacroflow,
real, dimension(maxsoillayers), intent(in)  ep,
real, dimension(maxsoillayers), intent(in)  pw,
real, dimension(maxsoillayers), intent(in)  sdepth,
real, dimension(maxsoillayers), intent(in)  sthick,
real, dimension(maxsoillayers), intent(out)  slmacroflows,
type(soilstatetype), intent(inout)  soilstate 
)

Add macropore water flow to soil layer with groundwater level.

If this soillayer can't take all water the rest is added to the soillayer(s) above.

Reference ModelDescription Chapter Land routines (Soil water - Macropore flow)

Parameters
[in]iindex of current subbasin
[in]jindex of current class
[in]macroflowmacropore flow to be added (mm/timestep)
[in]cmacroflowconcentration of macropore flow
[in]ep"effective porosity" volume (mm) (water avaliable for runoff)
[in]pwtotal pore volume (mm)
[in]sdepthlower border of soil layers (m)
[in]sthickthickness of soil layers (m)
[out]slmacroflowsmacropore flow to each soil layer (mm/timestep)
[in,out]soilstateSoil states

Algorithm
If no macropore flow: return

Find soillayer of groundwater table

If groundwater table in soillayer three:

  • Check if soillayer three has room and add the water there is room for
  • If too much water, check if soillayer 2 has room and add the water there is room for
  • If still too much water add the rest to soillayer 1

Elseif groundwater table in soillayer two:

  • Check if soillayer 2 has room and add the water there is room for
  • If too much water add the rest to soillayer 1

Elseif groundwater table in soillayer one:

  • Add macropore flow to soillayer 1
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculate_actual_soil_evapotranspiration()

subroutine, public soil_processes::calculate_actual_soil_evapotranspiration ( integer, intent(in)  i,
integer, intent(in)  j,
integer, intent(in)  maxevaplayers,
real, dimension(maxsoillayers), intent(in)  water,
real, intent(in)  temp,
real, intent(in)  epot,
real, dimension(maxsoillayers), intent(in)  wp,
real, dimension(maxsoillayers), intent(in)  fc,
real, dimension(maxevaplayers), intent(in)  epotfrac,
real, intent(in)  barefrac,
real, dimension(maxsoillayers), intent(in)  liqfrac,
type(soilstatetype), intent(inout)  soilstate,
real, intent(out)  evap,
real, dimension(maxevaplayers), intent(out)  evapflows,
real, dimension(numsubstances), intent(out)  cevap 
)

Calculate and remove evapotranspiration from the soil upper two layers.

Reference ModelDescription Chapter Processes above ground (Evaporation)

Parameters
[in]iindex of current subbasin
[in]jindex of current class
[in]maxevaplayersmax number of soil layers with evaporation (2)
[in]watersoil water (mm) (to base evapotranspiration calculation on)
[in]tempair temperature
[in]epotpotential evapotranspiration (mm/timestep)
[in]wpwilting point (mm)
[in]fcfield capacity (mm)
[in]epotfracrelative distribution of potential evaporation between upper two soil layers (-)
[in]barefracfraction of soil that has evapotranspiration (-)
[in]liqfracfraction of liquid water in soil
[in,out]soilstateSoil states
[out]evapactual evapotranspiration (mm/timestep)
[out]evapflowsactual evapotranspiration (mm/timestep)
[out]cevapconcentration in evapotranspiration (?)

Algorithm

Calculate soil temperature reduction

If temperature above threshold:

  • calculate actual evapotranspiration
  • Remove evapotranspiration from soil water

Set output variables

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculate_fractional_snowcover()

subroutine soil_processes::calculate_fractional_snowcover ( integer, intent(in)  iluse,
real, intent(in)  elevstd,
real, intent(in)  snow,
real, intent(in)  snowage,
real, intent(inout)  snowmax,
real, intent(out)  fsc 
)
private

Subroutine for calculation of fractional snow cover area The maximum snow of the winter season is also updated.

Reference ModelDescription Chapter Land routines (Snow routines - Snow cover)

Parameters
[in]iluseindex of landuse
[in]elevstdstandard deviation of elevation (m)
[in]snowsnow pack (mm)
[in]snowagesnow pack age (timesteps)
[in,out]snowmaxmaximum snow pack during winter (mm)
[out]fscfractional snowcover area (-)

Algorithm
Check snow pack status

Check if snowcover model is used

Reset snowmax and change to build-up of snow phase if new snow dominates the snowpack, snowage<1day

Check snowpack development phase, and select corresponding FSC function

+ Here is the caller graph for this function:

◆ calculate_frostdepth()

subroutine, public soil_processes::calculate_frostdepth ( real, dimension(maxsoillayers), intent(in)  fc,
real, dimension(maxsoillayers), intent(in)  wp,
real, intent(in)  cfrost,
real, intent(in)  sfrost,
real, intent(in)  soil,
real, intent(out)  frostdepth,
real, dimension(:), intent(in)  soiltemp,
real, dimension(maxsoillayers), intent(in)  thickness 
)

Calculation of soil frost depth depending on temperature of soil.

Reference ModelDescription Chapter Land routines (Basic assumptions - Diagnostic variables)

Parameters
[in]fcwater content at field capacity (mm)
[in]wpwater content at wilting point (mm)
[in]cfrostsoil frost coefficient, land use dependent (cm/degree)
[in]sfrostsoil frost coefficient, soil type dependent (cm/degree)
[in]soilsoil water (mm)
[out]frostdepthdepth of soil frost (cm)
[in]soiltempsoil temperature (degree Celcius)
[in]thicknesssoil layer thickness (m)

Algorithm
If soil frost parameters are set:

  • Calculate average temperature of upper two soil layers
  • If temperature is negative, calculate soil frost depth
+ Here is the caller graph for this function:

◆ calculate_glacier_melt()

subroutine, public soil_processes::calculate_glacier_melt ( integer, intent(in)  iluse,
integer, intent(in)  gtype,
real, intent(in)  temp,
real, intent(in)  swrad,
real, intent(in)  epot,
real, intent(in)  area,
real, intent(in)  glacvol,
real, intent(in)  snowage,
real, intent(in)  snowcov,
real, intent(out)  melt,
real, intent(out)  epotglac,
real, intent(out)  evap 
)

Subroutine for calculation of glacier melt by different methods.

Reference ModelDescription Chapter Land routines (Glaciers)

Parameters
[in]iluseindex of landuse
[in]gtypetype of glacier (0=default,1=icecap,2=ice sheet,3=infinit)
[in]tempair temperature (C)
[in]swradshortwave radiation (MJ/m2/day?)
[in]epotpotential evaporation (mm/timestep)
[in]areaglacier area (m2)
[in]glacvolglacier volume (m3)
[in]snowageage of snow (timesteps)
[in]snowcovcovarage of snow (fraction)
[out]meltglacier melt (mm/timestep)
[out]epotglacglacier potential evaporation (mm/timestep)
[out]evapglacier evaporation (mm/timestep)

Algorithm
Set parameter values and default output

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculate_groundwater_table()

subroutine, public soil_processes::calculate_groundwater_table ( integer, intent(in)  j,
real, dimension(maxsoillayers), intent(in)  soil,
real, dimension(maxsoillayers), intent(in)  epvol,
real, dimension(maxsoillayers), intent(in)  soildep,
real, dimension(maxsoillayers), intent(in)  thickness,
real, intent(out)  gwat 
)

Subroutine for calculation of ground water table level (metres above land surface)

Reference ModelDescription Chapter Land routines (Basic assumptions - Diagnostic variables)

Parameters
[in]jcurrent class
[in]soilsoil moisture (mm)
[in]epvoleffective porosity volume in all layers (mm)
[in]soildepdepth of soil layers (m)
[in]thicknessthickness of soil layers (m)
[out]gwatground water table (m), measured from land surface and up
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculate_infiltration_flow_diversion()

subroutine, public soil_processes::calculate_infiltration_flow_diversion ( integer, intent(in)  i,
integer, intent(in)  j,
integer, intent(in)  isoil,
real, dimension(maxsoillayers), intent(in)  wp,
real, dimension(maxsoillayers), intent(in)  fc,
real, dimension(maxsoillayers), intent(in)  ep,
real, intent(in)  ginfilt,
real, dimension(numsubstances), intent(in)  cginfilt,
real, intent(in)  temp,
real, intent(in)  tmin,
real, intent(in)  tmax,
real, intent(out)  infilt,
real, dimension(numsubstances), intent(out)  cinfilt,
real, intent(out)  surfaceflow,
real, dimension(numsubstances), intent(out)  csurfaceflow,
real, intent(out)  macroflow,
real, dimension(numsubstances), intent(out)  cmacroflow,
type(snowicestatetype), intent(in)  frozenstate,
type(soilstatetype), intent(inout)  soilstate 
)

Calculate infiltration to soil and surface flow and macropore flow due to limited infiltration capacity. Several formulations as options; based soil water threshold, soil moisture, or soil moisture and rain(+melt).

Reference ModelDescription Chapter Land routines (Soil water - Diversion of surface runoff and macropore flow, Infiltration)

Parameters
[in]iindex of current subbasin
[in]jindex of current class
[in]isoilindex of soil type
[in]wpwilting point volume (mm)
[in]fc"field capacity" volume (mm) (water available for evaporation but not for runoff)
[in]epeffective porosity volume (mm) (water available for runoff)
[in]ginfiltgross infiltration; rain+snowmelt (mm/timestep)
[in]cginfiltconcentration of gross infiltration
[in]tempcurrent air temperature (degree Celsius)
[in]tmincurrent daily minimum air temperature (degree Celsius)
[in]tmaxcurrent daily maximum air temperature (degree Celsius)
[out]infiltinfiltration (mm/timestep)
[out]cinfiltconcentration of infiltration
[out]surfaceflowsurface runoff due to limited infiltration capacity (mm/timestep)
[out]csurfaceflowconcentration of surface flow
[out]macroflowmacropore flow (mm/timestep)
[out]cmacroflowconcentration of macropore flow
[in]frozenstateSnow and ice states
[in,out]soilstateSoil states

Algorithm
Set default output values

If no incoming water; return

Default surface runoff model: Surface runoff and macropore flow calculated as fractions of water above thresholds

  • Set parameter values
  • Calculate surface flow and macropore flow due to limited infiltration capacity
  • Calculate net infiltration
  • Calculate relative fraction of macropore flow and surface runoff

Surface runoff model 1: Surface runoff calculated depending on soil moisture (continous equation formulation) Surface runoff model 2: Surface runoff calculated depending on soil moisture and rain+melt (continous equation formulation)

  • Calculate relative fraction of macropore flow and surface runoff
  • Set parameter values; beta is exponent of soil moisture relation
  • Calculate surface runoff ratio
  • Calculate flow of the different paths

Set concentration of the flow paths

Surface runoff model 3: Surface runoff calculated depending on soil moisture (discrete equation formulation) Surface runoff model 4: Surface runoff calculated depending on soil moisture and rain+melt (discrete equation formulation)

  • Calculate relative fraction of macropore flow and surface runoff
  • Set parameter values; beta is exponent of soil moisture relation
  • Calculate net infiltration
  • Calculate flow of the different paths

Set concentration of the flow paths

Calculate effect of frozen soil on infiltration and surface runoff Based on Zhao & Gray 1999 Estimate snowmelt infiltration into frozen soils coded by M.K. MacDonald (27 October 2015)

Presence of icelens depends on daily maximum and minimum air temperature.

Ice lens restricted infiltration, flow redirected to macroflow & surfaceflow, no infiltration

Frozen soil limited infiltration, no ice lens

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculate_linearly_interp_soil_temperature()

subroutine soil_processes::calculate_linearly_interp_soil_temperature ( integer, intent(in)  i,
integer, intent(in)  j,
integer, intent(in)  k,
integer, intent(in)  n,
real, intent(in)  airtemp,
type(soilstatetype), intent(inout)  soilstate,
real, dimension(n), intent(out)  temp 
)

Calculates odd number of soil teperatures representing one soil layer. The temperatures represent middle of 1/nth part of the soillayer, assuming linear interpolation between soilstatetemp representing middle of soillayers.

Parameters
[in]isubbasin
[in]jclass
[in]ksoil layer
[in]nnumber of points within layer
[in]airtempclass airtemp
[in,out]soilstateSoil states
[out]templinearly interpolated soil temperature of soil layer k
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculate_liquid_water_fraction()

subroutine, public soil_processes::calculate_liquid_water_fraction ( integer, intent(in)  i,
integer, intent(in)  j,
type(soilstatetype), intent(in)  soilstate,
real, dimension(maxsoillayers), intent(in)  frozenvol,
real, dimension(maxsoillayers), intent(out)  liqfrac 
)

Subroutine to calculate the fraction of liquid water in soil as a function of frozen water volume and total water volume.

Parameters
[in]iindex of current subbasin
[in]jindex of current class
[in]soilstateSoil states
[in]frozenvolFrozen water volume (mm)
[out]liqfracLiquid water fraction (-)
+ Here is the caller graph for this function:

◆ calculate_porevolumes()

subroutine soil_processes::calculate_porevolumes ( real, dimension(maxsoillayers,nclass), intent(out)  wp,
real, dimension(maxsoillayers,nclass), intent(out)  fc,
real, dimension(maxsoillayers,nclass), intent(out)  ep 
)

Calculate porevolumes.

Parameters
[out]wpwater content in mm
[out]fcwater content in mm
[out]epwater content in mm

Algoritm

Initiate soil water content parameters

+ Here is the caller graph for this function:

◆ calculate_pressurelevel_soillayer_runoff()

subroutine soil_processes::calculate_pressurelevel_soillayer_runoff ( integer, intent(in)  i,
integer, intent(in)  j,
integer, intent(in)  sl,
real, intent(in)  plevel,
real, intent(in)  water,
real, intent(in)  ep,
real, intent(in)  sthick,
type(soilstatetype), intent(inout)  soilstate,
real, intent(out)  runoff,
real, dimension(numsubstances), intent(out)  crunoff,
integer, intent(out)  status 
)

Calculate and remove soil layer runoff from a soil layer.

Reference ModelDescription Chapter Land routines (Soil water - Groundwater runoff)

Parameters
[in]iindex of current subbasin
[in]jindex of current class
[in]slsoil layer
[in]plevelpressure level (m)
[in]waterwater available for runoff (mm)
[in]epeffective porosity volume (mm)
[in]sthickThickness of soil layer (m)
[in,out]soilstateSoil states
[out]crunoffconcentration of runoff
[out]statuserror status
+ Here is the caller graph for this function:

◆ calculate_snow()

subroutine, public soil_processes::calculate_snow ( integer, intent(in)  i,
integer, intent(in)  j,
integer, intent(in)  subid,
integer, intent(in)  iluse,
real, intent(in)  snowfall,
real, dimension(numsubstances), intent(in)  csnowfall,
real, intent(in)  temp,
real, intent(in)  wind,
real, intent(out)  melt,
real, dimension(numsubstances), intent(out)  cmelt,
real, intent(in)  swrad,
type(snowicestatetype), intent(inout)  frozenstate,
real, intent(in)  epot,
real, intent(out)  evap,
real, dimension(numsubstances), intent(out)  cevap,
real, intent(out)  effcov,
real, intent(out)  snowtemp,
real, intent(out)  snowsurftemp,
real, intent(out)  srunoff,
real, intent(in), optional  scalingfactor 
)

Subroutine for calculation of changes in snow pack; snowfall addition, snow pack melting and snow age.

Reference ModelDescription Chapter Land routines (Snow routines)

Parameters
[in]iindex of current subbasin
[in]jindex of current class
[in]subidsubbasin id
[in]iluseindex of landuse
[in]snowfallprecipitation as snow (mm/timestep)
[in]csnowfallconcentration of precipitation as snow
[in]tempair temperature (C)
[in]windwind speed (m/s)
[out]meltsnow melt (mm/timestep)
[out]cmeltsubstances of snow melt
[in]swradshortwave radiation (MJ/m2/day?)
[in,out]frozenstateSnow and ice states
[in]epotpotential evapotranspiration of snow (mm/timestep)
[out]evapsnow sublimation (mm/timestep)
[out]cevapconcentrations in snow sublimation
[out]effcoveffective snowcover used for scaling snow and soil evaporation (0 if snowevap is switched off)
[out]snowtempsnowpack temperature
[out]snowsurftempsnowpack surface temperature
[out]srunoffsnow runoff (mm/timestep)
[in]scalingfactorscalingfactor for some snow states depending on classmodel (-)

Algorithm
Set current snow states

Set parameter values and default output

Calculate snow heat processes; heat content, temperature and surface temperature, refreezing liquid water if needed

calculate frozen mass of snow (after heat processes)

Calculate potential snow melt (and re-freeze)

Limit snow melt to frozen part

Limit refreeze to liquid water - and apply it

Calculate potential evaporation from snow (sublimation and evaporation of frozen and unfrozen part of snowmass, respectively)

Calculate ablation and check against snow pack

Update snow pack with snowfall (for now, rain on snow is still bypassing the snowpack - but ideally, if whc>0 the rain on snow covered ground should also be possible to be trapped in the snow)

Calculate snow age and snow depth

Calculate degree of snowcover and update maximum snow pach during winter

final check if snow==0 and snowliq>0 (shouldn't be needed, but seems to be some bug above)

Reset current snow states

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculate_snowdepth()

subroutine, public soil_processes::calculate_snowdepth ( integer, intent(in)  iluse,
real, intent(in)  snow,
real, intent(in)  oldsnow,
real, intent(in)  snowfall,
real, intent(in)  temp,
real, intent(in)  wind,
real, intent(in)  snowdensdt,
real, intent(inout)  snowage,
real, intent(inout)  snowdepth 
)

Calculation of snowdepth and age of snow. Snow depth depends on age of snow.

Reference ModelDescription Chapter Land routines (Snow routines - Soil temperature and snow depth)

Parameters
[in]iluseindex of landuse
[in]snowsnow water equivalent (mm)
[in]oldsnowsnow water equivalent before snowfall/melt this timestep (mm)
[in]snowfallprecipitation as snow (mm/timestep)
[in]tempair temperature (C)
[in]windwind speed (m/s)
[in]snowdensdtsnow density increase due to ageing (g/cm3.timestep)
[in,out]snowagehelp variable for snow; age of snow pack (timesteps)
[in,out]snowdepthcurrent depth of snow (cm)

Algorithm
Set parameter values

Algorithm
Set model parameters

Update snow age with time step and new snow

Calculate snow depth, depends of choice of snow density model

  • Case of age depending snow density model (0,default):
  • Case of compacting factor snow density model (1):
+ Here is the caller graph for this function:

◆ calculate_snowheat_processes()

subroutine soil_processes::calculate_snowheat_processes ( integer, intent(in)  iluse,
real, intent(in)  airtemp,
real, intent(in)  snowmass,
real, intent(in)  snowdepth,
real, intent(inout)  snowheat,
real, intent(out)  snowtemp,
real, intent(out)  surftemp,
real, intent(out)  fracmelt,
real, intent(inout)  snowliq 
)

Subroutine for calculation of snow heat and temperature processes.

Reference ModelDescription Chapter Land routines (Snow routines)

Parameters
[in]iluseindex of landuse
[in]airtempair temperature (C)
[in]snowmasssnow pack (mm) = frozen + liquid water
[in,out]snowliqsnow liquid water (mm)
[in]snowdepthsnow depth (cm)
[in,out]snowheatsnow heat content (J/m2)
[out]snowtempsnow temperature (C)
[out]surftempsnow surface temperature (C)
[out]fracmeltfraction of timestep with melting conditions (snowtemp=0)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculate_snowmelt()

subroutine, public soil_processes::calculate_snowmelt ( integer, intent(in)  iluse,
integer, intent(in)  i,
real, intent(in)  temp,
real, intent(in)  swrad,
real, intent(in)  snow,
real, intent(in)  snowage,
real, intent(in)  effcov,
real, intent(out)  melt,
real, intent(in)  snowliq,
real, intent(out)  refreeze 
)

Subroutine for calculation of snow melt by different methods.

Reference ModelDescription Chapter Land routines (Snow routines)

Parameters
[in]iluseindex of landuse
[in]iindex of subbasin
[in]tempair temperature (C)
[in]swradshortwave radiation (MJ/m2/day?)
[in]snowsnow pack (mm)
[in]snowageage of snow (timesteps)
[in]effcoveffective snowcover used for scaling of snow melt
[out]meltsnow melt (mm/timestep)
[in]snowliqsnow liquid water (mm)
[out]refreezesnow refreezing (mm/timestep)

Algorithm
Set parameter values and default output

Select snow melt model

  • Case 0 and 1: Original temperature index model, calculated with or without snowcover scaling
  • Temperature and radiation index model, with/without snowcover scaling and refreezing
  • Case default (0): Original temperature index model, calculated with or without snowcover scaling
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculate_soil_moisture_deficit()

subroutine, public soil_processes::calculate_soil_moisture_deficit ( real, dimension(maxsoillayers), intent(in)  soil,
real, dimension(maxsoillayers), intent(in)  wpvol,
real, dimension(maxsoillayers), intent(in)  fcvol,
real, dimension(maxsoillayers), intent(in)  thickness,
real, intent(out)  smdef 
)

Calculation of soil moisture deficit (mm left to field capacity) in top two layers.

Reference ModelDescription Chapter Land routines (Basic assumptions - Diagnostic variables)

Parameters
[in]soilsoil moisture (mm)
[in]wpvolwilting point volume in all layers (mm)
[in]fcvol"field capacity" volume in all layers (mm)
[in]thicknessthickness of soil layers (m)
[out]smdefsoil moisture deficit (mm)

Algorithm
Initate soil moisture deficit to zero

Calculate soil moisture deficit in top soil layer, add to total

Calculate soil moisture deficit in second soil layer, add to total

+ Here is the caller graph for this function:

◆ calculate_soil_runoff()

subroutine, public soil_processes::calculate_soil_runoff ( integer, intent(in)  i,
integer, intent(in)  j,
integer, intent(in)  isoil,
integer, intent(in)  subid,
real, dimension(maxsoillayers), intent(in)  water,
real, dimension(maxsoillayers), intent(in)  ep_org,
real, intent(in)  ddepth,
real, dimension(maxsoillayers), intent(in)  liqfrac,
type(soilstatetype), intent(inout)  soilstate,
real, dimension(maxsoillayers), intent(out)  soilrunoff,
real, dimension(numsubstances,maxsoillayers), intent(out)  csoilrunoff 
)

Runoff from soil layers, down to drainage depth ("streamdepth").

Reference ModelDescription Chapter Land routines (Soil water - Groundwater runoff)

Parameters
[in]iindex of current subbasin
[in]jindex of current class
[in]isoilindex of soil type
[in]subidsubbasin id
[in]watersoil water (mm) (to base runoff calculation on)
[in]ep_orgeffective porosity volume (mm)
[in]ddepthdrainage depth (m), "streamdepth"
[in]liqfracfraction of liquid water in soil (-)
[in,out]soilstateSoil states
[out]soilrunoffrunoff (mm/ts)
[out]csoilrunoffconcentration of runoff

Algorithm
Initialise soil runoff to zero. Soil runoff is calculated only if stream is below soil surface

Calculate available water for runoff from current state of soil water and individual "pressure level" from earlier state.

For each soil layer:

  • Calculate initial pressure level; soillayer water and distance to drainage depth
  • Add effect of above layers for saturated soil
  • Calculate runoff from soil layer
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculate_soiltemp()

subroutine, public soil_processes::calculate_soiltemp ( integer, intent(in)  n,
real, intent(in)  airtemp,
real, intent(in)  snowdepth,
real, intent(in)  soilmemdeep,
real, dimension(n), intent(in)  soilmemlayer,
real, intent(inout)  deeptemp,
real, dimension(n), intent(inout)  soiltemp 
)

Calculation of soil temperature in soil layers and deep soil.

Reference ModelDescription Chapter Land routines (Snow routines - Soil temperature and snow depth)

Parameters
[in]nnumber of soil layers
[in]airtempair temperature (degree Celcius)
[in]snowdepthsnow depth (cm)
[in]soilmemdeepparameter, temperature memory of deep soil (days)
[in]soilmemlayerparameter, temperature memory of soil layer (timesteps)
[in,out]deeptempdeep soil temperature (degree Celcius)
[in,out]soiltempsoil temperature (degree Celcius)

Algorithm
Calculate deep soil temperature

Calculate soil layer temperature for each soil layer

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculate_surface_runoff()

subroutine, public soil_processes::calculate_surface_runoff ( integer, intent(in)  i,
integer, intent(in)  j,
integer, intent(in)  iluse,
integer, intent(in)  subid,
logical, intent(in)  wetland,
real, intent(in)  rrcscorr,
real, dimension(maxsoillayers,nclass), intent(in)  pwmm,
real, intent(in)  qexcess,
real, dimension(numsubstances), intent(in)  cexcess,
real, dimension(maxsoillayers), intent(in)  frozenvol,
real, dimension(maxsoillayers), intent(inout)  liqfrac,
type(soilstatetype), intent(inout)  soilstate,
real, dimension(2), intent(out)  surfaceflow,
real, dimension(numsubstances), intent(out)  csrunoff 
)

Surface runoff from saturated overland flow of uppermost soil layer calculated and total surface runoff set by this and excess infiltration flow.

Reference ModelDescription Chapter Land routines (Soil water - Infiltration and surface runoff)

Parameters
[in]iindex of current subbasin
[in]jindex of current class
[in]iluseindex of landuse
[in]subidsubbasin id
[in]wetlandclass is an iwet or owet, no saturated overland flow
[in]rrcscorrcorrection of recession coefficients
[in]pwmmpore volume (mm)
[in]qexcessinfiltration excess surface runoff (mm/ts)
[in]cexcessconcentration in infiltration excess runoff
[in]frozenvolFrozen soil water volume (mm)
[in,out]liqfracfraction of liquid water in soil (-)
[in,out]soilstateSoil states
[out]surfaceflowsaturated overflow (1) and surface excess infiltration flow (2)
[out]csrunoffconcentration surface flow

Algorithm

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculate_tile_drainage()

subroutine, public soil_processes::calculate_tile_drainage ( integer, intent(in)  i,
integer, intent(in)  j,
integer, intent(in)  isoil,
integer, intent(in)  subid,
real, dimension(maxsoillayers), intent(in)  water,
real, dimension(maxsoillayers), intent(in)  ep_org,
real, dimension(maxsoillayers), intent(in)  sdepth,
real, dimension(maxsoillayers), intent(in)  sthick,
real, intent(in)  tdepth,
real, intent(in)  rrcscorr,
real, dimension(maxsoillayers), intent(in)  liqfrac,
type(soilstatetype), intent(inout)  soilstate,
real, intent(out)  runoffd,
real, dimension(numsubstances), intent(out)  crunoffd,
real, dimension(maxsoillayers), intent(out)  cweights 
)

Drainage level runoff: tile or drainage pipe.

Reference ModelDescription Chapter Land routines (Soil water - Runoff through drainage pipes)

Parameters
[in]iindex of current subbasin
[in]jindex of current class
[in]isoilsoil type index
[in]subidsubbasin id
[in]watersoil water (mm) (to base runoff calculation on)
[in]ep_orgeffective porosity volume (mm)
[in]sdepthLower border of soil layers (m)
[in]sthickThickness of soil layers (m)
[in]tdepthTiledepth (m)
[in]rrcscorrcorrection of recession coefficients
[in]liqfracfraction of liquid water in soil (-)
[in,out]soilstateSoil states
[out]runoffdrunoff
[out]crunoffdconcentration of runoff
[out]cweightsweights for calc. drain.conc from layer.conc (zero or one)

Algorithm
Set default output values

Set local parameters

Calculate available water for runoff from current state of soil water and individual "pressure level" from earlier state. If part of the soil water is frozen, we try to take expansion of frozen water into account as an increase in the pressure level

Depending on depth of tile drainage pipe calculate:

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculate_unfrozen_soil_water()

subroutine, public soil_processes::calculate_unfrozen_soil_water ( integer, intent(in)  i,
integer, intent(in)  j,
integer, intent(in)  isoil,
real, intent(in)  airtemp,
real, dimension(maxsoillayers), intent(in)  wp,
real, dimension(maxsoillayers), intent(in)  fc,
real, dimension(maxsoillayers), intent(in)  ep,
type(soilstatetype), intent(inout)  soilstate,
real, dimension(maxsoillayers), intent(out)  frozenvol,
real, dimension(maxsoillayers), intent(out)  liqfrac 
)

Calculates unfrozen soil water volume and fraction.

Parameters
[in]iindex of current subbasin
[in]jindex of current class
[in]isoilindex of soil type
[in]airtempair temperature (deg)
[in]wpvolume below wilting point (mm)
[in]fc"field capacity" volume (mm)
[in]epeffective porosity volume (mm)
[in,out]soilstateSoil states
[out]frozenvolFrozen water volume (mm)
[out]liqfracLiquid water fraction (-)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculate_weighted_temperature()

subroutine soil_processes::calculate_weighted_temperature ( real, intent(in)  temp1,
real, intent(in)  weight1,
real, intent(in)  temp2,
real, intent(in)  weight2,
real, intent(inout)  soiltemp 
)

Calculation of soil temperature as an average of three temperatures: air temperature, deep soil temperature and previous soil temperature.

Reference ModelDescription Chapter Land routines (Snow routines - Soil temperature and snow depth)

Parameters
[in]temp1air temperature (degree Celcius)
[in]weight1weight of temp1 (dimensionless)
[in]temp2temperature of deep soil (ca 1m) (degree Celcius)
[in]weight2weight of temp2 (dimensionless)
[in,out]soiltempsoil layer temperature (degree Celcius)

Algorithm
Calculate weighted temperature

+ Here is the caller graph for this function:

◆ flood_infiltration()

subroutine, public soil_processes::flood_infiltration ( integer, intent(in)  i,
integer, intent(in)  j,
real, intent(in)  pw,
real, intent(in)  infilt,
real, intent(out)  outfilt,
real, dimension(numsubstances), intent(inout)  cinfilt,
type(soilstatetype), intent(inout)  soilstate 
)

Calculate infiltration from flooded floodplain to floodplain soil layer 1.

Parameters
[in]iindex of current subbasin
[in]jindex of current class
[in]pwpore volume (mm)
[in]infiltavailable for infiltration (mm/timestep)
[out]outfiltactual infiltration (mm/timestep)
[in,out]cinfiltconcentration of infiltration
[in,out]soilstateSoil states

Add infiltration to the upper soillayer soil if there is room

+ Here is the caller graph for this function:

◆ initiate_soil_water()

subroutine, public soil_processes::initiate_soil_water

Initiate soil water help parameters.

Consequences Module hypevariables epotdist, soilrc, basinrrcscorr, basincevpam, basincevpph, basinlp, pwmm, wpmm, fcmm and epmm is set.

Reference ModelDescription Chapter Land routines (Basic assumptions, Soil water - Groundwater runoff) and Processes above ground (Evaporation)

Algoritm
Calculate distribution of potential evaporation between soil layers

Initiate soil water content parameters

Calculate adjustment factors

Replace parameter values with regional parameter estimates

Calculate soil runoff recession coeffcients for each soil layer, class and subbasin

Set evaporation seasonal corrections

Set evaporation subbasin parameter

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initiate_soil_water_state()

subroutine, public soil_processes::initiate_soil_water_state ( type(soilstatetype), intent(inout)  soilstate)

Initiate soil water state variables when no saved state exist.

Reference ModelDescription Chapter Land routines (Basic assumptions)

Parameters
[in,out]soilstateSoil states

Algoritm
Calculate size of water storage in soil (wp,fc and ep) in mm

Initiate soil state to saturation or plant available water

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ percolation()

subroutine, public soil_processes::percolation ( integer, intent(in)  i,
integer, intent(in)  j,
integer, intent(in)  isoil,
integer, intent(in)  subid,
real, dimension(maxsoillayers), intent(in)  wp,
real, dimension(maxsoillayers), intent(in)  fc,
real, dimension(maxsoillayers), intent(in)  pw,
real, dimension(maxsoillayers), intent(in)  sthick,
real, dimension(maxsoillayers), intent(in)  liqfrac,
real, dimension(2), intent(inout)  percflow,
real, dimension(numsubstances,2), intent(inout)  cpercflow,
type(soilstatetype), intent(inout)  soilstate,
logical, dimension(numsubstances), intent(in), optional  percred 
)

Calculate percolation down through the soil layers considering previous percolation and the maximum percolation of the whole timestep Includes change in concentration of percolating water.

Reference ModelDescription Chapter Land routines (Soil water - Percolation)

Parameters
[in]iindex of current subbasin
[in]jindex of current class
[in]isoilindex of soil type
[in]subidsubbasin id
[in]wpwilting point volume (mm)
[in]fc"field capacity" volume (mm) (water available for evaporation but not for runoff)
[in]pwpore volume (mm)
[in]sthickthickness of soil layers (m)
[in]liqfracfraction of liquid water (-)
[in,out]percflowpercolation (mm/time step) (between sl1&sl2 and sl2&sl3)
[in,out]cpercflowconcentration of percolation (mm/time step)
[in,out]soilstateSoil states
[in]percredflag for turning on nutrient reduction during percolation

Algorithm

Calculate limitations for second percolation

Calculate percolation amount of water

Move percolation water to underlaying soillayer and reduce the concentrations:

  • Remove water from upper soillayer and add to second soillayer
  • Remove water from middle soillayer and add to third soillayer
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_evaporation_concentrations()

subroutine, public soil_processes::set_evaporation_concentrations ( real, dimension(numsubstances), intent(in)  conc,
real, dimension(numsubstances), intent(out)  cevap 
)

Calculate and set concentration of evaporating water.

Reference ModelDescription Chapter Processes above ground (Evaporation)

Parameters
[in]concconcentration in water body (?)
[out]cevapconcentration in evapotranspiration (?)
+ Here is the caller graph for this function:

◆ snow_thermal_conductivityfunction()

real function soil_processes::snow_thermal_conductivityfunction ( real, intent(in)  snowdensity)

Calculate snow thermal conductivity as a function of snow density.

Parameters
[in]snowdensitysnow density (kg/m3)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ snowalbedo_function()

real function, public soil_processes::snowalbedo_function ( real, intent(in)  snowage,
real, intent(in)  albmin,
real, intent(in)  albmax,
real, intent(in)  kexp 
)

Function to calculate snow albedo depending on the snow age

Reference ModelDescription Chapter Land routines (Snow routines)

Parameters
[in]snowagesnow age (timesteps)
[in]albminminimum albedo (typical value 0.4)
[in]albmaxmaximum albedo (typical value 0.9)
[in]kexpexponential factor (1/time step) (typical value 0.1 for daily timesteps)
+ Here is the caller graph for this function:

◆ unfrozen_water_above_field_capacity()

real function soil_processes::unfrozen_water_above_field_capacity ( integer, intent(in)  sl,
integer, intent(in)  j,
real, intent(in)  water,
real, intent(in)  liqfrac 
)
Parameters
[in]slsoil layer
[in]jclass
[in]watersoil water
[in]liqfracfraction of water in liquid form
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ water_above_field_capacity()

real function soil_processes::water_above_field_capacity ( integer, intent(in)  sl,
integer, intent(in)  j,
real, intent(in)  water 
)
Parameters
[in]slsoil layer
[in]jclass
[in]watersoil water
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ water_above_wilting_point()

real function soil_processes::water_above_wilting_point ( integer, intent(in)  sl,
integer, intent(in)  j,
real, intent(in)  water 
)
Parameters
[in]slsoil layer
[in]jclass
[in]watersoil water
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ water_is_above_field_capacity()

logical function soil_processes::water_is_above_field_capacity ( integer, intent(in)  sl,
integer, intent(in)  j,
real, intent(in)  water 
)
Parameters
[in]slsoil layer
[in]jclass
[in]watersoil water
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ water_is_above_wilting_point()

logical function soil_processes::water_is_above_wilting_point ( integer, intent(in)  sl,
integer, intent(in)  j,
real, intent(in)  water 
)
Parameters
[in]slsoil layer
[in]jclass
[in]watersoil water
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ water_relative_porevolume()

real function soil_processes::water_relative_porevolume ( integer, intent(in)  sl,
integer, intent(in)  j,
real, intent(in)  water 
)
Parameters
[in]slsoil layer
[in]jclass
[in]watersoil water
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ errstring

character(len=80), dimension(13) soil_processes::errstring
private