- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems that OPTIONS /RECURSIVE is supported by the Intel compiler because it appears in its documentation. However, no further detail is given other than its existance. I can't figure out if OPTIONS /RECURSIVE does the same thing as it does on VMS, due to this complete lack of documentation. Also, I'm having a hard time figuring out what compiler option is equivalent to the VMS compiler option /NORECURSIVE (which is the default on VMS). Is it "-save"?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think that you will find your code easier to understand and manage if you use the recursion facilities and rules of Fortran 95/2003, rather than trying to match VMS-Fortran compiler options and the Intel compiler options.
If a routine is designated "recursive", whether by Fortran attribute, compiler directive or compiler switch, it follows that any of its local variables whose values depend on the input variables and affect the output variables cannot be given the SAVE attribute.
At the machine-code level, given that X86/X64 CPUs have few registers, allowing recursion has the consequence that passing subroutine arguments in registers will have to be given up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This option tells the compiler that all routines should be compiled for possible recursive execution. It sets the automatic option.
Whereas on VMS, the description actually has useful details:
Controls whether HP Fortran generates code and allocates data
so that a subroutine or function can be called recursively.
The default is /NORECURSIVE.
Specifying /RECURSIVE does the following:
o Changes the default allocation class for all local variables
from STATIC to AUTOMATIC, except for variables that are
data-initialized, named in a SAVE statement, or declared as
STATIC.
o Permits reference to a routine name from inside the routine.
Subprograms declared with the RECURSIVE keyword are always
recursive (whether you specify or omit the /RECURSIVE qualifier).
Data objects declared as AUTOMATIC always use stack-based storage
(whether you specify or omit the /RECURSIVE or /AUTOMATIC
qualifiers).
Specifying /RECURSIVE sets /AUTOMATIC.
You can also specify this qualifier using the OPTIONS statement.
So I guess I am just hoping these are the same between the two platforms. Since some of the authors of the HP compiler now work on the Linux one, I have a pretty good feeling that the behavior will indeed match.
We don't have "old" HP Fortran manuals to "dig up"; we are actually using a version of the compiler that was released two years ago and this code is actively maintained and changed on a daily basis. I consider the VMS manuals superior to the Intel Linux ones anyway, as my example above illustrates.
I'm surprised you are suggesting that I go through and change 63,000 lines of Fortan to work using automatic variables, rather than just supply a compiler flag on Linux for code that already works fine on VMS. It is always good to try to keep code updated for the latest standard, but in this case I think the risks outweigh the benefits.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As far as we can see from what you have said, the /recursive switch of current compilers should work, among the options available to you. Likewise, RECURSIVE keyword should work, and relieve you from depending on command line options, as both compilers support it in accordance with the standard.
- 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
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page