plusFORT Version 8 has been released

plusFORT Version 8 - Gets rid of ALL GOTOs

Version 8 is our biggest ever update, and it’s now free for personal, educational and academic users working on non-commercial projects. Just head to this page and enter your details to receive a free licence. Commercial users can go here to download a fully functional free trial version. Existing users with current maintenance can get their update here.

With the release of version 8, we are planning our first price increase for commercial licences in almost a decade. The bad news is that it will be quite a big increase, but the good news is that it will not take effect until January 6th 2024. This provides an opportunity for commercial and government agency users to buy the new version at old prices. You may also buy maintenance (for multiple years in advance if required). To take advantage, please be sure to send your PO, or visit our online shop, and complete your purchase before the end of the year.

Version 8 Changes

  • SPAG uses structure templates to unscramble spaghetti code. In earlier versions, there were three major templates:-
  • Block IF statements
  • DO loops with EXIT and CYCLE
  • Single statement code replication

Version 8 adds two new templates which allow it to remove all GOTOs in even the most convoluted code. These are:

  • Dispatch loops. SPAG identifies separately addressable code blocks (block 1, block 2 etc.), and relocates them into a SELECT CASE construct for execution in the correct sequence, under control of a dispatch loop.
  • Internal Subroutines. SPAG identifies separately addressable code blocks, and relocates them into internal
    subroutines. Blocks are invoked in the correct order using CALL statements, and the calls may be recursive.

These two new templates provide alternative ways to express the same control flow. SPAG allows you to select either one, but the default is to use internal subroutines in simpler cases, where there is no recursion, and dispatch loops otherwise. In practice, internal subroutines are a natural way to express many simple cases, for example where a code fragment is used to tidy up before exiting a subprogram. Conversely, dispatch loops keep a strict cap on the complexity of more complex codes.

Examples may be found in section 2.7.1 of the plusFORT manual.

  • Version 8 benefits from a major internal upgrade which removes a long-standing limitation to SPAG’s symbolic analysis, allowing it to “look ahead”, and reliably identify the characteristics of subprograms with and without explicit interfaces. This change has knock-on effects throughout SPAG and GXCHK, for example in improved reporting and error detection. It also enables new functionality both in this release and in the future.
  • SPAG’s prescan, which allows it re-order input files so that MODULES are processed before code that uses them without the use of makefiles or external props, has been extended and improved.
  • SPAG now uses the standard ISO_FORTRAN_ENV module to allow it to translate legacy non-standard types, such as INTEGER1 and REAL8, to standard Fortran. This supersedes and improves upon the previous treatment using the proprietary F77KINDS module.
  • By default, SPAG now inserts a PROGRAM statement at the beginning of code with no subprogram statement, and adds an invented name to un-named BLOCK DATA subprograms.
  • SPAG switches to “module-maker” mode when an INCLUDE file (no subprogram or END statement) is encountered.
  • Numerous bug fixes.
  • Manual updated to revision P.
11 Likes

plusFORT looks like a very interesting suite of tools. I’ve been looking at the static analysis tool GXCHK as something that I could use in my work. Does plusFORT support Intel extensions to the language, and, if so, are the supported extensions documented somewhere? As a specific example, can plusFORT be used in a way that treats e.g. “a = b + -5 * b” as valid Intel-extended Fortran, or would that be flagged as invalid since normally two consecutive operators cannot appear together?

Am I right in thinking that plusFORT supports Fortran 2003 plus selected items from more recent standards?

The Intel compiler has a long history and supports various vendor extensions reflecting that history, including from VAX and Microsoft Fortran. plusFORT supports those extensions, but excepting any which conflict with more recent Fortran standards. I’m afraid there is no definitive list, but you can download an evaluation version and check it out. The current version, released about a week ago, is 8.04.

plusFORT supports Fortran standards up to F2003, and, as you say, some extra bits and pieces from F2008. Your sample expression with “a = b + -5 * b” is fine.

Thank you. That sounds very promising. I’ll see what I have to do on my company’s side of things to get the evaluation version approved for testing.

Do you typically get feature requests from people who have purchased a license? If, say, my sample expression wasn’t supported, would it have been an easy thing to add to a future release? If that’s a vague question, I can be more specific after I try plusFORT out.

Thanks - we welcome feature requests, and will do our best to accommodate them if we think they are of general applicability.

1 Like

You’re welcome. That sounds good. I’ll see what I come up with.