Functions/Subroutines | |
subroutine, public | initiate_soil_water_state (soilstate) |
subroutine, public | initiate_soil_water () |
subroutine | calculate_porevolumes (wp, fc, ep) |
subroutine, public | calculate_soil_runoff_recession_coefficients (basinrrcscorr, soilrc) |
subroutine, public | recalculate_soil_state_variables (soilstate) |
subroutine, public | calculate_snow (i, j, subid, iluse, snowfall, csnowfall, temp, rh, 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 (cg_watertype, temp, rh, crain, conc, cevap) |
subroutine | set_evapotranspiration_concentrations (watertype, EETsplit, temp, rh, crain, conc, cevap) |
subroutine | calculate_evapotranspiration_split (j, maxevaplayers, soim, pw, wp, EETsplit) |
subroutine, public | calculate_actual_soil_evapotranspiration (i, j, maxevaplayers, water, temp, rh, epot, wp, fc, pw, epotfrac, barefrac, liqfrac, cprec, 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_memory (m, n, soilmemory) |
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 |
Water processes in soil in HYPE and some more.
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.
[in] | i | index of current subbasin |
[in] | j | index of current class |
[in] | iluse | index of landuse |
[in] | infilt | infiltration (mm/timestep) |
[in,out] | cinfilt | concentration of infiltration |
[in,out] | soilstate | soil states |
[in] | no_nutrred | flag 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
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)
[in] | i | index of current subbasin |
[in] | j | index of current class |
[in] | macroflow | macropore flow to be added (mm/timestep) |
[in] | cmacroflow | concentration of macropore flow |
[in] | ep | "effective porosity" volume (mm) (water avaliable for runoff) |
[in] | pw | total pore volume (mm) |
[in] | sdepth | lower border of soil layers (m) |
[in] | sthick | thickness of soil layers (m) |
[out] | slmacroflows | macropore flow to each soil layer (mm/timestep) |
[in,out] | soilstate | Soil states |
Algorithm
If no macropore flow: return
Find soillayer of groundwater table
If groundwater table in soillayer three:
Elseif groundwater table in soillayer two:
Elseif groundwater table in soillayer one:
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) | rh, | ||
real, intent(in) | epot, | ||
real, dimension(maxsoillayers), intent(in) | wp, | ||
real, dimension(maxsoillayers), intent(in) | fc, | ||
real, dimension(maxsoillayers), intent(in) | pw, | ||
real, dimension(maxevaplayers), intent(in) | epotfrac, | ||
real, intent(in) | barefrac, | ||
real, dimension(maxsoillayers), intent(in) | liqfrac, | ||
real, dimension(numsubstances), intent(in) | cprec, | ||
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)
[in] | i | index of current subbasin |
[in] | j | index of current class |
[in] | maxevaplayers | max number of soil layers with evaporation (2) |
[in] | water | soil water (mm) (to base evapotranspiration calculation on) |
[in] | temp | air temperature |
[in] | rh | relative humuidity (-) |
[in] | epot | potential evapotranspiration (mm/timestep) |
[in] | wp | wilting point (mm) |
[in] | fc | field capacity (mm) |
[in] | pw | pore volume (mm) |
[in] | epotfrac | relative distribution of potential evaporation between upper two soil layers (-) |
[in] | barefrac | fraction of soil that has evapotranspiration (-) |
[in] | liqfrac | fraction of liquid water in soil |
[in] | cprec | concentration in precipitation (?) |
[in,out] | soilstate | Soil states |
[out] | evap | actual evapotranspiration (mm/timestep) |
[out] | evapflows | actual evapotranspiration (mm/timestep) |
[out] | cevap | concentration in evapotranspiration (?) |
Algorithm
Calculate soil temperature reduction
If temperature above threshold:
Calculate evaporation/transpiration split
Set output variables
subroutine soil_processes::calculate_evapotranspiration_split | ( | integer, intent(in) | j, |
integer, intent(in) | maxevaplayers, | ||
real, dimension(maxsoillayers), intent(in) | soim, | ||
real, dimension(maxsoillayers), intent(in) | pw, | ||
real, dimension(maxsoillayers), intent(in) | wp, | ||
real, intent(out) | EETsplit | ||
) |
Calculate the separation between evaporation and transpiration.
Reference ModelDescription Chapter Processes above ground (Evaporation)
[in] | j | index of class |
[in] | maxevaplayers | max number of soil layers with evaporation (2) |
[in] | soim | soil water (mm) |
[in] | pw | pore volume (mm) |
[in] | wp | wilting point (mm) |
[out] | eetsplit | fraction of evapotranspiration that is evaporation (-) |
|
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)
[in] | iluse | index of landuse |
[in] | elevstd | standard deviation of elevation (m) |
[in] | snow | snow pack (mm) |
[in] | snowage | snow pack age (timesteps) |
[in,out] | snowmax | maximum snow pack during winter (mm) |
[out] | fsc | fractional 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
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)
[in] | fc | water content at field capacity (mm) |
[in] | wp | water content at wilting point (mm) |
[in] | cfrost | soil frost coefficient, land use dependent (cm/degree) |
[in] | sfrost | soil frost coefficient, soil type dependent (cm/degree) |
[in] | soil | soil water (mm) |
[out] | frostdepth | depth of soil frost (cm) |
[in] | soiltemp | soil temperature (degree Celcius) |
[in] | thickness | soil layer thickness (m) |
Algorithm
If soil frost parameters are set:
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)
[in] | iluse | index of landuse |
[in] | gtype | type of glacier (0=default,1=icecap,2=ice sheet,3=infinit) |
[in] | temp | air temperature (C) |
[in] | swrad | shortwave radiation (MJ/m2/ts) |
[in] | epot | potential evaporation (mm/timestep) |
[in] | area | glacier area (m2) |
[in] | glacvol | glacier volume (m3) |
[in] | snowage | age of snow (timesteps) |
[in] | snowcov | covarage of snow (fraction) |
[out] | melt | glacier melt (mm/timestep) |
[out] | epotglac | glacier potential evaporation (mm/timestep) |
[out] | evap | glacier evaporation (mm/timestep) |
Algorithm
Set parameter values and default output
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)
[in] | j | current class |
[in] | soil | soil moisture (mm) |
[in] | epvol | effective porosity volume in all layers (mm) |
[in] | soildep | depth of soil layers (m) |
[in] | thickness | thickness of soil layers (m) |
[out] | gwat | ground water table (m), measured from land surface and up |
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)
[in] | i | index of current subbasin |
[in] | j | index of current class |
[in] | isoil | index of soil type |
[in] | wp | wilting point volume (mm) |
[in] | fc | "field capacity" volume (mm) (water available for evaporation but not for runoff) |
[in] | ep | effective porosity volume (mm) (water available for runoff) |
[in] | ginfilt | gross infiltration; rain+snowmelt (mm/timestep) |
[in] | cginfilt | concentration of gross infiltration |
[in] | temp | current air temperature (degree Celsius) |
[in] | tmin | current daily minimum air temperature (degree Celsius) |
[in] | tmax | current daily maximum air temperature (degree Celsius) |
[out] | infilt | infiltration (mm/timestep) |
[out] | cinfilt | concentration of infiltration |
[out] | surfaceflow | surface runoff due to limited infiltration capacity (mm/timestep) |
[out] | csurfaceflow | concentration of surface flow |
[out] | macroflow | macropore flow (mm/timestep) |
[out] | cmacroflow | concentration of macropore flow |
[in] | frozenstate | Snow and ice states |
[in,out] | soilstate | Soil 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
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)
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)
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
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.
[in] | i | subbasin |
[in] | j | class |
[in] | k | soil layer |
[in] | n | number of points within layer |
[in] | airtemp | class airtemp |
[in,out] | soilstate | Soil states |
[out] | temp | linearly interpolated soil temperature of soil layer k |
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.
[in] | i | index of current subbasin |
[in] | j | index of current class |
[in] | soilstate | Soil states |
[in] | frozenvol | Frozen water volume (mm) |
[out] | liqfrac | Liquid water fraction (-) |
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.
[out] | wp | water content in mm |
[out] | fc | water content in mm |
[out] | ep | water content in mm |
Algoritm
Initiate soil water content parameters
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)
[in] | i | index of current subbasin |
[in] | j | index of current class |
[in] | sl | soil layer |
[in] | plevel | pressure level (m) |
[in] | water | water available for runoff (mm) |
[in] | ep | effective porosity volume (mm) |
[in] | sthick | Thickness of soil layer (m) |
[in,out] | soilstate | Soil states |
[out] | crunoff | concentration of runoff |
[out] | status | error status |
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) | rh, | ||
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)
[in] | i | index of current subbasin |
[in] | j | index of current class |
[in] | subid | subbasin id |
[in] | iluse | index of landuse |
[in] | snowfall | precipitation as snow (mm/timestep) |
[in] | csnowfall | concentration of precipitation as snow |
[in] | temp | air temperature (C) |
[in] | rh | relative humuidity (-) |
[in] | wind | wind speed (m/s) |
[out] | melt | snow melt (mm/timestep) |
[out] | cmelt | substances of snow melt |
[in] | swrad | shortwave radiation (MJ/m2/ts) |
[in,out] | frozenstate | Snow and ice states |
[in] | epot | potential evapotranspiration of snow (mm/timestep) |
[out] | evap | snow sublimation (mm/timestep) |
[out] | cevap | concentrations in snow sublimation |
[out] | effcov | effective snowcover used for scaling snow and soil evaporation (0 if snowevap is switched off) |
[out] | snowtemp | snowpack temperature |
[out] | snowsurftemp | snowpack surface temperature |
[out] | srunoff | snow runoff (mm/timestep) |
[in] | scalingfactor | scalingfactor 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)
Reset snow once per year to prevent build up
Calculate snow age and snow depth
Calculate degree of snowcover and update maximum snow pack 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
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)
[in] | iluse | index of landuse |
[in] | snow | snow water equivalent (mm) |
[in] | oldsnow | snow water equivalent before snowfall/melt this timestep (mm) |
[in] | snowfall | precipitation as snow (mm/timestep) |
[in] | temp | air temperature (C) |
[in] | wind | wind speed (m/s) |
[in] | snowdensdt | snow density increase due to ageing (g/cm3.day) (parameter) |
[in,out] | snowage | help variable for snow; age of snow pack (timesteps) |
[in,out] | snowdepth | current 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
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)
[in] | iluse | index of landuse |
[in] | airtemp | air temperature (C) |
[in] | snowmass | snow pack (mm) = frozen + liquid water |
[in,out] | snowliq | snow liquid water (mm) |
[in] | snowdepth | snow depth (cm) |
[in,out] | snowheat | snow heat content (J/m2) |
[out] | snowtemp | snow temperature (C) |
[out] | surftemp | snow surface temperature (C) |
[out] | fracmelt | fraction of timestep with melting conditions (snowtemp=0) |
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)
[in] | iluse | index of landuse |
[in] | i | index of subbasin |
[in] | temp | air temperature (C) |
[in] | swrad | shortwave radiation (MJ/m2/ts) |
[in] | snow | snow pack (mm) |
[in] | snowage | age of snow (timesteps) |
[in] | effcov | effective snowcover used for scaling of snow melt |
[out] | melt | snow melt (mm/timestep) |
[in] | snowliq | snow liquid water (mm) |
[out] | refreeze | snow refreezing (mm/timestep) |
Algorithm
Set parameter values and default output
Select snow melt model
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 the root zone (top two soil layers)
Reference ModelDescription Chapter Land routines (Basic assumptions - Diagnostic variables)
[in] | soil | soil moisture (mm) |
[in] | wpvol | wilting point volume in all layers (mm) |
[in] | fcvol | "field capacity" volume in all layers (mm) |
[in] | thickness | thickness of soil layers (m) |
[out] | smdef | soil moisture deficit (mm) |
Algorithm
Initate soil moisture deficit to zero
Calculate soil moisture deficit in root zone soil layer, add to total
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)
[in] | i | index of current subbasin |
[in] | j | index of current class |
[in] | isoil | index of soil type |
[in] | subid | subbasin id |
[in] | water | soil water (mm) (to base runoff calculation on) |
[in] | ep_org | effective porosity volume (mm) |
[in] | ddepth | drainage depth (m), "streamdepth" |
[in] | liqfrac | fraction of liquid water in soil (-) |
[in,out] | soilstate | Soil states |
[out] | soilrunoff | runoff (mm/ts) |
[out] | csoilrunoff | concentration 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:
subroutine, public soil_processes::calculate_soil_runoff_recession_coefficients | ( | real, dimension(nsub), intent(in) | basinrrcscorr, |
real, dimension(maxsoillayers,nclass,nsub), intent(out) | soilrc | ||
) |
Calculate soil runoff coefficients for each soillayer, class and subbasin.
[in] | basinrrcscorr | subbasin correction of reession coefficients |
[out] | soilrc | soil recession coefficient |
Algoritm
Calculate adjustment factors
Replace parameter values with regional parameter estimates
Calculate soil runoff recession coeffcients for each soil layer, class and subbasin
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)
[in] | n | number of soil layers |
[in] | airtemp | air temperature (degree Celcius) |
[in] | snowdepth | snow depth (cm) |
[in] | soilmemdeep | parameter, temperature memory of deep soil (days) |
[in] | soilmemlayer | parameter, temperature memory of soil layer (timesteps) |
[in,out] | deeptemp | deep soil temperature (degree Celcius) |
[in,out] | soiltemp | soil temperature (degree Celcius) |
Algorithm
Calculate deep soil temperature
Calculate soil layer temperature for each soil layer
subroutine, public soil_processes::calculate_soiltemp_memory | ( | integer, intent(in) | m, |
integer, intent(in) | n, | ||
real, dimension(m,n), intent(out) | soilmemory | ||
) |
Calculation of soil temperature memory in soil layers.
Reference ModelDescription Chapter Land routines (Snow routines - Soil temperature and snow depth)
[in] | m | maxsoilayers |
[in] | n | nclass |
[out] | soilmemory | soil temperature memory (timesteps) |
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)
[in] | i | index of current subbasin |
[in] | j | index of current class |
[in] | iluse | index of landuse |
[in] | subid | subbasin id |
[in] | wetland | class is an iwet or owet, no saturated overland flow |
[in] | rrcscorr | correction of recession coefficients |
[in] | pwmm | pore volume (mm) |
[in] | qexcess | infiltration excess surface runoff (mm/ts) |
[in] | cexcess | concentration in infiltration excess runoff |
[in] | frozenvol | Frozen soil water volume (mm) |
[in,out] | liqfrac | fraction of liquid water in soil (-) |
[in,out] | soilstate | Soil states |
[out] | surfaceflow | saturated overflow (1) and surface excess infiltration flow (2) |
[out] | csrunoff | concentration surface flow |
Algorithm
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)
[in] | i | index of current subbasin |
[in] | j | index of current class |
[in] | isoil | soil type index |
[in] | subid | subbasin id |
[in] | water | soil water (mm) (to base runoff calculation on) |
[in] | ep_org | effective porosity volume (mm) |
[in] | sdepth | Lower border of soil layers (m) |
[in] | sthick | Thickness of soil layers (m) |
[in] | tdepth | Tiledepth (m) |
[in] | rrcscorr | correction of recession coefficients |
[in] | liqfrac | fraction of liquid water in soil (-) |
[in,out] | soilstate | Soil states |
[out] | runoffd | runoff |
[out] | crunoffd | concentration of runoff |
[out] | cweights | weights 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:
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.
[in] | i | index of current subbasin |
[in] | j | index of current class |
[in] | isoil | index of soil type |
[in] | airtemp | air temperature (deg) |
[in] | wp | volume below wilting point (mm) |
[in] | fc | "field capacity" volume (mm) |
[in] | ep | effective porosity volume (mm) |
[in,out] | soilstate | Soil states |
[out] | frozenvol | Frozen water volume (mm) |
[out] | liqfrac | Liquid water fraction (-) |
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)
[in] | temp1 | air temperature (degree Celcius) |
[in] | weight1 | weight of temp1 (dimensionless) |
[in] | temp2 | temperature of deep soil (ca 1m) (degree Celcius) |
[in] | weight2 | weight of temp2 (dimensionless) |
[in,out] | soiltemp | soil layer temperature (degree Celcius) |
Algorithm
Calculate weighted temperature
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.
[in] | i | index of current subbasin |
[in] | j | index of current class |
[in] | pw | pore volume (mm) |
[in] | infilt | available for infiltration (mm/timestep) |
[out] | outfilt | actual infiltration (mm/timestep) |
[in,out] | cinfilt | concentration of infiltration |
[in,out] | soilstate | Soil states |
Add infiltration to the upper soillayer soil if there is room
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
Set evaporation seasonal corrections
Set evaporation subbasin parameter
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)
[in,out] | soilstate | Soil states |
Algoritm
Calculate size of water storage in soil (wp,fc and ep) in mm
Initiate soil state to saturation or plant available water
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(maxsoillayers-1), intent(inout) | percflow, | ||
real, dimension(numsubstances,maxsoillayers-1), 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)
[in] | i | index of current subbasin |
[in] | j | index of current class |
[in] | isoil | index of soil type |
[in] | subid | subbasin id |
[in] | wp | wilting point volume (mm) |
[in] | fc | "field capacity" volume (mm) (water available for evaporation but not for runoff) |
[in] | pw | pore volume (mm) |
[in] | sthick | thickness of soil layers (m) |
[in] | liqfrac | fraction of liquid water (-) |
[in,out] | percflow | percolation (mm/time step) from layer (between sl1&sl2 and sl2&sl3) |
[in,out] | cpercflow | concentration of percolation (mm/time step) |
[in,out] | soilstate | Soil states |
[in] | percred | flag 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:
subroutine, public soil_processes::recalculate_soil_state_variables | ( | type(soilstatetype), intent(inout) | soilstate | ) |
Recalculate soil state variables due to changed water content parameters.
Consequences Module hypevariable variables wpmm, fcmm, epmm and pwmm may be reset
Reference Tutorial Time dependent input data - Land use change (soil type)
[in,out] | soilstate | Soil states |
Algoritm
Save original values and calculate new pore volume values
Check each class and soil layer for difference in pore volumes
Reset pore volume (mm) hype variables
subroutine, public soil_processes::set_evaporation_concentrations | ( | integer, intent(in) | cg_watertype, |
real, intent(in) | temp, | ||
real, intent(in) | rh, | ||
real, dimension(numsubstances), intent(in) | crain, | ||
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)
[in] | cg_watertype | water body (1=soil water, 2=river, 3=lake, 4="wetland") (different parameters of kinetic isotopic fractionation) |
[in] | temp | air temperature (degree Celsius) |
[in] | rh | relative humidity (-) |
[in] | crain | concentration in precipitation/rain (permil) |
[in] | conc | concentration in water body (?) |
[out] | cevap | concentration in evapotranspiration (?) |
subroutine soil_processes::set_evapotranspiration_concentrations | ( | integer, intent(in) | watertype, |
real, intent(in) | EETsplit, | ||
real, intent(in) | temp, | ||
real, intent(in) | rh, | ||
real, dimension(numsubstances), intent(in) | crain, | ||
real, dimension(numsubstances), intent(in) | conc, | ||
real, dimension(numsubstances), intent(out) | cevap | ||
) |
Calculate and set concentration of evapotranspirating water, considering split between evaporation and transpiration.
Reference ModelDescription Chapter Processes above ground (Evaporation)
[in] | watertype | water body (1=soil water, 2=river, 3=lake, 4="wetland") (different parameters of kinetic isotopic fractionation) |
[in] | eetsplit | fraction of evapotranspiration that is evaporation (E/ET) (-) |
[in] | temp | air temperature (degree Celsius) |
[in] | rh | relative humuidity (-) |
[in] | crain | concentration in precipitation/rain (permil) |
[in] | conc | concentration in water body (?) |
[out] | cevap | concentration in evapotranspiration (?) |
real function soil_processes::snow_thermal_conductivityfunction | ( | real, intent(in) | snowdensity | ) |
Calculate snow thermal conductivity as a function of snow density.
[in] | snowdensity | snow density (kg/m3) |
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)
[in] | snowage | snow age (timesteps) |
[in] | albmin | minimum albedo (typical value 0.4) |
[in] | albmax | maximum albedo (typical value 0.9) |
[in] | kexp | exponential factor (1/time step) (typical value 0.1 for daily timesteps) |
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 | ||
) |
[in] | sl | soil layer |
[in] | j | class |
[in] | water | soil water |
[in] | liqfrac | fraction of water in liquid form |
real function soil_processes::water_above_field_capacity | ( | integer, intent(in) | sl, |
integer, intent(in) | j, | ||
real, intent(in) | water | ||
) |
[in] | sl | soil layer |
[in] | j | class |
[in] | water | soil water |
real function soil_processes::water_above_wilting_point | ( | integer, intent(in) | sl, |
integer, intent(in) | j, | ||
real, intent(in) | water | ||
) |
[in] | sl | soil layer |
[in] | j | class |
[in] | water | soil water |
logical function soil_processes::water_is_above_field_capacity | ( | integer, intent(in) | sl, |
integer, intent(in) | j, | ||
real, intent(in) | water | ||
) |
[in] | sl | soil layer |
[in] | j | class |
[in] | water | soil water |
logical function soil_processes::water_is_above_wilting_point | ( | integer, intent(in) | sl, |
integer, intent(in) | j, | ||
real, intent(in) | water | ||
) |
[in] | sl | soil layer |
[in] | j | class |
[in] | water | soil water |
real function soil_processes::water_relative_porevolume | ( | integer, intent(in) | sl, |
integer, intent(in) | j, | ||
real, intent(in) | water | ||
) |
[in] | sl | soil layer |
[in] | j | class |
[in] | water | soil water |
|
private |