[Lazarus] Converting Fortran to FPC?

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Thu Oct 7 12:19:46 CEST 2010


Bo Berglund wrote:
> On Thu, 07 Oct 2010 09:04:04 +0000, Mark Morgan Lloyd
> <markMLl.lazarus at telemetry.co.uk> wrote:
> 
>> A few seconds Googling comes up with 
>> http://community.freepascal.org:10000/bboards/message?message_id=145352&forum_id=24105 
>> which points at a Windows-based converter, still '77 though. There's 
>> also apparently a FORTRAN to Ada converter f2a which could be a useful 
>> intermediary, however I can't so far see a URL (and I'm not putting much 
>> time into this since /I/ don't have any FORTRAN to convert :-)
> 
> The URL did not work for me. Firefox shows an "Unable to connect"
> error. On examination of the URL I find the :10000 entry in the
> middle, which looks kind of funny. Is it by any chance a TCP port
> redirect? In tha case I have no chance since only port 80 is open in
> our firewall....

It worked here otherwise I'd not have given you the URL. I've just tried 
a different browser and it still works, our firewall is adequate and 
frequently tested (i.e. I'm /not/ running on an unfiltered line) but I'd 
rather not say much more than that on a public ML.

I've given you a link elsewhere for a Perl conversion script that might 
possibly be some use, but digging around I notice that a very frequently 
cited paper is

A Fortran to Pascal Translator R. A. Freak Softw., Pract. Exper., 
11(7):717-716, 1981.

with the implication that nobody's done much work on that problem since 
the early 80s. I've been looking briefly at GNU Fortran and I notice 
that g77 is superseded by gfortran, and that the latter doesn't appear 
to have a facility to warn about usage that can't be ported to the older 
compiler.

I reckon that you've got to find out to what extent your programs are 
really F77 with a few newer features, because it might be that the bulk 
could be converted using one of the available tools. Alternatively look 
to see to what extent conversion tools can cope with the source that 
you've got, even if you have to modify them. Finally, f2c might help if 
it can handle a more recent dialect than f2a etc., I've not checked.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]




More information about the Lazarus mailing list