Fix: print warning/error console messages (Intel Fortran compiler) - #3419
Conversation
|
This is interesting. It looks like this became a problem in commit 7ab2d0c. My version of the code has this: 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. |
|
As proposed by @bjonkman , I defined
I confirm that the compiled version with these modifications displays the proper messages: |
There was a problem hiding this comment.
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
ConRecLin severalSys*.f90system modules. - Tied
MaxWrScrLentoConRecL(currentlyMaxWrScrLen = 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.
There was a problem hiding this comment.
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
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

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 WrScrSo, 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
WRITEstatements, while GCC is more permissive.Below you can find screenshots illustrating all this using AeroDyn standalone:

GCC 15.2.0 compiler:
Intel Fortran compiler (GitHub Actions via

deploy.yml)Intel Fortran compiler after the fix:

Related issue, if one exists
Fixes #3418