Fortran to C translation

George Seibel seibel at cgl.ucsf.edu
Thu Aug 10 11:36:19 AEST 1989


In article <108783 at felix.UUCP> art at felix.UUCP (Art Dederick) writes:
>In article <7990 at spool.cs.wisc.edu> g-wardal at rocky.CS.WISC.EDU (John F. Wardale) writes:
>>We need to translate some Fortran programs into C.
>
>It seems this request is becomming more frequent so I will give my
>$.02 on the subject.
>
>On most BSD systems there is a program called "struct" that takes
>Fortran source and converts it to RATFOR source.  I have found this to
>be a good start on converting Fortran to C since RATFOR is like C in
>many ways, at least enough to cut down on the manual manipulations
>that make this conversion possible.

  I've attempted to use struct on several occasions, and was not
very happy with the results.   First of all, the 4BSD version of
struct expects FORTRAN IV (or maybe f66?) as input.  A number of
f77 constructs will choke it.   Struct is very ambitious in its
attempts to untangle spaghetti, and seems to get in over its head
quite frequently.  In other words, the output code was wrong too
often for my taste.   If you have code that is pretty clean and
simple to begin with, it might be ok.

George Seibel, UCSF



More information about the Comp.lang.c mailing list