New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing for precipitation values fails for some weather stat files #9420
Comments
Am glad to supply any files to help test this defect but cannot commit to changing some 20,000 files on climate.onebuilding.org at this time. Linda |
It took me a while to figure out why I wasn't getting any summary reports for my simulations with OneBuilding EPW files but this seems to be the reason. I appreciate the suggested workaround, @mjwitte , and I plan to make use of it until the next stable EnergyPlus release. |
#9420 - Parsing for precipitation values fails for some weather stat files (TMYx)
Issue overview
User file fails with this cryptic error:
There are two places where
std::stoi
is used to parse lines from the weather stat file for reporting monthly total and max precipitation.The line being parsed when it fails is this header under
- Wind Frequency (m/s) by Direction {Interval 11.25 deg from displayed deg) [%]
:<=.5 <=2 <=4 <=6 <=8 <=10 <=12 <=14 <=16 <=18 >18 Total
This is a newer block that does not exist in the stat files distributed with EnergyPlus.
The root of the problem is here in
parseStatLine
which assumes that any line containing "Max Hourly" will be for- Monthly Statistics for Liquid Precipitation [mm]
. The stat file for this defect has two lines with "Max Hourly" one for liquid precipitation and one for snow depth.parseStatLine
also assumes that there will be only 2 occurences of "Total" in the entire stat file, once forAverage Hourly Statistics for Total Sky Cover
and once for liquid precipitation. The stat file for this defect has 4 occurences of "Total".parseStatLine
needs to be more robust to ensure that values are being pulled from the correct block of statistics. The loop that callsparseStatLine
needs to be modified to search for " - Monthly Statistics for Liquid Precipitation [mm]" first, then look for "Total" and "Max Hourly".std::stoi
is fragile and needs to be protected to produce a useful error message, or ignore exceptions and move on to the next statistic, or be replaced with a more robust function such asUtilityRoutines::ProcessNumber
.Workaround
Rename the stat file so that EnergyPlus cannot find it. The simulation will complete, but the Weather Statistics File subtable of the Climatic Data Summary table output will be empty.
Details
Some additional details for this issue (if relevant):
Checklist
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
The text was updated successfully, but these errors were encountered: