!syn fc -sws file1 ... filen 
!desc FC is an implementation of the new Fortran 77 Fortran language. it is
written in C and runs under UNIX. the Fortran 77 language has a number of 
improvements over existing Fortran languages and implementations. in particular
it has the following advantages:
!pt better error diagnostics than existing UNIX compilers.
!pt DO loops are no longer so restrictive, one may use real variables or expressions
and the test is now made at the start of the loop rather than at the end.
!pt there is now a "structured" IF statement, similar to that of Algol, PL/I, and
other high level languages.
!head('Reference Materials')
this document is intended only as a users manual for the UBC UNIX Fortran 77
compiler. for more information on the Fortran 77 language itself the reader
is referred to the Fortran 77 standard published by the X3J3 Fortran standards
group. a more readable and understandable book on the subject has been 
written by Harry J. Katzan Jr.~and is published by Van Nostrand Reinhold
company.
!head('use of the compiler')
the !fc command behaves just like most other !un commands: the command
name (!fc!) is first, followed by option switches (a "switch" starts with
a "-" or "--"), the files to be compiled, and the appropriate object 
libraries. if a listing on the line printer is desired then the command
is often followed by "^lpr".
!p Like other UNIX compilers, FC requires the input files to have a name ending in 
either ".f" or ".ftn". the compiler may be given files with other names but these
will be assumed to be object files and passed thru to the linkeditor (LD). 
the normal command to FC will be something like: 
!i('fc --SL prog.f -lz')
this particular command causes the compilation of the program "prog.f" with inclusion
of the source line numbers, and linkediting with the library "z". 
!p the "--" before the "SL" option is used to indicate a "compile time"
option, as opposed to a linkeditting option.
note that on upper/lower case terminals a compiler option may be indicated
by using one "-" and an upper case option switch (e.g. "-SL" rather than
"--sl").
!p for a summary of all the switches available on the FC command, see
the FC command description in the UNIX Programmer's Manual, section I.
!head('getting a listing')
normally, !fc does not give a listing of the source program. it does 
of course give error messages for errors detected in a program. 
normally, to get a compile listing at the terminal the "--L1" listing
option is used. an example might be:
!i('fc --L1 prog.f ^ lpr')
in this case the listing is desired on the line printer so "^lpr" is 
appended after the !fc parameters.
!p the numbers on the left of the statements in the listing are the 
"isn's" or Internal Statement Numbers. these numbers are used in error
diagnostics to identify the statement where the error occurred.
!p the number printed for compile-time errors is the line number in the
file where the error was detected. the number may be given to the editor
to locate the statement so that it may be fixed.
!p the number in square brackets is the compiler error diagnostic number
which may be used with the "ferr" command in order to obtain a fuller
explanation of the cause of a particular error. note that the capital F
is part of the error number and must be specified when using "ferr".
For example, to get a fuller explanation of the F5 error diagnostic one
would say: "ferr -l F5". (the "-l") asks for the long version of the explanation
!head('separate compilations')
normally, !fc expects all of the subroutines and functions to be specified
on the !fc command (either as source files, object files or libraries).
it is possible however, to compile routines separately, and linkedit
them with a separate !fc command. this is often useful when an error is
detected in an original compile in just one subroutine, and can be corrected and recompiled. in this case, the "-c" (note the one "-" as this is a 
linkedit control option) option suppresses the linkedit for the compile
itself.
!i('fc -c sub.f')
since !fc places the object code into a file with the same name as the 
source code but with a ".o" suffix rather than ".f" the main program 
may now be linkeditted with the newly compiled subroutine by:
!i('fc main.o sub.o') if these are the only object files under this 
directory one could also have used:
!i('fc *.o') which is much less typing.
