Silverfrost Forums

Welcome to our forums

Fortran 77 compatibility?

19 May 2009 9:15 #4627

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?

20 May 2009 6:49 #4629

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?

20 May 2009 10:22 #4631

Yeah, that makes sense. Thanks for the info.

21 May 2009 4:38 #4638

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]

Please login to reply.