View previous topic :: View next topic |
Author |
Message |
silverdan
Joined: 14 May 2009 Posts: 29
|
Posted: Tue May 19, 2009 10:15 pm Post subject: Fortran 77 compatibility? |
|
|
I have seen a post or two mentioning that FTN95 has support for Fortran 77. Do I have to set some setting for that to kick in?
The reason I ask is that we are currently using Microsoft Developer PowerStation and have $DECLARE, STRUCTURE, and RECORD statements(and I'm sure many, many more) that are generating errors in FTN95 in Visual Studio.
So, again is there some compiler or build setting that I need to or can set? |
|
Back to top |
|
 |
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Wed May 20, 2009 7:49 am Post subject: |
|
|
Silverdan,
By default, standard conforming Fortran77 is a sub-set of Fortran95. It is written into the Fotran95 standard, to which Silverfrost FTN95 adheres. Thus any standard Fortran77 source code will compile without any alteration using FTN95.
The problem you are seeing is that your source code is NOT written using the Fortran77 standard. The statements that give you trouble are extensions to the standard, specific to the fortran compiler used when they were written.
You may have a lot of work on your hands converting the source code to standard fortran77, unless anyone else has any better ideas? |
|
Back to top |
|
 |
silverdan
Joined: 14 May 2009 Posts: 29
|
Posted: Wed May 20, 2009 11:22 am Post subject: |
|
|
Yeah, that makes sense. Thanks for the info. |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Thu May 21, 2009 5:38 pm Post subject: |
|
|
The $DECLARE metacommand isn't part of Fortran. Looking at a manual for a different version of Microsoft Fortran (5.1 ... and there were at least 2 "Powerstation" versions afterwards) this metacommand causes an error or warning message to be emitted at first use of an undeclared variable (error if IMPLICIT NONE is given, otherwise warning). FTN95 has something similar via the /UNDEF compiler option, so the $DECLARE you can safely delete.
As far as RECORD, STRUCTURE, UNION go, the Fortran Committee in its wisdom did not see fit to carry this established system of creating and using composite data types, and instead, devised a new way (in my view because it looked like a variant on COMMON, and they wanted something that looked like MODULE). There is a general similarity between the old (not in Fortran 77 but widely available) and the new (definitely in the Fortran 90 and 95 standards) methods.
You can get info on how to change your code into Fortran-90 style here:
http://gcc.gnu.org/onlinedocs/gfortran/STRUCTURE-and-RECORD.html
Eddie
[/url] |
|
Back to top |
|
 |
|