Fix GitHub Copilot identified issues in rc-5.0.1 cross-merge - #3433
Open
andrew-platt wants to merge 3 commits into
Open
Fix GitHub Copilot identified issues in rc-5.0.1 cross-merge#3433andrew-platt wants to merge 3 commits into
andrew-platt wants to merge 3 commits into
Conversation
1 task
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses three code-quality issues found during an rc-5.0.1 → dev cross-merge, focusing on safer edge-case handling and clearer runtime diagnostics.
Changes:
- Prevents an out-of-bounds access in AeroAcoustics blade-span percentage checks when
NumBlNds == 1. - Improves InflowWind fatal error messaging when cubic velocity interpolation and/or acceleration output requires a valid acceleration field.
- Adds
iostatchecking while reading OLAF grid point list files to fail gracefully on malformed/truncated input.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| modules/inflowwind/src/IfW_FlowField.f90 | Expands validation/error paths for cases where cubic time interpolation requires a valid acceleration field. |
| modules/aerodyn/src/FVW_IO.f90 | Adds iostat handling to prevent uncontrolled crashes when reading grid point list files. |
| modules/aerodyn/src/AeroAcoustics.f90 | Guards last-element percentage calculation for single-node blades to avoid invalid indexing. |
Suppressed comments (1)
modules/inflowwind/src/IfW_FlowField.f90:92
- The cubic-interpolation fatal message repeats “accel field” after stating “acceleration field”, which is inconsistent and slightly harder to read. Using consistent wording would improve clarity.
else ! FF%VelInterpCubic
call SetErrStat(ErrID_Fatal, "Cubic velocity interpolation requires a valid acceleration field, but accel field is not valid", &
ErrStat, ErrMsg, RoutineName)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Fix three code quality issues identified by GitHub Copilot in PR OpenFAST#3432: 1. AeroAcoustics.f90: Prevent out-of-bounds array access - Add guard for single-node case (NumBlNds==1) - Calculate LastElemPct safely without accessing NumBlNds-1 index - When NumBlNds==1, treat element as spanning entire blade (100%) 2. IfW_FlowField.f90: Improve error messaging for cubic interpolation - Clarify why acceleration field is required for cubic velocity interpolation - Provide context-specific error messages for three scenarios: * Both acceleration output and cubic interpolation enabled * Only acceleration output requested * Only cubic velocity interpolation enabled 3. FVW_IO.f90: Add I/O error handling in ResolveGridAxis - Add iostat check to grid point list file read loop - Return controlled error with line number and filename on read failure - Prevent unhandled runtime crashes from malformed/truncated files Co-authored-by: GitHub Copilot <noreply@github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Fix three code quality issues identified by GitHub Copilot in PR OpenFAST#3432: 1. AeroAcoustics.f90: Prevent out-of-bounds array access - Add guard for single-node case (NumBlNds==1) - Calculate LastElemPct safely without accessing NumBlNds-1 index - When NumBlNds==1, treat element as spanning entire blade (100%) 2. IfW_FlowField.f90: Improve error messaging for cubic interpolation - Clarify why acceleration field is required for cubic velocity interpolation - Provide context-specific error messages for three scenarios: * Both acceleration output and cubic interpolation enabled * Only acceleration output requested * Only cubic velocity interpolation enabled 3. FVW_IO.f90: Add I/O error handling in ResolveGridAxis - Add iostat check to grid point list file read loop - Return controlled error with line number and filename on read failure - Prevent unhandled runtime crashes from malformed/truncated files Co-authored-by: GitHub Copilot <noreply@github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Address two wording improvements suggested by Copilot in PR OpenFAST#3433: 1. IfW_FlowField.f90: Use consistent terminology - Changed 'accel field' to 'the acceleration field' in all three error messages for consistency within the same conditional block 2. FVW_IO.f90: Improve read error diagnostics - Changed 'line j' to 'grid point #j' (j is entry index, not line) - Added iostat code to error message for better troubleshooting - List-directed READ can consume multiple values per line, so reporting it as a line number was misleading Co-authored-by: GitHub Copilot <noreply@github.com>
andrew-platt
force-pushed
the
b/MiscBugsFromCrossMerge
branch
from
August 17, 2026 20:51
cdbf154 to
fb960d8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ready to merge
Feature or improvement description
Fix three code quality issues identified by GitHub Copilot in PR #3432:
AeroAcoustics.f90: Prevent out-of-bounds array access
IfW_FlowField.f90: Improve error messaging for cubic interpolation
FVW_IO.f90: Add I/O error handling in ResolveGridAxis
Additional supporting information
These issues were found during review of a cross-merge from
rc-5.0.1todevwith PR #3482Generative AI usage
Co-authored-by: GitHub Copilot noreply@github.com
Co-authored-by: Claude Sonnet 4.5 noreply@anthropic.com
Test results, if applicable
No results affected