VX/FPT - Migration from VMS and PDP11
You have half a million lines of VMS FORTRAN which has to go to Unix or Windows®. A trial compilation on the new host was disastrous.
What are the problems, and how can you deal with them?
Microsyntax and Syntax
These are issues in the way in which the names, numbers, keywords and other tokens are written, and the way in which they are combined to make statements.
Many of the changes required take only a few hours with a text editor. The danger of this approach is that the modified code no longer runs under VMS, so the codes for the two hosts immediately start to diverge. Also, the code passes through an intermediate stage during which it will not compile and run on either platform.
VX/FPT automates the changes, which may be made in a few seconds.
- Changing file name formats in INCLUDE statements.
- Removing leading tab characters, and the effect on line length of leading and embedded tabs.
- Specifying and enforcing a maximum number of continuation lines.
- Reformatting hexadecimal and octal numbers.
- Translating file names used in OPEN and INQUIRE statements, and as arguments to routines.
- Replacing the PDP11 and VAX record specifications, e.g. READ(2'IREC)X .
- Conversion of trailing comments to line comments.
- Systematically renaming variables with names which contain $ characters.
Semantic Issues
These are issues where the meanings of the tokens affect the changes which must be made. Often, the changes required are structural and affect more than one statement.
- Explicit specification of data sizes, and conversion between BYTE and INTEGER*1 or REAL*8 and DOUBLE PRECISION.
- Replacing PDP11 and VMS PARAMETER statements with no parentheses.
- Removing PARAMETER statements from STRUCTURE declarations.
- Re-programming the use of integer variables in logical IF statements.
- Supplying missing arguments.
- Inserting argument counts.
- Correcting arguments where REAL*8 is passed instead of REAL*4, or where INTEGER*4 is passed instead of INTEGER*2.
- Replacing CALL statements used for functions by assignment statements which invoke the functions as functions.
- Renaming intrinsic functions.
- Converting I/O statements which access ISAM files to calls to Sector7's ISAM FORTRAN library. Keyed access files are supported on Windows® and Unix hosts.
- Inserting data access functions for reads and writes to specified variables which are in number formats foreign to the new host.
- Inserting header declaration files in all sub-programs.

