Fix: print warning/error console messages (Intel Fortran compiler) - #3419
Fix: print warning/error console messages (Intel Fortran compiler)#3419RBergua wants to merge 3 commits into
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.
| 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 = 256 ! The maximum number of characters allowed to be written to a line in WrScr | ||
| INTEGER, PARAMETER :: MaxWrScrLen = ConRecL-1 ! The maximum number of characters allowed to be written to a line in WrScr, must be smaller than ConRecL |
| 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 = 256 ! The maximum number of characters allowed to be written to a line in WrScr | ||
| INTEGER, PARAMETER :: MaxWrScrLen = ConRecL-1 ! The maximum number of characters allowed to be written to a line in WrScr, must be smaller than ConRecL |
| 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 = 256 ! The maximum number of characters allowed to be written to a line in WrScr | ||
| INTEGER, PARAMETER :: MaxWrScrLen = ConRecL-1 ! The maximum number of characters allowed to be written to a line in WrScr, must be smaller than ConRecL |
| 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 = 256 ! The maximum number of characters allowed to be written to a line in WrScr | ||
| INTEGER, PARAMETER :: MaxWrScrLen = ConRecL-1 ! The maximum number of characters allowed to be written to a line in WrScr, must be smaller than ConRecL |
| 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 = 256 ! The maximum number of characters allowed to be written to a line in WrScr | ||
| INTEGER, PARAMETER :: MaxWrScrLen = ConRecL-1 ! The maximum number of characters allowed to be written to a line in WrScr, must be smaller than ConRecL |
| 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 = 256 ! The maximum number of characters allowed to be written to a line in WrScr | ||
| INTEGER, PARAMETER :: MaxWrScrLen = ConRecL-1 ! The maximum number of characters allowed to be written to a line in WrScr, must be smaller than ConRecL |
| 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) |
| !> This routine sets the values of NaN_D, Inf_D, NaN, Inf (IEEE | ||
| !! values for not-a-number and infinity in sindle and double | ||
| !! precision) This uses standard F03 intrinsic routines, |

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