Skip to content

Commit

Permalink
Fix max depth reporting when average is turned on. #188
Browse files Browse the repository at this point in the history
  • Loading branch information
cbuahin committed Sep 12, 2024
1 parent 133f788 commit 7266536
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/solver/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
// - Large file support added.
// Build5.2.1:
// - Corrects the definition of F_OFF for non-Microsoft C/C++ compilers.
// Build5.3.0:
// - Save max of averaged node depths per reporting period when saving node
// results with average turned on. Fix suggested by @MitchHeineman (CDM).
//-----------------------------------------------------------------------------
#define _CRT_SECURE_NO_DEPRECATE

Expand Down Expand Up @@ -928,7 +931,7 @@ void output_saveAvgResults(FILE* file)
// --- update each node's max depth and contribution to system storage
for (i = 0; i < Nobjects[NODE]; i++)
{
stats_updateMaxNodeDepth(i, Node[i].newDepth * UCF(LENGTH));
stats_updateMaxNodeDepth(i, AvgNodeResults[i].xAvg[NODE_DEPTH] * UCF(LENGTH) / Nsteps);
SysResults[SYS_STORAGE] += (REAL4)(Node[i].newVolume * UCF(VOLUME));
}

Expand Down
2 changes: 1 addition & 1 deletion src/solver/swmm5.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ int DLLEXPORT swmm_open(const char* inputFile, const char* reportFile, const cha
// reportFile = name of report file
// outputFile = name of binary output file
// Output: returns error code
// Purpose: opens a SWMM project.
// Purpose: opens a SWMM project.
//
{
// --- to be safe, reset the state of the floating point unit
Expand Down

0 comments on commit 7266536

Please sign in to comment.