- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
According to http://software.intel.com/en-us/forums/showthread.php?t=66931, I can use
EXTERNAL IARGC
to suppress the warning (#7416) when the code is compiled with the '-std90' switch. Can anyone explain to me why?
Steven
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As Steve Lionel said back then, ifort has been made to recognize IARGC as a non-standard intrinsic. Apparently, this leads to various anomalies when checking standard compliance. EXTERNAL IARGC tells the compiler you don't intend it as an intrinsic. I could read his comment as indicating possibly it should have been defined under USE IFPORT, rather than as something the compiler could recognize without USE IFPORT.
Even more confusing is the conflicting definition of IARGC under USE IFPOSIX.
Even more confusing is the conflicting definition of IARGC under USE IFPOSIX.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tim:
Thanks for your reply. I now have 3 questions:
1. Will IARGC eventually find its way in IFPORT?
2. I looked up IFPOSIX, I don't see another IARGC defined there (my ifort is11.0.083).
3. Are the reasons behind making IARGC a non-standard intrinsic specific to ifort only? Do other fortran compilers regard IARGC anon-standard intrinsic as well?
Steven
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can see with any search engine that the getarg/iargc pair was defined for many compilers prior to the advent of the Fortran get_command_argument. HP, IBM, Sun, .... Then there were others with slight variations in spelling.
g77 treated it as an intrinsic; gfortran moved away from such incompatibility with the standard.
As far as I could tell from my long ago acquaintance with HP Fortran, it wasn't treated as an intrinsic, but was included in libU77 for compatibility with f2c.
I don't see the point in knowing exact details of how various compilers treated IARGC, now that a preferable choice has been available for 8 years or so, so perhaps I haven't answered the question.
g77 treated it as an intrinsic; gfortran moved away from such incompatibility with the standard.
As far as I could tell from my long ago acquaintance with HP Fortran, it wasn't treated as an intrinsic, but was included in libU77 for compatibility with f2c.
I don't see the point in knowing exact details of how various compilers treated IARGC, now that a preferable choice has been available for 8 years or so, so perhaps I haven't answered the question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May I humbly suggest that you drop IARGC and use COMMAND_ARGUMENT_COUNT, as Tim hints in his last sentence?
IARGC, as Tim mentions, varies in usage across compilers. We made it an intrinsic in order to be able to resolve the variations without requiring code changes.
IARGC, as Tim mentions, varies in usage across compilers. We made it an intrinsic in order to be able to resolve the variations without requiring code changes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve:
So, is it safe to say that for portability reasons it is better to replace
IARGC withCOMMAND_ARGUMENT_COUNT, and
GETARG withGET_COMMAND_ARGUMENT
?
I assume these new calls are fine as long as the guy next to me has a compiler that understands the Fortran 2003 standard, right?
Steven
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes - and any compiler worth using implements at least those intrinsics, even if it doesn't have all of F2003 (which ifort doesn't yet.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Steve and Tim. Your replies were very helpful indeed.
Steven

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