34#ifndef OPENSWMM_GAGE_HPP
35#define OPENSWMM_GAGE_HPP
186double convertGageValue(
double raw,
int rain_type,
double interval_sec,
double& cumul_accum,
187 double units_factor,
double scale_factor);
Structure-of-Arrays (SoA) storage for subcatchments.
Rain records, accepted runoff-clock state and read-only report lookups. Context routines require alig...
Definition Gage.cpp:38
constexpr double ONE_SECOND
One second in days.
Definition Gage.hpp:57
double getReportRainfall(const SimulationContext &ctx, int gage_idx, double report_date)
Query rainfall using the most recently advanced runoff-gage state.
Definition Gage.cpp:638
void updateAllGages(SimulationContext &ctx, double current_time)
Advance used gage record state and publish current effective rainfall.
Definition Gage.cpp:483
double getReportRainfallFromSeries(const SimulationContext &ctx, int gage_idx, double report_date)
Query report-time source records independently of a later runoff cursor.
Definition Gage.cpp:642
double getPastRain(const GageState &state, int hours)
Sum completed hourly depth buckets, excluding the current partial hour.
Definition Gage.cpp:168
void updatePastRain(GageState &state, int time_step)
Accumulate a standalone gage's held intensity into completed-hour history.
Definition Gage.cpp:154
double gageUnitsFactor(const SimulationContext &ctx, int gage_idx)
Return the source-storage-to-project rainfall depth multiplier.
Definition Gage.cpp:206
double convertGageValue(double raw, int rain_type, double interval_sec, double &cumul_accum, double units_factor, double scale_factor)
Transform one source record and apply units then scale factors.
Definition Gage.cpp:223
double gageNextRainDate(const SimulationContext &ctx, int gage_idx, double t)
Read the next runoff-clock rainfall boundary from cached gage state.
Definition Gage.cpp:434
double gageNextRateChange(const SimulationContext &ctx, int j, double date, double limit)
Forecast the end of the current held rain rate without changing source state.
Definition Gage.cpp:453
RainType
Definition Gage.hpp:64
@ INTENSITY
Definition Gage.hpp:64
@ VOLUME
Definition Gage.hpp:64
@ CUMULATIVE
Definition Gage.hpp:64
PrecipSplit splitPrecip(const SimulationContext &ctx, std::size_t sub)
Split a subcatchment's current gage intensity into internal rain and snow.
Definition Gage.cpp:69
int gageSeriesRainType(const SimulationContext &ctx, int gage_idx)
Select the transform appropriate to resolved source storage.
Definition Gage.cpp:198
const Table * gageRainSeries(const SimulationContext &ctx, int gage_idx)
Borrow the actual resolved source table for a gage.
Definition Gage.cpp:182
constexpr int MAXPASTRAIN
Max past hours tracked.
Definition Gage.hpp:58
double convertRainfall(double raw_value, GageState &state)
Transform one raw rain record with standalone GageState factors.
Definition Gage.cpp:40
bool gageIsUsed(const SimulationContext &ctx, int gage_idx)
Test whether the model or enabled rainfall mesh consumes a gage.
Definition Gage.cpp:244
Definition ExchangeLaw.hpp:60
Central, reentrant simulation context.
Definition SimulationContext.hpp:390
Definition TableData.hpp:154
double rain_interval
Rain recording interval (seconds)
Definition Gage.hpp:80
double past_rain_interval
Seconds in the current partial hour (0..3600)
Definition Gage.hpp:85
double rainfall
Current intensity (project in/hr or mm/hr)
Definition Gage.hpp:71
double past_rain_accum
Accumulator for current hour.
Definition Gage.hpp:84
double scale_factor
Rainfall scaling factor (1.0 = no scaling)
Definition Gage.hpp:77
double snow_factor
Snow catch factor.
Definition Gage.hpp:76
double adjust_factor
Monthly/seasonal adjustment factor.
Definition Gage.hpp:79
double past_rain[MAXPASTRAIN]
Past hourly rainfall totals.
Definition Gage.hpp:83
double total_precip
rainfall + snowfall
Definition Gage.hpp:73
RainType rain_type
Definition Gage.hpp:81
double snowfall
Current snow intensity (project in/hr or mm/hr)
Definition Gage.hpp:72
double api_rainfall
API-overridden rainfall (-1 = no override)
Definition Gage.hpp:75
double rain_accum
Cumulative rain accumulator (for CUMULATIVE type)
Definition Gage.hpp:74
double units_factor
Unit conversion factor.
Definition Gage.hpp:78
Result of splitting a gage's precipitation for one subcatchment.
Definition Gage.hpp:192
double snowfall
Snowfall (ft/sec, internal units)
Definition Gage.hpp:194
double rainfall
Rainfall (ft/sec, internal units)
Definition Gage.hpp:193