VIF(1) Programmer's Manual VIF(1) NAME vif - VIntage Fortran compiler SYNOPSIS vif [-c | -d | -f | -g | -k | -l | -p | -r | -s | -t | -v | -w] [-O | -O0 | -O1 | -O2 | -O3 | -Of] source [, source ...] 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, used 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' proce- dures on IBM mainframes. Output to standard output is tee'd to file. -k If the backend compiler reports an error, specify the corresponding object code line instead of the 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. -v Print version and exit. -w Suppress warning diagnostics. -W 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 pre- fers speed over strict adherence to IEEE 754. COMPARISON OF VIF TO EARLY FORTRAN II/IV/66/77 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 has reserved words. 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 vari- ables 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) ftnnfmmm FORTRAN file associated with unit n, file version mmm ft06f000 Copy of standard output (from -g) AUTHOR AND COPYRIGHT Author and copyright holder of VIF is Marcel van der Veer . LINUX May 10, 2024 LINUX