Skip to content

Commit

Permalink
Merge pull request #99 from USEPA/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
michaeltryby authored Dec 2, 2022
2 parents 9a845db + 63ffa9a commit 0eb322c
Show file tree
Hide file tree
Showing 17 changed files with 171 additions and 154 deletions.
52 changes: 17 additions & 35 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,57 +10,39 @@ env:
OMP_NUM_THREADS: 1
BUILD_HOME: build
TEST_HOME: nrtests
PACKAGE_NAME: vcpkg-export-20220826-200052.1.0.0
PKG_NAME: vcpkg-export-20220826-200052

jobs:
unit_test:
name: Build and unit test
runs-on: windows-2019
environment: testing
defaults:
run:
shell: cmd
working-directory: ci-tools/windows

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Checkout submodule
uses: actions/checkout@v2
with:
repository: michaeltryby/ci-tools
path: ci-tools

- name: Add tar.exe
if: ${{ runner.os == 'Windows' }}
shell: pwsh
- name: Install boost-test
env:
REMOTE_STORE: "https://nuget.pkg.github.com/michaeltryby/index.json"
USERNAME: michaeltryby
run: |
"C:\Program Files\Git\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
nuget sources add -Name github -Source ${{ env.REMOTE_STORE }} -Username ${{ env.USERNAME }} -Password ${{ secrets.ACCESS_TOKEN }}
nuget install ${{env.PKG_NAME}} -Source github
- name: Cache boost
id: cache-boost
uses: actions/cache@v2
env:
cache_paths: |
C:/ProgramData/chocolatey/lib/boost-*
C:/local/boost_*
pkg_file_hash: ${{ hashFiles('**/windows/packages.config') }}
with:
path: ${{ env.cache_paths }}
key: ${{ runner.os }}-cache-boost-${{ env.pkg_file_hash }}
restore-keys: |
${{ runner.os }}-cache-boost-
${{ runner.os }}-cache-
${{ runner.os }}-
- name: Install boost
if: steps.cache-boost.outputs.cache-hit != 'true'
- name: Build
env:
pkg_cmnd: choco install -y packages.config
run: ${{ env.pkg_cmnd }}
TOOL_CHAIN_PATH: \scripts\buildsystems\vcpkg.cmake
run: |
cmake -B.\build -DBUILD_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=.\${{env.PACKAGE_NAME}}${{env.TOOL_CHAIN_PATH}} .
cmake --build .\build --config DEBUG
- name: Build and unit test
run: make.cmd /t /g "Visual Studio 16 2019"
- name: Unit Test
run: ctest --test-dir .\build -C Debug --output-on-failure


reg_test:
Expand Down Expand Up @@ -98,7 +80,7 @@ jobs:
- name: Before reg test
env:
NRTESTS_URL: https://github.com/USEPA/swmm-nrtestsuite
BENCHMARK_TAG: v2.1.0
BENCHMARK_TAG: v2.2.0
run: before-nrtest.cmd ${{ env.BENCHMARK_TAG }}

- name: Run reg test
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif()


project(swmm-solver
VERSION 5.2.1
VERSION 5.2.2
LANGUAGES C CXX
)

Expand Down
4 changes: 2 additions & 2 deletions Readme.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
CONTENTS OF SWMM520_ENGINE.ZIP
CONTENTS OF SWMM522_ENGINE.ZIP
==============================

The 'src' folder of this archive contains the C source code for
version 5.2.0 of the Storm Water Management Model's computational
version 5.2.2 of the Storm Water Management Model's computational
engine. Consult the included 'Roadmap.txt' file for an overview of
the various code modules. The code can be compiled into both a shared
object library and a command line executable. Under Windows, the
Expand Down
22 changes: 6 additions & 16 deletions extern/boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# CMakeLists.txt - CMake configuration file for swmm-solver/extern
#
# Created: March 16, 2020
# Updated: May 21, 2020
# Updated: Oct 19, 2022
#
# Author: Michael E. Tryby
# US EPA - ORD/CESER
Expand All @@ -17,22 +17,12 @@ else()
endif()


# Environment variable "BOOST_ROOT_X_XX_X" points to local install location
if(DEFINED ENV{BOOST_ROOT_1_74_0})
set(BOOST_ROOT $ENV{BOOST_ROOT_1_74_0})

elseif(DEFINED ENV{BOOST_ROOT_1_72_0})
set(BOOST_ROOT $ENV{BOOST_ROOT_1_72_0})

elseif(DEFINED ENV{BOOST_ROOT_1_67_0})
set(BOOST_ROOT $ENV{BOOST_ROOT_1_67_0})

endif()


