Skip to content
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

Closed
2 of 3 tasks
mjwitte opened this issue May 10, 2022 · 3 comments · Fixed by #9444
Closed
2 of 3 tasks

Parsing for precipitation values fails for some weather stat files #9420

mjwitte opened this issue May 10, 2022 · 3 comments · Fixed by #9444
Assignees
Labels
Defect Includes code to repair a defect in EnergyPlus

Comments

@mjwitte
Copy link
Contributor

mjwitte commented May 10, 2022

Issue overview

User file fails with this cryptic error:

   ************* Beginning Simulation
   ** Severe  ** invalid stoi argument
   ************* EnergyPlus Warmup Error Summary. During Warmup: 0 Warning; 0 Severe Errors.

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 for Average Hourly Statistics for Total Sky Cover and once for liquid precipitation. The stat file for this defect has 4 occurences of "Total".

  1. parseStatLine needs to be more robust to ensure that values are being pulled from the correct block of statistics. The loop that calls parseStatLine needs to be modified to search for " - Monthly Statistics for Liquid Precipitation [mm]" first, then look for "Total" and "Max Hourly".
  2. 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 as UtilityRoutines::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):

  • Platform Windows 10
  • Version of EnergyPlus v22.1
  • Private email and helpdesk ticket number nnnn

Checklist

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Defect file attached: 9420-weather error.zip
  • Ticket added to Pivotal for defect (development team task)
  • Pull request created (the pull request will have additional tasks related to reviewing changes that fix this defect)
@jmarrec jmarrec self-assigned this May 16, 2022
@jmarrec jmarrec added the Defect Includes code to repair a defect in EnergyPlus label May 16, 2022
@lklawrie
Copy link

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

@jmarrec
Copy link
Contributor

jmarrec commented May 17, 2022

@lklawrie completely understandable :).

I'll fix it on this side. I would suggest making some unit tests on your side to ensure this doesn't creep up again if you make change to your code generation though (or run the ones I added in 243ba2e with some of your files or something)

@chriswmackey
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Includes code to repair a defect in EnergyPlus
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants