◆ AddAction()
| bool ModelHydro::AddAction |
( |
Action * | action | ) |
|
Add an action to the model.
- Parameters
-
- Returns
- true if the action was added successfully.
◆ AddTimeSeries()
| bool ModelHydro::AddTimeSeries |
( |
std::unique_ptr< TimeSeries > | timeSeries | ) |
|
Add a time series to the model.
- Parameters
-
| timeSeries | time series to add. |
- Returns
- true if the time series was added successfully.
◆ AttachTimeSeriesToHydroUnits()
| bool ModelHydro::AttachTimeSeriesToHydroUnits |
( |
| ) |
|
Attach the time series to the hydro units.
- Returns
- true if the time series were attached successfully.
◆ ClearTimeSeries()
| void ModelHydro::ClearTimeSeries |
( |
| ) |
|
◆ CloseLog()
| void ModelHydro::CloseLog |
( |
| ) |
|
Flush and close the model's own log file.
◆ CreateTimeSeries()
| bool ModelHydro::CreateTimeSeries |
( |
const string & | varName, |
|
|
const axd & | time, |
|
|
const axi & | ids, |
|
|
const axxd & | data ) |
Create a time series and add it to the model.
- Parameters
-
| varName | name of the variable. |
| time | time series data. |
| ids | ids of the data. |
| data | data to add. |
- Returns
- true if the time series was created and added successfully.
◆ DumpOutputs()
| bool ModelHydro::DumpOutputs |
( |
const string & | path | ) |
|
Dump the outputs as betCDF file to the specified path.
- Parameters
-
| path | path to dump the outputs. |
- Returns
- true if the dump was successful.
◆ ForcingLoaded()
| bool ModelHydro::ForcingLoaded |
( |
| ) |
const |
|
nodiscard |
Check if the forcing data were loaded.
- Returns
- true if the forcing data were loaded.
◆ GetActionCount()
| int ModelHydro::GetActionCount |
( |
| ) |
const |
|
nodiscard |
Get the number of actions in the model.
- Returns
- number of actions.
◆ GetActionsManager()
Get the actions manager.
- Returns
- pointer to the actions manager.
◆ GetChannelRoutingScheme()
| string ModelHydro::GetChannelRoutingScheme |
( |
| ) |
const |
|
nodiscard |
Get the name of the channel routing scheme in use.
- Returns
- the scheme name ('none' without a river network).
◆ GetHydroUnitAreas()
| axd ModelHydro::GetHydroUnitAreas |
( |
| ) |
const |
|
nodiscard |
Get the areas of the hydro units in the recorded order.
- Returns
- array of hydro unit areas.
◆ GetHydroUnitById()
| HydroUnit * ModelHydro::GetHydroUnitById |
( |
int | id | ) |
const |
|
nodiscard |
Get a hydro unit by ID, in any subbasin.
- Parameters
-
| id | The ID of the hydro unit. |
- Returns
- the hydro unit, or nullptr if the ID is unknown.
◆ GetHydroUnitFractions()
| axxd ModelHydro::GetHydroUnitFractions |
( |
const string & | label | ) |
const |
|
nodiscard |
Get the recorded land-cover fraction series for a given fraction label (land cover name), read from the in-memory logger. Fractions are recorded only when record_all is enabled.
- Parameters
-
| label | the land cover name (e.g. "glacier"). |
- Returns
- the recorded fraction series as a 2D array (time steps x hydro units).
◆ GetHydroUnitIds()
| vecInt ModelHydro::GetHydroUnitIds |
( |
| ) |
const |
|
nodiscard |
Get the ids of the hydro units in the recorded order.
- Returns
- vector of hydro unit ids.
◆ GetHydroUnitLabelBasis()
| string ModelHydro::GetHydroUnitLabelBasis |
( |
const string & | label | ) |
const |
|
nodiscard |
Get the area basis of a recorded hydro unit component: "land_cover" (over the area of its land cover), "hydro_unit" (over the unit) or "subbasin" (over the local area of the subbasin).
- Parameters
-
| label | the component label (e.g. "glacier:melt:output"). |
- Returns
- the area basis.
◆ GetHydroUnits()
| std::vector< HydroUnit * > ModelHydro::GetHydroUnits |
( |
| ) |
const |
|
nodiscard |
Get every hydro unit of the model, subbasin after subbasin in processing order.
- Returns
- the hydro units.
◆ GetHydroUnitSubbasinFractions()
| axd ModelHydro::GetHydroUnitSubbasinFractions |
( |
| ) |
const |
|
nodiscard |
Get the share of its subbasin's area covered by each hydro unit, in recorded order.
- Returns
- vector of area fractions.
◆ GetHydroUnitValues()
| axxd ModelHydro::GetHydroUnitValues |
( |
const string & | label | ) |
const |
|
nodiscard |
Get the recorded hydro unit value series for a given component label, read from the in-memory logger (no file dump). Requires the component to have been recorded (e.g. with record_all enabled).
- Parameters
-
| label | the recorded component label (e.g. "glacier:melt:output"). |
- Returns
- the recorded series as a 2D array (time steps x hydro units).
◆ GetLogger()
| Logger * ModelHydro::GetLogger |
( |
| ) |
|
|
inline |
Get the logger.
- Returns
- pointer to the logger.
◆ GetNetwork()
Get the river network (the tree of subbasins), owned by the model once InitializeWithBasin has run.
- Returns
- the river network, or nullptr when the subbasin was provided externally.
◆ GetOutletDischarge()
| axd ModelHydro::GetOutletDischarge |
( |
| ) |
const |
Get the outlet discharge series.
- Returns
- outlet discharge series.
◆ GetProcessor()
Get the processor.
- Returns
- pointer to the processor. Get the processor of the outlet subbasin (the only one for a single subbasin).
-
the processor, or nullptr before initialization.
◆ GetReachLengths()
| axd ModelHydro::GetReachLengths |
( |
| ) |
const |
|
nodiscard |
Get the length of the reach of every subbasin [m], in the order of GetSubbasinIds().
- Returns
- the reach lengths.
◆ GetReachSlopes()
| axd ModelHydro::GetReachSlopes |
( |
| ) |
const |
|
nodiscard |
Get the slope of the reach of every subbasin [m/m], in the order of GetSubbasinIds().
- Returns
- the reach slopes.
◆ GetReachSubreachCounts()
| vecInt ModelHydro::GetReachSubreachCounts |
( |
| ) |
const |
|
nodiscard |
Get the number of sub reaches the reach of every subbasin is divided into, in the order of GetSubbasinIds(). Always 1 except with Muskingum-Cunge, and only once the model has run a step.
- Returns
- the sub reach counts.
◆ GetReachTravelTimes()
| axd ModelHydro::GetReachTravelTimes |
( |
| ) |
const |
|
nodiscard |
Get the travel time of the reach of every subbasin [days], at the reference discharge, in the order of GetSubbasinIds(). With the discharge-dependent schemes the travel time of a step differs from it.
- Returns
- the reach travel times.
◆ GetRecordedHydroUnitFractionLabels()
| vecStr ModelHydro::GetRecordedHydroUnitFractionLabels |
( |
| ) |
const |
|
nodiscard |
Get the labels of the recorded land-cover fractions.
- Returns
- vector of recorded fraction labels (land cover names).
◆ GetRecordedHydroUnitLabels()
| vecStr ModelHydro::GetRecordedHydroUnitLabels |
( |
| ) |
const |
|
nodiscard |
Get the labels of the recorded hydro unit components.
- Returns
- vector of recorded component labels.
◆ GetSporadicActionItemCount()
| int ModelHydro::GetSporadicActionItemCount |
( |
| ) |
const |
|
nodiscard |
Get the number of sporadic action items in the model (i.e., actions that are not recursive).
- Returns
- number of sporadic action items.
◆ GetSubbasin()
| Subbasin * ModelHydro::GetSubbasin |
( |
| ) |
const |
|
inline |
Get the subbasin.
- Returns
- pointer to the subbasin.
◆ GetSubbasinDischarge()
| axd ModelHydro::GetSubbasinDischarge |
( |
int | subbasinId | ) |
const |
|
nodiscard |
Get the discharge at the outlet of a subbasin [mm over its drained area].
- Parameters
-
| subbasinId | The ID of the subbasin. |
- Returns
- the discharge time series.
◆ GetTimeMachine()
Get the time machine (timer).
- Returns
- pointer to the timer.
◆ GetTotalET()
| double ModelHydro::GetTotalET |
( |
| ) |
const |
|
nodiscard |
Get the total amount of water lost by evapotranspiration.
- Returns
- total amount of water lost by evapotranspiration.
◆ GetTotalOutletDischarge()
| double ModelHydro::GetTotalOutletDischarge |
( |
| ) |
const |
|
nodiscard |
Get the total outlet discharge.
- Returns
- total outlet discharge.
◆ GetTotalSnowStorageChanges()
| double ModelHydro::GetTotalSnowStorageChanges |
( |
| ) |
const |
|
nodiscard |
Get the total change in snow storage.
- Returns
- total change in snow storage.
◆ GetTotalWaterStorageChanges()
| double ModelHydro::GetTotalWaterStorageChanges |
( |
| ) |
const |
|
nodiscard |
Get the total change in water storage.
- Returns
- total change in water storage.
◆ Initialize()
Initialize the model.
- Parameters
-
| modelSettings | settings of the model. |
| basinSettings | settings of the basin. |
| checkProcesses | whether to check the processes during validation. |
- Returns
- true if the initialization was successful.
◆ InitializeWithBasin()
Initialize the model along with the basin.
- Parameters
-
| modelSettings | settings of the model. |
| basinSettings | settings of the basin. |
- Returns
- true if the initialization was successful.
◆ IsValid()
| bool ModelHydro::IsValid |
( |
| ) |
const |
|
nodiscard |
Check that everything is correctly defined.
- Returns
- true if everything is correctly defined.
◆ OpenLog()
| void ModelHydro::OpenLog |
( |
const string & | directory | ) |
|
Open the model's own log file (hydrobricks_<timestamp>.log) in the given directory. The messages logged while this model initializes, runs or updates go there instead of the global log file, so that several models can log independently.
- Parameters
-
| directory | directory of the log file. |
◆ Reset()
| void ModelHydro::Reset |
( |
| ) |
|
◆ Run()
| ModelResult ModelHydro::Run |
( |
| ) |
|
|
nodiscard |
Run the model.
- Returns
- true if the model run was successful.
◆ SaveAsInitialState()
| void ModelHydro::SaveAsInitialState |
( |
| ) |
|
Save the model state as initial conditions.
◆ SetSubbasin()
| void ModelHydro::SetSubbasin |
( |
Subbasin * | subbasin | ) |
|
|
inline |
Set the subbasin (non-owning; caller retains ownership).
- Parameters
-
| subbasin | pointer to the subbasin. |
◆ UpdateParameters()
| void ModelHydro::UpdateParameters |
( |
SettingsModel & | modelSettings | ) |
|
Update the model parameters.
- Parameters
-
| modelSettings | settings of the model. |
◆ Validate()
| void ModelHydro::Validate |
( |
| ) |
const |
Validate that everything is correctly defined. Throws an exception if validation fails.
- Exceptions
-
The documentation for this class was generated from the following files:
- /github/workspace/core/src/base/ModelHydro.h
- /github/workspace/core/src/base/ModelHydro.cpp