Skip to content

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

Open
RBergua wants to merge 3 commits into
OpenFAST:rc-5.0.1from
RBergua:console_print
Open

Fix: print warning/error console messages (Intel Fortran compiler)#3419
RBergua wants to merge 3 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 on lines +58 to +60
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
Comment on lines +57 to +59
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
Comment on lines +61 to +63
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
Comment on lines +61 to +63
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
Comment on lines +58 to +60
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
Comment on lines +75 to +77
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
Comment on lines +61 to 62
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)
Comment on lines +279 to +281
!> 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,
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