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

Marine Wave Energy model fails to read weather file if Location ID is not a number #1994

Open
cpaulgilman opened this issue Jan 22, 2025 · 0 comments
Assignees
Labels

Comments

@cpaulgilman
Copy link
Collaborator

cpaulgilman commented Jan 22, 2025

Describe the bug

When the Location ID in the weather file is not a number, the std::stod() function used to read the value returns an error and stops the file reading process.

See https://sam.nrel.gov/forum/forum-general/4905-wave-resource-simulation.

To Reproduce

Steps to reproduce the behavior:

  1. Download weather file from SAM Forum post.
  2. Create a new Marine Wave case.
  3. On the Wave Resource page click Add/remove weather file folders and add the folder containing the weather file from Step 1.
  4. Note that weather file does not get added to the library.
  5. Open the weather file with a text editor, and edit the Location ID value in Row to a numeric value.
  6. Repeat Step 3 above.
  7. Note weather file is added to library.

In general, I think anytime std::stod() or std::stof() is used, the value returned should be checked and if it is invalid (not a number), a useful error message should be generated. (This is also an issue with the wind file reader.)

Operating System and Version

  • SAM 2024.12.12
  • Windows 11
@mjprilliman mjprilliman self-assigned this Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants