- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Folks,
I'm migrating a dusty deck of F77 simulation code from the IBM xlf compiler to ifort 8.1 under Linux and I have the following question:
There are several hundred variables in a half dozen common blocks defined for this simulation, but variables used in the code and not listed in common blocks behave differently between xlf and ifort. In xlf, the values of the non-common variables seem to be still maintained between procedure calls, whereas they are zeroed when using ifort. The code (sadly) depends on the older behavior, so I've been going through and finding which variables need to be added to the common blocks manually. However, is there something I'm missing here? Can I force ifort to support this older method? I've tried using -save, but that doesn't seem to help.
I'm still learning about the quirks of older fortran code, so any advice or assistance would be greatly appreciated!
- Justin
I'm migrating a dusty deck of F77 simulation code from the IBM xlf compiler to ifort 8.1 under Linux and I have the following question:
There are several hundred variables in a half dozen common blocks defined for this simulation, but variables used in the code and not listed in common blocks behave differently between xlf and ifort. In xlf, the values of the non-common variables seem to be still maintained between procedure calls, whereas they are zeroed when using ifort. The code (sadly) depends on the older behavior, so I've been going through and finding which variables need to be added to the common blocks manually. However, is there something I'm missing here? Can I force ifort to support this older method? I've tried using -save, but that doesn't seem to help.
I'm still learning about the quirks of older fortran code, so any advice or assistance would be greatly appreciated!
- Justin
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Rather than moving local variables to COMMON, simply to prevent dynamic allocation, specifying them as SAVE variables should accomplish the original intent. A SAVE with no variables specified applies to all local variables. If -save with a current compiler doesn't have that effect, that would be a reportable bug.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Or compile with -save. But giving the variables you want saved the SAVE attribute is by far the better approach.

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