OpenSWMM Engine  6.0.0-alpha.3
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.3)
Loading...
Searching...
No Matches
funcs.h
Go to the documentation of this file.
1
36
37#ifndef FUNCS_H
38#define FUNCS_H
39
45
52
59void project_open(const char *inp_file, const char *rpt_file, const char *out_file);
60
64void project_close(void);
65
69void project_readInput(void);
70
78int project_readOption(char *s1, char *s2);
79
83void project_validate(void);
84
88int project_init(void);
89
97int project_addObject(int type, char *id, int n);
98
105int project_findObject(int type, const char *id);
106
113char *project_findID(int type, char *id);
114
121double **project_createMatrix(int nrows, int ncols);
122
126void project_freeMatrix(double **m);
130
137
142int input_countObjects(void);
143
148int input_readData(void);
152
159
166int report_readOptions(char *tok[], int ntoks);
167
172void report_writeLine(const char *line);
173
177void report_writeSysTime(void);
178
182void report_writeLogo(void);
183
187void report_writeTitle(void);
188
192void report_writeOptions(void);
193
197void report_writeReport(void);
198
204void report_writeRainStats(int gage, TRainStats *rainStats);
205
211void report_writeRdiiStats(double totalRain, double totalRdii);
212
217
225void report_writeControlAction(DateTime aDate, char *linkID, double value,
226 char *ruleID);
227
233void report_writeRunoffError(TRunoffTotals *totals, double area);
234
240
246void report_writeGwaterError(TGwaterTotals *totals, double area);
247
253
259
267void report_writeMaxStats(TMaxStats massBalErrs[], TMaxStats CourantCrit[],
268 int nMaxStats);
269
277void report_writeMaxFlowTurns(TMaxStats flowTurns[], int nMaxStats);
278
284void report_writeNonconvergedStats(TMaxStats maxNonconverged[],
285 int nMaxStats);
286
291void report_writeTimeStepStats(TTimeStepStats *timeStepStats);
292
298void report_writeErrorMsg(int code, char *msg);
299
303void report_writeErrorCode(void);
304
312void report_writeInputErrorMsg(int k, int sect, char *line, long lineCount);
313
319void report_writeWarningMsg(char *msg, char *id);
320
329void report_invokeWarningCallback(const char *msg);
330
336void report_writeTseriesErrorMsg(int code, TTable *tseries);
337
341void inputrpt_writeInput(void);
342
346void statsrpt_writeReport(void);
350
357
372int climate_readParams(char *tok[], int ntoks);
373
389int climate_readEvapParams(char *tok[], int ntoks);
390
406int climate_readAdjustments(char *tok[], int ntoks);
407
411void climate_validate(void);
412
416void climate_openFile(void);
417
421void climate_initState(void);
422
427void climate_setState(DateTime theDate);
428
434
438
445
449void rain_open(void);
450
454void rain_close(void);
455
459
466
477int snow_readMeltParams(char *tok[], int ntoks);
478
485int snow_createSnowpack(int subcatchIndex, int snowIndex);
486
491void snow_validateSnowmelt(int snowIndex);
492
497void snow_initSnowpack(int subcatchIndex);
498
503void snow_initSnowmelt(int snowIndex);
504
511void snow_getState(int subcatchIndex, int subAreaIndex, double x[]);
512
519void snow_setState(int subcatchIndex, int subAreaIndex, double x[]);
520
526void snow_setMeltCoeffs(int snowIndex, double season);
527
533void snow_plowSnow(int subcatchIndex, double tStep);
534
545double snow_getSnowMelt(int subcatchIndex, double rainfall, double snowfall,
546 double tStep, double netPrecip[]);
547
553double snow_getSnowCover(int subcatchIndex);
557
568int runoff_open(void);
569
573void runoff_execute(void);
574
578void runoff_close(void);
582
589
594int routing_open(void);
595
602double routing_getRoutingStep(int routingModel, double fixedStep);
603
609void routing_execute(int routingModel, double routingStep);
610
615void routing_close(int routingModel);
619
626
630int output_open(void);
631
635void output_end(void);
636
640void output_close(void);
641
646void output_saveResults(double reportTime);
647
651void output_updateAvgResults(void);
652
659void output_readDateTime(long period, DateTime *days);
660
667void output_readSubcatchResults(long period, int index);
668
674void output_readNodeResults(long period, int index);
675
681void output_readLinkResults(long period, int index);
685
692
705int gwater_readAquiferParams(int aquiferIndex, char *tok[], int ntoks);
706
717int gwater_readGroundwaterParams(char *tok[], int ntoks);
718
730int gwater_readFlowExpression(char *tok[], int ntoks);
731
736void gwater_deleteFlowExpression(int subcatchIndex);
737
742void gwater_validateAquifer(int aquiferIndex);
743
748void gwater_validate(int subcatchIndex);
749
754void gwater_initState(int subcatchIndex);
755
761void gwater_getState(int subcatchIndex, double x[]);
762
768void gwater_setState(int subcatchIndex, double x[]);
769
777void gwater_getGroundwater(int subcatchIndex, double evap, double infil,
778 double tStep);
779
785double gwater_getVolume(int subcatchIndex);
789
796
803int rdii_readRdiiInflow(char *tok[], int ntoks);
804
809void rdii_deleteRdiiInflow(int nodeIndex);
810
815void rdii_initUnitHyd(int unitHydIndex);
816
823int rdii_readUnitHydParams(char *tok[], int ntoks);
824
828void rdii_openRdii(void);
829
833void rdii_closeRdii(void);
834
841
848void rdii_getRdiiFlow(int index, int *nodeIndex, double *q);
852
859
869int landuse_readParams(int landuseIndex, char *tok[], int ntoks);
870
880int landuse_readPollutParams(int pollutIndex, char *tok[], int ntoks);
881
890int landuse_readBuildupParams(char *tok[], int ntoks);
891
900int landuse_readWashoffParams(char *tok[], int ntoks);
901
912void landuse_getInitBuildup(TLandFactor *landFactor, double *initBuildup,
913 double area, double curb);
914
925double landuse_getBuildup(int landuseIndex, int pollutIndex, double area, double curb,
926 double buildup, double tStep);
927
938double landuse_getWashoffLoad(int landuse, int p, double area,
939 TLandFactor landFactor[], double runoff, double vOutflow);
940
948double landuse_getAvgBmpEffic(int subcatchIndex, int pollutIndex);
949
956double landuse_getCoPollutLoad(int p, double washoff[]);
960
967
972void flowrout_init(int routingModel);
973
978void flowrout_close(int routingModel);
979
986double flowrout_getRoutingStep(int routingModel, double fixedStep);
987
995int flowrout_execute(int links[], int routingModel, double tStep);
996
1001void toposort_sortLinks(int sortedLinks[]);
1002
1020int kinwave_execute(int linkIndex, double *qin, double *qout, double tStep);
1021
1025void dynwave_validate(void);
1026
1030void dynwave_init(void);
1031
1035void dynwave_close(void);
1036
1042double dynwave_getRoutingStep(double fixedStep);
1043
1048int dynwave_execute(double tStep);
1049
1058void dwflow_findConduitFlow(int linkIndex, int steps, double omega, double dt);
1059
1063void qualrout_init(void);
1064
1070void qualrout_execute(double tStep);
1074
1081
1086int treatmnt_open(void);
1087
1091void treatmnt_close(void);
1092
1099int treatmnt_readExpression(char *tok[], int ntoks);
1100
1105void treatmnt_delete(int nodeIndex);
1106
1114void treatmnt_treat(int nodeIndex, double q, double v, double tStep);
1115
1121void treatmnt_setInflow(double qIn, double wIn[]);
1125
1132
1137int massbal_open(void);
1138
1142void massbal_close(void);
1143
1147void massbal_report(void);
1148
1154void massbal_updateRunoffTotals(int flowType, double v);
1155
1162void massbal_updateLoadingTotals(int type, int pollutIndex, double w);
1163
1172void massbal_updateGwaterTotals(double vInfil, double vUpperEvap,
1173 double vLowerEvap, double vLowerPerc, double vGwater);
1174
1179void massbal_updateRoutingTotals(double tStep);
1180
1185
1191void massbal_addInflowFlow(int type, double q);
1192
1199void massbal_addInflowQual(int type, int pollutIndex, double w);
1200
1206void massbal_addOutflowFlow(double q, int isFlooded);
1207
1214void massbal_addOutflowQual(int pollutIndex, double mass, int isFlooded);
1215
1221void massbal_addNodeLosses(double evapLoss, double infilLoss);
1222
1228void massbal_addLinkLosses(double evapLoss, double infilLoss);
1229
1235void massbal_addReactedMass(int pollutIndex, double mass);
1236
1242void massbal_addSeepageLoss(int pollutIndex, double seepLoss);
1243
1249void massbal_addToFinalStorage(int pollutIndex, double mass);
1250
1255double massbal_getStepFlowError(void);
1256
1261double massbal_getRunoffError(void);
1262
1267double massbal_getFlowError(void);
1271
1282int stats_open(void);
1283
1287void stats_close(void);
1288
1292void stats_report(void);
1293
1299void stats_updateCriticalTimeCount(int nodeIndex, int linkIndex);
1300
1306void stats_updateFlowStats(double tStep, DateTime aDate);
1307
1314void stats_updateTimeStepStats(double tStep, int trialsCount, int steadyState);
1315
1328void stats_updateSubcatchStats(int subcatchIndex, double rainVol,
1329 double runonVol, double evapVol, double infilVol,
1330 double impervVol, double pervVol, double runoffVol, double runoff);
1331
1343void stats_updateGwaterStats(int subcatchIndex, double infil, double evap,
1344 double latFlow, double deepFlow, double theta, double waterTable,
1345 double tStep);
1346
1351void stats_updateMaxRunoff(void);
1352
1358void stats_updateMaxNodeDepth(int nodeIndex, double depth);
1359
1365void stats_updateConvergenceStats(int nodeIndex, int converged);
1369
1386int gage_readParams(int gageIndex, char *tok[], int ntoks);
1387
1393void gage_validate(int gageIndex);
1394
1399void gage_initState(int gageIndex);
1400
1406void gage_setState(int gageIndex, DateTime aDate);
1407
1415double gage_getPrecip(int gageIndex, double *rainfall, double *snowfall);
1416
1422void gage_setReportRainfall(int gageIndex, DateTime aDate);
1423
1430DateTime gage_getNextRainDate(int gageIndex, DateTime aDate);
1431
1441void gage_updatePastRain(int gageIndex, int tStep);
1442
1449double gage_getPastRain(int gageIndex, int hrs);
1453
1469int subcatch_readParams(int subcatchIndex, char *tok[], int ntoks);
1470
1480int subcatch_readSubareaParams(char *tok[], int ntoks);
1481
1491int subcatch_readLanduseParams(char *tok[], int ntoks);
1492
1502int subcatch_readInitBuildup(char *tok[], int ntoks);
1503
1508void subcatch_validate(int subcatchIndex);
1509
1514void subcatch_initState(int subcatchIndex);
1515
1520void subcatch_setOldState(int subcatchIndex);
1521
1528double subcatch_getFracPerv(int subcatchIndex);
1529
1536double subcatch_getEvapRate(int subcatchIndex);
1537
1544double subcatch_getStorage(int subcatchIndex);
1545
1552double subcatch_getDepth(int subcatchIndex);
1553
1559void subcatch_getRunon(int subcatchIndex);
1560
1567void subcatch_addRunonFlow(int subcatchIndex, double flow);
1568
1582double subcatch_getRunoff(int subcatchIndex, double tStep);
1583
1590double subcatch_getWtdOutflow(int subcatchIndex, double wt);
1591
1598void subcatch_getResults(int subcatchIndex, double wt, float x[]);
1602
1613void surfqual_initState(int subcatchIndex);
1614
1629void surfqual_getWashoff(int subcatchIndex, double runoff, double tStep);
1630
1636void surfqual_getBuildup(int subcatchIndex, double tStep);
1637
1646void surfqual_applyAPIBuildup(int subcatchIndex);
1647
1653void surfqual_sweepBuildup(int subcatchIndex, DateTime aDate);
1654
1662double surfqual_getWtdWashoff(int subcatchIndex, int pollutIndex, double wt);
1666
1673
1683int node_readParams(int nodeIndex, int type, int subIndex, char *tok[], int ntoks);
1684
1689void node_validate(int nodeIndex);
1690
1695void node_initState(int nodeIndex);
1696
1702void node_initFlows(int nodeIndex, double tStep);
1703
1708void node_setOldHydState(int nodeIndex);
1709
1714void node_setOldQualState(int nodeIndex);
1715
1723void node_setOutletDepth(int nodeIndex, double yNorm, double yCrit, double z);
1724
1731double node_getSurfArea(int nodeIndex, double depth);
1732
1739double node_getDepth(int nodeIndex, double volume);
1740
1747double node_getVolume(int nodeIndex, double depth);
1748
1755double node_getPondedArea(int nodeIndex, double depth);
1756
1763double node_getOutflow(int nodeIndex, int linkIndex);
1764
1772double node_getLosses(int nodeIndex, double tStep);
1773
1781double node_getMaxOutflow(int nodeIndex, double q, double tStep);
1782
1789double node_getSystemOutflow(int nodeIndex, int *isFlooded);
1790
1797void node_getResults(int nodeIndex, double wt, float x[]);
1801
1817int inflow_readExtInflow(char *tok[], int ntoks);
1818
1827int inflow_readDwfInflow(char *tok[], int ntoks);
1828
1838int inflow_readDwfPattern(char *tok[], int ntoks);
1839
1852int inflow_setExtInflow(int nodeIndex, int param, int type, int tSeries,
1853 int basePat, double cf, double baseline, double sf);
1854
1862void inflow_initDwfInflow(TDwfInflow *inflow);
1863
1868void inflow_initDwfPattern(int patternIndex);
1869
1877double inflow_getExtInflow(TExtInflow *inflow, DateTime aDate);
1878
1887double inflow_getDwfInflow(TDwfInflow *inflow, int m, int d, int h);
1888
1893void inflow_deleteExtInflows(int nodeIndex);
1894
1899void inflow_deleteDwfInflows(int nodeIndex);
1903
1904//-----------------------------------------------------------------------------
1905// Routing Interface File Methods
1906//-----------------------------------------------------------------------------
1907int iface_readFileParams(char *tok[], int ntoks);
1908void iface_openRoutingFiles(void);
1909void iface_closeRoutingFiles(void);
1911int iface_getIfaceNode(int index);
1912double iface_getIfaceFlow(int index);
1913double iface_getIfaceQual(int index, int pollut);
1914void iface_saveOutletResults(DateTime reportDate, FILE *file);
1918
1919//-----------------------------------------------------------------------------
1920// Hot Start File Methods
1921//-----------------------------------------------------------------------------
1922int hotstart_open(void);
1923void hotstart_save(void);
1924int hotstart_save_to_file(const char *hotstartFile);
1925int hotstart_is_valid(const char *hotstartFile, int *inputFileVersion);
1926void hotstart_close(void);
1930
1931//-----------------------------------------------------------------------------
1932// Conveyance System Link Methods
1933//-----------------------------------------------------------------------------
1934int link_readParams(int link, int type, int subIndex, char *tok[], int ntoks);
1935int link_readXsectParams(char *tok[], int ntoks);
1936int link_readLossParams(char *tok[], int ntoks);
1937
1938void link_validate(int link);
1939void link_initState(int link);
1940void link_setOldHydState(int link);
1941void link_setOldQualState(int link);
1942
1943void link_setTargetSetting(int j);
1944void link_setSetting(int j, double tstep);
1945int link_setFlapGate(int link, int n1, int n2, double q);
1946
1947double link_getInflow(int link);
1948void link_setOutfallDepth(int link);
1949double link_getLength(int link);
1950double link_getYcrit(int link, double q);
1951double link_getYnorm(int link, double q);
1952double link_getVelocity(int link, double q, double y);
1953double link_getFroude(int link, double v, double y);
1954double link_getPower(int link);
1955double link_getLossRate(int link, int routeModel, double q, double tstep);
1956char link_getFullState(double a1, double a2, double aFull);
1957
1958void link_getResults(int link, double wt, float x[]);
1962
1963//-----------------------------------------------------------------------------
1964// Link Cross-Section Methods
1965//-----------------------------------------------------------------------------
1966int xsect_isOpen(int type);
1967int xsect_setParams(TXsect *xsect, int type, double p[], double ucf);
1971double xsect_getAmax(TXsect *xsect);
1972
1973double xsect_getSofA(TXsect *xsect, double area);
1974double xsect_getYofA(TXsect *xsect, double area);
1975double xsect_getRofA(TXsect *xsect, double area);
1976double xsect_getAofS(TXsect *xsect, double sFactor);
1977double xsect_getdSdA(TXsect *xsect, double area);
1978double xsect_getAofY(TXsect *xsect, double y);
1979double xsect_getRofY(TXsect *xsect, double y);
1980double xsect_getWofY(TXsect *xsect, double y);
1981double xsect_getYcrit(TXsect *xsect, double q);
1985
1986//-----------------------------------------------------------------------------
1987// Culvert/Roadway Methods
1988//-----------------------------------------------------------------------------
1989double culvert_getInflow(int link, double q, double h);
1990double roadway_getInflow(int link, double dir, double hcrest, double h1,
1991 double h2);
1995
1996//-----------------------------------------------------------------------------
1997// Force Main Methods
1998//-----------------------------------------------------------------------------
1999double forcemain_getEquivN(int j, int k);
2000double forcemain_getRoughFactor(int j, double lengthFactor);
2001double forcemain_getFricSlope(int j, double v, double hrad);
2005
2006//-----------------------------------------------------------------------------
2007// Cross-Section Transect Methods
2008//-----------------------------------------------------------------------------
2009int transect_create(int n);
2010void transect_delete(void);
2011int transect_readParams(int *count, char *tok[], int ntoks);
2012void transect_validate(int j);
2017
2018//-----------------------------------------------------------------------------
2019// Street Cross-Section Methods
2020//-----------------------------------------------------------------------------
2021int street_create(int nStreets);
2022void street_delete();
2023int street_readParams(char *tok[], int ntoks);
2024double street_getExtentFilled(int link);
2028
2029//-----------------------------------------------------------------------------
2030// Custom Shape Cross-Section Methods
2031//-----------------------------------------------------------------------------
2032int shape_validate(TShape *shape, TTable *curve);
2036
2043
2047void controls_init(void);
2048
2054void controls_addToCount(char *s);
2055
2061int controls_create(int n);
2062
2066void controls_delete(void);
2067
2077int controls_addVariable(char *tok[], int ntoks);
2078
2087int controls_addExpression(char *tok[], int ntoks);
2088
2097int controls_addRuleClause(int rule, int keyword, char *Tok[], int nTokens);
2098
2106int controls_evaluate(DateTime currentTime, DateTime elapsedTime,
2107 double tStep);
2111
2112//-----------------------------------------------------------------------------
2113// Table & Time Series Methods
2114//-----------------------------------------------------------------------------
2115int table_readCurve(char *tok[], int ntoks);
2116int table_readTimeseries(char *tok[], int ntoks);
2117
2118int table_addEntry(TTable *table, double x, double y);
2119int table_getFirstEntry(TTable *table, double *x, double *y);
2120int table_getNextEntry(TTable *table, double *x, double *y);
2121void table_deleteEntries(TTable *table);
2122
2123void table_init(TTable *table);
2124int table_validate(TTable *table);
2125
2126double table_lookup(TTable *table, double x);
2127double table_lookupEx(TTable *table, double x);
2128double table_intervalLookup(TTable *table, double x);
2129double table_inverseLookup(TTable *table, double y);
2130
2131double table_getSlope(TTable *table, double x);
2132double table_getMaxY(TTable *table, double x);
2133double table_getStorageVolume(TTable *table, double x);
2134double table_getStorageDepth(TTable *table, double v);
2135
2136void table_tseriesInit(TTable *table);
2137double table_tseriesLookup(TTable *table, double t, char extend);
2141
2148
2154double UCF(int quantity);
2155
2162int getInt(char *s, int *y);
2163
2170int getFloat(char *s, float *y);
2171
2178int getDouble(char *s, double *y);
2179
2185char *getTempFileName(char *fname);
2186
2193int findmatch(char *s, char *keyword[]);
2194
2202int match(char *str, char *substr);
2203
2210int strcomp(const char *s1, const char *s2);
2211
2220size_t sstrncpy(char *dest, const char *src, size_t n);
2221
2229size_t sstrcat(char *dest, const char *src, size_t destsize);
2230
2235void writecon(const char *s);
2236
2245void getElapsedTime(DateTime aDate, int *days, int *hrs, int *mins);
2246
2253DateTime getDateTime(double elapsedMsec);
2254
2261char *addAbsolutePath(char *fname); // add full path to a file name
2265
2269
2270#endif // FUNCS_H
double DateTime
Type for storing date and time values.
Definition datetime.h:29
int table_getNextEntry(TTable *table, double *x, double *y)
Definition table.c:371
double link_getYnorm(int link, double q)
Definition link.c:786
double table_intervalLookup(TTable *table, double x)
Definition table.c:508
void link_validate(int link)
Definition link.c:406
double forcemain_getFricSlope(int j, double v, double hrad)
Definition forcmain.c:88
int table_addEntry(TTable *table, double x, double y)
Definition table.c:211
double forcemain_getRoughFactor(int j, double lengthFactor)
Definition forcmain.c:64
double link_getLossRate(int link, int routeModel, double q, double tstep)
Definition link.c:896
double culvert_getInflow(int link, double q, double h)
Definition culvert.c:174
double xsect_getSofA(TXsect *xsect, double area)
Definition xsect.c:718
int link_readLossParams(char *tok[], int ntoks)
Definition link.c:274
double table_inverseLookup(TTable *table, double y)
Definition table.c:532
double table_lookup(TTable *table, double x)
Definition table.c:400
double table_lookupEx(TTable *table, double x)
Definition table.c:469
void link_getResults(int link, double wt, float x[])
Definition link.c:677
void street_delete()
Definition street.c:46
double table_tseriesLookup(TTable *table, double t, char extend)
Definition table.c:750
double xsect_getRofA(TXsect *xsect, double area)
Definition xsect.c:1104
void table_init(TTable *table)
Definition table.c:263
double table_getMaxY(TTable *table, double x)
Definition table.c:567
double xsect_getYcrit(TXsect *xsect, double q)
Definition xsect.c:1261
double link_getPower(int link)
Definition link.c:878
void link_setOldQualState(int link)
Definition link.c:590
void hotstart_close(void)
Definition hotstart.c:201
int table_readTimeseries(char *tok[], int ntoks)
Definition table.c:116
int transect_readParams(int *count, char *tok[], int ntoks)
Definition transect.c:106
double street_getExtentFilled(int link)
Definition street.c:141
double xsect_getdSdA(TXsect *xsect, double area)
Definition xsect.c:1198
double xsect_getAofY(TXsect *xsect, double y)
Definition xsect.c:861
double link_getLength(int link)
Definition link.c:811
double xsect_getAofS(TXsect *xsect, double sFactor)
Definition xsect.c:1153
double roadway_getInflow(int link, double dir, double hcrest, double h1, double h2)
Definition roadway.c:85
double link_getInflow(int link)
Definition link.c:546
void transect_validate(int j)
Definition transect.c:196
void link_setSetting(int j, double tstep)
Definition link.c:631
double xsect_getAmax(TXsect *xsect)
Definition xsect.c:704
void xsect_setIrregXsectParams(TXsect *xsect)
Definition xsect.c:642
double table_getStorageDepth(TTable *table, double v)
Definition table.c:656
void link_setTargetSetting(int j)
Definition link.c:607
int link_setFlapGate(int link, int n1, int n2, double q)
Definition link.c:646
double table_getStorageVolume(TTable *table, double x)
Definition table.c:592
double link_getYcrit(int link, double q)
Definition link.c:773
double forcemain_getEquivN(int j, int k)
Definition forcmain.c:37
int street_create(int nStreets)
Definition street.c:29
void link_setOldHydState(int link)
Definition link.c:567
int xsect_isOpen(int type)
Definition xsect.c:208
int table_getFirstEntry(TTable *table, double *x, double *y)
Definition table.c:336
void transect_delete(void)
Definition transect.c:92
int hotstart_save_to_file(const char *hotstartFile)
Definition hotstart.c:123
double link_getVelocity(int link, double q, double y)
Definition link.c:824
void transect_createStreetTransect(TStreet *street)
Definition transect.c:599
int hotstart_open(void)
Definition hotstart.c:77
int street_readParams(char *tok[], int ntoks)
Definition street.c:58
void link_setOutfallDepth(int link)
Definition link.c:731
int link_readParams(int link, int type, int subIndex, char *tok[], int ntoks)
Definition link.c:140
int transect_create(int n)
Definition transect.c:72
int hotstart_is_valid(const char *hotstartFile, int *inputFileVersion)
Definition hotstart.c:158
void xsect_setStreetXsectParams(TXsect *xsect)
Definition xsect.c:655
void xsect_setCustomXsectParams(TXsect *xsect)
Definition xsect.c:668
void table_deleteEntries(TTable *table)
Definition table.c:234
int table_readCurve(char *tok[], int ntoks)
Definition table.c:70
int link_readXsectParams(char *tok[], int ntoks)
Definition link.c:165
int xsect_setParams(TXsect *xsect, int type, double p[], double ucf)
Definition xsect.c:220
double link_getFroude(int link, double v, double y)
Definition link.c:850
double table_getSlope(TTable *table, double x)
Definition table.c:435
void link_initState(int link)
Definition link.c:511
int shape_validate(TShape *shape, TTable *curve)
Definition shape.c:42
void table_tseriesInit(TTable *table)
Definition table.c:735
double xsect_getWofY(TXsect *xsect, double y)
Definition xsect.c:947
double xsect_getYofA(TXsect *xsect, double area)
Definition xsect.c:777
double xsect_getRofY(TXsect *xsect, double y)
Definition xsect.c:1035
char link_getFullState(double a1, double a2, double aFull)
Definition link.c:914
void hotstart_save(void)
Definition hotstart.c:99
int table_validate(TTable *table)
Definition table.c:288
DateTime climate_getNextEvapDate(void)
Gets the next date when evaporation rate changes.
Definition climate.c:1026
int climate_readEvapParams(char *tok[], int ntoks)
Reads evaporation parameters from input line of data.
Definition climate.c:653
void climate_initState(void)
Initializes climate state variables.
Definition climate.c:965
int climate_readAdjustments(char *tok[], int ntoks)
Reads adjustments to monthly evaporation or rainfall from input line of data.
Definition climate.c:742
void climate_setState(DateTime theDate)
Sets climate variables for current date.
Definition climate.c:1007
int climate_readParams(char *tok[], int ntoks)
Reads climate/temperature parameters from input line of data.
Definition climate.c:523
void climate_validate(void)
Validates climatological variables.
Definition climate.c:846
void climate_openFile(void)
Opens a climate file and reads in first set of values.
Definition climate.c:900
int controls_addVariable(char *tok[], int ntoks)
Adds a named variable to the control rule system from a tokenized line of input with formats:
Definition controls.c:864
int controls_addExpression(char *tok[], int ntoks)
Adds a math expression to the control rule system from a a tokenized line of input with format: EXPRE...
Definition controls.c:891
int controls_evaluate(DateTime currentTime, DateTime elapsedTime, double tStep)
Evaluates all control rules at the current time of the simulation.
Definition controls.c:980
void controls_addToCount(char *s)
Updates the number of named variables or math expressions used by control rules.
Definition controls.c:788
void controls_delete(void)
Deletes all control rules.
Definition controls.c:843
int controls_create(int n)
Creates an array of control rules.
Definition controls.c:799
void controls_init(void)
Initializes the control rule system.
Definition controls.c:775
int controls_addRuleClause(int rule, int keyword, char *Tok[], int nTokens)
Adds a new clause to a control rule.
Definition controls.c:921
int inflow_readDwfPattern(char *tok[], int ntoks)
Reads values of a time pattern from a line of input data.
Definition inflow.c:400
void inflow_initDwfInflow(TDwfInflow *inflow)
Initialzes a dry weather inflow by ordering its time patterns.
Definition inflow.c:326
int inflow_readDwfInflow(char *tok[], int ntoks)
Reads dry weather inflow parameters from line of input data.
Definition inflow.c:236
double inflow_getExtInflow(TExtInflow *inflow, DateTime aDate)
Retrieves the value of an external inflow at a specific date and time.
Definition inflow.c:207
void inflow_initDwfPattern(int patternIndex)
Initialzes a dry weather inflow time pattern.
Definition inflow.c:382
double inflow_getDwfInflow(TDwfInflow *inflow, int m, int d, int h)
Computes dry weather inflow value at a specific point in time.
Definition inflow.c:347
void inflow_deleteExtInflows(int nodeIndex)
Deletes all time series inflow data for a node.
Definition inflow.c:187
void inflow_deleteDwfInflows(int nodeIndex)
Deletes all dry weather inflow data for a node.
Definition inflow.c:301
int inflow_setExtInflow(int nodeIndex, int param, int type, int tSeries, int basePat, double cf, double baseline, double sf)
This function assigns property values to the inflow object.
Definition inflow.c:147
int inflow_readExtInflow(char *tok[], int ntoks)
Reads parameters of a direct external inflow from a line of input.
Definition inflow.c:50
void node_validate(int nodeIndex)
Validates a node's properties.
Definition node.c:207
void node_setOutletDepth(int nodeIndex, double yNorm, double yCrit, double z)
Sets water depth at a node that serves as an outlet point.
Definition node.c:514
void node_getResults(int nodeIndex, double wt, float x[])
Computes weighted average of old and new results at a node.
Definition node.c:481
void node_setOldQualState(int nodeIndex)
Replaces a node's old water quality state values with new ones.
Definition node.c:306
double node_getVolume(int nodeIndex, double depth)
Computes volume stored at a node from its water depth.
Definition node.c:354
double node_getLosses(int nodeIndex, double tStep)
Computes the rates of evaporation and infiltration over a given time step for a node.
Definition node.c:565
double node_getMaxOutflow(int nodeIndex, double q, double tStep)
Limits outflow rate from a node with storage volume.
Definition node.c:405
void node_initState(int nodeIndex)
Initializes a node's state variables at start of simulation.
Definition node.c:241
double node_getOutflow(int nodeIndex, int linkIndex)
Computes outflow from node available for inflow into a link.
Definition node.c:388
int node_readParams(int nodeIndex, int type, int subIndex, char *tok[], int ntoks)
Reads node properties from a tokenized line of input.
Definition node.c:116
double node_getPondedArea(int nodeIndex, double depth)
Computes surface area of water at a node based on depth.
Definition node.c:539
double node_getDepth(int nodeIndex, double volume)
Computes a node's water depth from its volume.
Definition node.c:339
void node_initFlows(int nodeIndex, double tStep)
Initializes a node's inflow/outflow/overflow at start of time step.
Definition node.c:321
void node_setOldHydState(int nodeIndex)
Replaces a node's old hydraulic state values with new ones.
Definition node.c:294
double node_getSurfArea(int nodeIndex, double depth)
Computes surface area of water stored at a node from water depth.
Definition node.c:373
double node_getSystemOutflow(int nodeIndex, int *isFlooded)
Computes flow rate at outfalls and flooded nodes.
Definition node.c:418
int kinwave_execute(int linkIndex, double *qin, double *qout, double tStep)
Finds outflow over time step tStep given flow entering a conduit using Kinematic Wave flow routing.
Definition kinwave.c:72
void flowrout_init(int routingModel)
Initializes flow routing system.
Definition flowrout.c:75
void toposort_sortLinks(int sortedLinks[])
Sorts links from upstream to downstream.
Definition toposort.c:60
void dynwave_close(void)
Frees memory allocated for dynamic wave routing method.
Definition dynwave.c:163
int flowrout_execute(int links[], int routingModel, double tStep)
Routes flow through conveyance network over current time step.
Definition flowrout.c:142
int dynwave_execute(double tStep)
Routes flows through drainage network over current time step.
Definition dynwave.c:218
void flowrout_close(int routingModel)
Closes down flow routing system.
Definition flowrout.c:109
double dynwave_getRoutingStep(double fixedStep)
Computes variable routing time step if applicable.
Definition dynwave.c:192
double flowrout_getRoutingStep(int routingModel, double fixedStep)
Finds variable time step for dynamic wave routing.
Definition flowrout.c:125
void qualrout_execute(double tStep)
Routes water quality constituents through the drainage network over the current time step.
Definition qualrout.c:106
void qualrout_init(void)
Initializes water quality concentrations in all nodes and links.
Definition qualrout.c:67
void dynwave_validate(void)
Adjusts dynamic wave routing options.
Definition dynwave.c:176
void dwflow_findConduitFlow(int linkIndex, int steps, double omega, double dt)
Updates flow in conduit link by solving finite difference form of continuity and momentum equations.
Definition dwflow.c:64
void dynwave_init(void)
Initializes dynamic wave routing method.
Definition dynwave.c:120
double iface_getIfaceFlow(int index)
Definition iface.c:262
void iface_saveOutletResults(DateTime reportDate, FILE *file)
Definition iface.c:311
void iface_closeRoutingFiles(void)
Definition iface.c:200
int iface_getNumIfaceNodes(DateTime aDate)
Definition iface.c:217
int iface_readFileParams(char *tok[], int ntoks)
Definition iface.c:68
void iface_openRoutingFiles(void)
Definition iface.c:168
double iface_getIfaceQual(int index, int pollut)
Definition iface.c:283
int iface_getIfaceNode(int index)
Definition iface.c:249
int gwater_readFlowExpression(char *tok[], int ntoks)
Reads mathematical expression for lateral or deep groundwater flow for a subcatchment from a line of ...
Definition gwater.c:276
void gwater_validate(int subcatchIndex)
Validates groundwater parameters for a subcatchment.
Definition gwater.c:373
void gwater_initState(int subcatchIndex)
Initializes state of subcatchment's groundwater.
Definition gwater.c:398
int gwater_readAquiferParams(int aquiferIndex, char *tok[], int ntoks)
Reads aquifer parameter values from line of input data.
Definition gwater.c:129
void gwater_getState(int subcatchIndex, double x[])
Retrieves state of subcatchment's groundwater.
Definition gwater.c:439
double gwater_getVolume(int subcatchIndex)
Finds volume of groundwater stored in upper & lower zones.
Definition gwater.c:468
void gwater_validateAquifer(int aquiferIndex)
Validates groundwater aquifer properties.
Definition gwater.c:345
int gwater_readGroundwaterParams(char *tok[], int ntoks)
Reads groundwater inflow parameters for a subcatchment from a line of input data.
Definition gwater.c:197
void gwater_deleteFlowExpression(int subcatchIndex)
Veletes a subcatchment's custom groundwater flow expressions.
Definition gwater.c:335
void gwater_setState(int subcatchIndex, double x[])
Assigns values to a subcatchment's groundwater state.
Definition gwater.c:453
void gwater_getGroundwater(int subcatchIndex, double evap, double infil, double tStep)
Computes groundwater flow for a subcatchment.
Definition gwater.c:482
int input_countObjects(void)
Reads input file to determine number of system objects.
Definition input.c:69
int input_readData(void)
Reads input file to determine number of system objects.
Definition input.c:147
int landuse_readPollutParams(int pollutIndex, char *tok[], int ntoks)
Reads pollutant parameters from a tokenized line of input.
Definition landuse.c:96
void landuse_getInitBuildup(TLandFactor *landFactor, double *initBuildup, double area, double curb)
Determines the initial buildup of each pollutant on each land use for a given subcatchment.
Definition landuse.c:347
int landuse_readBuildupParams(char *tok[], int ntoks)
Reads pollutant buildup parameters from a tokenized line of input.
Definition landuse.c:184
double landuse_getBuildup(int landuseIndex, int pollutIndex, double area, double curb, double buildup, double tStep)
Computes new pollutant buildup on a landuse after a time increment.
Definition landuse.c:403
double landuse_getCoPollutLoad(int p, double washoff[])
Finds washoff mass added by a co-pollutant of a given pollutant.
Definition landuse.c:666
int landuse_readWashoffParams(char *tok[], int ntoks)
Reads pollutant washoff parameters from a tokenized line of input.
Definition landuse.c:281
double landuse_getWashoffLoad(int landuse, int p, double area, TLandFactor landFactor[], double runoff, double vOutflow)
Computes pollutant load generated by a land use over a time step.
Definition landuse.c:550
double landuse_getAvgBmpEffic(int subcatchIndex, int pollutIndex)
Finds the overall average BMP removal achieved for pollutant pollutIndex treated in subcatchment j.
Definition landuse.c:529
int landuse_readParams(int landuseIndex, char *tok[], int ntoks)
Reads landuse parameters from a tokenized line of input.
Definition landuse.c:58
double massbal_getRunoffError(void)
Computes runoff mass balance error.
Definition massbal.c:658
double massbal_getStepFlowError(void)
Computes flow routing mass balance error at current time step.
Definition massbal.c:957
void massbal_close(void)
Frees memory used by mass balance system.
Definition massbal.c:246
void massbal_updateLoadingTotals(int type, int pollutIndex, double w)
Adds inflow mass loading to loading totals for current time step.
Definition massbal.c:429
void massbal_addLinkLosses(double evapLoss, double infilLoss)
Adds link losses over current time step to routing totals.
Definition massbal.c:539
int massbal_open(void)
Opens and initializes mass balance continuity checking.
Definition massbal.c:100
void massbal_addInflowFlow(int type, double q)
Adds flow inflow to routing totals for current time step.
Definition massbal.c:411
void massbal_updateRoutingTotals(double tStep)
Updates overall routing totals with totals from current time step.
Definition massbal.c:549
void massbal_updateRunoffTotals(int flowType, double v)
Updates runoff totals after current time step.
Definition massbal.c:342
void massbal_addSeepageLoss(int pollutIndex, double seepLoss)
Adds mass lost to seepage during current time step to routing totals.
Definition massbal.c:506
void massbal_addNodeLosses(double evapLoss, double infilLoss)
Adds node losses over current time step to routing totals.
Definition massbal.c:528
void massbal_updateGwaterTotals(double vInfil, double vUpperEvap, double vLowerEvap, double vLowerPerc, double vGwater)
Updates groundwater totals after current time step.
Definition massbal.c:363
void massbal_addInflowQual(int type, int pollutIndex, double w)
Adds quality inflow to routing totals for current time step.
Definition massbal.c:449
void massbal_addReactedMass(int pollutIndex, double mass)
Adds mass reacted during current time step to routing totals.
Definition massbal.c:495
void massbal_report(void)
Reports mass balance results.
Definition massbal.c:262
void massbal_initTimeStepTotals(void)
Initializes routing totals for current time step.
Definition massbal.c:376
void massbal_addOutflowQual(int pollutIndex, double mass, int isFlooded)
Adds pollutant outflow over current time step to routing totals.
Definition massbal.c:479
double massbal_getFlowError(void)
Computes flow routing mass balance error.
Definition massbal.c:820
void massbal_addToFinalStorage(int pollutIndex, double mass)
Adds mass remaining on dry surface to routing totals.
Definition massbal.c:517
void massbal_addOutflowFlow(double q, int isFlooded)
Adds flow outflow over current time step to routing totals.
Definition massbal.c:467
void output_readNodeResults(long period, int index)
Reads computed results for a node at a specific time period.
Definition output.c:736
void output_readLinkResults(long period, int index)
Reads computed results for a link at a specific time period.
Definition output.c:751
int output_open(void)
Writes basic project data to binary output file.
Definition output.c:136
void output_updateAvgResults(void)
Updates average results for current time period.
Definition output.c:849
void output_close(void)
Frees memory used for accessing the binary file.
Definition output.c:547
void output_end(void)
Writes closing records to binary file.
Definition output.c:527
void output_readSubcatchResults(long period, int index)
Reads computed results for a subcatchment at a specific time period.
Definition output.c:721
void output_saveResults(double reportTime)
Writes computed results for current report time to binary file.
Definition output.c:468
void output_readDateTime(long period, DateTime *days)
Retrieves the date/time for a specific reporting period from the binary output file.
Definition output.c:706
double ** project_createMatrix(int nrows, int ncols)
Allocates memory for a matrix of doubles.
Definition project.c:398
int project_readOption(char *s1, char *s2)
Reads a project option from a pair of string tokens.
Definition project.c:453
int project_findObject(int type, const char *id)
Uses hash table to find index of an object with a given ID.
Definition project.c:372
void project_freeMatrix(double **m)
Frees memory allocated for a matrix of doubles.
Definition project.c:437
void project_close(void)
Close project.
Definition project.c:282
int project_addObject(int type, char *id, int n)
Adds an object Id to a hash table.
Definition project.c:342
void project_readInput(void)
Read project inputs.
Definition project.c:137
int project_init(void)
Initializes the internal state of the project.
Definition project.c:295
char * project_findID(int type, char *id)
Uses hash table to find address of a given string entry.
Definition project.c:385
void project_validate(void)
Checks validity of project data.
Definition project.c:194
void project_open(const char *inp_file, const char *rpt_file, const char *out_file)
Opens a new SWMM project.
Definition project.c:128
void rdii_openRdii(void)
Opens an exisiting RDII interface file or creates a new one.
Definition rdii.c:407
int rdii_readRdiiInflow(char *tok[], int ntoks)
Reads properties of an RDII inflow from a line of input.
Definition rdii.c:152
int rdii_readUnitHydParams(char *tok[], int ntoks)
Reads parameters of an RDII unit hydrograph from a line of input.
Definition rdii.c:221
void rdii_closeRdii(void)
Closes the RDII interface file.
Definition rdii.c:492
int rdii_getNumRdiiFlows(DateTime aDate)
Finds number of RDII inflows at a specified date.
Definition rdii.c:505
void rdii_initUnitHyd(int unitHydIndex)
Initializes properties of a unit hydrograph group.
Definition rdii.c:200
void rdii_getRdiiFlow(int index, int *nodeIndex, double *q)
Finds index and current RDII inflow for an RDII node.
Definition rdii.c:534
void rdii_deleteRdiiInflow(int nodeIndex)
Deletes RDII inflow data for a node.
Definition rdii.c:386
void rain_close(void)
Closes rain interface file and RDII processor.
Definition rain.c:184
void rain_open(void)
Opens binary rainfall interface file and RDII processor.
Definition rain.c:118
DateTime gage_getNextRainDate(int gageIndex, DateTime aDate)
Finds the next date from specified date when rainfall occurs.
Definition gage.c:497
int gage_readParams(int gageIndex, char *tok[], int ntoks)
Reads rain gage parameters from a line of input data.
Definition gage.c:68
double gage_getPrecip(int gageIndex, double *rainfall, double *snowfall)
Determines whether gage's recorded rainfall is rain or snow.
Definition gage.c:513
void gage_initState(int gageIndex)
Initializes state of a rain gage.
Definition gage.c:284
double gage_getPastRain(int gageIndex, int hrs)
Retrieves rainfall total over some previous number of hours.
Definition gage.c:481
void gage_setReportRainfall(int gageIndex, DateTime aDate)
Sets the rainfall value reported at the current reporting time.
Definition gage.c:530
void gage_setState(int gageIndex, DateTime aDate)
Updates state of rain gage for specified date.
Definition gage.c:332
void gage_validate(int gageIndex)
Checks for valid rain gage parameters.
Definition gage.c:229
void gage_updatePastRain(int gageIndex, int tStep)
Updates past MAXPASTRAIN hourly rain totals.
Definition gage.c:435
void report_writeSysTime(void)
Writes starting/ending processing times to the report file.
Definition report.c:183
void report_writeReport(void)
Writes project title to report file.
Definition report.c:1113
void report_writeLogo(void)
Writes report header lines to report file.
Definition report.c:220
void report_writeGwaterError(TGwaterTotals *totals, double area)
Writes groundwater continuity error to report file.
Definition report.c:685
void report_writeTitle(void)
Writes project title to report file.
Definition report.c:235
void report_writeRdiiStats(double totalRain, double totalRdii)
Writes summary of RDII inflow to report file.
Definition report.c:396
void report_writeRainStats(int gage, TRainStats *rainStats)
Writes summary of rain data read from input file to report file.
Definition report.c:355
void report_writeFlowError(TRoutingTotals *totals)
Writes flow routing continuity error to report file.
Definition report.c:737
void report_writeMaxStats(TMaxStats massBalErrs[], TMaxStats CourantCrit[], int nMaxStats)
Lists nodes and links with highest mass balance errors and courant time step violations to report fil...
Definition report.c:923
void statsrpt_writeReport(void)
Reports simulation summary statistics.
Definition statsrpt.c:87
void report_writeTseriesErrorMsg(int code, TTable *tseries)
Writes the date where a time series' data is out of order.
Definition report.c:1522
void report_writeLine(const char *line)
Writes a line of text to the report file.
Definition report.c:171
void report_writeLoadingError(TLoadingTotals *totals)
Writes runoff loading continuity error to report file.
Definition report.c:577
void report_writeErrorMsg(int code, char *msg)
Writes error message to report file.
Definition report.c:1422
void report_writeQualError(TRoutingTotals *totals)
Writes quality routing continuity error to report file.
Definition report.c:800
void report_writeNonconvergedStats(TMaxStats maxNonconverged[], int nMaxStats)
Writes non-converging nodes to report file.
Definition report.c:1011
void report_writeInputErrorMsg(int k, int sect, char *line, long lineCount)
Writes input error message to report file.
Definition report.c:1464
void report_writeRunoffError(TRunoffTotals *totals, double area)
Writes runoff continuity error to report file.
Definition report.c:480
void report_writeControlActionsHeading(void)
Writes summary control actions heading to report file.
Definition report.c:441
void inputrpt_writeInput(void)
Writes summary of input data to report file.
Definition inputrpt.c:27
void report_writeMaxFlowTurns(TMaxStats flowTurns[], int nMaxStats)
Lists links with highest number of flow turns to report (i.e., fraction of time periods where the flo...
Definition report.c:977
void report_writeOptions(void)
Writes analysis options in use to report file.
Definition report.c:254
void report_writeErrorCode(void)
Writes error message to report file.
Definition report.c:1446
void report_writeWarningMsg(char *msg, char *id)
Writes a warning message to report file.
Definition report.c:1500
void report_writeTimeStepStats(TTimeStepStats *timeStepStats)
Writes routing time step statistics to report file.
Definition report.c:1037
void report_invokeWarningCallback(const char *msg)
Invokes the registered warning callback (if any) with a message.
Definition report.c:1485
void report_writeControlAction(DateTime aDate, char *linkID, double value, char *ruleID)
Writes control action to report file.
Definition report.c:452
int report_readOptions(char *tok[], int ntoks)
Reads reporting options from a line of input data.
Definition report.c:93
int routing_open(void)
Initializes the routing analyzer.
Definition routing.c:96
int runoff_open(void)
Opens the runoff analyzer.
Definition runoff.c:84
void runoff_close(void)
Closes the runoff analyzer.
Definition runoff.c:127
double routing_getRoutingStep(int routingModel, double fixedStep)
Determines time step used for flow routing at current time period.
Definition routing.c:159
void routing_execute(int routingModel, double routingStep)
Executes the routing process at the current time period.
Definition routing.c:210
void routing_close(int routingModel)
Closes down the routing analyzer.
Definition routing.c:137
void runoff_execute(void)
Computes runoff for each subcatchment at the current runoff time.
Definition runoff.c:159
void stats_updateMaxRunoff(void)
Updates value of maximum system runoff rate.
Definition stats.c:416
void stats_updateConvergenceStats(int nodeIndex, int converged)
Updates convergence statistics node.
Definition stats.c:519
void stats_close(void)
Closes the simulation statistics system.
Definition stats.c:316
void stats_updateFlowStats(double tStep, DateTime aDate)
Updates various flow routing statistics at current time period.
Definition stats.c:441
int stats_open(void)
Opens the simulation statistics system.
Definition stats.c:104
void stats_updateMaxNodeDepth(int nodeIndex, double depth)
Updates a node's maximum depth recorded at reporting times.
Definition stats.c:430
void stats_updateTimeStepStats(double tStep, int trialsCount, int steadyState)
Updates flow routing time step statistics.
Definition stats.c:474
void stats_updateCriticalTimeCount(int nodeIndex, int linkIndex)
Updates count of times a node or link was time step-critical.
Definition stats.c:508
void stats_report(void)
Reports simulation statistics.
Definition stats.c:336
void stats_updateGwaterStats(int subcatchIndex, double infil, double evap, double latFlow, double deepFlow, double theta, double waterTable, double tStep)
Updates groundwater statistics for a specific subcatchment.
Definition stats.c:394
void stats_updateSubcatchStats(int subcatchIndex, double rainVol, double runonVol, double evapVol, double infilVol, double impervVol, double pervVol, double runoffVol, double runoff)
Updates totals of runoff components for a specific subcatchment.
Definition stats.c:368
int snow_createSnowpack(int subcatchIndex, int snowIndex)
Creates a snowpack object for a subcatchment.
Definition snow.c:138
double snow_getSnowCover(int subcatchIndex)
Computes volume of snow on a subcatchment.
Definition snow.c:587
void snow_getState(int subcatchIndex, int subAreaIndex, double x[])
Retrieves the current state of a snowpack object.
Definition snow.c:273
void snow_initSnowmelt(int snowIndex)
Initializes values in a snowmelt parameter set.
Definition snow.c:209
void snow_setMeltCoeffs(int snowIndex, double season)
Sets values of snowmelt coefficients for a particular time of year.
Definition snow.c:370
double snow_getSnowMelt(int subcatchIndex, double rainfall, double snowfall, double tStep, double netPrecip[])
Modifies rainfall input to subcatchment's subareas based on possible snow melt and updates snow depth...
Definition snow.c:510
void snow_setState(int subcatchIndex, int subAreaIndex, double x[])
Sets the current state of a snowpack object.
Definition snow.c:296
void snow_validateSnowmelt(int snowIndex)
Checks for valid values in a snowmelt parameter set.
Definition snow.c:237
int snow_readMeltParams(char *tok[], int ntoks)
Reads snowmelt parameters from a tokenized line of input data.
Definition snow.c:76
void snow_initSnowpack(int subcatchIndex)
Initializes state of a subcatchment's snowpack.
Definition snow.c:158
void snow_plowSnow(int subcatchIndex, double tStep)
Adds new snow to subcatchment and plows it between sub-areas.
Definition snow.c:392
void subcatch_setOldState(int subcatchIndex)
Replaces old state of subcatchment with new state.
Definition subcatch.c:476
int subcatch_readParams(int subcatchIndex, char *tok[], int ntoks)
Reads subcatchment parameters from a tokenized line of input data.
Definition subcatch.c:134
double subcatch_getFracPerv(int subcatchIndex)
Determines what fraction of subcatchment area, including any LID area, is pervious.
Definition subcatch.c:499
void subcatch_getResults(int subcatchIndex, double wt, float x[])
Computes wtd. combination of old and new subcatchment results.
Definition subcatch.c:867
void subcatch_validate(int subcatchIndex)
Checks for valid subcatchment input parameters.
Definition subcatch.c:380
double subcatch_getStorage(int subcatchIndex)
Finds total volume of water stored on a subcatchment's surface and its LIDs at the current time.
Definition subcatch.c:518
int subcatch_readInitBuildup(char *tok[], int ntoks)
Reads initial pollutant buildup on subcatchment from tokenized line of input data.
Definition subcatch.c:348
void subcatch_addRunonFlow(int subcatchIndex, double flow)
Updates the total runon flow (ft/s) seen by a subcatchment that receives runon flow from an upstream ...
Definition subcatch.c:612
double subcatch_getEvapRate(int subcatchIndex)
Returns the potential evaporation rate for a subcatchment.
Definition subcatch.c:642
void subcatch_getRunon(int subcatchIndex)
Routes runoff from a subcatchment to its outlet subcatchment or between its subareas.
Definition subcatch.c:536
void subcatch_initState(int subcatchIndex)
Initializes state of a subcatchment.
Definition subcatch.c:437
double subcatch_getRunoff(int subcatchIndex, double tStep)
Computes runoff & new storage depth for subcatchment.
Definition subcatch.c:663
double subcatch_getDepth(int subcatchIndex)
Finds average depth of water over the non-LID portion of a subcatchment.
Definition subcatch.c:829
double subcatch_getWtdOutflow(int subcatchIndex, double wt)
Computes weighted combination of old and new subcatchment runoff.
Definition subcatch.c:855
int subcatch_readSubareaParams(char *tok[], int ntoks)
Rreads subcatchment's subarea parameters from a tokenized line of input data.
Definition subcatch.c:226
int subcatch_readLanduseParams(char *tok[], int ntoks)
Reads assignment of landuses to subcatchment from a tokenized line of input data.
Definition subcatch.c:311
void surfqual_getBuildup(int subcatchIndex, double tStep)
Adds to pollutant buildup on subcatchment surface.
Definition surfqual.c:115
void surfqual_sweepBuildup(int subcatchIndex, DateTime aDate)
Reduces pollutant buildup over a subcatchment if sweeping occurs.
Definition surfqual.c:204
double surfqual_getWtdWashoff(int subcatchIndex, int pollutIndex, double wt)
Finds wtd. combination of old and new washoff for a pollutant.
Definition surfqual.c:387
void surfqual_getWashoff(int subcatchIndex, double runoff, double tStep)
Computes new runoff quality for a subcatchment.
Definition surfqual.c:268
void surfqual_initState(int subcatchIndex)
Initializes pollutant buildup, ponded mass, and washoff.
Definition surfqual.c:89
void surfqual_applyAPIBuildup(int subcatchIndex)
Applies the buildup of a pollutant over a subcatchment for a given time step.
Definition surfqual.c:161
void treatmnt_close(void)
Frees memory used for computing pollutant removals by treatment.
Definition treatmnt.c:88
void treatmnt_treat(int nodeIndex, double q, double v, double tStep)
Updates pollutant concentrations at a node after treatment.
Definition treatmnt.c:196
void treatmnt_delete(int nodeIndex)
Deletes the treatment objects for each pollutant at a node.
Definition treatmnt.c:158
int treatmnt_open(void)
Allocates memory for computing pollutant removals by treatment.
Definition treatmnt.c:68
int treatmnt_readExpression(char *tok[], int ntoks)
Reads a treatment expression from a tokenized line of input.
Definition treatmnt.c:100
void treatmnt_setInflow(double qIn, double wIn[])
Computes and saves array of inflow concentrations to a node.
Definition treatmnt.c:180
void getElapsedTime(DateTime aDate, int *days, int *hrs, int *mins)
Finds elapsed simulation time for a given calendar date.
size_t sstrcat(char *dest, const char *src, size_t destsize)
Safe string concatenation.
int findmatch(char *s, char *keyword[])
Finds match between string and array of keyword strings.
Definition input.c:791
int getDouble(char *s, double *y)
Converts a string to a double precision floating point number.
Definition input.c:857
double UCF(int quantity)
Computes a conversion factor from SWMM's internal units to user's units.
char * getTempFileName(char *fname)
Creates a temporary file name with path prepended to it.
size_t sstrncpy(char *dest, const char *src, size_t n)
Copies a string to a new memory location in a safe way.
int getInt(char *s, int *y)
Converts a string to an int value.
Definition input.c:829
int match(char *str, char *substr)
Sees if a sub-string of characters appears in a string (not case sensitive). (not case sensitive).
Definition input.c:805
DateTime getDateTime(double elapsedMsec)
Finds calendar date/time value for elapsed milliseconds of simulation time.
int getFloat(char *s, float *y)
Converts a string to a float value.
Definition input.c:846
int strcomp(const char *s1, const char *s2)
Compares two strings (case insensitive).
char * addAbsolutePath(char *fname)
Adds an absolute path name to a file name.
void writecon(const char *s)
Writes string to console.
struct DwfInflow TDwfInflow
Definition objects.h:470
struct ExtInflow TExtInflow
Definition objects.h:458
double * y
Definition odesolve.c:28
Definition objects.h:925
Definition objects.h:378
Definition objects.h:909
Definition objects.h:1091
Definition objects.h:976
Definition objects.h:940
Definition objects.h:890
Definition objects.h:665
Definition objects.h:645
Definition objects.h:106
Definition objects.h:961
Definition objects.h:599