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

Fortran refactoring in VS2008/2010 ?

David_Hittner
Beginner
417 Views
Is there any refactoringcapability or toolsfor the Visual Studio 2008/2010 environment and the Intel Fortran compiler, similar to the Eclipse/Photran refactoring environment? Sadly, Photran appears toonly refactor free-form code, and doesn't work with the Intel Fortran Compiler for Windows, and of course, it barfs onour STRUCTURE/RECORD syntax..

I'm specifically looking to:
1)refactor Digital/Compaq/HP-extension fixed-form source to free-form source (change comment inducer to '!',update line continuation style, etc.)
2) refactor implicit variable declaration to explicit variable declaration and add 'implicit none'
3) refactor variable names across projects (for example,an INCLUDEd variable used by many projects)
4) refactor global variables by encapsulation into struct/recordor TYPEdstructures to remove them from the global namespace(example integer a,b; a= 5; b=10=> type dual_int; integer a,b; end type; type(dual_int) c; c%a = 5; c%b = 10)
5) refactor deprecated syntax (equivalence, goto 10,20,30 x, etc..)

This would be a great aid to porting older Fortran IV, Fortran-66, and Fortran-77 code up to Fortran-90/95 and beyond.
0 Kudos
5 Replies
TimP
Honored Contributor III
417 Views
There are several popular open source fixed to free form translators. If you're tied to some non-standard format or syntax, you'd probably need to adapt one of those yourself. I don't think anyone was successful trying to make a business out of more ambitious specifications.
0 Kudos
bmchenry
New Contributor II
417 Views
in addition to the freebies out there, you might also check out
http://www.cobalt-blue.com/
i used it many years ago to clean up old spagetti code.
It also cleans up f90, etc code
0 Kudos
rase
New Contributor I
417 Views
Another package for reformatting and converting old Fortran code is "PlusFort with Spag" from
www. polyhedron.co.uk (not freeware).
0 Kudos
TimP
Honored Contributor III
417 Views
Yes, PlusFort has a good reputation among the commercial alternatives in this arena. I tried Cobalt Blue in its early days (don't know if it's improved since then).
0 Kudos
bmchenry
New Contributor II
417 Views
oops! i had forgot about plusfort. used that also and more recently. highly recommended.
0 Kudos
Reply