fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

DATAPOOL LISTING FILE

Syntax:

[NO] DATAPOOL [INPUT] LISTING FILE <file>

Function:

The DATAPOOL construct is supported by ENCORE (Gould-SEL) Concept-32 and RSX series systems under the MPX operating system. The DATAPOOL LISTING FILE command is used in migrating code which uses the construct from MPX systems to standard Fortran environments.

DATAPOOL is essentially a Fortran 77 COMMON block in which the addresses of objects in the COMMON block are maintained by the operating system independently of the Fortran compiler. DATAPOOL statements are written with the same syntax as COMMON statements, for example:

COMMON /DATAPOOL/ X,Y,H,THETA,PSI,PHI

If this were a standard Fortran 77 COMMON block, the statement would specify the addresses of the variables X, Y, H etc. relative to the start of the COMMON block. In the DATAPOOL it does not. X, Y, H, THETA etc. are assigned the addresses held in the DATAPOOL database, and these addresses are not necessarily adjacent. Typically, a DATAPOOL may contain several thousand variables and arrays. The advantages of the construct are that:

  1. It is only necessary to declare the DATAPOOL variables which are used in the current sub-program. The MPX compiler does not need place holders to pad out the COMMON block so that variables are assigned the correct addresses.
  2. There is no risk that variables will be assigned different addresses in different routines.
  3. Independent utilities running outside the Fortran program, and other Fortran programs, may access the variables at run-time. Under MPX, this supports a powerful on-line debugging feature.

The disadvantage was that the construct was not supported by any vendor other than Gould-SEL (ENCORE). However, DATAPOOL, the external debugging environment and the associated utilities have now been re-implemented in standard Fortran 77, and may be used in any Fortran environment. Please contact SimCon if these facilities are required.

The MPX system may be used to generate a listing file which shows the addresses of all variables in the DATAPOOL. The fpt command DATAPOOL LISTING FILE instructs fpt to read this file, and to use the address and data type information which it contains to convert DATAPOOL statements to standard Fortran 77. The changes made are as follows:

  1. An INCLUDE file is written for declaration of the DATAPOOL COMMON block. This INCLUDE file contains a declaration statement for the array DP_BYTE, which is used to form the backbone of the COMMON block. Declaration of DP_BYTE is followed by type declarations for all variables and arrays in the DATAPOOL, and EQUIVALENCE statements which position the variables at the correct addresses within DP_BYTE. Comments in the original DATAPOOL listing file are written as trailing comments to the declarations. The name of the INCLUDE file is taken from the base file name of the primary input file to fpt, with the suffix '_cmn' and the current default INCLUDE output file name extension. The file name is modified if necessary so as to be unique.
  2. An INCLUDE statement is inserted in every Fortran sub-program which uses the DATAPOOL.
  3. Existing declarations of DATAPOOL variables are removed from the sub-programs.

This command therefore converts the program to standard Fortran. However, the code has the disadvantage that the entire DATAPOOL is declared in every sub-program which needs it. The DATAPOOL INCLUDE file may contain several thousand declarations, and this may have an adverse effect on compilation times.

The problem of the size of the INCLUDE file is overcome by the DATAPOOL Toolkit, DPTK. This re-processes the Fortran sources to replace the single DATAPOOL INCLUDE file by separate declaration INCLUDE files for each DATAPOOL variable. Thus, if a sub-program uses six DATAPOOL variables, it has six very small INCLUDE files rather than one very large one. The separate INCLUDE files are maintained by components of DPTK, using an ASCII text file database. This database file is written in response to the fpt command WRITE DATAPOOL TEXT FILE.

Where to Use this Command

Operating system command line Yes
Configuration file, config.fsp Yes
Specification (fsp) files, *.fsp Yes
Interactively, to FPT> prompt No
Interactive command files No
Embedded in the Fortran code No

Default

NO DATAPOOL LISTING FILE

(Note that defaults may be changed in the configuration file)

Examples

The program HOVER2 is processed with the command:

$ fpt hover2.fsp /datapool_listing_file:dpool.lis

A fragment of the Gould-SEL DATAPOOL listing file, dpool.lis, is shown below:

LOG X EQU X:QDO +X'00028' EW001 X Pos, World, ft LOG Y EQU X:QDO +X'0002C' EW001 Y Pos, World, ft LOG H EQU X:QDO +X'00030' EW001 Height abs ft LOG HRAD EQU X:QDO +X'00034' EW001 Height radar ft LOG HBAR EQU X:QDO +X'00038' EW001 Height baromet ft LOG THETA EQU X:QDO +X'0003C' EW001 Degrees LOG PHI EQU X:QDO +X'00040' EW001 Degrees LOG PSI EQU X:QD0 +X'00044' EW001 Degrees +- 180 LOG P EQU X:QDO +X'00048' EW001 Degrees/sec LOG Q EQU X:QDO +X'0004C' EW001 Degrees/sec LOG R EQU X:QDO +X'00050' EW001 Degrees/sec LOG LAT EQU X:QDO +X'00058' ED001 Latitude, degrees LOG LONG EQU X:QDO +X'00060' ED001 Longitde, degrees

The INCLUDE file hover2_cmn.fpi is generated. The variables shown above generate the fragment:

BYTE DP_BYTE(0:103) : : REAL*4 X ! X Position, World, ft REAL*4 Y ! Y Position, World, ft REAL*4 H ! Height absolute ft REAL*4 HRAD ! Height radar ft REAL*4 HBAR ! Height barometric ft REAL*4 THETA ! Degrees REAL*4 PHI ! Degrees REAL*4 PSI ! Degrees +- 180 REAL*4 P ! Degrees/sec REAL*4 Q ! Degrees/sec REAL*4 R ! Degrees/sec REAL*8 LAT ! Latitude, degrees REAL*8 LONG ! Longitude, degrees : ! COMMON /DATAPOOL/DP_BYTE ! : EQUIVALENCE (X,DP_BYTE(40)) EQUIVALENCE (Y,DP_BYTE(44)) EQUIVALENCE (H,DP_BYTE(48)) EQUIVALENCE (HRAD,DP_BYTE(52)) EQUIVALENCE (HBAR,DP_BYTE(56)) EQUIVALENCE (THETA,DP_BYTE(60)) EQUIVALENCE (PHI,DP_BYTE(64)) EQUIVALENCE (PSI,DP_BYTE(68)) EQUIVALENCE (P,DP_BYTE(72)) EQUIVALENCE (Q,DP_BYTE(76)) EQUIVALENCE (R,DP_BYTE(80)) EQUIVALENCE (LAT,DP_BYTE(88)) EQUIVALENCE (LONG,DP_BYTE(96))

and references to this INCLUDE file are inserted in all sub-programs which use DATAPOOL variables.

See Also

WRITE DATAPOOL TEXT FILE

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