VIF(1)

NAME
vif - VIntage Fortran compiler

SYNOPSIS
vif [ options ] [ file(s) ]

DESCRIPTION
VIF is a FORTRAN dialect that largely coincides with early FORTRAN II/IV and FORTRAN 66/77. VIF also is an early FORTRAN label-renumber tool. Below is a section with important differences between VIF and early FORTRAN.

VIF is not designed for very large modular projects, although it can compile libraries such as BLAS or LINPACK. All source files in a project are compiled together and linked into one executable, so the back-end compiler can optimize globally. Libraries compiled with VIF will export subroutines and functions, but not common blocks or block data.

VIF generates C99 using gcc extensions. VIF writes old-school listing files in the style of 1980's VS FORTRAN or VAX FORTRAN compilers.

OPTIONS
Options are passed to VIF from the command-line, or from '#pragma' lines in the source code.

-c  Compile only, use to compile libraries.

-d  Compile DO loops as post-checked loops, which was an idiosyncrasy of some FORTRAN IV compilers.

-f  Keep a table of invocations per subprogram.

-g  Start the program after succesful compilation. This mimics the behaviour of the WATFOR or WATFIV compilers, or JCL 'CLG' procedures on IBM mainframes. Output to standard output is tee'd to file.

-k  If the backend compiler reports a diagnostic message, specify the corresponding C object code line instead of the corresponding FORTRAN source code line.

-l  Generate a classic, verbose listing file.

-o -name
    Sets the base name for output files to `name'.

-p  As -k, but converts the file to pdf. This option requires `ps2pdf' and `enscript'; in their absence -p acts as -k.

-r  Renumber labels in the source files.

-s  Syntax check only, do not generate an object file.

-t  Trace the running program.

-u  Use case insensitive string comparison at runtime.

-v  Print version and exit.

-w  Suppress warning diagnostics.

-x  Start the program after succesful compilation and erase the executable. Output to standard output is tee'd to file.

-y  Renumber labels in the source files and apply upper stropping.

-z  Set the default REAL length to 8 and default COMPLEX length to 16. Note that linked libraries must be compiled with this option as well.

-O | -O0 | -O1 | -O2 | -O3 | -Of
    Select optimisation level to pass to gcc, where -Of selects -Ofast. Note that -Of may produce unexpected results since it prefers speed over strict adherence to IEEE 754.

COMPARISON OF VIF TO EARLY FORTRAN

VIF source code is fixed format as in vintage FORTRAN. On each line, the first position marks comment, positions 1-5 contain a label and position 6 marks a continuation card. On physical punch cards, positions 72-80 may contain a line number to sort the deck if needed. To VIF, text beyond position 72 is source code.

Early FORTRAN knows no reserved words - context determines meaning. VIF requires reserved words to be separated from variable names by whitespace. Reserved words can mostly be used as variable names. Whitespace may occur in variable names, when the part upto the first whitespace is not a reserved word.

Early FORTRAN limits the length of variable and subprogram names to 6 characters. VIF does not impose this small limit.

VIF is probably the only early FORTRAN compiler that offers extended precision REAL*32 and COMPLEX*64. The extended exponent symbol is X, for example '1.0X1'.

VIF implements any CHARACTER*n length as a C string. CHARACTER strings are null-terminated as in C, not padded with spaces. Hence the length of a CHARACTER*n object is n+1 characters.

VIF allows recursion, which is not supported by early FORTRAN. Note that IO statements are not re-entrant.

Early FORTRAN does not allow two adjacent operator symbols, except for practical combinations as for example '.AND..NOT.'. VIF does not pose this restriction.

VIF merges all declarations for (named) COMMON blocks after compilation. Hence there is no need to specify in every subprogram all variables per block in the exact same order.

VIF constant lists in DATA statements are circular, like format lists. Hence after INTEGER ROW(100) you can initialize the array with DATA ROW /0/ in VIF while in early FORTRAN this only initializes the first element.

VIF has a DO REPEAT ... END DO construct where 'UNTIL (condition)' terminates the loop.

VIF has rudimentary preprocessing features as '#include' or '#pragma". The '#' token must be at the start of a line.

In the intermediate language C99 and therefore in VIF, labels have function scope.

VIF allows Fortran 90 statements 'EXIT' and 'CYCLE'. Vintage operators like .EQ. and .NE. can be denoted as '==', '/=', etcetera. Also .AND. can be denoted as '&', .OR. as '|', .XOR. as '^' and .NOT. as '!'.

VIF allows CRAY-1 FORTRAN two-branch arithmetic if-statements and indirect logical-if statements.

NOT IMPLEMENTED

Namelist IO.

List-directed niceties and sugar as for example repetition counts for input items.

FEATURES OBSOLETED IN MODERN FORTRAN AND VIF

VIF does not implement alternate ENTRY and alternate RETURN.

FILES

file.f Source file

file.f~ Renumbered source file

file.l Listing file (from -l)

file.pdf Listing file (from -p)

file.date.vif Copy of standard output (from -g)

ftnnfmmm FORTRAN file associated with unit n, file version mmm

AUTHOR AND COPYRIGHT
Author and copyright holder of VIF is Marcel van der Veer <algol68g@xs4all.nl>.