- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I found a strange behavior with the version 2024.2.1 (2021.12.0) version of the IFORT compiler. A Fortran module is getting some fpp errors, while there is no compilation directives in it! The module compiles fine with earlier versions. Based on the identified location of the so called errors, I discovered that the module uses array of integers initialized with hexadecimal values written as something like #AB16D4. The preprocessor says:
HashData.f90(393): #error: unknown fpp directive.
while the corresponding line is the line #2 below.
integer(4) :: k(64) = [ #D76AA478, #E8C7B756, #242070DB, #C1BDCEEE, #F57C0FAF, #4787C62A, #A8304613, #FD469501, &
#698098D8, #8B44F7AF, #FFFF5BB1, #895CD7BE, #6B901122, #FD987193, #A679438E, #49B40821, &
#F61E2562, #C040B340, #265E5A51, #E9B6C7AA, #D62F105D, #02441453, #D8A1E681, #E7D3FBC8, &
#21E1CDE6, #C33707D6, #F4D50D87, #455A14ED, #A9E3E905, #FCEFA3F8, #676F02D9, #8D2A4C8A, &
#FFFA3942, #8771F681, #6D9D6122, #FDE5380C, #A4BEEA44, #4BDECFA9, #F6BB4B60, #BEBFBC70, &
#289B7EC6, #EAA127FA, #D4EF3085, #04881D05, #D9D4D039, #E6DB99E5, #1FA27CF8, #C4AC5665, &
#F4292244, #432AFF97, #AB9423A7, #FC93A039, #655B59C3, #8F0CCC92, #FFEFF47D, #85845DD1, &
#6FA87E4F, #FE2CE6E0, #A3014314, #4E0811A1, #F7537E82, #BD3AF235, #2AD7D2BB, #EB86D391 ]
I found that changing the way the hexadecimal constants are written, for example Z'698098D8' instead of #698098D8, solved the issue. The other strange thing is that Fortran modules generated using the Fortran module wizard contain a lot of hexadecimal constants written this way and thy compile fine.
Any idea? I can provide the source code if needed.
Best regards,
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Additional information.
The problem seems relating to the declaration of the array k() over several lines with continuation marks '&', because if all the declaration is made on a single line, no fpp error is issued.
Best regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Alternate hack to try:
integer(4) :: k(64) = [ #D76AA478, #E8C7B756, #242070DB, #C1BDCEEE, #F57C0FAF, #4787C62A, #A8304613, #FD469501, &
& #698098D8, #8B44F7AF, #FFFF5BB1, #895CD7BE, #6B901122, #FD987193, #A679438E, #49B40821, &
...
(add & to front of each continuation line)
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Somewhere in Metcalf and Eddy I saw recently that the &..........................& is required for some objects, I think it included arrays.
Could be wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi John,
Can you give me more information about "Metcalf and Eddy" you are refering to?
Best regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jim and John,
Thanks for the reply and advices. I never thought that using a pair of & was something authorized by the Fortran compiler.
Anyway this is clearly a bug since this type of declaration was working in previous versions. Anyway I browsed all my source code to change the declaration of hexadecimal constants with # by the standard form Z'**bleep**' which is, unfortunately, a bit less easy to read but works (I did not change the sources codes automatically generated by the Fortran Module Wizard since they comile fine).
Best regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not sure why my original text Z'.....' was replaced by Z'**bleep**'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the main use & & is used when a string is split across lines.
Buf = 'How now brown &
&cow'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Andrew,
I didn't know that there was a need to use a pair of & for a string split across lines.
Best regards,

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page