Stormwater-Management-Model
Stormwater-Management-Model copied to clipboard
Variable not initialized
I am getting this error while debugging the engine:
in the void runoff_execute() method in runoff.c:
// --- see if street sweeping can occur on current date
day = datetime_dayOfYear(currentDate);
if ( SweepStart <= SweepEnd )
{
if ( day >= SweepStart && day <= SweepEnd ) canSweep = TRUE;
}
else if ( day <= SweepEnd || day >= SweepStart ) canSweep = TRUE;
else canSweep = FALSE;
There is a chance that canSweep is not assigned a value. The following code should avoid such issue.
// --- see if street sweeping can occur on current date
day = datetime_dayOfYear(currentDate);
canSweep = FALSE;
if ( SweepStart <= SweepEnd )
{
if ( day >= SweepStart && day <= SweepEnd ) canSweep = TRUE;
}
else if ( day <= SweepEnd || day >= SweepStart ) canSweep = TRUE;
I wonder how many SWMM models use street sweeping?
I used it once: https://ascelibrary.org/doi/10.1061/9780784412947.007 . I don't know if the model is still in use.
Addressed in 5.2.3.