top_left_banner  SimCon logo

fpt - Tools for Fortran Engineering - What Would You like to do to Your Code?

What would you like to do to your code?

The following facilities are currently supported in WinFPT and fpt. Follow the hyperlinks from the headings for more information. Some of the links will take you directly to the fpt reference manual.

And if you can't find what you want, please contact SimCon and we will try to help.

Error Checking

Most large programs contain errors. Sometimes they result in unexplained crashes. More often the program runs, but the results are slightly inaccurate. Inaccuracies of about 5% are quite common because they are too small to be recognised by the program authors.

Some classes of error are systematic in Fortran programs. These classes, and the fpt facilities to trap them, are described here.

The errors listed below are rarely found by Fortran compiler and linkers. fpt can show that a code is free from them.

Dead Code
Dead Variables
  • Variables used but never assigned - Check across all shared memory
  • Variables assigned but never used
  • Variables declared but never accessed
Mis-matched Arguments
  • Wrong Data Type - find, e.g. integers passed to routines where reals were expected
  • Wrong data size - find, e.g. real(kind=4) objects passed where real(kind=8) objects were expected
  • Wrong intent - find, e.g. variables with INTENT(IN) which are written to
  • Wrong protocol - find, e.g. variables passed by value which should be passed by reference
  • Wrong array bounds - find inconsistencies between the bounds of the arrays passed and expected
  • Missing arguments - detect missing arguments which are not declared to be optional
Mis-aligned Memory
Errors in Expressions
  • Loss of Precision - Detect mixed precision in arithmetic expressions
  • Accidental whole array assignments - Find missing sub-scripts in DO loops - the whole array is assigned
  • Integers rased to negative powers - Find errors like Time_secs=Time_microsec*10**(-6)   (This won't work!)
Errors in Names
Errors in Physical Units and Dimensions

Measurement and Assessment

Code metrics allow you to assess the scale of an engineering task, and the risks and cost of ownership of a software package. They are key to successful project management.

Code Metrics
  • How big is it? - Count the number of lines, statements, comments, blank lines
  • How complex? - Measure the cyclomatic complexity
  • How maintainable? - Assess the meaningfulness and uniqueness of variable names and the level of commentary
Report Generation

Structural Engineering

With fpt, you can systematically clean up codes, enforce declarations, insert IMPLICIT NONE statements and move COMMON blocks to INCLUDE files. The variable name editing facilities make it easy to apply naming conventions. With these tools you can significantly reduce the workload and risk of future maintenance.

Declarations & Names
Control Constructs
Interactive Controller
Correct Errors

Software Migration

fpt converts the control and data structures found in legacy systems to modern Fortran. Many old codes are hugely valuable. With fpt you can keep them and maintain them. Our approach to migration is described here. Also, please see the notes on migration in the reference manual.

VMS Migration
Gould-SEL Migration
Arguments and Sub-programs
Code Formatting

Run-time Testing

The coverage analysis allows you to see how much of a code is actually exercised by your test suite. The trace and record/replay facilities allow you to isolate components of a code for reproducible tests, to compare runs on the new and old systems in migration, and to investigate the conditions which lead to a program crash.

Coverage Analysis
  • Instrumenting Code - to record all sections of the code visited in a test
Trace Data Flow


With fpt you can write and maintain your code using small data access routines to encapsulate data structures, and then expand the routines in-line to achieve efficiency in production builds.

Optimisation for Speed of Execution

Formatting and Pretty-printing

fpt contains a powerful and flexible code formatter and browser. You can switch safely and easily from FORTRAN 77 fixed format to Fortran 90 free format - and back again if you need to test on an old compiler.

Layout Conversion
Pretty Printing
  • Indentation - Indent for control constructs and declarations
  • Spacing - Specify spacing for symbols, numbers, labels and separately for every keyword and operator
  • Upper/lower case - Specify case separately for keywords, operators, symbols, intrinsics
  • Number format - Add leading and trailing zeros, specify data size and kind
  • Renumbering labels - Number labels systematically in ascending order
Code Browsing

Security - Obfuscation

Have you ever needed to send a code to a compiler vendor to analyse a problem, without giving them access to secret material? Have you ever needed to release code to be built by a third party without releasing sensitive information? With fpt, you can do this.

Make Code Unreadable

Copyright ©1995 to 2024 Software Validation Ltd. All rights reserved.