Skip to content

Fix: print warning/error console messages (Intel Fortran compiler) - #3419

Merged
andrew-platt merged 5 commits into
OpenFAST:rc-5.0.1from
RBergua:console_print
Aug 5, 2026
Merged

Fix: print warning/error console messages (Intel Fortran compiler)#3419
andrew-platt merged 5 commits into
OpenFAST:rc-5.0.1from
RBergua:console_print

Conversation

@RBergua

@RBergua RBergua commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Feature or improvement description
On builds compiled with Intel Fortran compiler (e.g., using GitHub Actions), some console messages do not appear. They are never printed, with no indication anything went wrong.

In SysIVF.f90, it was defined:
INTEGER, PARAMETER :: ConRecL = 120 ! The record length for console output.

Note that the same file defines:
INTEGER, PARAMETER :: MaxWrScrLen = 256 ! The maximum number of characters allowed to be written to a line in WrScr

So, before, we could have messages writen to screen (WrScr) of up to 256 characters (allowed length). But only messages up to 120 characters (ConRecL) actually got accepted by the console output write. Anything longer was silently dropped.

Interestingly, this only affected the Intel Fortran compiler, not gfortran. For example, compiling locally with GCC 15.2.0 showed the correct behavior, with all messages printed as expected. This indicates that the Intel Fortran compiler strictly enforces the length limit on WRITE statements, while GCC is more permissive.

Below you can find screenshots illustrating all this using AeroDyn standalone:
GCC 15.2.0 compiler:
image

Intel Fortran compiler (GitHub Actions via deploy.yml)
image

Intel Fortran compiler after the fix:
image

Related issue, if one exists
Fixes #3418

@bjonkman

bjonkman commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This is interesting. It looks like this became a problem in commit 7ab2d0c.

My version of the code has this:
image

image

Setting the value of MaxWrScrLen relative to ConRecL and adding comments might be less prone to issues with mismatches in the future. I would recommend that the other Sys*.f90 file be updated in a similar way.

@RBergua

RBergua commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

As proposed by @bjonkman , I defined MaxWrScrLen in terms of ConRecL so the two limits cannot drift apart if the maximum console-message length changes in the future.

ConRecL defines the total space available for one console output record (180 characters), while MaxWrScrLen defines the maximum text length that WrScr may write to that record (ConRecL - 1). Keeping the relationship explicit guarantees that MaxWrScrLen remains always smaller than ConRecL.

I confirm that the compiled version with these modifications displays the proper messages:
image

@andrew-platt
andrew-platt requested a lite review from Copilot August 4, 2026 20:56
@andrew-platt andrew-platt self-assigned this Aug 4, 2026
@andrew-platt andrew-platt added this to the v5.0.1 milestone Aug 4, 2026

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

This PR aims to ensure warning/error console output is reliably printed across compilers—especially Intel Fortran—by aligning console record-length limits with the maximum line length used by WrScr.

Changes:

  • Increased ConRecL in several Sys*.f90 system modules.
  • Tied MaxWrScrLen to ConRecL (currently MaxWrScrLen = ConRecL-1) to avoid record-length overruns.
  • Minor whitespace/comment formatting cleanup in SysIVF.f90.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
modules/nwtc-library/src/SysMatlabLinuxIntel.f90 Updates console-length parameters for Intel/Linux Matlab system module.
modules/nwtc-library/src/SysMatlabLinuxGnu.f90 Updates console-length parameters for GNU/Linux Matlab system module.
modules/nwtc-library/src/SysIVF.f90 Updates console-length parameters and comment formatting for Intel Visual Fortran (Windows).
modules/nwtc-library/src/SysIVF_Labview.f90 Updates console-length parameters for Intel Visual Fortran (Windows/LabVIEW).
modules/nwtc-library/src/SysGnuLinux.f90 Updates console-length parameters for GNU/Linux system module.
modules/nwtc-library/src/SysFlangLinux.f90 Updates console-length parameters for Flang/Linux system module.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread modules/nwtc-library/src/SysGnuLinux.f90
Comment thread modules/nwtc-library/src/SysFlangLinux.f90
Comment thread modules/nwtc-library/src/SysMatlabLinuxIntel.f90
Comment thread modules/nwtc-library/src/SysMatlabLinuxGnu.f90
Comment thread modules/nwtc-library/src/SysIVF.f90
Comment thread modules/nwtc-library/src/SysIVF_Labview.f90
Comment thread modules/nwtc-library/src/SysMatlabLinuxIntel.f90
Comment thread modules/nwtc-library/src/SysIVF.f90

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

Suppressed comments (7)

modules/nwtc-library/src/SysIVF.f90:60

  • MaxWrScrLen is now derived from ConRecL (ConRecL-1), which reduces the WrScr line-wrap limit from 256 to 179 characters. The PR description suggests the intent is to keep allowing 256-character WrScr lines and instead increase ConRecL so Intel's RECL limit doesn't drop longer writes. Consider keeping MaxWrScrLen at 256 and defining ConRecL relative to it (>= MaxWrScrLen+1, since WriteScr/WrNR add a leading 1X).
   INTEGER, PARAMETER            :: ConRecL     = 180                               ! The record length for console output (maximum number of characters that can be written in WrOver(), must be larger than MaxWrScrLen)
   INTEGER, PUBLIC               :: CU          = 7                                 ! The I/O unit for the console (Can be changed with SetConsoleUnit subroutine)
   INTEGER, PARAMETER            :: MaxWrScrLen = ConRecL-1                         ! The maximum number of characters allowed to be written to a line in WrScr, must be smaller than ConRecL

