Dimensional Generator

Ron Davis, Different.Software.

Dimensional analysis is important in scientific and engineering programming for two main reasons:

  1. It can detect a large class of errors.
  2. It determines conversion factors among units.

With Dimensional Generator, these functions are automatic.

  • No major changes to your program.

    You only

    • Change your type statements to specify the units.  E.g.
      Real:: Length
      might become
      Type (Centimetre):: Length.

    • Remove conversion factors.  (Good riddance!)

    • Add a file, prepared by Dimensional Generator from brief instructions, to your source files.

    • Add a line in each program unit to Use the module in that file.


  • No sacrifice of speed or memory usage.

    All the dimensional analysis is done by your compiler.  Your executable code is unaffected, except that a large class of errors becomes impossible.

  • No cost.

    • Any program you develop using the output from Dimensional Generator is entirely your property, even if it is for profit.

    • Any program that includes any part of Dimensional Generator itself (as distinct from source code that it creates) must be free.

This is for Fortran programmers.  You can program in any dialect of Fortran you like, but your compiler must have modern Fortran capability.  Users of stripped-down Fortran compilers that concentrate on modern language features, such as F, will probably have no problem.

You can use the file from Dimensional Generator with any compiler and operating system you choose.  (Dimensional Generator itself runs under Windows, but its output is completely portable.)

The download package (0.97 megabytes) is a Zip file. It contains

Revision History

This program only reads a short ASCII text file and writes another ASCII file.  It does not

If you download this free program, please tell me, or otherwise comment.  (No obligation.)

Here is another example, suggested by Terence Wright.

Back to Different.Software