g95 and STATIC attributes

25 views
Skip to first unread message

Donald Johnson

unread,
Apr 2, 2012, 6:11:28 AM4/2/12
to gg95
I am trying to move a computational model written in FORTRAN from
Windows to Linux using g95. Most of the files compile without a
problem with the exception for files containing this pattern

REAL, STATIC :: <VARIABLE NAME>


After a lengthy search the only reference is could find to STATIC as a
FORTRAN attribute stated that is was
1) An extension
2) Identical to using the attribute SAVE which makes me wonder why
there would be an extension to add a redundant keyword.

Does anyone know if there is a way to get g95 to accept this syntax or
if it is safe to replace all instances of this pattern with


<TYPE>, SAVE :: <VARIABLE NAME>


Thanks

Tobias Burnus

unread,
Apr 4, 2012, 3:04:01 PM4/4/12
to gg95
I think g95 - like most compilers - do not have a flag to accept
STATIC. I assume STATIC was added before the Fortran standard
specified SAVE. A quick glance at the Fortran 77 standard shows that
SAVE exists since at least Fortran 77 (i.e. around the year 1977).

There is no good reason to use STATIC instead of SAVE. Additionally,
it should be relatively straight forward to change it.

Tobias
Reply all
Reply to author
Forward
0 new messages