License MIT license
Lines 218
Keywords
code generator (1) f2py (1) Fortran (1) fparse (1) numerical computing (8)
Permissions
Owner: Stou S.
Viewable by Everyone
Editable by All Siafoo Users
Hide
Don't get spied on – We respect your privacy and provide numerous options to protect it. Join Siafoo Now or Learn More

Fortran to C translation script Atom Feed 0

In Brief A script that will perform a rough translation of fortran code to C syntax. The idea is to automate a large part of the porting effort from Fortran to C/C++ but without spending too much time worrying about corner cases. Human involvement is required. You might want to check out f2c for something more sophisticated (but which generated uglier code).... more

A script that will perform a rough translation of fortran code to C syntax. The idea is to automate a large part of the porting effort from Fortran to C/C++ but without spending too much time worrying about corner cases. Human involvement is required. You might want to check out f2c for something more sophisticated (but which generated uglier code).

Warning

Do not expect translated code to compile out of the box

You will need to install f2py (or copy fparse into your PYTHONPATH).

Usage is

python f_to_c.py test.f test.cpp

the -p option is used to specify a file that will be prepended to the generated source.