|
hydrobricks
|
#include <Logger.h>
Public Member Functions | |
| void | InitContainers (int timeSize, const std::vector< Subbasin * > &subbasins, SettingsModel &modelSettings) |
| void | Reset () |
| void | SetSubbasinValuePointer (int iSubbasin, int iLabel, double *valPt) |
| void | SetHydroUnitValuePointer (int iUnit, int iLabel, double *valPt) |
| void | SetHydroUnitFractionPointer (int iUnit, int iLabel, double *valPt) |
| void | SetHydroUnitLabelBasis (int iLabel, const string &basis) |
| void | SetDate (double date) |
| void | SaveInitialValues () |
| void | Record () |
| void | Increment () |
| bool | DumpOutputs (const string &path) |
| axd | GetOutletDischarge () const |
| axd | GetSubbasinDischarge (int subbasinId) const |
| vecInt | GetIndicesForSubbasinElements (const string &item) const |
| vecInt | GetIndicesForHydroUnitElements (const string &item) const |
| double | GetTotalSubbasin (const string &item) const |
| double | GetTotalHydroUnits (const string &item, bool needsAreaWeighting=false) const |
| double | GetTotalOutletDischarge () const |
| double | GetTotalET () const |
| double | GetSubbasinInitialStorageState (const string &tag) const |
| double | GetSubbasinFinalStorageState (const string &tag) const |
| int | GetFractionIndexForComponent (const string &componentName) const |
| double | GetHydroUnitsInitialStorageState (const string &tag) const |
| double | GetHydroUnitsFinalStorageState (const string &tag) const |
| double | GetTotalWaterStorageChanges () const |
| double | GetTotalSnowStorageChanges () const |
| double | GetTotalGlacierStorageChanges () const |
| vecAxd | GetSubbasinValues () const |
| const vecAxxd & | GetSubbasinValuesPerSubbasin () const |
| const vecAxxd & | GetHydroUnitValues () const |
| const axd & | GetTime () const |
| const vecInt & | GetSubbasinIds () const |
| const vecInt & | GetSubbasinDownstreamIds () const |
| const vecInt & | GetSubbasinStructureIds () const |
| const axd & | GetSubbasinLocalAreas () const |
| const axd & | GetSubbasinDrainedAreas () const |
| int | GetSubbasinCount () const |
| const vecInt & | GetHydroUnitIds () const |
| const axd & | GetHydroUnitAreas () const |
| const vecStr & | GetSubbasinLabels () const |
| const vecStr & | GetHydroUnitLabels () const |
| const vecStr & | GetHydroUnitFractionLabels () const |
| const vecAxxd & | GetHydroUnitFractions () const |
| const vecStr & | GetHydroUnitLabelBases () const |
| const axd & | GetHydroUnitSubbasinFractions () const |
| void | RecordFractions () |
| void | AddSubbasinEtIndex (int iLabel) |
| void | AddHydroUnitEtIndex (int iLabel) |
Records the model values over time: the subbasin (aggregated) values per subbasin, and the hydro unit (distributed) values per unit. The subbasins are indexed in processing order (upstream first, the outlet last); the hydro units are indexed globally, in the order of the subbasins.
|
inline |
Tag a hydro unit log label index as an evapotranspiration (to-atmosphere) flux.
| iLabel | index of the hydro unit label. |
| void Logger::AddSubbasinEtIndex | ( | int | iLabel | ) |
Tag a subbasin log label index as an evapotranspiration (to-atmosphere) flux. A label is tagged once (the same structure is built in every subbasin).
| iLabel | index of the subbasin label. |
| bool Logger::DumpOutputs | ( | const string & | path | ) |
Dump the outputs to a file.
| path | path to the output file. |
|
nodiscard |
Find the land-cover fraction series that weights a logged hydro-unit component to a basin (area) average. A component is matched to its land cover by name: the land cover itself (<cover>:) or one of its surface components (<cover>_snowpack:, <cover>_canopy:). Returns the index into _hydroUnitFractions or -1 if the component is not tied to a land cover (then a fraction of one applies, i.e. it spans the whole unit).
| componentName | the logged component label (e.g. "forest_canopy:water_content"). |
|
inline |
Get the hydro unit areas.
|
inline |
Get the hydro unit fraction labels.
|
inline |
Get the hydro unit fractions.
|
inline |
Get the hydro unit IDs.
|
inline |
Get the area basis of each hydro unit label ("land_cover", "hydro_unit" or "subbasin").
|
inline |
Get the hydro unit labels.
|
nodiscard |
Get the final storage state of a hydro unit for a given tag.
| tag | tag to search for. |
|
nodiscard |
Get the initial storage state of a hydro unit for a given tag.
| tag | tag to search for. |
|
inline |
Get the share of its subbasin's area covered by each hydro unit (unit area / subbasin area).
|
inline |
Get all the hydro unit values.
|
nodiscard |
Get the indices of the hydro unit elements for a given item.
| item | item to search for. |
|
nodiscard |
Get the indices of the subbasin elements for a given item.
| item | item to search for. |
|
nodiscard |
Get the outlet discharge series at the catchment outlet (the terminal subbasin), in mm over the drained area.
|
inlinenodiscard |
Get the number of subbasins.
|
nodiscard |
Get the discharge series at the outlet of a subbasin, in mm over its drained area.
| subbasinId | ID of the subbasin. |
|
inline |
Get the downstream subbasin IDs (0 for the catchment outlet).
|
inline |
Get the areas drained at the subbasin outlets (own plus upstream) [m2].
|
nodiscard |
Get the final storage state of the subbasins for a given tag (area-weighted over the subbasins).
| tag | tag to search for. |
|
inline |
Get the subbasin IDs (processing order, the outlet last).
|
nodiscard |
Get the initial storage state of the subbasins for a given tag (area-weighted over the subbasins).
| tag | tag to search for. |
|
inline |
Get the subbasin labels.
|
inline |
Get the local areas of the subbasins (their own hydro units) [m2].
|
inline |
Get the structure variant used by each subbasin's catchment-level components (processing order).
|
nodiscard |
Get all the subbasin values at the catchment outlet (the terminal subbasin).
|
inline |
Get all the subbasin values of every subbasin.
|
inline |
Get the time series.
|
nodiscard |
Get the total ET over time.
|
nodiscard |
Get the total glacier storage changes.
|
nodiscard |
Get the sum of hydro unit values for a given item.
| item | item to search for. |
| needsAreaWeighting | if true, area weighting is applied. |
|
nodiscard |
Get the total outlet discharge over time (at the catchment outlet).
|
nodiscard |
Get the total snow storage changes.
|
nodiscard |
Get the sum of a subbasin values for a given item, over time and over the subbasins (each weighted by its local area, so the total is in mm over the catchment area).
| item | item to search for. |
|
nodiscard |
Get the total water storage changes.
| void Logger::Increment | ( | ) |
Increment the cursor to the next time step.
| void Logger::InitContainers | ( | int | timeSize, |
| const std::vector< Subbasin * > & | subbasins, | ||
| SettingsModel & | modelSettings ) |
Initialize the logger with the size of the time vector and the subbasins.
| timeSize | size of the time vector. |
| subbasins | the subbasins in processing order (upstream first, the outlet last). |
| modelSettings | settings of the model. |
| void Logger::Record | ( | ) |
Record the current values in the logger.
|
inline |
Activate the recording of fractions.
| void Logger::Reset | ( | ) |
Reset the logger.
| void Logger::SaveInitialValues | ( | ) |
Save the current values as initial values.
| void Logger::SetDate | ( | double | date | ) |
Set the date in the logger.
| date | date to set. |
| void Logger::SetHydroUnitFractionPointer | ( | int | iUnit, |
| int | iLabel, | ||
| double * | valPt ) |
Set a hydro unit fraction pointer in the logger array.
| iUnit | index of the hydro unit (global, over all the subbasins). |
| iLabel | index of the hydro unit label. |
| valPt | pointer to the value. |
| void Logger::SetHydroUnitLabelBasis | ( | int | iLabel, |
| const string & | basis ) |
Set the area a hydro unit label is expressed over: "land_cover" (a land cover or one of its surface components, over its own area), "hydro_unit" (over the hydro unit) or "subbasin" (a flux delivered to the outlet or to a subbasin brick, over the subbasin's local area).
| iLabel | index of the hydro unit label. |
| basis | the area basis. |
| void Logger::SetHydroUnitValuePointer | ( | int | iUnit, |
| int | iLabel, | ||
| double * | valPt ) |
Set a hydro unit value pointer in the logger array.
| iUnit | index of the hydro unit (global, over all the subbasins). |
| iLabel | index of the hydro unit label. |
| valPt | pointer to the value. |
| void Logger::SetSubbasinValuePointer | ( | int | iSubbasin, |
| int | iLabel, | ||
| double * | valPt ) |
Set a subbasin value pointer in the logger array.
| iSubbasin | index of the subbasin (processing order). |
| iLabel | index of the subbasin label. |
| valPt | pointer to the value. |