[fpc-pascal] FORTRAN from FreePascal

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Mon Nov 13 15:58:22 CET 2017

On 13/11/17 13:30, brian wrote:
> I need to try to put a user-friendly GUI and some graphical outputonto an old command-line FORTRAN number cruncher, and have beenprovided with around 130 KB of FORTRAN source code. A quick scan ofdocumentation seems to suggest that this is possible using gfortranand the C calling conventions (if someone knows differently, pleasesay so right now!) :)
> My knowledge of FORTRAN-77 is sound, if rather rusty, but I knowalmost nothing about C programming, having been brought up as achemist before I was dragged across to programming (I learned toprogram on Algol-60, BASIC and FORTRAN-IV, yes, that long ago ): ).
> Anyone with any past experience here? It seems I have two choices, totry to call the FORTRAN subroutines from FreePascal or to port theFORTRAN code to Pascal, I'm looking for advice...

If the FORTRAN can be called from C as distinct from being able to call 
C subroutines, then I'd have thought that you'd be able to replace the 
main part of the program (that reads the data cards or whatever) with 
something written in Pascal. That would potentially allow you to put 
together a UI using Lazarus etc.

Granted that various companies have long had translators from FORTRAN to 
ALGOL (particularly in the case of B who I don't think had a native 
compiler) or other languages, but I'd have thought that a full 
translation would be best avoided if possible.

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 fpc-pascal mailing list