Fortran is Fortran is Fortran
Post on 21-Jun-2016
Embed Size (px)
172 trends in analytical chemistry, vol. 3, no. 7, I984
FORTRAN is FORTRAN is FORTRAN L. Kaufman and D. L. Massart Brussels, Belgium
One of the major problems of using computer pro- grams in a research environment is that of transfer- ing a program written for one computer system to another computer or to the same computer using a different operating system or different compiler. A very elegant solution exists for FORTRAN which is the most widely used scientific language. The PFORT Verifier is a program which checks whether the statements of a FORTRAN program (whether it is FORTRAN 77, IV, extended, etc.) belong to PFORT, a subset of American National Standard FORTRAN (ANS FORTRAN). PFORT also diag- noses several errors which compilers often miss (re- lating to inter-program-unit communication and to COMMON statements). It also provides a number of features useful in debugging and documentation of a program. It produces error diagnostics, symbol tables and several lists of cross-references. An inter- program-unit description includes for each unit a list of variables, common blocks, program units called, and the units which call them. A list of common defi- nitions is also produced. The PFORT Verifier is itself written in PFORT and can easily be installed on a variety of computers using two small assembly language programs. PFORT was written at Bell laboratories and is described by Hall and Ryder and RydeG.
As an illustration part of the output obtained from a run of PFORT is given below. The program used for this run is legal in FORTRAN IV extended (on CDC) but not for all FORTRAN compilers. State- ment 2 is a good example of errors undetected by some compilers. The statement should be: A=A-1.) but it runs as given in the program and can
PFORT VERIFIER l/12/79 VERSION
1 A=100 2 10 A=A-1
l * ILLEGAL CO!lRfNATION OF DATA TYPE6 3 IFtA. CT. -1. )GO TO 10
i* WARNING - ADJACENT PLACEMENT OF OPERATOR AND UNARY -* +A/5
l )+ :LLEGAL CO:*BIN4TION OF DATA TYPE6
5 CALL SUB(A. B. C) 6 WRITEt2.99!A. 8, C 7 99 FORMAT(/,lXo6H A.B,C :.3FlO.Z)
. . WARNIWC - NON-FORTRAN CHARACTER IN HOLLERITli l . ILLEGAL MIXING OF / AND I IN FORMAT
Fig. 1. Sample output from PFORT.
yield incorrect results. In statement 7 the : character in a Hollerith string is legal in the system employed but not in some other FORTRAN versions.
Our experience with PFORT consists in the test- ing of a set of statistical programs written in CDC ex- tended FORTRAN. This language contains many non-standard instructions and most programs there- fore required extensive rewriting before they passed the PFORT test without errors. However once this was achieved it proved very easy to use the same programs on a PDP 11/70 (under UNIX) and a VAX 11/780 computer of another Belgian universi- ty. The ease with which this was done and in view of the many problems we have had in the past trying (and often not succeeding) to implement programs written for other systems, has led us to use PFORT for testing many new FORTRAN programs in our department.
Hopefully a similar verifier will be developed in the near future for other languages such as BASIC and PASCAL.
References 1 A. D. Hall and B. G. Ryder, Installation of the PFORT Veri-
fier, Bell Laboratories, Murray Hill, New Jersey, 1973. 2 B. G. Ryder, The PFORT Verifier, Software Practice and Ex-
perience, 4(4) (1974) 359-377. 3 B. G. Ryder, The PFORT Verifier - Users Guide, Computer
Science Report 12, Bell Laboratories, Murray Hill, New Jer- sey, 1973, revised 1975.
Computer Corner - Contributions
Contributions of between 400 and 900 words are welcome in the categories described below and should be sent to the appropriate contributing editor.
Information on hardware, general software, software tips, and interfacing should be sent to:
TrAC Computer Corner B. G. M. Vandeginste, Depart- ment of Analytical Chemistry, University of Nijmegen, Toernooiveld, 6525 ED Nijmegen, The Netherlands.
Information on chemical applications, software and math- ematical tools for improving information content should be sent to:
TrAC Computer Corner, D. L. Massart, L. Kaufman, Vrije Universiteit Brussel, Fakulteit der Geneeskunde en der Farmacie, Farmaceutisch Scheikunde, Laarbeeklaan 103, B-1090 Brussels, Belgium.
0 Elsevier Science Publishers B .V