views:

247

answers:

2

In the past I've used Doxygen for C and C++, but now I've been thrown on Fortran project and I would like to get a quick all encompassing look at the architecture.

In the past I've found reverse engineering tools to be useful where no documentation of the architecture exists.

So, is there a tool out there that will reverse engineer Fortran code?

I tried to use Doxygen, but didn't have any luck. I will be working with two different projects - one Fortran 90 and I think is in Fortran 77.

Thanks for any insights and feedback.

+2  A: 

Tools which may help with reverse engineering:
SciTools Understand
Link with some more tools (search "fortran")

Also, maybe some of these unit testing frameworks will be helpful (I haven't used them, so I cannot comment on the pros and cons of any of them):
FUnit
FRUIT
Ftnunit
(these links link to fortranwiki, where you can find a tidbit on every one of them, and from there there are links to their home sites).

ldigas
Well, the SciTools look promising, but currently I am looking for an OpenSource solution. It looks like FUnit has been stale for about 6 months or so, and similar length of time for FRUIT and Ftunit. I guess the search continues, but it is a little surprising that nothing like this exists for FORTRAN given how long it has been around.
JustADude
It's not that nothing exists. It's just that reverse engineering isn't everyday in fortran industry. It's not that common anywhere for that matter. Personally, I've never done it, and I've been using fortran for a long time. You might have some luck asking on comp.lang.fortran
ldigas
+2  A: 

Doxygen 1.6.1 will generate documentation, call graphs, etc. for Fortran source code in free-format (F90) format. You are out of luck for auto-documenting fixed-format (F77) code with doxygen.

All is not lost, however. The conversion from fixed to free format is straightforward and can be automated to a great degree - change comment characters to '!', change continuation characters to '&', and append '&' to lines to be continued. In fact, if the appended continuation character is placed in column 73, it should be ignored by standard F77 compilers (which still only recognize code in columns 1 through 72) but will be recognized by F9x/F2003/F2008 compilers. This allows the same code to be recognized as both in fixed and free format, which lets you gracefully migrate from one format to the other.

Conveniently, there are about a thousand small programs that will do this format adjustment to some degree or another. Realistically, if you're going to be maintaining the code, you might as well move it away from the 1928 spec for Hollerith (IBM) punched cards. :)

arclight