Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Fortran90 to C?

sarosh
Beginner
1,686 Views
Hi, I'm interested in converting some code that is written in f90 into C. Is there a converter of any sort located on visual fortran 6.6a? If so, how do I access and use it?
Thanks!
Sarosh
0 Kudos
3 Replies
Steven_L_Intel1
Employee
1,686 Views

No, Visual Fortran does not contain such a converter. I don't know of any Fortran 90 to C converters; there have been some that work, sort of, with Fortran 77, but they also require a special library.

Do you really need to do the conversion? Why not just use the Fortran code as-is?

0 Kudos
sarosh
Beginner
1,686 Views

Hi Steve,

I'm doing research (really code conversion) for a Professor who has assigned me the task of converting f90 to java. At this point in time, I have been unable to located a translator for f90 to java, so the next step was to find two translators, one that does f90 to c, and then c to java.

There are some students at uiuc working on an f90 to java compiler, but it seems a ways off. Anyway, thanks again for the input =)

Sarosh

0 Kudos
invariant-invariant
1,686 Views

Hello Sarosh,

For Linux there is an old public domain software product that converts Fortran 90 to Fortran 77. It's name is VAST fortran, and you download the product from this site:

http://www.sternwarte.uni-erlangen.de/pub/NAPIWOTZKI/VF90_PER.TAR

This program converts Fortran 90 code into very nice Fortran 77 code. Then you could use the F2C converter to convert the Fortran 77 code to C:

ftp://netlib.no/netlib/f2c/

The first of these two steps, converting from Fortran90 to Fortran 77, may improve thesoftware efficiency and readability. The second step may strongly reduce the software readability and also impair the efficiency of the program somewhat.

Bothsites above includes documentation of the tools. However, some manual fixing of the source code may be required before each of the two translation steps is being done.

Best regards from Lars Petter Endresen

(who still thinks that Fortran 77 is the language with the best efficiency and the highest readability for mathematical modeling).

0 Kudos
Reply