- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The current Fortran compiler (12.0 Update 2, IA32 and Intel64) accepts the two spellings 'INOUT' and 'IN OUT' as an attribute, but not in an INTENT statement. For example, the following interface declaration, intended to be used with a generic sorting module
[fortran]module MergeModcause the compiler to complain:
Interface
subroutine Merge(QA,NA,QB,NB,QC,NC)
integer, intent(in out) :: NA,NB,NC ! <=== either 'in out' or 'inout' OK
intent(in out) :: QA, QC ! <=== only 'inout' is accepted
intent(in) :: QB
dimension :: QA(NA), QB(NB), QC(NC)
end Subroutine Merge
end Interface
end module MergeMod
[/fortran]
[bash]Intel Visual Fortran Compiler XE for applications running on IA-32, Version 12.0.2.154 Build 20110112
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.
mint.f90(5): error #5082: Syntax error, found IDENTIFIER 'OUT' when expecting one of: )
intent(in out) :: QA, QC ! <=== only 'inout' is accepted
----------------^
compilation aborted for mint.f90 (code 1)[/bash]
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Amusing. I can understand how that happened. I will report it to the developers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>integer,intent(inout)::NA,NB,NC!<===either'inout'or'inout'OK
Did this produce "IN" or "INOUT"?
Wouldn't intent(in,out)be more syntatically correct (FORTRAN standards may have addressed this issue)
Jim Dempsey
Did this produce "IN" or "INOUT"?
Wouldn't intent(in,out)be more syntatically correct (FORTRAN standards may have addressed this issue)
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
According to this reference f2008 specifically calls out this case as one where INOUT and IN OUT must be interchangeable. I noticed that the current version of the compiler corrected some instances where ENDDO wasn't accepted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If it produced 'IN', that would be close to unacceptable and deceptive behavior. By testing the compiler with the following example, we can see that the parsing is done correctly.
[fortran]subroutine Merge(QA,NA,QB,NB,QC,NC) integer, intent(in out) :: NA,NB,NC ! <=== either 'in out' or 'inout' OK intent(inout) :: QA, QC ! <=== only 'inout' is accepted intent(in) :: QB dimension :: QA(NA), QB(NB), QC(NC) NC=NA+NB QC(1:NA)=QA QC(NA+1:NC)=QB return end Subroutine Merge[/fortran]The first executable statement would have produced an error at compile time otherwise.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The standard says that the possible INTENT keywords are IN, OUT and INOUT. But a separate part of the standard (under "source form") lists "IN OUT" as an allowed alternative to INOUT.
This broke between updates 1 and 2 of 12.0 - reported as DPD200166641.
This broke between updates 1 and 2 of 12.0 - reported as DPD200166641.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is fixed in Update 4.

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