|
VIntage Fortran (VIF) is my experimental compiler for vintage Fortran, that is, Fortran 66-77. VIF is experimental in the sense that it does not emulate the Fortran machine model, and therefore cannot compile a few rarely used archaic statements. This is a trade-off between completeness and efficiency. Also, VIF has reserved words unlike Fortran, facilitating straightforward translation.
Even so, VIF builds a mathematical library including vintage packages that are still in use today such as BLAS, ARPACK (used in SciPy, Mathematica, GNU Octave and MATLAB), LAPACK, or ODRPACK (used in SciPy). This legacy code adheres to the by-then Fortran standard and recommended coding practice. I like to think that most people avoided Fortran's idiosyncrasies as to write portable code.
Here you can download the current VIF source distribution. The linux manual page can be viewed here.
A goal for VIF was to make available multiple precision data types REAL*32 and COMPLEX*64, considering that most multi-precision applications require twenty up to sixty digits. VIF is probably the only vintage Fortran implementation offering these types.
A caveat when compiling vintage code is that in the old days, different machines had different representations of types. A REAL value could occupy a 32-bit, 36-bit or 64-bit word, depending on the hardware. Portable programs from the time call routines like D1MACH for details of a type representation. Next trivial snippet x1mach.f prints machine parameters for REAL*32 analogous to the D1MACH function:
real*32 x1mach do k = 1, 5 print *, k, x1mach(k) end do end
VIF can immediately execute a program upon successful compilation, like WATFOR or WATFIV, or a JCL CLG-type procedure under MVS or z/OS. We can execute above snippet with VIF like so, specifying -g:
$ vif -g x1mach.f ** main ** end of compilation 1 ** linker ** object size 372280 bytes ** statistics ** 1 subprogram, no errors, no warnings ** execution ** 1 3.3621031431120935062626778173217526025980793448464712401088272298088533e-4932 2 1.1897314953572317650857593266280071307634446870965102374726748212332616e+4932 3 1.1319598848533390459386399113609739725853163997673922736978268612419382e-0072 4 2.2639197697066780918772798227219479451706327995347845473956537224838764e-0072 5 3.0102999566398119521373889472449302676818988146210854131042746112710819e-0001
Below is a list with the cross-referenced source files of the current version.
File | Synopsis | Lines | |
compiler | assign.c | Compile assignments. | 97 |
compiler | autosave.c | Compile SAVE. | 183 |
compiler | banner.c | Banner for listing files. | 169 |
compiler | call.c | Compile CALL and function calls. | 174 |
compiler | code.c | Routines to emit C object code. | 466 |
compiler | coerce.c | Type conversions for assignments and function statements. | 229 |
compiler | common.c | Compile COMMON. | 153 |
compiler | data.c | Compile DATA. | 338 |
compiler | decls.c | Compile declarations. | 271 |
compiler | diag.c | Diagnostic message routines. | 93 |
compiler | dimension.c | Compile DIMENSION. | 136 |
compiler | emit.c | Emit C object code. | 211 |
compiler | equivalence.c | Compile EQUIVALENCE. | 333 |
compiler | expression.c | Compile Fortran expressions. | 611 |
compiler | external.c | Compile declarations. | 63 |
compiler | factor.c | Compile Fortran expression factors. | 362 |
compiler | fold.c | Constant folder. | 562 |
compiler | format.c | Compile FORMAT. | 456 |
compiler | fpp.c | Fortran preprocessor. | 173 |
compiler | goto.c | Compile GOTO. | 138 |
compiler | implicit.c | IMPLICIT declaration routines. | 187 |
compiler | intrinsic.c | Compile inline intrinsic functions. | 788 |
compiler | jcl.c | Rudimentary JCL handler | 152 |
compiler | macro.c | Compile function statements. | 223 |
compiler | modules.c | Compile BLOCK DATA, FUNCTION, PROGRAM and SUBROUTINE. | 606 |
compiler | parameter.c | Compile PARAMETER. | 74 |
compiler | renum.c | Vintage Fortran statement renumbering tool. | 647 |
compiler | scan.c | Fortran scanner. | 764 |
compiler | slice.c | Compile array slices. | 185 |
compiler | statements.c | Compile statements. | 683 |
compiler | table.c | Symbol table routines. | 337 |
compiler | transput.c | Compile Fortran IO. | 1111 |
compiler | type.c | Type routines. | 360 |
compiler | vif.c | VIF driver. | 673 |
compiler | vif.h | VIF include file. | 861 |
runtime | rts.c | Runtime support. | 334 |
runtime | rts-char.c | Runtime support for character - integer/real conversion. | 117 |
runtime | rts-format.c | Runtime support for formatted IO. | 816 |
runtime | rts-io.c | Runtime support for Fortran IO. | 341 |
runtime | rts-jit.c | Just-in-time compilation of FORMAT strings. | 387 |
runtime | rts-lapack.c | Runtime support for LAPACK subprograms. | 807 |
runtime | rts-math.c | Runtime support for math operations. | 451 |
runtime | rts-real16.c | Runtime support for REAL*16 and COMPLEX*32. | 127 |
runtime | rts-real32.c | Runtime support for REAL*32 and COMPLEX*64. | 2468 |
runtime | rts-slatec.c | Runtime support for SLATEC subprograms. | 600 |
runtime | rts-wapr.c | Runtime support implementing the W-function. | 359 |
runtime | rts-real32.h | Runtime support for REAL*32 and COMPLEX*64. | 320 |
runtime | box-behnken.f | Box-Behnken desing related subprograms. | 172 |
runtime | chemometrics.f | Machine Learning subprograms for VIF. Needs LAPACK. | 207 |
runtime | doomsday.f | Doomsday algorithm giving the day of the week for a date. | 595 |
runtime | fortran-iv.f | FORTRAN IV library functions for VIF. | 44 |
runtime | vif-math.f | Auxiliary math functions for VIF. | 185 |
mathlib | mathlib-arpack.c | 82 subprograms from ARPACK | 28895 |
mathlib | mathlib-blas.c | 148 subprograms from BLAS | 19249 |
mathlib | mathlib-eispack.c | 81 subprograms from EISPACK | 9442 |
mathlib | mathlib-fftpack.c | 68 subprograms from FFTPACK | 3934 |
mathlib | mathlib-fishpack.c | 19 subprograms from FISHPACK | 4030 |
mathlib | mathlib-fnlib.c | 268 subprograms from FNLIB | 86703 |
mathlib | mathlib-lapack-arpack.c | 161 subprograms from LAPACK-ARPACK | 22749 |
mathlib | mathlib-lapack-svd.c | 85 subprograms from LAPACK-SVD | 16516 |
mathlib | mathlib-linpack.c | 177 subprograms from LINPACK | 21036 |
mathlib | mathlib-minpack.c | 23 subprograms from MINPACK | 3021 |
mathlib | mathlib-odepack.c | 85 subprograms from ODEPACK | 17235 |
mathlib | mathlib-odrpack.c | 63 subprograms from ODRPACK | 14847 |
mathlib | mathlib-pchip.c | 41 subprograms from PCHIP | 4180 |
mathlib | mathlib-quadpack.c | 73 subprograms from QUADPACK | 15449 |
mathlib | mathlib-slatec.c | 527 subprograms from SLATEC | 105987 |
mathlib | mathlib-slatec-dassl.c | 10 subprograms from SLATEC-DASSL | 5670 |
mathlib | mathlib-slatec-extended.c | 22 subprograms from SLATEC-EXTENDED | 3011 |
mathlib | mathlib-slatec-sdrive.c | 24 subprograms from SLATEC-SDRIVE | 10220 |
mathlib | mathlib-toeplitz.c | 19 subprograms from TOEPLITZ | 960 |
Total | 414333 |
|
||
I wrote a simple compiler that translates most Fortran IV/66/77 source code … |
|
||
Recently, Algol68C Release 1.3039 was made public for download … |
© 2002-2025 J.M. van der Veer (jmvdveer@xs4all.nl)
|