SWMM-Project / swmm-solver

Open Water Analytics Stormwater Management Model repository
Other
1 stars 0 forks source link

Output library unable to read binary output files written by swmm prior to v5.1.10 #8

Open michaeltryby opened 3 years ago

michaeltryby commented 3 years ago

Build v5.1.10 added Potentional ET to list of system-wide variables saved to file. The swmm-output library was introduced in SWMM v5.1.11 and accounts for potential ET properly. However, an off by one type error is caused when using swmm-output library to read binary files written by versions of SWMM prior to v5.1.10.

michaeltryby commented 3 years ago

Versions of SWMM prior to v5.1.10 save 14 system variables to the binary file at each report time, while v5.1.10 and later save 15 variables at each report time. Offsets into the file seem to be computed correctly. The comparison routines found in nrtest-swmm are designed to throw a value error when comparing arrays with unequal numbers of elements.

One potential solution would be to augment the result to make them comparable. A NaN value for SYS_PET could be inserted into the array returned by SMO_getSystemResult() for versions of SWMM less than v5.1.10. The nrtest-swmm comparison routine has an option to always return "true" for NaN value comparisons.

Another potential solution would be to configure the input files in the nrtest suite to not save SYS_PET to the binary output file. Essentially, skipping this value in all tests and all comparisons.