- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In Fortran 2018 do variables in implied-do loop can have local scope like forall/do concurrent in Fortran 2008, if I understand correctly.
With ifx (IFORT) 2021.1 Beta 20200827, snippet below doesn't give syntax error, but it doesn't working correctly. The variable x behaves like (implicitly) REAL variable. And if I add implicit none, then compiler gives error.
HO
snippet
print *, (x, integer(8)::x=1, 10)
end
error message
loop.f90(6): error #6404: This name does not have a type, and must have an explicit type. [X]
print *, (x, integer(8)::x=1, 10)
-----------^
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This snippet is not valid Fortran 2018. I understand the confusion because an I/O Implied DO looks a lot like an array constructor or DATA implied DO, but they are treated very differently in the language.
The syntax rule for an I/O implied DO does not permit you to specify the type of the do-variable, which is NOT statement scope nor construct scope (what you call local scope). Any typing is done in the declaration section of the procedure (or BLOCK). Nothing changed here in F2018.
R1220 io-implied-do-control is do-variable = scalar-int-expr , scalar-int-expr [ , scalar-int-expr ]
There is a bug, and that's that ifort is not rejecting the integer(8):: in this context. Please file a bug report with the Intel Online Service Center.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Haruhiko,
This is a Fortran query and there is a dedicated forum for Fortran compiler(https://community.intel.com/t5/Intel-Fortran-Compiler/bd-p/fortran-compiler). We are transferring your query to that forum.
Regards
Prasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not sure that all of 2018 is currently implemented, when I last check it was not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@HO ,
Try IFORT driver with your oneAPI BETA installation instead of IFX.
IFX is still under development it appears with features from current Fortran standard (2018).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With oneAPI HPCKit beta09 that was released yesterday, F2018 is fully implemented when using the ifort driver. That compiler has a new official name, Intel® Fortran Compiler Classic (BETA), too.
The compiler invoked with ifx, Intel® Fortran Compiler (BETA), has limited features at this time. See the Known Issues section for ifx in the Release Notes.
Remember these are beta releases.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This snippet is not valid Fortran 2018. I understand the confusion because an I/O Implied DO looks a lot like an array constructor or DATA implied DO, but they are treated very differently in the language.
The syntax rule for an I/O implied DO does not permit you to specify the type of the do-variable, which is NOT statement scope nor construct scope (what you call local scope). Any typing is done in the declaration section of the procedure (or BLOCK). Nothing changed here in F2018.
R1220 io-implied-do-control is do-variable = scalar-int-expr , scalar-int-expr [ , scalar-int-expr ]
There is a bug, and that's that ifort is not rejecting the integer(8):: in this context. Please file a bug report with the Intel Online Service Center.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Steve and others.
I should have read MFE more carefully. In section 23.8 it is noted "this feature is not available for an implied-do in an input/output list".
I tried array constructor but I showed I/O implied-do loop snippet because it was more confusing. In the case of array constructor, the syntax error message looked to me this feature is not yet implemented.
loop.f90(5): error #6404: This name does not have a type, and must have an explicit type. [I]
m = [(i, integer(8):: i = 1, 10)]
----------------------^
I apologize for posting on an inappropriate board.
HO
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bug ID CMPLRLLVM-23026
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Since we're talking Fortran and oneAPI, there is a new Fortran Developer Guide published with oneAPI beta09.

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