knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
US EPA's Stormwater Management Model (SWMM) stores all relevant data in the so called
*.inp file. This plain ASCII coded file contains information about model structure
(e.g., subcatchments) and model options (e.g. flow units, flow routing, simulation
period). The file itself is structured into sections which starts and ends with opening
and closing squared brackets ([
, ]
).
Currently, r length(swmmr:::input_sections)
sections are recognized. These are:
swmmr:::input_sections
read_inp
?swmmr
's inp parser walks through the file and separates the file into section
blocks. A section is recognized if its name is enclosed by squared brackets.
Each section has an own parsing scheme, which especially holds header information
(i.e. colnames). The result of a parsed section is always a tibble
, which
subsequently leads to a list of tibbles
for the entire inp
file.
write_inp
?The benefit of parsing the inp
file into a list of tibbles
becomes clearly
if a new inp
file has to be written to disk: swmmr
's inp writer just walks
through the inp
object and writes each tibble (whitespace separated) into one
file. However, column names of sections are not written to clearly indicate the
origin of file (i.e. swmmr
). If column names are really required, the new
generated inp file can still be opened with SWMM and saved back with the GUI.
After each SWMM simulation run, a report file (*.rpt
) is generated containing
status reports and result summaries.
Currently, r length(swmmr:::report_sections)
report sections are recognized.
These are:
swmmr:::report_sections
read_rpt
?Report files are read in the same manner like inp
files. The output will be
a tibble
for each summary, which results as a list of tibbles
for a single
rpt
file.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.