modules/nwtc-library/src/SysGnuLinux.f90:60

  • This change reduces MaxWrScrLen from 256 to 179 (via ConRecL-1), which will change how WrScr wraps output on GNU/Linux builds even though the PR motivation is Intel-specific. If the goal is to prevent record-length overruns while preserving 256-character WrScr lines, keep MaxWrScrLen at 256 and set ConRecL accordingly (>= MaxWrScrLen+1).
   INTEGER, PARAMETER            :: ConRecL     = 180                               ! The record length for console output (maximum number of characters that can be written in WrOver(), must be larger than MaxWrScrLen)
   INTEGER, PUBLIC               :: CU          = 6                                 ! The I/O unit for the console (Can be changed with SetConsoleUnit subroutine)
   INTEGER, PARAMETER            :: MaxWrScrLen = ConRecL-1                         ! The maximum number of characters allowed to be written to a line in WrScr, must be smaller than ConRecL

modules/nwtc-library/src/SysMatlabLinuxIntel.f90:63

  • MaxWrScrLen is now ConRecL-1, which reduces the WrScr wrap limit from 256 to 179 for the MATLAB/Linux/Intel build. If the intent is to preserve the 256-character WrScr behavior and only raise the console record length to satisfy stricter Intel handling, consider keeping MaxWrScrLen at 256 and defining ConRecL relative to it.
   INTEGER, PARAMETER            :: ConRecL     = 180                               ! The record length for console output (maximum number of characters that can be written in WrOver(), must be larger than MaxWrScrLen)
   INTEGER, PUBLIC               :: CU          = 6                                 ! The I/O unit for the console (Can be changed with SetConsoleUnit subroutine)
   INTEGER, PARAMETER            :: MaxWrScrLen = ConRecL-1                         ! The maximum number of characters allowed to be written to a line in WrScr, must be smaller than ConRecL

modules/nwtc-library/src/SysMatlabLinuxGnu.f90:63

  • MaxWrScrLen is now ConRecL-1, which reduces the WrScr wrap limit from 256 to 179 for the MATLAB/Linux/GNU build. This is a user-visible behavior change unrelated to the Intel RECL issue described in the PR. Consider keeping MaxWrScrLen at 256 and setting ConRecL to at least MaxWrScrLen+1 instead.
   INTEGER, PARAMETER            :: ConRecL     = 180                               ! The record length for console output (maximum number of characters that can be written in WrOver(), must be larger than MaxWrScrLen)
   INTEGER, PUBLIC               :: CU          = 6                                 ! The I/O unit for the console (Can be changed with SetConsoleUnit subroutine)
   INTEGER, PARAMETER            :: MaxWrScrLen = ConRecL-1                         ! The maximum number of characters allowed to be written to a line in WrScr, must be smaller than ConRecL

modules/nwtc-library/src/SysIVF_Labview.f90:77

  • MaxWrScrLen is now ConRecL-1, reducing the WrScr wrap limit from 256 to 179 for the LabVIEW build. If the goal is only to avoid record-length overruns while preserving existing 256-character WrScr behavior, keep MaxWrScrLen at 256 and define ConRecL relative to it (>= MaxWrScrLen+1).
   INTEGER, PARAMETER            :: ConRecL     = 180                               ! The record length for console output (maximum number of characters that can be written in WrOver(), must be larger than MaxWrScrLen)
   INTEGER, PUBLIC               :: CU          = 7                                 ! The I/O unit for the console (Can be changed with SetConsoleUnit subroutine)
   INTEGER, PARAMETER            :: MaxWrScrLen = ConRecL-1                         ! The maximum number of characters allowed to be written to a line in WrScr, must be smaller than ConRecL

modules/nwtc-library/src/SysFlangLinux.f90:59

  • MaxWrScrLen is now ConRecL-1, which reduces the WrScr wrap limit from 256 to 179 and changes user-visible console formatting for Flang builds. If the intent is to preserve the existing 256-character WrScr limit, keep MaxWrScrLen at 256 and set ConRecL to at least MaxWrScrLen+1 (to account for the leading 1X used by WriteScr/WrNR).
    INTEGER, PARAMETER            :: ConRecL     = 180                               ! The record length for console output (maximum number of characters that can be written in WrOver(), must be larger than MaxWrScrLen)
    INTEGER, PUBLIC               :: CU          = 6                                 ! The I/O unit for the console.  Unit 6 causes ADAMS to crash.
    INTEGER, PARAMETER            :: MaxWrScrLen = ConRecL-1                         ! The maximum number of characters allowed to be written to a line in WrScr, must be smaller than ConRecL

modules/nwtc-library/src/SysIVF.f90:280

  • Typo in comment: "sindle" should be "single".
!! values for not-a-number and infinity in sindle and double

andrew-platt and others added 2 commits August 5, 2026 14:06
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@andrew-platt
andrew-platt merged commit 603af2b into OpenFAST:rc-5.0.1 Aug 5, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants