![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
OpenSWMM Engine — Climatology configuration C API. More...
#include "openswmm_engine.h"Go to the source code of this file.
Classes | |
| struct | SWMM_EvapPreviewSample |
| struct | SWMM_EvapPreviewSummary |
| struct | SWMM_EvapPreviewConfig |
Macros | |
| #define | SWMM_CLIMATE_MONTHS 12 |
| Number of monthly values in a climate monthly table. | |
| #define | SWMM_CLIMATE_ADC_POINTS 10 |
| Number of points in an areal-depletion curve. | |
Typedefs | |
| typedef enum SWMM_TempSource | SWMM_TempSource |
| Air-temperature data source (matches [TEMPERATURE]). | |
| typedef enum SWMM_EvapType | SWMM_EvapType |
| Evaporation method (matches [EVAPORATION]). | |
| typedef enum SWMM_EvapPreviewStatus | SWMM_EvapPreviewStatus |
| typedef struct SWMM_EvapPreviewSample | SWMM_EvapPreviewSample |
| typedef struct SWMM_EvapPreviewSummary | SWMM_EvapPreviewSummary |
| typedef struct SWMM_EvapPreviewConfig | SWMM_EvapPreviewConfig |
| typedef enum SWMM_WindType | SWMM_WindType |
| Wind-speed data source (matches [TEMPERATURE] WINDSPEED). | |
| typedef enum SWMM_HumidityType | SWMM_HumidityType |
| Humidity data source (matches [TEMPERATURE] HUMIDITY). | |
| typedef enum SWMM_HumidityVar | SWMM_HumidityVar |
| Quantity the HUMIDITY values express. | |
Enumerations | |
| enum | SWMM_TempSource { SWMM_TEMP_NONE = 0 , SWMM_TEMP_TIMESERIES = 1 , SWMM_TEMP_FILE = 2 } |
| Air-temperature data source (matches [TEMPERATURE]). More... | |
| enum | SWMM_EvapType { SWMM_EVAP_CONSTANT = 0 , SWMM_EVAP_MONTHLY = 1 , SWMM_EVAP_TIMESERIES = 2 , SWMM_EVAP_TEMPERATURE = 3 , SWMM_EVAP_FILE = 4 } |
| Evaporation method (matches [EVAPORATION]). More... | |
| enum | SWMM_EvapPreviewStatus { SWMM_EVAP_PREVIEW_AVAILABLE = 0 , SWMM_EVAP_PREVIEW_HELD = 1 , SWMM_EVAP_PREVIEW_MISSING = 2 , SWMM_EVAP_PREVIEW_ESTIMATED = 3 } |
| enum | SWMM_WindType { SWMM_WIND_MONTHLY = 0 , SWMM_WIND_FILE = 1 } |
| Wind-speed data source (matches [TEMPERATURE] WINDSPEED). More... | |
| enum | SWMM_HumidityType { SWMM_HUMIDITY_CONSTANT = 0 , SWMM_HUMIDITY_MONTHLY = 1 , SWMM_HUMIDITY_TIMESERIES = 2 } |
| Humidity data source (matches [TEMPERATURE] HUMIDITY). More... | |
| enum | SWMM_HumidityVar { SWMM_HUMIDITY_RELATIVE = 0 , SWMM_HUMIDITY_DEWPOINT = 1 } |
| Quantity the HUMIDITY values express. More... | |
Functions | |
| SWMM_ENGINE_API int | swmm_climate_get_temp_source (SWMM_Engine engine, int *source) |
| Read the configured air-temperature source. | |
| SWMM_ENGINE_API int | swmm_climate_set_temp_source (SWMM_Engine engine, int source) |
| Set the configured air-temperature source. | |
| SWMM_ENGINE_API int | swmm_climate_get_temp_timeseries (SWMM_Engine engine, char *buf, int buflen) |
| Copy the configured temperature time-series ID. | |
| SWMM_ENGINE_API int | swmm_climate_set_temp_timeseries (SWMM_Engine engine, const char *ts_id) |
| Copy a configured temperature time-series ID. | |
| SWMM_ENGINE_API int | swmm_climate_get_temp_file_start (SWMM_Engine engine, double *date) |
| Read the configured climate-file start date. | |
| SWMM_ENGINE_API int | swmm_climate_set_temp_file_start (SWMM_Engine engine, double date) |
| Set the configured climate-file start date. | |
| SWMM_ENGINE_API int | swmm_climate_get_temp_units (SWMM_Engine engine, int *units) |
| Read the configured climate-file temperature-unit selector. | |
| SWMM_ENGINE_API int | swmm_climate_set_temp_units (SWMM_Engine engine, int units) |
| Set the configured climate-file temperature-unit selector. | |
| SWMM_ENGINE_API int | swmm_climate_get_elevation (SWMM_Engine engine, double *elev) |
| Read the configured site elevation. | |
| SWMM_ENGINE_API int | swmm_climate_set_elevation (SWMM_Engine engine, double elev) |
| Set the configured site elevation. | |
| SWMM_ENGINE_API int | swmm_climate_get_latitude (SWMM_Engine engine, double *latitude) |
| Read the configured site latitude. | |
| SWMM_ENGINE_API int | swmm_climate_set_latitude (SWMM_Engine engine, double latitude) |
| Set the configured site latitude. | |
| SWMM_ENGINE_API int | swmm_climate_get_longitude_correction (SWMM_Engine engine, double *minutes) |
| Read the configured longitude/solar-time correction. | |
| SWMM_ENGINE_API int | swmm_climate_set_longitude_correction (SWMM_Engine engine, double minutes) |
| Set the configured longitude/solar-time correction. | |
| SWMM_ENGINE_API int | swmm_climate_get_evap_type (SWMM_Engine engine, int *type) |
| Read the configured evaporation method. | |
| SWMM_ENGINE_API int | swmm_climate_set_evap_type (SWMM_Engine engine, int type) |
| Set the configured evaporation method. | |
| SWMM_ENGINE_API int | swmm_climate_get_evap_monthly (SWMM_Engine engine, double *buf, int count) |
| Copy all monthly evaporation rates in January through December. | |
| SWMM_ENGINE_API int | swmm_climate_set_evap_monthly (SWMM_Engine engine, const double *values, int count) |
| Replace all monthly evaporation rates in January through December. | |
| SWMM_ENGINE_API int | swmm_climate_get_evap_timeseries (SWMM_Engine engine, char *buf, int buflen) |
| Copy the configured evaporation time-series ID. | |
| SWMM_ENGINE_API int | swmm_climate_set_evap_timeseries (SWMM_Engine engine, const char *ts_id) |
| Copy a configured evaporation time-series ID. | |
| SWMM_ENGINE_API int | swmm_climate_preview_evaporation (SWMM_Engine engine, double start_date, double end_date, double sample_interval_days, SWMM_EvapPreviewSample *samples, int capacity, int *sample_count, SWMM_EvapPreviewSummary *summary, char *diagnostic, int diagnostic_capacity) |
| Preview saved evaporation without runtime forcing. | |
| SWMM_ENGINE_API int | swmm_climate_preview_evaporation_with_config (SWMM_Engine engine, const SWMM_EvapPreviewConfig *config, double start_date, double end_date, double sample_interval_days, SWMM_EvapPreviewSample *samples, int capacity, int *sample_count, SWMM_EvapPreviewSummary *summary, char *diagnostic, int diagnostic_capacity) |
| Preview draft or saved evaporation without runtime forcing. | |
| SWMM_ENGINE_API int | swmm_climate_get_pan_coeff (SWMM_Engine engine, double *buf, int count) |
| Copy all monthly pan coefficients in January through December. | |
| SWMM_ENGINE_API int | swmm_climate_set_pan_coeff (SWMM_Engine engine, const double *values, int count) |
| Replace all monthly pan coefficients in January through December. | |
| SWMM_ENGINE_API int | swmm_climate_get_evap_recovery (SWMM_Engine engine, char *buf, int buflen) |
| Copy the configured soil-moisture recovery pattern ID. | |
| SWMM_ENGINE_API int | swmm_climate_set_evap_recovery (SWMM_Engine engine, const char *pattern_id) |
| Copy a configured soil-moisture recovery pattern ID. | |
| SWMM_ENGINE_API int | swmm_climate_get_wind_type (SWMM_Engine engine, int *type) |
| Read the configured wind-speed source. | |
| SWMM_ENGINE_API int | swmm_climate_set_wind_type (SWMM_Engine engine, int type) |
| Set the configured wind-speed source. | |
| SWMM_ENGINE_API int | swmm_climate_get_wind_monthly (SWMM_Engine engine, double *buf, int count) |
| Copy all monthly average wind speeds in January through December. | |
| SWMM_ENGINE_API int | swmm_climate_set_wind_monthly (SWMM_Engine engine, const double *values, int count) |
| Replace all monthly average wind speeds in January through December. | |
| SWMM_ENGINE_API int | swmm_climate_get_humidity_type (SWMM_Engine engine, int *type) |
| Read the configured humidity source. | |
| SWMM_ENGINE_API int | swmm_climate_set_humidity_type (SWMM_Engine engine, int type) |
| Set the configured humidity source. | |
| SWMM_ENGINE_API int | swmm_climate_get_humidity_variable (SWMM_Engine engine, int *var) |
| Read the configured humidity quantity. | |
| SWMM_ENGINE_API int | swmm_climate_set_humidity_variable (SWMM_Engine engine, int var) |
| Set the configured humidity quantity. | |
| SWMM_ENGINE_API int | swmm_climate_get_humidity_monthly (SWMM_Engine engine, double *buf, int count) |
| Copy all monthly humidity values in January through December. | |
| SWMM_ENGINE_API int | swmm_climate_set_humidity_monthly (SWMM_Engine engine, const double *values, int count) |
| Replace all monthly humidity values in January through December. | |
| SWMM_ENGINE_API int | swmm_climate_get_humidity_timeseries (SWMM_Engine engine, char *buf, int buflen) |
| Copy the configured humidity time-series ID. | |
| SWMM_ENGINE_API int | swmm_climate_set_humidity_timeseries (SWMM_Engine engine, const char *ts_id) |
| Copy a configured humidity time-series ID. | |
| SWMM_ENGINE_API int | swmm_climate_get_snow_temp (SWMM_Engine engine, double *divide_temp) |
| Read the configured snow/rain dividing temperature. | |
| SWMM_ENGINE_API int | swmm_climate_set_snow_temp (SWMM_Engine engine, double divide_temp) |
| Set the configured snow/rain dividing temperature. | |
| SWMM_ENGINE_API int | swmm_climate_get_ati_weight (SWMM_Engine engine, double *tipm) |
| Read the configured antecedent-temperature-index weight. | |
| SWMM_ENGINE_API int | swmm_climate_set_ati_weight (SWMM_Engine engine, double tipm) |
| Set the configured antecedent-temperature-index weight. | |
| SWMM_ENGINE_API int | swmm_climate_get_neg_melt_ratio (SWMM_Engine engine, double *rnm) |
| Read the configured negative-melt-coefficient ratio. | |
| SWMM_ENGINE_API int | swmm_climate_set_neg_melt_ratio (SWMM_Engine engine, double rnm) |
| Set the configured negative-melt-coefficient ratio. | |
| SWMM_ENGINE_API int | swmm_climate_get_adc_impervious (SWMM_Engine engine, double *buf, int count) |
| Copy all impervious areal-depletion fractions in the configured ten-point depletion-curve order. | |
| SWMM_ENGINE_API int | swmm_climate_set_adc_impervious (SWMM_Engine engine, const double *values, int count) |
| Replace all impervious areal-depletion fractions in the configured ten-point depletion-curve order. | |
| SWMM_ENGINE_API int | swmm_climate_get_adc_pervious (SWMM_Engine engine, double *buf, int count) |
| Copy all pervious areal-depletion fractions in the configured ten-point depletion-curve order. | |
| SWMM_ENGINE_API int | swmm_climate_set_adc_pervious (SWMM_Engine engine, const double *values, int count) |
| Replace all pervious areal-depletion fractions in the configured ten-point depletion-curve order. | |
| SWMM_ENGINE_API int | swmm_climate_get_adjust_temperature (SWMM_Engine engine, double *buf, int count) |
| Copy all monthly temperature offsets in January through December. | |
| SWMM_ENGINE_API int | swmm_climate_set_adjust_temperature (SWMM_Engine engine, const double *values, int count) |
| Replace all monthly temperature offsets in January through December. | |
| SWMM_ENGINE_API int | swmm_climate_get_adjust_evaporation (SWMM_Engine engine, double *buf, int count) |
| Copy all monthly evaporation offsets in January through December. | |
| SWMM_ENGINE_API int | swmm_climate_set_adjust_evaporation (SWMM_Engine engine, const double *values, int count) |
| Replace all monthly evaporation offsets in January through December. | |
| SWMM_ENGINE_API int | swmm_climate_get_adjust_rainfall (SWMM_Engine engine, double *buf, int count) |
| Copy all monthly rainfall multipliers in January through December. | |
| SWMM_ENGINE_API int | swmm_climate_set_adjust_rainfall (SWMM_Engine engine, const double *values, int count) |
| Replace all monthly rainfall multipliers in January through December. | |
| SWMM_ENGINE_API int | swmm_climate_get_adjust_conductivity (SWMM_Engine engine, double *buf, int count) |
| Copy all monthly hydraulic-conductivity multipliers in January through December. | |
| SWMM_ENGINE_API int | swmm_climate_set_adjust_conductivity (SWMM_Engine engine, const double *values, int count) |
| Replace all monthly hydraulic-conductivity multipliers in January through December. | |
OpenSWMM Engine — Climatology configuration C API.
Read/write accessors for the model's climate configuration — the data parsed from the [TEMPERATURE], [EVAPORATION], [WINDSPEED] (a sub-keyword of [TEMPERATURE]), [ADJUSTMENTS], and the snowmelt globals / areal-depletion curves. This complements the runtime climate forcing API in openswmm_forcing.h, which overrides the live air-temperature / wind / evaporation values while a simulation is RUNNING. The accessors here edit the inputs before a run.
Units: every value is expressed in the project's display units — exactly as it appears in the .inp file. The engine keeps these configuration values verbatim in SimulationOptions / SimulationContext and defers the internal-unit conversion to swmm_engine_initialize(); the accessors here are therefore a straight pass-through (no unit conversion at the boundary).
Setters require an editable lifecycle state (BUILDING or OPENED) and return SWMM_ERR_LIFECYCLE otherwise — once the simulation is initialized the configuration has already been baked into the climate/snow solver state. Getters work in any readable state.
DRY_ONLY is exposed by swmm_climate_get_dry_only / swmm_climate_set_dry_only in openswmm_forcing.h (not duplicated here). The climate temperature/evaporation FILE path is managed via swmm_file_path_get / swmm_file_path_set (SWMM_FILE_CLIMATE_TEMP) in openswmm_model.h.
| #define SWMM_CLIMATE_ADC_POINTS 10 |
Number of points in an areal-depletion curve.
| #define SWMM_CLIMATE_MONTHS 12 |
Number of monthly values in a climate monthly table.
| typedef struct SWMM_EvapPreviewConfig SWMM_EvapPreviewConfig |
Draft values for previewing evaporation before the climatology dialog saves.
| typedef struct SWMM_EvapPreviewSample SWMM_EvapPreviewSample |
One evaporation source-rate sample; rates use the model's display units.
| typedef enum SWMM_EvapPreviewStatus SWMM_EvapPreviewStatus |
Availability of one source-rate sample returned by the evaporation preview.
| typedef struct SWMM_EvapPreviewSummary SWMM_EvapPreviewSummary |
Summary counts for one evaporation preview window.
| typedef enum SWMM_EvapType SWMM_EvapType |
Evaporation method (matches [EVAPORATION]).
| typedef enum SWMM_HumidityType SWMM_HumidityType |
Humidity data source (matches [TEMPERATURE] HUMIDITY).
| typedef enum SWMM_HumidityVar SWMM_HumidityVar |
Quantity the HUMIDITY values express.
| typedef enum SWMM_TempSource SWMM_TempSource |
Air-temperature data source (matches [TEMPERATURE]).
| typedef enum SWMM_WindType SWMM_WindType |
Wind-speed data source (matches [TEMPERATURE] WINDSPEED).
Availability of one source-rate sample returned by the evaporation preview.
| enum SWMM_EvapType |
Evaporation method (matches [EVAPORATION]).
| enum SWMM_HumidityType |
| enum SWMM_HumidityVar |
| enum SWMM_TempSource |
| enum SWMM_WindType |
| SWMM_ENGINE_API int swmm_climate_get_adc_impervious | ( | SWMM_Engine | engine, |
| double * | buf, | ||
| int | count ) |
Copy all impervious areal-depletion fractions in the configured ten-point depletion-curve order.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | buf | Non-null caller-owned array of exactly 10 doubles, in dimensionless fractions in [0,1]. |
| [in] | count | Must equal SWMM_CLIMATE_ADC_POINTS (10) exactly; no partial-copy or size-query mode. |
| SWMM_ENGINE_API int swmm_climate_get_adc_pervious | ( | SWMM_Engine | engine, |
| double * | buf, | ||
| int | count ) |
Copy all pervious areal-depletion fractions in the configured ten-point depletion-curve order.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | buf | Non-null caller-owned array of exactly 10 doubles, in dimensionless fractions in [0,1]. |
| [in] | count | Must equal SWMM_CLIMATE_ADC_POINTS (10) exactly; no partial-copy or size-query mode. |
| SWMM_ENGINE_API int swmm_climate_get_adjust_conductivity | ( | SWMM_Engine | engine, |
| double * | buf, | ||
| int | count ) |
Copy all monthly hydraulic-conductivity multipliers in January through December.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | buf | Non-null caller-owned array of exactly 12 doubles, in dimensionless (1 means unchanged). |
| [in] | count | Must equal SWMM_CLIMATE_MONTHS (12) exactly; no partial-copy or size-query mode. |
| SWMM_ENGINE_API int swmm_climate_get_adjust_evaporation | ( | SWMM_Engine | engine, |
| double * | buf, | ||
| int | count ) |
Copy all monthly evaporation offsets in January through December.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | buf | Non-null caller-owned array of exactly 12 doubles, in in/day in US or mm/day in SI. |
| [in] | count | Must equal SWMM_CLIMATE_MONTHS (12) exactly; no partial-copy or size-query mode. |
| SWMM_ENGINE_API int swmm_climate_get_adjust_rainfall | ( | SWMM_Engine | engine, |
| double * | buf, | ||
| int | count ) |
Copy all monthly rainfall multipliers in January through December.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | buf | Non-null caller-owned array of exactly 12 doubles, in dimensionless (1 means unchanged). |
| [in] | count | Must equal SWMM_CLIMATE_MONTHS (12) exactly; no partial-copy or size-query mode. |
| SWMM_ENGINE_API int swmm_climate_get_adjust_temperature | ( | SWMM_Engine | engine, |
| double * | buf, | ||
| int | count ) |
Copy all monthly temperature offsets in January through December.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | buf | Non-null caller-owned array of exactly 12 doubles, in degrees F in US or degrees C in SI. |
| [in] | count | Must equal SWMM_CLIMATE_MONTHS (12) exactly; no partial-copy or size-query mode. |
| SWMM_ENGINE_API int swmm_climate_get_ati_weight | ( | SWMM_Engine | engine, |
| double * | tipm ) |
Read the configured antecedent-temperature-index weight.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | tipm | Optional destination: dimensionless fraction in [0,1]. |
| SWMM_ENGINE_API int swmm_climate_get_elevation | ( | SWMM_Engine | engine, |
| double * | elev ) |
Read the configured site elevation.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | elev | Optional destination: project display length (ft in US, m in SI). |
| SWMM_ENGINE_API int swmm_climate_get_evap_monthly | ( | SWMM_Engine | engine, |
| double * | buf, | ||
| int | count ) |
Copy all monthly evaporation rates in January through December.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | buf | Non-null caller-owned array of exactly 12 doubles, in in/day in US or mm/day in SI. |
| [in] | count | Must equal SWMM_CLIMATE_MONTHS (12) exactly; no partial-copy or size-query mode. |
| SWMM_ENGINE_API int swmm_climate_get_evap_recovery | ( | SWMM_Engine | engine, |
| char * | buf, | ||
| int | buflen ) |
Copy the configured soil-moisture recovery pattern ID.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | buf | Non-null caller-owned buffer; empty when no ID is configured, NUL-terminated and silently truncated to buflen-1 bytes. |
| [in] | buflen | Positive byte capacity including NUL. |
| SWMM_ENGINE_API int swmm_climate_get_evap_timeseries | ( | SWMM_Engine | engine, |
| char * | buf, | ||
| int | buflen ) |
Copy the configured evaporation time-series ID.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | buf | Non-null caller-owned buffer; empty when no ID is configured, NUL-terminated and silently truncated to buflen-1 bytes. |
| [in] | buflen | Positive byte capacity including NUL. |
| SWMM_ENGINE_API int swmm_climate_get_evap_type | ( | SWMM_Engine | engine, |
| int * | type ) |
Read the configured evaporation method.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | type | Optional destination: SWMM_EvapType: CONSTANT=0, MONTHLY=1, TIMESERIES=2, TEMPERATURE=3, FILE=4. |
| SWMM_ENGINE_API int swmm_climate_get_humidity_monthly | ( | SWMM_Engine | engine, |
| double * | buf, | ||
| int | count ) |
Copy all monthly humidity values in January through December.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | buf | Non-null caller-owned array of exactly 12 doubles, in RH percent or dew-point degrees F/C according to the humidity quantity/unit system. |
| [in] | count | Must equal SWMM_CLIMATE_MONTHS (12) exactly; no partial-copy or size-query mode. |
| SWMM_ENGINE_API int swmm_climate_get_humidity_timeseries | ( | SWMM_Engine | engine, |
| char * | buf, | ||
| int | buflen ) |
Copy the configured humidity time-series ID.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | buf | Non-null caller-owned buffer; empty when no ID is configured, NUL-terminated and silently truncated to buflen-1 bytes. |
| [in] | buflen | Positive byte capacity including NUL. |
| SWMM_ENGINE_API int swmm_climate_get_humidity_type | ( | SWMM_Engine | engine, |
| int * | type ) |
Read the configured humidity source.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | type | Optional destination: SWMM_HumidityType: CONSTANT=0, MONTHLY=1, TIMESERIES=2. |
| SWMM_ENGINE_API int swmm_climate_get_humidity_variable | ( | SWMM_Engine | engine, |
| int * | var ) |
Read the configured humidity quantity.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | var | Optional destination: SWMM_HumidityVar: RELATIVE=0 (percent) or DEWPOINT=1 (degrees F US/degrees C SI). |
| SWMM_ENGINE_API int swmm_climate_get_latitude | ( | SWMM_Engine | engine, |
| double * | latitude ) |
Read the configured site latitude.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | latitude | Optional destination: degrees north in [-90,90]. |
| SWMM_ENGINE_API int swmm_climate_get_longitude_correction | ( | SWMM_Engine | engine, |
| double * | minutes ) |
Read the configured longitude/solar-time correction.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | minutes | Optional destination: minutes; 0 selects true solar time. |
| SWMM_ENGINE_API int swmm_climate_get_neg_melt_ratio | ( | SWMM_Engine | engine, |
| double * | rnm ) |
Read the configured negative-melt-coefficient ratio.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | rnm | Optional destination: dimensionless fraction in [0,1]. |
| SWMM_ENGINE_API int swmm_climate_get_pan_coeff | ( | SWMM_Engine | engine, |
| double * | buf, | ||
| int | count ) |
Copy all monthly pan coefficients in January through December.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | buf | Non-null caller-owned array of exactly 12 doubles, in dimensionless multipliers applied by FILE evaporation. |
| [in] | count | Must equal SWMM_CLIMATE_MONTHS (12) exactly; no partial-copy or size-query mode. |
| SWMM_ENGINE_API int swmm_climate_get_snow_temp | ( | SWMM_Engine | engine, |
| double * | divide_temp ) |
Read the configured snow/rain dividing temperature.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | divide_temp | Optional destination: project temperature (degrees F in US, degrees C in SI). |
| SWMM_ENGINE_API int swmm_climate_get_temp_file_start | ( | SWMM_Engine | engine, |
| double * | date ) |
Read the configured climate-file start date.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | date | Optional destination: SWMM DateTime decimal days since 1899-12-30; 0 starts at the file beginning. |
| SWMM_ENGINE_API int swmm_climate_get_temp_source | ( | SWMM_Engine | engine, |
| int * | source ) |
Read the configured air-temperature source.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | source | Optional destination: SWMM_TempSource: 0=NONE, 1=TIMESERIES, 2=FILE. |
| SWMM_ENGINE_API int swmm_climate_get_temp_timeseries | ( | SWMM_Engine | engine, |
| char * | buf, | ||
| int | buflen ) |
Copy the configured temperature time-series ID.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | buf | Non-null caller-owned buffer; empty when no ID is configured, NUL-terminated and silently truncated to buflen-1 bytes. |
| [in] | buflen | Positive byte capacity including NUL. |
| SWMM_ENGINE_API int swmm_climate_get_temp_units | ( | SWMM_Engine | engine, |
| int * | units ) |
Read the configured climate-file temperature-unit selector.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | units | Optional destination: -1=unspecified per-format default, 0=tenths degrees C, 1=degrees C, 2=degrees F. |
| SWMM_ENGINE_API int swmm_climate_get_wind_monthly | ( | SWMM_Engine | engine, |
| double * | buf, | ||
| int | count ) |
Copy all monthly average wind speeds in January through December.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | buf | Non-null caller-owned array of exactly 12 doubles, in mph in US or km/h in SI. |
| [in] | count | Must equal SWMM_CLIMATE_MONTHS (12) exactly; no partial-copy or size-query mode. |
| SWMM_ENGINE_API int swmm_climate_get_wind_type | ( | SWMM_Engine | engine, |
| int * | type ) |
Read the configured wind-speed source.
| [in] | engine | Non-null live engine with exclusive caller access; getters read stored configuration without changing lifecycle state. |
| [out] | type | Optional destination: SWMM_WindType: MONTHLY=0 or FILE=1. |
| SWMM_ENGINE_API int swmm_climate_preview_evaporation | ( | SWMM_Engine | engine, |
| double | start_date, | ||
| double | end_date, | ||
| double | sample_interval_days, | ||
| SWMM_EvapPreviewSample * | samples, | ||
| int | capacity, | ||
| int * | sample_count, | ||
| SWMM_EvapPreviewSummary * | summary, | ||
| char * | diagnostic, | ||
| int | diagnostic_capacity ) |
Preview saved evaporation without runtime forcing.
Samples [start_date,end_date) at the specified interval. TIMESERIES uses step-and-hold scheduling; FILE holds the last valid pan rate. TEMPERATURE uses daily Hargreaves estimates because runtime air forcing and climate-step frequency are unknown. System/subcatchment forcing is excluded and runtime_forcing_unknown is always 1. Missing file/series data can yield MISSING samples and a diagnostic while returning success; inspect statuses and summary rather than return code alone.
| [in] | engine | Non-null live engine, excluding RUNNING; no simulation state or stored options are changed. |
| [in] | start_date | Finite inclusive OADate/SWMM DateTime window start, within model simulation dates. |
| [in] | end_date | Finite exclusive window end, greater than start_date and within simulation dates (1e-10 day tolerance). |
| [in] | sample_interval_days | Finite positive sampling interval in days; the window must produce between 1 and 1,000,000 samples. |
| [out] | samples | Caller-owned capacity-record array; NULL with capacity=0 queries the count and summary. A short non-null array is refused before sampling. |
| [in] | capacity | Nonnegative number of available sample records; nonzero requires non-null samples. |
| [out] | sample_count | Non-null required-count output, written after validating the time window and before short-buffer/draft refusals. |
| [out] | summary | Non-null coverage/rate-summary destination; written after successful sampling even in count-only mode. Rates use project evaporation units (in/day US, mm/day SI). |
| [out] | diagnostic | Non-null caller-owned diagnostic buffer; cleared after basic validation, NUL-terminated/truncated for later errors or unavailable file-source notices. |
| [in] | diagnostic_capacity | Positive diagnostic capacity in bytes including NUL. |
| SWMM_ENGINE_API int swmm_climate_preview_evaporation_with_config | ( | SWMM_Engine | engine, |
| const SWMM_EvapPreviewConfig * | config, | ||
| double | start_date, | ||
| double | end_date, | ||
| double | sample_interval_days, | ||
| SWMM_EvapPreviewSample * | samples, | ||
| int | capacity, | ||
| int * | sample_count, | ||
| SWMM_EvapPreviewSummary * | summary, | ||
| char * | diagnostic, | ||
| int | diagnostic_capacity ) |
Preview draft or saved evaporation without runtime forcing.
Samples [start_date,end_date) at the specified interval. TIMESERIES uses step-and-hold scheduling; FILE holds the last valid pan rate. TEMPERATURE uses daily Hargreaves estimates because runtime air forcing and climate-step frequency are unknown. System/subcatchment forcing is excluded and runtime_forcing_unknown is always 1. Missing file/series data can yield MISSING samples and a diagnostic while returning success; inspect statuses and summary rather than return code alone.
| [in] | engine | Non-null live engine, excluding RUNNING; no simulation state or stored options are changed. |
| [in] | config | Optional borrowed complete preview draft; NULL uses saved values. String fields may be NULL for empty references and are copied for this call. Arrays must contain finite values; source selectors/site metadata are validated. |
| [in] | start_date | Finite inclusive OADate/SWMM DateTime window start, within model simulation dates. |
| [in] | end_date | Finite exclusive window end, greater than start_date and within simulation dates (1e-10 day tolerance). |
| [in] | sample_interval_days | Finite positive sampling interval in days; the window must produce between 1 and 1,000,000 samples. |
| [out] | samples | Caller-owned capacity-record array; NULL with capacity=0 queries the count and summary. A short non-null array is refused before sampling. |
| [in] | capacity | Nonnegative number of available sample records; nonzero requires non-null samples. |
| [out] | sample_count | Non-null required-count output, written after validating the time window and before short-buffer/draft refusals. |
| [out] | summary | Non-null coverage/rate-summary destination; written after successful sampling even in count-only mode. Rates use project evaporation units (in/day US, mm/day SI). |
| [out] | diagnostic | Non-null caller-owned diagnostic buffer; cleared after basic validation, NUL-terminated/truncated for later errors or unavailable file-source notices. |
| [in] | diagnostic_capacity | Positive diagnostic capacity in bytes including NUL. |
| SWMM_ENGINE_API int swmm_climate_set_adc_impervious | ( | SWMM_Engine | engine, |
| const double * | values, | ||
| int | count ) |
Replace all impervious areal-depletion fractions in the configured ten-point depletion-curve order.
Each fraction is range checked, without a separate finite-value or monotonicity check.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | values | Non-null borrowed array of 10 doubles in dimensionless fractions in [0,1]; copied synchronously. |
| [in] | count | Must equal SWMM_CLIMATE_ADC_POINTS (10) exactly. |
| SWMM_ENGINE_API int swmm_climate_set_adc_pervious | ( | SWMM_Engine | engine, |
| const double * | values, | ||
| int | count ) |
Replace all pervious areal-depletion fractions in the configured ten-point depletion-curve order.
Each fraction is range checked, without a separate finite-value or monotonicity check.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | values | Non-null borrowed array of 10 doubles in dimensionless fractions in [0,1]; copied synchronously. |
| [in] | count | Must equal SWMM_CLIMATE_ADC_POINTS (10) exactly. |
| SWMM_ENGINE_API int swmm_climate_set_adjust_conductivity | ( | SWMM_Engine | engine, |
| const double * | values, | ||
| int | count ) |
Replace all monthly hydraulic-conductivity multipliers in January through December.
Each value <=0 is stored as 1 (legacy convention); positive values are retained. No separate finite-value validation.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | values | Non-null borrowed array of 12 doubles in dimensionless (1 means unchanged); copied synchronously. |
| [in] | count | Must equal SWMM_CLIMATE_MONTHS (12) exactly. |
| SWMM_ENGINE_API int swmm_climate_set_adjust_evaporation | ( | SWMM_Engine | engine, |
| const double * | values, | ||
| int | count ) |
Replace all monthly evaporation offsets in January through December.
Offsets are added to the evaporation source rate; these are not multiplicative coefficients. Caller must supply physically valid finite values; this setter copies entries without additional validation.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | values | Non-null borrowed array of 12 doubles in in/day in US or mm/day in SI; copied synchronously. |
| [in] | count | Must equal SWMM_CLIMATE_MONTHS (12) exactly. |
| SWMM_ENGINE_API int swmm_climate_set_adjust_rainfall | ( | SWMM_Engine | engine, |
| const double * | values, | ||
| int | count ) |
Replace all monthly rainfall multipliers in January through December.
Multipliers are copied directly; this setter imposes no nonnegative/finite-value validation. Caller must supply physically valid finite values; this setter copies entries without additional validation.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | values | Non-null borrowed array of 12 doubles in dimensionless (1 means unchanged); copied synchronously. |
| [in] | count | Must equal SWMM_CLIMATE_MONTHS (12) exactly. |
| SWMM_ENGINE_API int swmm_climate_set_adjust_temperature | ( | SWMM_Engine | engine, |
| const double * | values, | ||
| int | count ) |
Replace all monthly temperature offsets in January through December.
Offsets are added to the temperature source in display units. Caller must supply physically valid finite values; this setter copies entries without additional validation.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | values | Non-null borrowed array of 12 doubles in degrees F in US or degrees C in SI; copied synchronously. |
| [in] | count | Must equal SWMM_CLIMATE_MONTHS (12) exactly. |
| SWMM_ENGINE_API int swmm_climate_set_ati_weight | ( | SWMM_Engine | engine, |
| double | tipm ) |
Set the configured antecedent-temperature-index weight.
Caller must supply a finite value; only lower/upper comparisons guard this setter.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | tipm | dimensionless fraction in [0,1]. Values outside [0,1] are refused. |
| SWMM_ENGINE_API int swmm_climate_set_elevation | ( | SWMM_Engine | engine, |
| double | elev ) |
Set the configured site elevation.
Used for psychrometric/snow calculations. Assigned without finite/range validation.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | elev | project display length (ft in US, m in SI). Stored directly. |
| SWMM_ENGINE_API int swmm_climate_set_evap_monthly | ( | SWMM_Engine | engine, |
| const double * | values, | ||
| int | count ) |
Replace all monthly evaporation rates in January through December.
All 12 supplied values are retained; CONSTANT runtime use selects the first value. The setter does not replicate it across months or change the method. Caller must supply physically valid finite values; this setter copies entries without additional validation.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | values | Non-null borrowed array of 12 doubles in in/day in US or mm/day in SI; copied synchronously. |
| [in] | count | Must equal SWMM_CLIMATE_MONTHS (12) exactly. |
| SWMM_ENGINE_API int swmm_climate_set_evap_recovery | ( | SWMM_Engine | engine, |
| const char * | pattern_id ) |
Copy a configured soil-moisture recovery pattern ID.
Empty clears the pattern without changing the evaporation method. This does not add a missing series/pattern or open a data file.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | pattern_id | Non-null NUL-terminated identifier to copy; empty is accepted. The referenced object need not resolve at this authoring call. |
| SWMM_ENGINE_API int swmm_climate_set_evap_timeseries | ( | SWMM_Engine | engine, |
| const char * | ts_id ) |
Copy a configured evaporation time-series ID.
Also sets evaporation method to TIMESERIES, including for an empty ID. This does not add a missing series/pattern or open a data file.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | ts_id | Non-null NUL-terminated identifier to copy; empty is accepted. The referenced object need not resolve at this authoring call. |
| SWMM_ENGINE_API int swmm_climate_set_evap_type | ( | SWMM_Engine | engine, |
| int | type ) |
Set the configured evaporation method.
Stores the method only; associated rates/series/file configuration are managed separately.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | type | SWMM_EvapType: CONSTANT=0, MONTHLY=1, TIMESERIES=2, TEMPERATURE=3, FILE=4. Values outside 0..4 are refused. |
| SWMM_ENGINE_API int swmm_climate_set_humidity_monthly | ( | SWMM_Engine | engine, |
| const double * | values, | ||
| int | count ) |
Replace all monthly humidity values in January through December.
All 12 values are retained as supplied; CONSTANT mode uses the configured constant entry. Does not change source or quantity. Caller must supply physically valid finite values; this setter copies entries without additional validation.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | values | Non-null borrowed array of 12 doubles in RH percent or dew-point degrees F/C according to the humidity quantity/unit system; copied synchronously. |
| [in] | count | Must equal SWMM_CLIMATE_MONTHS (12) exactly. |
| SWMM_ENGINE_API int swmm_climate_set_humidity_timeseries | ( | SWMM_Engine | engine, |
| const char * | ts_id ) |
Copy a configured humidity time-series ID.
Also sets humidity source to TIMESERIES, including for an empty ID. This does not add a missing series/pattern or open a data file.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | ts_id | Non-null NUL-terminated identifier to copy; empty is accepted. The referenced object need not resolve at this authoring call. |
| SWMM_ENGINE_API int swmm_climate_set_humidity_type | ( | SWMM_Engine | engine, |
| int | type ) |
Set the configured humidity source.
Does not change the humidity quantity selector or validate a referenced series.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | type | SWMM_HumidityType: CONSTANT=0, MONTHLY=1, TIMESERIES=2. Values outside 0..2 are refused. |
| SWMM_ENGINE_API int swmm_climate_set_humidity_variable | ( | SWMM_Engine | engine, |
| int | var ) |
Set the configured humidity quantity.
Dew-point values are converted to relative humidity against runtime air temperature.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | var | SWMM_HumidityVar: RELATIVE=0 (percent) or DEWPOINT=1 (degrees F US/degrees C SI). Values outside 0..1 are refused. |
| SWMM_ENGINE_API int swmm_climate_set_latitude | ( | SWMM_Engine | engine, |
| double | latitude ) |
Set the configured site latitude.
Used by Hargreaves evaporation and snowmelt. Caller must provide a finite value; the range guard does not independently reject NaN.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | latitude | degrees north in [-90,90]. Values outside [-90,90] are refused. |
| SWMM_ENGINE_API int swmm_climate_set_longitude_correction | ( | SWMM_Engine | engine, |
| double | minutes ) |
Set the configured longitude/solar-time correction.
Matches the legacy SNOWMELT correction field; assigned without finite/range validation.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | minutes | minutes; 0 selects true solar time. Stored directly. |
| SWMM_ENGINE_API int swmm_climate_set_neg_melt_ratio | ( | SWMM_Engine | engine, |
| double | rnm ) |
Set the configured negative-melt-coefficient ratio.
Caller must supply a finite value; only lower/upper comparisons guard this setter.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | rnm | dimensionless fraction in [0,1]. Values outside [0,1] are refused. |
| SWMM_ENGINE_API int swmm_climate_set_pan_coeff | ( | SWMM_Engine | engine, |
| const double * | values, | ||
| int | count ) |
Replace all monthly pan coefficients in January through December.
Does not select the FILE method or validate/open its climate source. Caller must supply physically valid finite values; this setter copies entries without additional validation.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | values | Non-null borrowed array of 12 doubles in dimensionless multipliers applied by FILE evaporation; copied synchronously. |
| [in] | count | Must equal SWMM_CLIMATE_MONTHS (12) exactly. |
| SWMM_ENGINE_API int swmm_climate_set_snow_temp | ( | SWMM_Engine | engine, |
| double | divide_temp ) |
Set the configured snow/rain dividing temperature.
Assigned without finite/range validation; affects precipitation partitioning when snowmelt is initialized.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | divide_temp | project temperature (degrees F in US, degrees C in SI). Stored directly. |
| SWMM_ENGINE_API int swmm_climate_set_temp_file_start | ( | SWMM_Engine | engine, |
| double | date ) |
Set the configured climate-file start date.
No finite/calendar validation is applied; caller must provide a valid date.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | date | SWMM DateTime decimal days since 1899-12-30; 0 starts at the file beginning. Stored directly. |
| SWMM_ENGINE_API int swmm_climate_set_temp_source | ( | SWMM_Engine | engine, |
| int | source ) |
Set the configured air-temperature source.
Selecting a source does not validate its file or series reference.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | source | SWMM_TempSource: 0=NONE, 1=TIMESERIES, 2=FILE. Values outside 0..2 are refused. |
| SWMM_ENGINE_API int swmm_climate_set_temp_timeseries | ( | SWMM_Engine | engine, |
| const char * | ts_id ) |
Copy a configured temperature time-series ID.
Also sets temperature source to TIMESERIES, including for an empty ID. This does not add a missing series/pattern or open a data file.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | ts_id | Non-null NUL-terminated identifier to copy; empty is accepted. The referenced object need not resolve at this authoring call. |
| SWMM_ENGINE_API int swmm_climate_set_temp_units | ( | SWMM_Engine | engine, |
| int | units ) |
Set the configured climate-file temperature-unit selector.
Applies to reading climate-file records, not the model display-unit choice.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | units | -1=unspecified per-format default, 0=tenths degrees C, 1=degrees C, 2=degrees F. Values outside -1..2 are refused. |
| SWMM_ENGINE_API int swmm_climate_set_wind_monthly | ( | SWMM_Engine | engine, |
| const double * | values, | ||
| int | count ) |
Replace all monthly average wind speeds in January through December.
Does not change the wind source selector. Caller must supply physically valid finite values; this setter copies entries without additional validation.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | values | Non-null borrowed array of 12 doubles in mph in US or km/h in SI; copied synchronously. |
| [in] | count | Must equal SWMM_CLIMATE_MONTHS (12) exactly. |
| SWMM_ENGINE_API int swmm_climate_set_wind_type | ( | SWMM_Engine | engine, |
| int | type ) |
Set the configured wind-speed source.
Does not open or validate the climate file.
| [in] | engine | Non-null engine in BUILDING or OPENED. Configure before initialize; runtime climate forcing has a separate API. |
| [in] | type | SWMM_WindType: MONTHLY=0 or FILE=1. Values outside 0..1 are refused. |