Skip to content

Fix integer(wp) non-standard kind for loop variables in bubble module#1182

Closed
sbryngelson wants to merge 1 commit into
MFlowCode:masterfrom
sbryngelson:fix/bubble-integer-kind
Closed

Fix integer(wp) non-standard kind for loop variables in bubble module#1182
sbryngelson wants to merge 1 commit into
MFlowCode:masterfrom
sbryngelson:fix/bubble-integer-kind

Conversation

@sbryngelson

@sbryngelson sbryngelson commented Feb 21, 2026

Copy link
Copy Markdown
Member

Summary

Severity: HIGH — non-standard integer kind may produce wrong-sized loop variables.

File: src/simulation/m_bubbles_EE.fpp, line 77

Loop variables i, j, k, l are declared as integer(wp) where wp is a real kind parameter (e.g., 8 for double precision). integer(wp) is non-standard Fortran — it uses the real kind selector as an integer kind, which may produce wrong-sized integers on strict compilers.

Before

integer(wp) :: i, j, k, l    ! wp is a real kind, not an integer kind

After

integer :: i, j, k, l        ! default integer

Why this went undetected

Most compilers silently accept integer(8) as a valid 8-byte integer kind, so this happens to work when wp=8. Would fail on compilers where kind 8 is not a valid integer kind.

Test plan

  • Build with strict compiler flags (-std=f2018)
  • Run Euler-Euler bubble test case

🤖 Generated with Claude Code

wp is a real kind parameter. integer(wp) is non-standard and may
produce wrong-sized integers on strict compilers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 21, 2026 03:23
@codeant-ai

codeant-ai Bot commented Feb 21, 2026

Copy link
Copy Markdown
Contributor

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Feb 21, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@sbryngelson has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 28 minutes and 48 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codeant-ai codeant-ai Bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Feb 21, 2026
@codeant-ai

codeant-ai Bot commented Feb 21, 2026

Copy link
Copy Markdown
Contributor

Nitpicks 🔍

🔒 No security issues identified
⚡ Recommended areas for review

  • Integer-kind mismatch
    The loop counters were changed to the default integer. Verify all loop bounds and array subscripts (e.g. m, n, p, nb) are also default-kind integers. If any of those are declared with a non-default kind elsewhere, loops may produce implicit conversions or unexpected behaviour on some compilers.

@codeant-ai

codeant-ai Bot commented Feb 21, 2026

Copy link
Copy Markdown
Contributor

CodeAnt AI finished reviewing your PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates loop variable declarations in the Euler–Euler bubbles module to avoid using a non-standard integer kind derived from a real kind parameter (wp), improving portability with strict Fortran compilers.

Changes:

  • Replaced integer(wp) with plain integer for loop indices in s_comp_alpha_from_n.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@sbryngelson

Copy link
Copy Markdown
Member Author

Closing: integer(wp) is valid Fortran — wp as a kind parameter gives a legal integer kind.

@sbryngelson sbryngelson deleted the fix/bubble-integer-kind branch February 21, 2026 03:51
@codecov

codecov Bot commented Feb 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.05%. Comparing base (356b61f) to head (08d1259).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1182   +/-   ##
=======================================
  Coverage   44.05%   44.05%           
=======================================
  Files          70       70           
  Lines       20498    20498           
  Branches     1990     1990           
=======================================
  Hits         9030     9030           
  Misses      10329    10329           
  Partials     1139     1139           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files

Development

Successfully merging this pull request may close these issues.

2 participants