Skip to content

bugfix: Replace non-standard fstat with standard Fortran INQUIRE in mkMITAquaRaster.F90 - #1445

Closed
mathomp4 wants to merge 2 commits into
developfrom
bugfix/fixes-for-gcc16
Closed

mathomp4 wants to merge 2 commits into
developfrom
bugfix/fixes-for-gcc16

Conversation

@mathomp4

@mathomp4 mathomp4 commented Jun 4, 2026 •

Copy link
Copy Markdown
Member

GCC 16 tightened enforcement of the fstat intrinsic signature, requiring a 13-element array but the code declared only 12, causing a compile error:

Error: Size of 'values' argument of 'fstat' intrinsic at (1) too small (12/13)

fstat is a non-standard GNU extension. This fix replaces both calls with the standard Fortran 2003 INQUIRE(file=..., size=...) intrinsic, which directly returns the file size without needing an intermediate status array. This is portable across compilers and was already applied in the Flang fixes in #1175.

Additional cleanup:

  • integer(REAL64) → integer(INT64) for filesize and Length — using REAL64 as a kind parameter for an integer variable was technically accidental (both happen to be kind=8 on most platforms); INT64 is semantically correct.
  • STATARRAY(12) declaration removed as it is no longer needed.
  • INT64 added to the iso_fortran_env import.

All my testing shows this is zero-diff but then, the model doesn't run this code. This is part of the makebcs code...

@mathomp4
mathomp4 requested a review from a team as a code owner June 4, 2026 16:01
@mathomp4 mathomp4 added the 0 diff The changes in this pull request have verified to be zero-diff with the target branch. label Jun 4, 2026
@mathomp4 mathomp4 closed this Jun 4, 2026
@mathomp4
mathomp4 deleted the bugfix/fixes-for-gcc16 branch June 4, 2026 20:11
@mathomp4

mathomp4 commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

This is very weird. The CI keeps trying to checkout this branch in MAPL:

Checking out branch bugfix/fixes-for-gcc16 in cmake
Checking out branch bugfix/fixes-for-gcc16 in MAPL

But that branch does not exist. At all.

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

Labels

0 diff The changes in this pull request have verified to be zero-diff with the target branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants