Hi
SPAG, which is part of our plusFORT toolkit does this. In fact, I’ve noticed that it’s over 35 years since the first release of SPAG (the spaghetti unscrambler!), and it’s evolved a lot since then. For example, it also rewrites declarations in modern Fortran, and allows switching from implicit to explicit typing. plusFORT also includes global static and dynamic and coverage analysis, and uses cluster analysis to help define a module structure for refactored code. SPAG accepts all of Fortran 66/77/90 and 95 and, with a few documented exceptions, Fortran 2003.
In addition to the “starter pack” mentioned by Beliavsky, we can offer a full licence FOC on request for projects which involve only open-source code. You can contact us via https://fortran.uk.
John Appleyard