This is an old revision of the document!



  • Ratfor (17KB tar.gz) is freely available on our ftp site. (You may have to press the shift key to download the file to your system rather than viewing the file in your browser).


Ratfor is preprocessor for FORTRAN code that allows us to use C-like flow expressions. Jon Claerbout believes that Ratfor is the best available expository language for mathematical algorithms. Ratfor was invented by Brian Kernigham who also co-wrote the first C book. You will not really need precise definitions of Ratfor to use it. Statements on a line may be separated by a ”;”. Statements may be grouped together with braces {}. Do loops do not require statement numbers because {} defines the range, etc. The Fortran relational operators ”.gt.,.ge,.ne.,” etc. may be written ”>,⇐,!=,”etc. Unfortunately, the Ratfor switch statement conflicts with “implicit undefined” declaration, consequently we never use it. Ratfor also frees you from FORTRANs strict indentation rules. Anything from a # to the end of the line is a comment. Ratfor offers quite a few more features more and we strongly recommend it to any FORTRAN programmer.


  • Download the file.
  • Unshar the file with unshar ratfor.shar.2.
  • Compile “rat4.o, getopt.o, lookup.o”.
  • Link “rat4.o” (main routine), “getopt.o, lookup.o”(subroutines) and install the executable as “ratfor77”


  • Kernighan and Plauger wrote and published the original Ratfor preprocessor in 1976 while working at the Bell Telephone Laboratories.
  • Oz implemented a C version of the Ratfor preprocessor and made it freely available on the internet.


/web/html/data/attic/sep/software/ratfor.1216757294.txt.gz · Last modified: 2015/05/26 22:41 (external edit) Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0