find_package(Boost 1.67.0
find_package(
Boost
COMPONENTS
unit_test_framework
)

include_directories (${Boost_INCLUDE_DIRS})
include_directories(
${Boost_INCLUDE_DIRS}
)
4 changes: 2 additions & 2 deletions src/solver/consts.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//
// Project: EPA SWMM5
// Version: 5.2
// Date: 06/01/22 (Build 5.2.1)
// Date: 10/18/22 (Build 5.2.2)
// Author: L. Rossman
//
// Various Constants
Expand All @@ -16,7 +16,7 @@
// General Constants
//------------------

#define VERSION 52001
#define VERSION 52002
#define MAGICNUMBER 516114522
#define EOFMARK 0x1A // Use 0x04 for UNIX systems
#define MAXTITLE 3 // Max. # title lines
Expand Down
34 changes: 21 additions & 13 deletions src/solver/inlet.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//
// Project: EPA SWMM5
// Version: 5.2
// Date: 06/01/22 (Build 5.2.1)
// Date: 10/08/22 (Build 5.2.2)
// Author: L. Rossman
//
// Street/Channel Inlet Functions
Expand All @@ -16,6 +16,8 @@
//
// Build 5.2.1:
// - Substitutes the constant BIG for HUGE.
// Build 5.2.2:
// - Additional statistics added to Street Flow Summary table.
//-----------------------------------------------------------------------------
#define _CRT_SECURE_NO_DEPRECATE

Expand Down Expand Up @@ -1030,17 +1032,18 @@ void writeStreetStatsHeader()
report_writeLine("*******************");
report_writeLine("");
fprintf(Frpt.file,
"\n ----------------------------------------------------------------------------------------------------------------------"
"\n Peak Maximum Maximum Peak Flow Average Bypass BackFlow"
"\n Flow Spread Depth Inlet Inlet Capture Capture Frequency Frequency");
"\n ---------------------------------------------------------------------------------------------------------------------------------------"
"\n Peak Avg. Bypass Back Peak Peak"
"\n Peak Maximum Maximum Flow Flow Flow Flow Capture Bypass"
"\n Flow Spread Depth Inlet Inlet Inlet Capture Capture Freq Freq / Inlet Flow");
if (UnitSystem == US) fprintf(Frpt.file,
"\n Street Conduit %3s ft ft Design Location %% %% %% %%",
FlowUnitWords[FlowUnits]);
"\n Street Conduit %3s ft ft Design Location Count Pcnt Pcnt Pcnt Pcnt %3s %3s",
FlowUnitWords[FlowUnits], FlowUnitWords[FlowUnits], FlowUnitWords[FlowUnits]);
else fprintf(Frpt.file,
"\n Street Conduit %3s m m Design Location %% %% %% %%",
FlowUnitWords[FlowUnits]);
"\n Street Conduit %3s m m Design Location Pcnt Pcnt Pcnt Pcnt %3s %3s",
FlowUnitWords[FlowUnits], FlowUnitWords[FlowUnits], FlowUnitWords[FlowUnits]);
fprintf(Frpt.file,
"\n ----------------------------------------------------------------------------------------------------------------------");
"\n ---------------------------------------------------------------------------------------------------------------------------------------");
}

//=============================================================================
Expand Down Expand Up @@ -1095,19 +1098,24 @@ void writeStreetStats(int link)
fprintf(Frpt.file, " ON-GRADE");
else
fprintf(Frpt.file, " ON-SAG ");
fprintf(Frpt.file, " %5d", inlet->numInlets);
fp = inlet->stats.flowPeriods / 100.0;
if (fp > 0.0)
{
cp = inlet->stats.capturePeriods / 100.0;
fprintf(Frpt.file, " %9.2f", inlet->stats.peakFlowCapture);
fprintf(Frpt.file, " %7.2f", inlet->stats.peakFlowCapture);
if (cp > 0.0)
{
afc = inlet->stats.avgFlowCapture / cp;
bpf = inlet->stats.bypassFreq / cp;
}
fprintf(Frpt.file, " %9.2f", afc);
fprintf(Frpt.file, " %9.2f", bpf);
fprintf(Frpt.file, " %9.2f", inlet->stats.backflowPeriods / fp);
fprintf(Frpt.file, " %7.2f", afc);
fprintf(Frpt.file, " %7.2f", bpf);
fprintf(Frpt.file, " %7.2f", inlet->stats.backflowPeriods / fp);
fprintf(Frpt.file, " %7.2f", (maxFlow / Street[t].sides) * UCF(FLOW) *
0.01 * inlet->stats.peakFlowCapture / inlet->numInlets);
fprintf(Frpt.file, " %7.2f", maxFlow * UCF(FLOW) * 0.01 *
(100.0 - inlet->stats.peakFlowCapture));
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/solver/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//
// Project: EPA SWMM5
// Version: 5.2
// Date: 06/01/22 (Build 5.2.1)
// Date: 10/29/22 (Build 5.2.2)
// Author: L. Rossman
// M. Tryby (EPA)
//
Expand Down Expand Up @@ -44,6 +44,8 @@
// - Support added for variable speed pumps.
// Build 5.2.1
// - Warning no longer issued when conduit elevation drop < MIN_DELTA_Z.
// Build 5.2.2:
// - Warning for conduit elevation drop < MIN_DELTA_Z restored.
//-----------------------------------------------------------------------------
#define _CRT_SECURE_NO_DEPRECATE

Expand Down Expand Up @@ -1264,9 +1266,7 @@ double conduit_getSlope(int j)
delta = fabs(elev1 - elev2);
if ( delta < MIN_DELTA_Z )
{
/* Deprecated as of v.5.2.1
report_writeWarningMsg(WARN04, Link[j].ID);
*/
delta = MIN_DELTA_Z;
}

Expand Down
Loading

0 comments on commit 0eb322c

Please sign in to comment.