RATFOR(1) — HP-UX
NAME
ratfor − rational Fortran dialect
SYNOPSIS
ratfor [ options ] [ file ... ]
DESCRIPTION
Ratfor converts a rational dialect of Fortran into ordinary irrational Fortran. Ratfor provides control flow constructs essentially identical to those in C:
statement grouping:
{ statement; statement; statement }
decision-making:
if (condition) statement [ else statement ]
switch (integer value) {
case integer:statement
...
[ default: ]statement
}
loops:
while (condition) statement
for (expression; condition; expression) statement
do limits statement
repeat statement [ until (condition) ]
break
next
and some syntactic sugar to make programs easier to read and write:
free form input:
multiple statements per line and automatic continuation of lines
comments:
# this is a comment.
compiler directives:
directives beginning with a dollar sign ($) in column one are passed through to the compiler unchanged.
translation of relationals:
>, >=, etc., become .GT., .GE., etc.
return expression to caller from function:
return (expression)
define:
define name replacement
include:
include file
Options
The following options are supported:
−h Cause quoted strings to be turned into Hollerith constructs as, for example, 27H.
−C Copy comments to the output and format them neatly.
−6c Normally, continuation lines are marked with an & in column 1. The −6c option makes the continuation character c and places it in column 6.
Ratfor is best used with f77(1).
DEPENDENCIES
Series 300
Options can be passed to ratfor through f77(1) by using the −W option specifier.
Series 800
The −6x option must be used for successful automatic line continuation.
SEE ALSO
Ratfor: A Preprocessor for a Rational FORTRAN, tutorial in HP-UX Concepts and Tutorials: Programming Environment.
B. W. Kernighan and P. J. Plauger, Software Tools, Addison-Wesley, 1976.
Hewlett-Packard Company — May 11, 2021