dleutnant / swmmr

R Interface for US EPA's SWMM
https://cran.r-project.org/package=swmmr
39 stars 15 forks source link

Function `run_swmm` fails to create "rpt" and "out" files? #115

Open Freestyleyang opened 1 year ago

Freestyleyang commented 1 year ago

Hi there, thank you for developing such a great SWMM auo-calibration package. I am trying to follow the example, but find that "rpt" and "out" files are not created. Could you please help me with the issue? Thank you.

 library(swmmr)
 library(DEoptim)

 inp_file <- system.file("extdata", "Example1.inp", package = "swmmr", mustWork = TRUE)
 tmp_rpt_file <- tempfile(tmpdir = "D:/SWMM_example", fileext = ".rpt")
 tmp_out_file <- tempfile(tmpdir = "D:/SWMM_example", fileext = ".out")

 swmm_files <- run_swmm(inp = inp_file, rpt = tmp_rpt_file,  out = tmp_out_file, 
                        exec = "D:/SWMM/EPA SWMM 5.2.3 (64-bit)/epaswmm5.exe")

When running the code, SWMM will run automatically, and I usually close it after 10-15 seconds so that it can finish running the example. It is expected that the ".rpt" and ".out" files will be created under "D:/SWMM_example". However, some warnings occur as below. It seems that "run_swmm" fails to create the ".rpt" and ".out" files.

01

hsonne commented 10 months ago

Hi @Freestyleyang,

could you please install the swmmr package from the dev branch of this repository:

remotes::install_github("dleutnant/swmmr@dev")

With this version you should get more clear error messages. Also in this version, you can call run_swmm() with debug = TRUE which generates some console outputs that inform about what happens behind the scenes.