Functions/Subroutines | |
subroutine, public | define_model_parameters () |
subroutine, public | set_parameters_region_division (nregpar) |
subroutine, public | get_special_model_parameters (velindex, dampindex) |
subroutine, public | calculate_special_model_parameters (nsubb, optrivvel, optdamp, dimriver) |
subroutine, public | model_specified_atmospheric_deposition () |
subroutine, public | calculate_translation_time (rivlen, rivvel, damp, totaltime, transtime) |
subroutine, public | set_modelconfig_from_parameters () |
subroutine, public | initiate_model_state (frozenstate, soilstate, aquiferstate, riverstate, lakestate, miscstate) |
subroutine, public | initiate_model (frozenstate, soilstate, aquiferstate, riverstate, lakestate, miscstate) |
subroutine, public | model (frozenstate, soilstate, aquiferstate, riverstate, lakestate, miscstate) |
subroutine | calculate_lake_volume_output (n, lakestate, ilakevol, olakevol, localoutvar) |
subroutine | initialize_class_outvar_to_zero () |
subroutine | calculate_class_outvar_initialize (idindex, isb) |
subroutine | calculate_class_outvar_add (idindex, isb, jcl, fraction, value, fraction2) |
subroutine | calculate_class_outvar_add_amount (idindex, isb, jcl, fraction, value, value2) |
subroutine | calculate_class_outvar_add_accumulate (idindex, isb, jcl, fraction, value) |
subroutine | calculate_class_outvar_finish (idindex, isb, denominator) |
subroutine | calculate_class_outvar_finish_scale (idindex, isb, factor) |
subroutine | set_class_outvar_missing (idindex, isb) |
subroutine | calculate_outvar_watertemperature (idindex, isb, itype, lowerlimit, riverstate, lakestate) |
subroutine | calculate_class_outvar_for_substance_soil (isb, j, aadj, a, classarea, denitrif, nitrif, cropuptake, atmdepload1, atmdepload2, soillgrossload, soillnetload, soilstate, miscstate) |
subroutine | calculate_class_outvar_for_substance_soil_finish (isb, asum, soilwateri) |
subroutine | set_output_runoff_concentrations_leakagemodel1 (isb, nsb, runoffts, crunoffts) |
subroutine | set_all_aquifer_outvar (nsub, naquifers, aqremflow, aquiferstate) |
subroutine | set_all_observation_outvar () |
subroutine | set_outvar_xobs (idindex, isb) |
subroutine | set_outvar_xobs_scaled (idindex, isb, idxobs, factor) |
subroutine | set_outvar_xobsmean (idindex, isb, idxobs) |
subroutine | set_outvar_xobsstate (idindex, isb, idxobs) |
subroutine | calculate_regional_groundwaterflow_to_outside_system (isb, totflow, outflow) |
real function | wetland_wbstore (j, i, frozenstate, soilstate) |
subroutine | calculate_flow_from_undivided_lake (i, itype, qin, lakearea, flowreduction, hypodepth, olakewstold, outflowsim, lakeoutflow, mainflow, branchflow, concout, wstlakesim, lakewst, wcomaver, Lpathway, lakestate, miscstate) |
subroutine | calculate_flow_for_lakebasin_lake (ilast, itype, looplakes, qini2, lakeareai2, hypodepthi2, olakewstoldi2, resusp_downstream, outflowsimi2, lakeoutflowi2, mainflowi2, branchflowi2, accinflow, acccinflow, clakeoutflowi2, cmainflowi2, cbranchflowi2, qcinflii2, netroutload, wstlakesimi2, lakewsti2, wcomaveri2, Lpathwayi2, Lbranchi2, totaloutflow, ctotaloutflow, lakestate, miscstate) |
subroutine | accumulate_flow_to_downstream_subbasin (i, mainflow, branchflow, concout, accinflow, acccinflow, volumeflow) |
subroutine | calculate_internal_wetland (i, radext, cloud, added_water, precij, sfdist, q, conc, frozenstate, soilstate, miscstate, localoutvar, localwbflows, localLpathway) |
subroutine | calculate_outlet_wetland (i, radext, cloud, added_water, precij, sfdist, wetinflow, conc, frozenstate, soilstate, miscstate, wetoutflow, updatedoutflow, cwetoutflow, mainflow, branchflow, localoutvar, localwbflows, localLpathway) |
subroutine | calculate_local_river (i, lriverlen, radext, rh, cloud, pobs, precij, sfdist, localpcorricep, qriverin, criverin, qriver, criver, localeacti, localpreci, localarea_water, localprec_water, localevap_water, frozenstate, miscstate, riverstate, lakestate, localoutvar, localwbflows, localwbstores, localLatmdep, localLruralb, localLpathway) |
subroutine | calculate_local_lake_model (i, radext, rh, cloud, pobs, precij, sfdist, localpcorricep, qin, cin, hypodep, localeacti, localpreci, localarea_water, localprec_water, localevap_water, frozenstate, riverstate, lakestate, surftemp, outflow, coutflow, outwst, localoutvar, localwbflows, localLatmdep, localLpathway) |
subroutine | compute_substance_load (load, flow, conc, conc2) |
Main module for hydrological model HYPE.
subroutine modelmodule::accumulate_flow_to_downstream_subbasin | ( | integer, intent(in) | i, |
real, intent(in) | mainflow, | ||
real, intent(in) | branchflow, | ||
real, dimension(numsubstances), intent(in) | concout, | ||
real, dimension(nsub), intent(inout) | accinflow, | ||
real, dimension(numsubstances,nsub), intent(inout) | acccinflow, | ||
real, dimension(:,:), intent(inout), allocatable | volumeflow | ||
) |
Accumulate flow to downstream subbasins, and calculate volume flow for water balance.
[in] | i | index of current subbasin |
[in] | mainflow | outflow through main branch (m3/s) |
[in] | branchflow | outflow through second branch (m3/s) |
[in] | concout | concentration of outflow |
[in,out] | accinflow | inflow from upstream subbasins (m3/s) |
[in,out] | acccinflow | concentration of inflow |
[in,out] | volumeflow | volume outflow of subbasin (m3/ts) (and other flows) |
Algorithm
Accumulate flow and load for downstream inflow from main outlet
Save main outlet flow for water balance output
Accumulate flow and load for downstream inflow from branch
Save branched flow for water balance output
subroutine modelmodule::calculate_class_outvar_add | ( | integer, intent(in) | idindex, |
integer, intent(in) | isb, | ||
integer, intent(in) | jcl, | ||
real, intent(in) | fraction, | ||
real, intent(in) | value, | ||
real, intent(in), optional | fraction2 | ||
) |
Add class value to the variables accumulating these for calculating output of subbasin mean values and classgroup mean values. This subroutine handle subbasin mean by accumulating directly, possibly with extra scaling factor, and class mean by saving datavalue and fraction.
Consequences Module modvar variable outvar, outvarclassdata, and outvarclassfraction may change.
[in] | idindex | index in outvarid |
[in] | isb | index of subbasin |
[in] | jcl | index of class |
[in] | fraction | area fraction of class |
[in] | value | class value of output variable |
[in] | fraction2 | fraction of class area which should be included in subbasin mean |
subroutine modelmodule::calculate_class_outvar_add_accumulate | ( | integer, intent(in) | idindex, |
integer, intent(in) | isb, | ||
integer, intent(in) | jcl, | ||
real, intent(in) | fraction, | ||
real, intent(in) | value | ||
) |
Add class value to the variables accumulating these for calculating output of subbasin accumulated values and classgroup accumulated values. Add class value to calculate subbasin accumulated value and classgroup accumulated value.
Consequences Module modvar variable outvar, outvarclassdata, and outvarclassfraction may change.
[in] | idindex | index in outvarid |
[in] | isb | index of subbasin |
[in] | jcl | index of class |
[in] | fraction | area fraction of class |
[in] | value | class value of output variable |
subroutine modelmodule::calculate_class_outvar_add_amount | ( | integer, intent(in) | idindex, |
integer, intent(in) | isb, | ||
integer, intent(in) | jcl, | ||
real, intent(in) | fraction, | ||
real, intent(in) | value, | ||
real, intent(in) | value2 | ||
) |
Add class value to the variables accumulating these for calculating output of subbasin mean values and classgroup mean values. Add amount for class value to outvar-array for subbasin mean value of concentration, and concentration to calculate classgroup mean value of concentrations.
Consequences Module modvar variable outvar, outvarclassdata, and outvarclassfraction may change.
[in] | idindex | index in outvarid |
[in] | isb | index of subbasin |
[in] | jcl | index of class |
[in] | fraction | area fraction of class |
[in] | value | class value of output variable (amount) |
[in] | value2 | class value of output variable (concentration) |
subroutine modelmodule::calculate_class_outvar_finish | ( | integer, intent(in) | idindex, |
integer, intent(in) | isb, | ||
real, intent(in) | denominator | ||
) |
Finalize the calculation of output of subbasin mean values. The variables accumulating class values will be turned into subbasin mean values by dividing by the total area fraction or, for concentration, by the sum of runoff.
Consequences Module modvar variable outvar may change.
[in] | idindex | index in outvarid |
[in] | isb | index of subbasin |
[in] | denominator | land area fraction (or other fraction) of subbasin area or total runoff |
subroutine modelmodule::calculate_class_outvar_finish_scale | ( | integer, intent(in) | idindex, |
integer, intent(in) | isb, | ||
real, intent(in) | factor | ||
) |
Finalize the calculation of subbasin mean value and classgroup mean value by multiplying by factor.
Consequences Module modvar variables outvar, outvarclassdata may change.
[in] | idindex | index in outvarid |
[in] | isb | index of subbasin |
[in] | factor | multipying factor |
|
private |
Calculate and add class values for output variables for substances in soil Consequences Module modvar variable outvar may change.
[in] | isb | index of subbasin |
[in] | j | index of class |
[in] | aadj | class area fraction, including only land area of floodplain river and lake |
[in] | a | class area fraction, correspond to classarea |
[in] | classarea | class area |
[in] | denitrif | denitrification in soil layers |
[in] | cropuptake | uptake of IN |
[in] | atmdepload2 | wet dep and dry dep |
[in,out] | soilstate | Soil states |
[in,out] | miscstate | Miscstate states |
subroutine modelmodule::calculate_class_outvar_for_substance_soil_finish | ( | integer, intent(in) | isb, |
real, dimension(maxsoillayers), intent(in) | asum, | ||
real, dimension(maxsoillayers), intent(in) | soilwateri | ||
) |
Calculate and finish output variables for substances in soil Consequences Module modvar variable outvar may change.
[in] | isb | index of subbasin |
[in] | asum | sum of land area parts, including only land area of floodplain river and lake |
[in] | soilwateri | soil water (mm) |
subroutine modelmodule::calculate_class_outvar_initialize | ( | integer, intent(in) | idindex, |
integer, intent(in) | isb | ||
) |
Initialize to zero the variables accumulating class values for calculating output of subbasin mean values and classgroup mean values for a specific variable and subbasin.
Consequences Module modvar variable outvar, outvarclassdata, and outvarclassfraction may change.
[in] | idindex | index in outvarid |
[in] | isb | index of subbasin |
subroutine modelmodule::calculate_flow_for_lakebasin_lake | ( | integer, intent(in) | ilast, |
integer, intent(in) | itype, | ||
logical, dimension(nsub), intent(in) | looplakes, | ||
real, dimension(nsub), intent(in) | qini2, | ||
real, dimension(nsub), intent(in) | lakeareai2, | ||
real, dimension(nsub), intent(in) | hypodepthi2, | ||
real, dimension(nsub), intent(in) | olakewstoldi2, | ||
real, dimension(numsubstances,nsub), intent(in) | resusp_downstream, | ||
real, dimension(nsub), intent(inout) | outflowsimi2, | ||
real, dimension(nsub), intent(inout) | lakeoutflowi2, | ||
real, dimension(nsub), intent(inout) | mainflowi2, | ||
real, dimension(nsub), intent(inout) | branchflowi2, | ||
real, dimension(nsub), intent(inout) | accinflow, | ||
real, dimension(numsubstances,nsub), intent(inout) | acccinflow, | ||
real, dimension(numsubstances,nsub), intent(inout) | clakeoutflowi2, | ||
real, dimension(numsubstances,nsub), intent(inout) | cmainflowi2, | ||
real, dimension(numsubstances,nsub), intent(inout) | cbranchflowi2, | ||
real, dimension(nsub), intent(inout) | qcinflii2, | ||
real, dimension(numsubstances,nsub), intent(inout) | netroutload, | ||
real, dimension(nsub), intent(inout) | wstlakesimi2, | ||
real, dimension(nsub), intent(inout) | lakewsti2, | ||
real, dimension(nsub), intent(inout) | wcomaveri2, | ||
real, dimension(numsubstances,18:19,nsub), intent(inout) | Lpathwayi2, | ||
real, dimension(numsubstances,nsub), intent(out) | Lbranchi2, | ||
real, intent(out) | totaloutflow, | ||
real, dimension(numsubstances), intent(out) | ctotaloutflow, | ||
type(lakestatetype), intent(inout) | lakestate, | ||
type(miscstatetype), intent(inout) | miscstate | ||
) |
Calculate flow withing and out from each lakebasin of a lakebasin lake of the new type with equal water level. Subroutine called for "last" lakebasin.
Consequences Module hype_waterbalance variable wbflows may be set.
Reference ModelDescription Chapter Rivers and lakes (Basic assumptions, Lakes - Outlet lake as lake basin a part of a multi-basin lake with equal water level)
[in] | ilast | index of current subbasin (last lakebasin of current lake) |
[in] | itype | lake type (internal or outlet) (only outlet allowed) |
[in] | looplakes | flag for lakebasins belonging to this lake |
[in] | qini2 | inflow to lake basin from main river (incl. upstream subbasins but not other lakebasins) (m3/s) |
[in] | lakeareai2 | area of lakebasins (m2) |
[in] | hypodepthi2 | lake hypolimnion depth (m) |
[in] | olakewstoldi2 | lake water stage, end of last timestep (mm) |
[in] | resusp_downstream | flushing to downstream subbasin from lake last subbasin |
[in,out] | outflowsimi2 | flow to downstream subbasins/lakebasins (m3/s) |
[in,out] | lakeoutflowi2 | flow to downstream subbasins, after updating (m3/s) |
[in,out] | mainflowi2 | flow to main downstream subbasin, after updating (m3/s) |
[in,out] | branchflowi2 | flow to branch downstream subbasin, after updating (m3/s) |
[in,out] | accinflow | upstream inflow to subbasin (m3/s) |
[in,out] | acccinflow | load of substances in upstream inflow to subbasin |
[in,out] | clakeoutflowi2 | concentration of substances in flow to downstream subbasins |
[in,out] | cmainflowi2 | concentration of substances in main flow to downstream subbasins |
[in,out] | cbranchflowi2 | concentration of substances in branch flow to downstream subbasins |
[in,out] | qcinflii2 | net inflow to lake basin (incl. prec-evap etc) (m3/s) |
[in,out] | netroutload | net load of main river and olake (outflow-(local and upstream)inflows) |
[in,out] | wstlakesimi2 | lake water stage (mm) |
[in,out] | lakewsti2 | lake water stage, after updating (mm) |
[in,out] | wcomaveri2 | average lake water stage over the time step (mm) |
[in,out] | lpathwayi2 | output loads for sourceapportionment calculations |
[out] | lbranchi2 | output loads for sourceapportionment calculations |
[out] | totaloutflow | total outflow of multi-basin lake (m3/s) |
[out] | ctotaloutflow | concentration of total outflow of multi-basin lake |
[in,out] | lakestate | Lake states |
[in,out] | miscstate | Miscstate states |
Algoritm
Calculate lakebasinlake average waterstage
Calculate inflow to lake (needed for outflow calculation)
Calculate outflow of lakebasin lake (all outlets of lakebasin lake)
Calculate new lake water stage we want to reach, check if water available
Calculate flow between lakebasins to reach new wst; calculate net flow (first loop) and then total flow adding inflow from other upstream lakebasins (second loop)
Calculate where/when to take water at what concentration and move the water
Let calculated flows (clbinflow, m3/ts) move to recieving lakebasin (i2)
Set variables used for output of upstream lakebasins
Set output of last lakebasin
Update by/of water stage
Update modelled subbasin outflow with observations or nutrient concentrations, only for whole lake outflow
Accumulate flow to downstream subbasins, downstream of whole lakebasinlake
Set output of whole multi-basin lake outflow
|
private |
Calculate flow from lake that is not a lakebasin lake. This include effect of damming floodplains, updating by flow or water level observations, and setting miscellaneous outputs.
Reference ModelDescription Chapter Rivers and lakes (Basic assumptions, Lakes - Simple outlet lake or dam)
[in] | i | index of current subbasin |
[in] | itype | lake type (internal or outlet) (only outlet allowed) |
[in] | qin | net inflow to lake (m3/s) |
[in] | lakearea | area of lake (m2) |
[in] | flowreduction | downstream dammed flow on olake (m3/s) |
[in] | hypodepth | lake hypolimnion depth (m) |
[in] | olakewstold | lake water stage, end of last timestep (mm) |
[out] | outflowsim | flow to downstream subbasins (m3/s) |
[out] | lakeoutflow | flow to downstream subbasins, after updating (m3/s) |
[out] | mainflow | flow to main downstream subbasin, after updating (m3/s) |
[out] | branchflow | flow to branch downstream subbasin, after updating (m3/s) |
[out] | concout | concentration of substances in flow to downstream subbasins |
[out] | wstlakesim | lake water stage (mm) |
[out] | lakewst | lake water stage, after updating (mm) |
[out] | wcomaver | average lake water stage over the time step (mm) |
[in,out] | lpathway | output loads for sourceapportionment calculations |
[in,out] | lakestate | Lake states |
[in,out] | miscstate | Miscstate states |
Algorithm Initialisation
Calculate outflow from lake according to rating curve or regulation
For floodplain model, the lake outflow can be dammed and thus reduced
Remove water from lake and calculate T2 of outflow
Update lake outflow and lake water volume with waterstage observations
Update modelled subbasin outflow with flow observations or nutrient concentrations
subroutine modelmodule::calculate_internal_wetland | ( | integer, intent(in) | i, |
real, intent(in) | radext, | ||
real, intent(in) | cloud, | ||
real, intent(in) | added_water, | ||
real, dimension(:,:), intent(in), allocatable | precij, | ||
real, dimension(nclass), intent(in) | sfdist, | ||
real, intent(inout) | q, | ||
real, dimension(numsubstances), intent(inout) | conc, | ||
type(snowicestatetype), intent(in) | frozenstate, | ||
type(soilstatetype), intent(inout) | soilstate, | ||
type(miscstatetype), intent(inout) | miscstate, | ||
real, dimension(:,:), intent(inout), allocatable | localoutvar, | ||
real, dimension(:,:), intent(inout), allocatable | localwbflows, | ||
real, dimension(:,:), intent(inout), allocatable | localLpathway | ||
) |
Calculate inflow, outflow and internal processes of an internal wetland (if present). Precipitation and soil related processes no included. They are calculated by the soilmodel earlier.
Reference ModelDescription Chapter Water management (Constructed wetlands with water regulation capability)
[in] | i | current subbasin index |
[in] | radext | extra terrestrial radiation for subbasin i |
[in] | cloud | subbasin cloudiness (-) |
[in] | added_water | water already added to wetland (soil layer 1), eg. P-E (mm/ts) |
[in] | precij | class precipitation after downwind redistribution of snow (mm/timestep) |
[in] | sfdist | snow fall distribution factor for subbasin i |
[in,out] | q | flow to local river |
[in,out] | conc | concentration of flow to local river |
[in] | frozenstate | Frozen states |
[in,out] | soilstate | Soil states |
[in,out] | miscstate | Misc states |
[in,out] | localoutvar | outvar; output for print out |
[in,out] | localwbflows | wbflows; flow for water balance output (m3/ts) |
[in,out] | locallpathway | Lpathway; load for print out |
Algorithm
Check for internal wetland
If water temperature (T2) is simulated: calculate current temperature and solar radiation for surface heat exchange
Calculate inflow and outflow to wetland (and processes therein)
Set output variables of internal wetland
Set water balance flows for internal wetland (m3/ts)
Calculate resulting inflow to local river after passing internal wetland
subroutine modelmodule::calculate_lake_volume_output | ( | integer, intent(in) | n, |
type(lakestatetype), intent(in) | lakestate, | ||
real, dimension(n), intent(out) | ilakevol, | ||
real, dimension(n), intent(out) | olakevol, | ||
real, dimension(:,:), intent(inout), allocatable | localoutvar | ||
) |
Calculate output variables for lake volumes.
[in] | n | number of subbasins |
[in] | lakestate | Lake state, submodel |
[out] | ilakevol | volume of ilake (m3) |
[out] | olakevol | volume of olake (m3) |
[in,out] | localoutvar | outvar; output for print out |
subroutine modelmodule::calculate_local_lake_model | ( | integer, intent(in) | i, |
real, intent(in) | radext, | ||
real, intent(in) | rh, | ||
real, intent(in) | cloud, | ||
real, intent(in) | pobs, | ||
real, dimension(:,:), intent(in), allocatable | precij, | ||
real, dimension(nclass), intent(in) | sfdist, | ||
real, intent(in) | localpcorricep, | ||
real, intent(in) | qin, | ||
real, dimension(numsubstances), intent(in) | cin, | ||
real, intent(in) | hypodep, | ||
real, intent(inout) | localeacti, | ||
real, intent(inout) | localpreci, | ||
real, intent(inout) | localarea_water, | ||
real, intent(inout) | localprec_water, | ||
real, intent(inout) | localevap_water, | ||
type(snowicestatetype), intent(inout) | frozenstate, | ||
type(riverstatetype), intent(inout) | riverstate, | ||
type(lakestatetype), intent(inout) | lakestate, | ||
real, dimension(2), intent(inout) | surftemp, | ||
real, intent(out) | outflow, | ||
real, dimension(numsubstances), intent(out) | coutflow, | ||
real, intent(out) | outwst, | ||
real, dimension(:,:), intent(inout), allocatable | localoutvar, | ||
real, dimension(:,:), intent(inout), allocatable | localwbflows, | ||
real, dimension(:,:,:), intent(inout), allocatable | localLatmdep, | ||
real, dimension(:,:), intent(inout), allocatable | localLpathway | ||
) |
Almost all calculations related to local internal lake.
Calculate flow into local lake and resulting outflow. Calculates processes related to evaporation, ice, nutrients, and other substances. Calculate special output, e.g. for loads and waterbalance. Note that abstraction for irrigation is done outside (before) this subroutine.
Reference ModelDescription Chapter Rivers and lakes (Local lake (ilake))
[in] | i | current subbasin index |
[in] | radext | extra terrestrial radiation for subbasin i |
[in] | rh | relative humuidity (-) |
[in] | cloud | subbasin cloudiness (-) |
[in] | pobs | precipitation original from Pobs.txt (mm) for subbasin i |
[in] | precij | class precipitation after downwind redistribution of snow (mm/timestep) |
[in] | sfdist | snow fall distribution factor for subbasin i |
[in] | localpcorricep | interception evaporation due to negative preccorr-parameter [mm/timestep] |
[in] | qin | flow into lake from local river (m3/s) |
[in] | cin | concentration of flow in local river |
[in] | hypodep | local lake hypolimnion depth (m) |
[in,out] | localeacti | accumulation of actual evapotranspiration (mm) |
[in,out] | localpreci | accumulation of actual precipitation (mm) |
[in,out] | localarea_water | accumulation of water area fraction (-) |
[in,out] | localprec_water | accumulation of precipitation on water (mm) |
[in,out] | localevap_water | accumulation of actual evapotranspiration on water (mm) |
[in,out] | frozenstate | Frozen states |
[in,out] | riverstate | River states |
[in,out] | lakestate | Lake states |
[out] | outflow | flow from lake (m3/s) |
[out] | coutflow | concentration of flow from lake |
[out] | outwst | lake water (mm) |
[in,out] | localoutvar | outvar; output for print out |
[in,out] | localwbflows | wbflows; flow for water balance output (m3/ts) |
[in,out] | locallatmdep | Latmdep; load for print out |
[in,out] | locallpathway | Lpathway; load for print out |
Algorithm
Initiation of lake calculations
Forcing data set precipitation concentration on local lake
Add precipitation and atmospheric deposition to lake water
Evaporation of lake, taking partial ice cover into account if lakeriverice model is enabled
Accumulate output variables for mean over subbasin (accumulation for cevapi)
Calculate and add inflow (including point source) to local lake
Calculate lake tracer (T1), temperature (T2) and ice processes
Calculate substances processes in lakes
Calculate and remove outflow from lake
subroutine modelmodule::calculate_local_river | ( | integer, intent(in) | i, |
real, intent(in) | lriverlen, | ||
real, intent(in) | radext, | ||
real, intent(in) | rh, | ||
real, intent(in) | cloud, | ||
real, intent(in) | pobs, | ||
real, dimension(:,:), intent(in), allocatable | precij, | ||
real, dimension(nclass), intent(in) | sfdist, | ||
real, intent(in) | localpcorricep, | ||
real, intent(in) | qriverin, | ||
real, dimension(numsubstances), intent(in) | criverin, | ||
real, intent(out) | qriver, | ||
real, dimension(numsubstances), intent(out) | criver, | ||
real, intent(inout) | localeacti, | ||
real, intent(inout) | localpreci, | ||
real, intent(inout) | localarea_water, | ||
real, intent(inout) | localprec_water, | ||
real, intent(inout) | localevap_water, | ||
type(snowicestatetype), intent(inout) | frozenstate, | ||
type(miscstatetype), intent(in) | miscstate, | ||
type(riverstatetype), intent(inout) | riverstate, | ||
type(lakestatetype), intent(inout) | lakestate, | ||
real, dimension(:,:), intent(inout), allocatable | localoutvar, | ||
real, dimension(:,:), intent(inout), allocatable | localwbflows, | ||
real, dimension(:,:), intent(inout), allocatable | localwbstores, | ||
real, dimension(:,:,:), intent(inout), allocatable | localLatmdep, | ||
real, dimension(:), intent(inout), allocatable | localLruralb, | ||
real, dimension(:,:), intent(inout), allocatable | localLpathway | ||
) |
Almost all calculations related to local river.
Calculate flow into local river and resulting outflow. Calculates processes related to river wetland, ice, nutrients, and other substances. Calculate special output, e.g. for loads and waterbalance. Note that abstraction for irrigation is done outside (before) this subroutine.
Reference ModelDescription Chapter Rivers and lakes (Local river)
[in] | i | current subbasin index |
[in] | lriverlen | local river length (m) !Only used to check if river is present |
[in] | radext | extra terrestrial radiation for subbasin i |
[in] | rh | relative humuidity (-) |
[in] | cloud | subbasin cloudiness (-) |
[in] | pobs | precipitation original from Pobs.txt (mm) for subbasin i |
[in] | precij | class precipitation after downwind redistribution of snow (mm/timestep) |
[in] | sfdist | snow fall distribution factor for subbasin i |
[in] | localpcorricep | interception evaporation due to negative preccorr-parameter [mm/timestep] |
[in] | qriverin | flow into of local river (m3/s) |
[in] | criverin | concentration of flow into local river |
[out] | qriver | flow out of local river (m3/s) |
[out] | criver | concentration of flow out of local river |
[in,out] | localeacti | accumulation of actual evapotranspiration (mm) |
[in,out] | localpreci | accumulation of actual precipitation (mm) |
[in,out] | localarea_water | accumulation of water area fraction (-) |
[in,out] | localprec_water | accumulation of precipitation on water (mm) |
[in,out] | localevap_water | accumulation of actual evapotranspiration on water (mm) |
[in,out] | frozenstate | Frozen states |
[in] | miscstate | Misc states |
[in,out] | riverstate | River states |
[in,out] | lakestate | Lake states (is really only IN, but subroutine demande INOUT) |
[in,out] | localoutvar | outvar; output for print out |
[in,out] | localwbflows | wbflows; flow for water balance output (m3/ts) |
[in,out] | localwbstores | wbstores; stores for water balance output (m3) |
[in,out] | locallatmdep | Latmdep; load for print out |
[in,out] | locallruralb | Lruralb; load for print out |
[in,out] | locallpathway | Lpathway; load for print out |
Algorithm
Initiation of river calculations
Add local sources to local river flow
Check for presence of local river. If no river the above flow is directly passed on
Calculate river wetland
Translation (delay) in river inflow
Check if local river has been given class area
Calculate river ice and T2 processes of local river
Calculate substances processes in river (should they also use fractional river area?)
Calculate outflow of local river and remove from river water volume
Set output variables for local river
subroutine modelmodule::calculate_outlet_wetland | ( | integer, intent(in) | i, |
real, intent(in) | radext, | ||
real, intent(in) | cloud, | ||
real, intent(in) | added_water, | ||
real, dimension(:,:), intent(in), allocatable | precij, | ||
real, dimension(nclass), intent(in) | sfdist, | ||
real, intent(in) | wetinflow, | ||
real, dimension(numsubstances), intent(in) | conc, | ||
type(snowicestatetype), intent(in) | frozenstate, | ||
type(soilstatetype), intent(inout) | soilstate, | ||
type(miscstatetype), intent(inout) | miscstate, | ||
real, intent(out) | wetoutflow, | ||
real, intent(out) | updatedoutflow, | ||
real, dimension(numsubstances), intent(out) | cwetoutflow, | ||
real, intent(out) | mainflow, | ||
real, intent(out) | branchflow, | ||
real, dimension(:,:), intent(inout), allocatable | localoutvar, | ||
real, dimension(:,:), intent(inout), allocatable | localwbflows, | ||
real, dimension(:,:), intent(inout), allocatable | localLpathway | ||
) |
Calculate inflow, outflow and internal processes of an outlet wetland (if present). Precipitation and soil related processes no included. They are calculated by the soilmodel earlier.
Reference ModelDescription Chapter Water management (Constructed wetlands with water regulation capability)
[in] | i | current subbasin index |
[in] | radext | extra terrestrial radiation for subbasin i |
[in] | cloud | subbasin cloudiness (-) |
[in] | added_water | water already added to wetland (soil layer 1), eg. P-E (mm/ts) |
[in] | precij | class precipitation after downwind redistribution of snow (mm/timestep) |
[in] | sfdist | snow fall distribution factor for subbasin i |
[in] | wetinflow | flow from main river (dampq) (m3/s) |
[in] | conc | concentration of flow from main river |
[in] | frozenstate | Frozen states |
[in,out] | soilstate | Soil states |
[in,out] | miscstate | Misc states |
[out] | wetoutflow | flow from outlet wetland (originally simulated) (m3/s) |
[out] | updatedoutflow | flow from outlet wetland after updating (m3/s) |
[out] | cwetoutflow | concentration of flow from outlet wetland |
[out] | mainflow | flow from outlet wetland to main downstream subbasin (m3/s) |
[out] | branchflow | flow from outlet wetland to branched downstream subbasin (m3/s) |
[in,out] | localoutvar | outvar; output for print out |
[in,out] | localwbflows | wbflows; flow for water balance output (m3/ts) |
[in,out] | locallpathway | Lpathway; load for print out |
Algorithm
Check for outlet wetland
Calculate helpful variables for the outlet wetland
If water temperature (T2) is simulated: calculate current temperature and solar radiation for surface heat exchange
Calculate inflow and outflow to wetland
Set output variables of outlet wetland
Update modelled subbasin outflow with flow observations
subroutine modelmodule::calculate_outvar_watertemperature | ( | integer, intent(in) | idindex, |
integer, intent(in) | isb, | ||
integer, intent(in) | itype, | ||
real, intent(in) | lowerlimit, | ||
type(riverstatetype), intent(in) | riverstate, | ||
type(lakestatetype), intent(in) | lakestate | ||
) |
Calculate temperature of outflow from subbasin from river or lake outflow Consequences Module modvar variable outvar may change.
[in] | idindex | index in outvarid |
[in] | isb | index of subbasin |
[in] | itype | index of system (1=local, 2=main) |
[in] | lowerlimit | lower limit of temperature |
[in] | riverstate | River states |
[in] | lakestate | Lake states |
subroutine modelmodule::calculate_regional_groundwaterflow_to_outside_system | ( | integer, intent(in) | isb, |
real, intent(in) | totflow, | ||
real, intent(out) | outflow | ||
) |
Calculate regional groundwater flow to outside model domain (for deepmodel 1)
[in] | isb | index of subbasin |
[in] | totflow | total flow of regional groundwater (m3/ts) |
[out] | outflow | flow to outside of model domain (m3/ts) |
subroutine, public modelmodule::calculate_special_model_parameters | ( | integer, intent(in) | nsubb, |
real, intent(in) | optrivvel, | ||
real, intent(in) | optdamp, | ||
integer, intent(out) | dimriver | ||
) |
Calculate special HYPE parameters needed by HYSS.
[in] | nsubb | dimension, number of subbasins (submodel) |
[in] | optrivvel | lower river velocity boundary (optpar) |
[in] | optdamp | lower damp boundary (optpar) |
[out] | dimriver | maximum size river lag needed |
subroutine, public modelmodule::calculate_translation_time | ( | real, intent(in) | rivlen, |
real, intent(in) | rivvel, | ||
real, intent(in) | damp, | ||
real, intent(out) | totaltime, | ||
real, intent(out) | transtime | ||
) |
Calculate delay times in rivers.
[in] | rivlen | river length (m) |
[in] | rivvel | river velocity (m3/s) |
[in] | damp | damp parameter |
[out] | totaltime | total delay time of river (timesteps) |
[out] | transtime | translation time of river (timesteps) |
subroutine modelmodule::compute_substance_load | ( | real, intent(out) | load, |
real, intent(in) | flow, | ||
real, intent(in) | conc, | ||
real, intent(in), optional | conc2 | ||
) |
Compute load from concentration and flow (matching units) while handling missing value of concentration at zero flow.
[out] | load | load=flow*conc or load=flow*(conc+conc2) |
[in] | conc | concentration |
[in] | conc2 | concentration of second substance |
subroutine, public modelmodule::define_model_parameters |
Set variable holding model parameter information of HYPE model.
Note that only small letters allowed in parameter names modparid structure: name, dependence type, index (defined in hypevar)
subroutine, public modelmodule::get_special_model_parameters | ( | integer, intent(out) | velindex, |
integer, intent(out) | dampindex | ||
) |
Set special HYPE parameters needed by HYSS.
[out] | velindex | index of rivvel in modparid |
[out] | dampindex | index of damp in modparid |
subroutine modelmodule::initialize_class_outvar_to_zero |
Initialize to zero the variables accumulating class values for calculating output of subbasin mean values and classgroup mean values.
Consequences Module modvar variable outvar, outvarclassdata, and outvarclassfraction may change.
subroutine, public modelmodule::initiate_model | ( | type(snowicestatetype), intent(inout) | frozenstate, |
type(soilstatetype), intent(inout) | soilstate, | ||
type(aquiferstatetype), intent(inout) | aquiferstate, | ||
type(riverstatetype), intent(inout) | riverstate, | ||
type(lakestatetype), intent(inout) | lakestate, | ||
type(miscstatetype), intent(inout) | miscstate | ||
) |
Initiates model variables and parameters for a simulation. This include calculating HYPE variables for holding model set-up information and more...
Consequences Module modvar variables soildepth and soilthick may change.
[in,out] | frozenstate | Snow and ice states |
[in,out] | soilstate | Soil states |
[in,out] | aquiferstate | Aquifer states |
[in,out] | riverstate | River states |
[in,out] | lakestate | Lake states |
[in,out] | miscstate | Misc states |
Algorithm Set flags for radiation, humidity and wind calculations
Set flag for T1 simulation with typical soil leakage
Initiate soil layer and water processes help parameters.
Initialize glacier parameters and type
Initiate soil temperature parameters and variables
Initialize lake and river
Initialize internal landclass wetland (iwet).
Calculate floodplain reference level (deepest bottom of floodplain), if not set in file
Calculate river transport time parameters
Replace parameter values with regional parameter estimates
Set river bankful variables
Initialize lake parameters
Initiate regional groundwater flow/aquifer
Allocate and initiate output variable
Allocate nutrient (NP) load variables
Initiate irrigation
Initate calculations for water balance output
subroutine, public modelmodule::initiate_model_state | ( | type(snowicestatetype), intent(inout) | frozenstate, |
type(soilstatetype), intent(inout) | soilstate, | ||
type(aquiferstatetype), intent(inout) | aquiferstate, | ||
type(riverstatetype), intent(inout) | riverstate, | ||
type(lakestatetype), intent(inout) | lakestate, | ||
type(miscstatetype), intent(inout) | miscstate | ||
) |
Initiates the model state for a simulation with no saved states.
[in,out] | frozenstate | Snow and ice states |
[in,out] | soilstate | Soil states |
[in,out] | aquiferstate | Aquifer states |
[in,out] | riverstate | River states |
[in,out] | lakestate | Lake states |
[in,out] | miscstate | Misc states |
subroutine, public modelmodule::model | ( | type(snowicestatetype), intent(inout) | frozenstate, |
type(soilstatetype), intent(inout) | soilstate, | ||
type(aquiferstatetype), intent(inout) | aquiferstate, | ||
type(riverstatetype), intent(inout) | riverstate, | ||
type(lakestatetype), intent(inout) | lakestate, | ||
type(miscstatetype), intent(inout) | miscstate | ||
) |
Model subroutine for HYPE. Calculates what happen during one timestep.
[in,out] | frozenstate | Snow and ice states |
[in,out] | soilstate | Soil states |
[in,out] | aquiferstate | Aquifer states |
[in,out] | riverstate | River states |
[in,out] | lakestate | Lake states |
[in,out] | miscstate | Misc states |
Algorithm
Initial calculation of regional groundwater
Initial calculation of regional floodplains
Get current observations for HYPE specific indata
Calculate and/or adjust subbasin average atmospheric forcing for all subbasins
Main subbasin-loop, subbasins calculated in flow order
Main class-loop for calculation of soil water and substances (land classes)
Calculations for soil leakage concentrations from input data
Main subbasin-loop, subbasins calculated in flow order
Routing in rivers and lakes
Internal wetland (routing part, soil processes already calculated)
Local river (itype=1)
Local internal lake (itype=1)
Main river (itype=2)
Outlet lake (itype=2) or outlet wetland (owet)
Update modelled subbasin outflow with observations
Update modelled subbasin outflow with nutrient concentrations
Accumulate flow to downstream subbasins, and calculate volume flow for water balance
Set subbasin output variables (outvar) for print out dependent on outlet lake/no lake or lakebasins, NEED TO HANDLE LAKEBASINS
Set subbasin output variables (outvar) for print out dependent on outlet lake
Set subbasin output variables (outvar) for print out dependent on outlet lake for all lakebasins when reach last lakebasin
End main subbasin-loop
subroutine, public modelmodule::model_specified_atmospheric_deposition |
Set atmospheric deposition for model if no AtmdepData.txt file is used. HYPE uses model paraemters to be compatible with olde versions.
subroutine modelmodule::set_all_aquifer_outvar | ( | integer, intent(in) | nsub, |
integer, intent(in) | naquifers, | ||
real, dimension(nsub), intent(in) | aqremflow, | ||
type(aquiferstatetype), intent(in) | aquiferstate | ||
) |
Set output variables for aquifers Consequences Module modvar variable outvar may change.
[in] | nsub | number of subbasins |
[in] | naquifers | number of aquifers |
[in] | aqremflow | water removed from soillayers for aquifer |
[in] | aquiferstate | Aquifer states |
subroutine modelmodule::set_all_observation_outvar |
Set output variables from Xobs, Qobs, Wobs Consequences Module modvar variable outvar may change.
Set observed subbasin output variables (outvar) for print out
subroutine modelmodule::set_class_outvar_missing | ( | integer, intent(in) | idindex, |
integer, intent(in) | isb | ||
) |
Set the output of subbasin mean value from classe values to missing value in the cases when a variable is not calculated and could be miss used.
Consequences Module modvar variable outvar may change
[in] | idindex | index in outvarid |
[in] | isb | index of subbasin |
subroutine, public modelmodule::set_modelconfig_from_parameters |
Set model configuration data from input parameters; lake depth and catchment area of ilake.
Algorithm
Calculate new soil layer thickness (m)
Set local lake depth from regional or general parameter
Replace local lake with hds model, if option set and depth value given.
Set local lake location (icatch) from parameters.
Set olake lakedepth from parameter inputs (if not set already by GeoData/LakeData/DamData input)
Set recharge and discharge model calculation
subroutine modelmodule::set_output_runoff_concentrations_leakagemodel1 | ( | integer, intent(in) | isb, |
integer, intent(in) | nsb, | ||
real, dimension(nsb), intent(in) | runoffts, | ||
real, dimension(numsubstances,nsb), intent(in) | crunoffts | ||
) |
Set output variables for runoff concentrations when using soil leakage model 1 Consequences Module modvar variable outvar may change.
[in] | isb | index of subbasin |
[in] | nsb | number of subbasin |
[in] | runoffts | runoff |
[in] | crunoffts | concentration of runoff |
|
private |
Set output variable from Xobs Consequences Module modvar variable outvar may change.
[in] | idindex | index in outvarid |
[in] | isb | index of subbasin |
|
private |
Set output variable from a scaled Xobs variable Consequences Module modvar variable outvar may change.
[in] | idindex | index in outvarid for output variable |
[in] | isb | index of subbasin |
[in] | idxobs | index in outvarid for xobs variable |
[in] | factor | scale factor for output |
|
private |
Set output variable for a meantype Xobs/Xom variable Consequences Module modvar variable outvar may change.
[in] | idindex | index in outvarid for output variable |
[in] | isb | index of subbasin |
[in] | idxobs | index in outvarid for xom variable |
subroutine modelmodule::set_outvar_xobsstate | ( | integer, intent(in) | idindex, |
integer, intent(in) | isb, | ||
integer, intent(in) | idxobs | ||
) |
Set output variable from a statetype Xobs/Xos variable Consequences Module modvar variable outvar may change.
[in] | idindex | index in outvarid for output variable |
[in] | isb | index of subbasin |
[in] | idxobs | index in outvarid for xos variable |
subroutine, public modelmodule::set_parameters_region_division | ( | integer, intent(in) | nregpar | ) |
Allocate and set parameter region division.
[in] | nregpar | number of region parameters |
|
private |
Calculate current amount of water in wetland (iwet,owet) in m3.
[in] | j | soil landuse class |
[in] | i | subbasin |
[in] | frozenstate | Snow and ice states |
[in] | soilstate | Soil states |