SimCon logo

SimCon - Fortran Analysis, Engineering & Migration

  FPT Reference ManualDownloadsLicensingHome

 
 
 
 
 
FPT - Interactive Control of a Fortran Program
 
Fortran Program Control

FPT can add a command-line and command-file interactive environment to a Fortran program.

  • Command files may be set up to initialise the program and to carry out experiments.

  • Variables in COMMON blocks are visible in the interactive environment and can be inspected and changed at run-time.

The system can be used for non-real-time experiments, or for run-time control of a real-time program.

 

The steps in setting up a non-real-time system are:

  1. Set up an FPT specification file for the program. This contains a list of all the primary files (the INCLUDE files are found automatically). Run FPT on the program, and deal with any errors which FPT reports.

  2. Identify one or more points in the program flow where it may be interrupted for program initialisation, or for inspection and modification of variables. If the program is a continuous system simulation, for example, it could be interrupted at the start of each simulation frame. Edit the program and insert a call to the FPT library subroutine ADB at these points. ADB passes control to the interactive environment.

  3. Edit the program and insert a call to the subroutine ADINIT to initialise the interactive environment. ADINIT is called during program initialisation, before any call to ADB.

  4. Add the specification file FPTMAIN:adbserve.fsp at the end of the specification file for the program. Run FPT again, and build the output. The output files will contain all of the code used in setting up the interactive environment.

For example - a simulation of a cannon ball, with a simple square-law drag.

 

Scripted Experiments

The environment supports command file scripts, for example, click here for a script to initialise the cannon ball.

 

An Example Session

Interactive sessions may be logged automatically. Click here for an example.

 

What Does FPT Do? - How Does it Work?

FPT creates a database which contains the names and descriptions of all of the variables in COMMON blocks in the original program. The database is written as two new Fortran COMMON blocks initialised by BLOCK DATA.

The interactive environment is written in Software Validation's ACL product. ACL contains service routines which use the database to access the program COMMON blocks at run-time.

All of the code required is written in Fortran, and all is made available, without licence restrictions, in the FPT distribution.

 

Control of Real-Time Programs

When the program is to run in real-time, the subroutines ADB and ADINIT are built into a separate thread or separate program, which shares the main program COMMON blocks. Usually a flag or MUTEX is inserted in the main program frame which allows the interactive handler to pause and continue the main program.

 

Is This a Symbolic Debugger?

FPT's access database mechanism is unlike a symbolic debugger in that:

  • The command set is biased towards engineering rather than programming. It is similar to the command line environments for some Gould-SEL (Encore) and Applied Dynamics Internatonal simulation systems.

  • The system is less powerful than a debugger. There is no direct access to the program code or to local variables.

  • The system is much less invasive than a symbolic debugger. The program runs fully optimized and at full speed.

  • Users may modify and extend the command set, and customise it to their specific applications.

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