F77 - run Fortran 77 compiler and/or programs.

Syntax:

f77 infile [infile]* [option]* [runtime-file]*
(+|-)BCd (-)         (+|-)Clear (-)     (+|-)CoMmon (-)
(+|-)CoNVert (+)     (+|-)DeBug (-)     (+|-)DeCLare (+)
(+|-)DSS (-)         (+|-)Extensions (+)(+|-)FDeBug (-)
(+|-)FDS (-)         (+|-)Formatted (+) (+|-)Go (+)
(+|-)InFormation (+) (+|-)Include (+)   (+|-)lineNumbers (-)
(+|-)ListIng (-)     (+|-)Load (+)      (+|-)LstOu (-)
(+|-)Map (-)         (+|-)OneTrip (-)   (+|-)Parmcheck (+)
(+|-)SlowFormat (-)  (+|-)Tables (+)    (+|-)Value (+)
(+|-)Warning (+)     (+|-)Xref (-)      (+|-)Zdebug (-)
CoMmon=number        Entry=symdef       FFile=options
Hstar=file (.h)      Library=filename   LoaderMemory=number
MeMory=number (50)   Name=name          Object=filename
Search=rule          TEST=filename      Time=number
USe=symref           Update=filename
nn<[filename]        nn>[filename]

Examples:

f77 *
    Compile and run program in current file.
f77 srcpart1 srcpart2 hstar=prog -go
    Compile an load program into file "prog".  Don't run it.
f77 prog 01</myfile 02>02 10<
    Run compiled program in "prog", redirecting some I/O.
f77 /subra up=tlib +clear
    Build a library with the routines in "/subra".

Options:

infile
is a filename or set of filenames separated by blanks. Normally, an "infile" contains either Fortran source to be compiled or Fortran object decks to be passed to the loader. However, if there is only one "infile" and it is random, it is assumed to be a Fortran load module to be executed.
+BCd
means the program is to run in the BCD environment. The default is ASCII.
+Clear
is used in conjunction with the "Update=" option. It tells Ranedit to clear/initialize the random library.
+CoMmon
tells the compiler to check that all variables in common blocks are referenced. The default (-CoMmon) corresponds to the batch NCMREF option.
CoMmon=number
specifies the number of words of blank common. This is only needed if you have blank common and use the +DSS option, or if the amount of blank common declared in different modules is inconsistent. With inconsistent declarations, it is better to correct the declarations than to use this option.
-CoNVert
tells the compiler to issue diagnostic messages if the code contains implicit type conversions. The default (+CoNVert) means the compiler quietly accepts implicit type conversions. -CoNVert is the batch IMPCNV option.
+DeBug
indicates that the DSS debugger should be given control before your program begins execution. This implicitly turns on +DSS for compile and/or loading.
-DeCLare
tells the compiler to issue diagnostic messages if variables are implicitly declared. The default (+DeCLare) makes the compiler quietly declare undeclared variables. -DeCLare is the batch IMPNON option.
+DSS
indicates that the compiler should generate DSS debug tables, and that the loader should include the DSS startup code in the hstar file. Unlike the FDS option, this adds about 22k to your program whether or not you actually use the debugger.
Entry=symdef
tells the loader the name of the main routine. You only need this if you have used a PROGRAM statement to give your main program some name other than the default "......", and the main routine is not the first routine in the source file. "symdef" is the name of the program from the PROGRAM statement.
-Extensions
makes the compiler complain about non-ANSI extensions. This is the batch ANSI option.
+FDeBug
calls FDEBUG on program startup. This implicitly turns on the +FDS option.
+FDS
indicates that the compiler should produce FDS type symbol tables for use with the FDEBUG interactive debugger.
FFile=nn,org[,options]*
creates a $FFILE card image for the loader. A $FFILE card is needed for any random files or other files that have special characteristics. The FFile= option tells the loader to build a file information block (FIB) that records the special attributes. This FIB will be used when the program is executed.
nn
is the file code in the FIB. Normally this is the two-digit Fortran unit number; however, it may be different if the FFILE LGU option is used.
org
indicates the file organization. It will usually be the string "gfrc" for sequential files and "uff" for random files.
options*
is a list of FFILE options. For random files, you usually use "org/rel". See the control card manual or the Fortran 77 user guide for more information.
-Formatted
indicates that the source is in free format. The default is fixed Fortran format.
-Go
indicates that the program should NOT be executed once it has been loaded.
Hstar=filename
specifies the name of the hstar file where the loader should write the loaded program. If you do not specify this option, F77 uses a file called ".h".
-Include
does not look for command options embedded in source files.
-InFormation
does not display compiler information messages (e.g. "variable not used").
Library=filename
specifies the name of a random library to be searched for subroutines, before the linker searches the system library. Libraries are searched in the order that the Library= options are processed by the command scanner.
+lineNumbers
indicates that the input file has line numbers. If a line has no line number but does have a statement number, the statement number must be preceded by at least one blank; otherwise, it will get taken as the line number.
-lineNumbers
indicates that the source is not line-numbered (default). Line numbers in error messages will be relative to the beginning of the function or subroutine. Information past column 72 (the so-called sequence field) will be ignored.
+ListIng
generates a source listing via the LSTIN option.
-Load
does not attempt to make a load module. If you specify this option, F77 does not call the loader.
LoaderMemory=number
specifies how many 1024 word blocks of memory should be dedicated to the loader when loading. The default is 10. Use this option when you have an extremely large number of routines to be loaded, in case the loader needs more memory for its tables.
+LstOu
creates a listing of the machine language code generated, via the LSTOU option.
+Map
writes a load map to "fc*p*".
MeMory=number
sets the compiler memory size to "number" K words. The default is 50K words. This also controls how big your program can be. The amount of space given to the loader to load your program is this value minus the LoaderMemory= value.
Name=name
specifies the name of the main element in the hstar. The default is "object" unless +DSS is specified, in which case the main element is called "//////".
Object=filename
writes the object files into "filename".
+OneTrip
forces all DO loops to execute at least once. Normally, a DO loop is not executed at all if the condition of the loop is satisfied when the DO is entered. This option forces the loop to execute at least once, and test the condition after the loop has been done. +OneTrip is not recommended, since it violates the ANSI standard for Fortran. However, it may be needed for old Fortran programs that expected this behavior. Use +OneTrip should only be a temporary measure; change the program so that +OneTrip is not required.
-Parmcheck
does not generate code to check arguments. Normally, F77 turns on the compiler PARCHK option, so the compiler generates code that checks arguments for validity. The argument checks are not very thorough, but they are better than nothing.
Search=rule
adds "rule" to the search rules used to resolve the search form of the "include" statement. "rule" can be:

For more information, see "expl f77 include".

+SlowFormat
prevents the compiler from encoding format statements. When this option is specified, formatted I/O is performed more slowly. This is the batch OLDFORMAT option. You probably only need this if you are trying to use the FDS FTIMER routine.
-Tables
suppresses the creation of line number tables.
TEST=filename
indicates that the given file contains a test version of the Fortran compiler which is to be used for the batch activity.
Time=number
sets a limit on the processor time that can be used for execution. The time is given in seconds. The default is no limit.
Update=filename
places the object deck into the named random library.
USe=symref
requests that the loader search for some particular external name.
-Value
suppresses the compilation of code to check subscript values. This corresponds to the batch SUBCHK option.
-Warning
stops the generation of warning messages.
+Xref
tells the compiler to generate a cross-reference in its listing file.
+Zdebug
is used for debugging the F77 command itself. The effects of this option may change at any time.
runtime-files
take the form "nn>[filename]" or "nn<[filename]". For full details, see below.

Description:

F77 can compile and run Fortran programs. It can also restart a compiled program without recompiling.

F77 uses the DRL TASK interface to compile and load the program in batch, but execution takes place in TSS.

To rerun your program without recompiling it, give the name of the load module rather than a source file on the command line. The name of the load module will be ".h" unless you used the Hstar= option to give it a different name.

Source Code Format:

The default compilation options assume that your source program is in fixed format, i.e. it follows the usual Fortran rules:

There are two other formats accepted by the Fortran compiler: unnumbered free format and line-numbered free format.

To indicate unnumbered free format, specify the -Formatted option. With this format, a Fortran statement may start anywhere between columns 1 and 72. You indicate a continuation with an ampersand (&) as the first non-blank character on the line. You indicate a comment by a "*" as the first non-blank character. The compiler still ignores everything after column 72.

To indicate line-numbered free format, specify the +lineNumber option. This format is similar to unnumbered free format, except that each line must begin with a line number. This is useful for source files that were created with build mode. Lines may have any length; the compiler does NOT ignore text after column 72. Fortran column 1 is taken to be the first position after the line number. You need at least one space between the line number and any Fortran statement number.

In both free format modes, beware of starting a CALL, CHARACTER, or COMMON statement in column 1, since the compiler sees a C in column 1 and treats the statement as a comment. This also applies to assignment statements whose variables begin with C.

Run-Time Files:

F77 lets you associate an I/O unit in your program with an actual file. You do this using a run-time file specifier of the form

nn<[filename]
    or
nn>[filename]
where "nn" is a number representing an I/O unit.
Each specifier may be used for one of three purposes:

A specifier with a "<" character is for reading only. A specifier with a ">" character is for reading or writing.

When your program contains a statement like

read(1,100)a,b

Fortran I/O attempts to read from file 01 in the AFT. Thus, the file associated with the unit must be in the AFT with an aftname that is the same as the file code, expressed as two digits. If it is not there, and you are reading, you will get a run-time error. If you are writing, the I/O package will create a temporary file using the unit number as the two-digit name. F77 lets you associate specific units with files or the terminal.

Suppose you wanted unit 01 to read from your file "data1". You would do this by including

01</data1

on the command line. In response to this, F77 accesses your file under the alternate name of "01". As long as you do not remove "01" from the AFT during the session, you do not have to specify this again, because F77 does not remove run-time files from the AFT. Thus, a basic run-time file specifier consists of a two-digit unit number (in the range 01 to 99), a "<" or ">" character, and a file name.

As already noted you must use ">" rather than "<" if your program needs to write on the file at any time. If you use ">" and the file does not already exist, the file will be created as either temporary or permanent, according to the usual conventions for implicit file creation.

For example, suppose you wish the output generated by unit 02 of your program to be directed to a temporary file called "02". You would specify

02>02

on the command line. Again, as long as you do not deaccess the file, you only need to specify this once during a session.

Fortran I/O associates units 05, 06, 41, and 42 with the terminal by default, while all other units are associated with a disk file. Unit 41 is used by a READ statement which has no unit number. Unit 42 is used by the PRINT statement.

To make a terminal-oriented unit read from a file, you must use a specifier in your F77 command. For example, to cause output on unit 06 to go to a file, you would say

06>/out1

This first creates "/out1" if necessary, then accesses "out1" under the alternate name of "06", then modifies the load module so that Fortran run-time initialization is aware of the deviation from the default. IMPORTANT NOTE: If you redirect 06 into a permanent file, you cannot look at the file until you issue the TSS command

remo 06

TSS does not update the "file is empty" bit for the file until the file is deaccessed, which happens when the file is removed from the AFT.

If you want Fortran I/O to read from the terminal instead of a disk file, just omit the file name altogether, as in

10<

This specifies that unit 10 is to be associated with the terminal instead of a disk file. When asking to use the terminal, you can specify either ">" or "<".

There is one nasty glitch in all this. If the file name you specify is a temporary file, the name must be the same as the unit with which the file is to be associated. If it is not, F77 will tell you that you must use the RENAME command yourself to change the name of the file. For example, if you want output unit 06 to go to a temporary file named "xxx", you must explicitly RENAME "xxx" to "06". This is necessary because it is not possible to have an alternate name for a temporary file.

For technically obscure reasons, you cannot use the +DeBug option with redirecting terminal I/O units. This means that if you use +DeBug, you cannot use "nn>" to redirect unit "nn" to the terminal, nor can you use "nn>file" to redirect unit 05, 06, 41 or 42 to a file. It is still possible to do these redirections using the FFile= option when loading with +DSS, but once the program has been loaded, you cannot change whether a unit goes to a terminal or a file (if you use the +DeBug option). This is only a problem with the DSS debugger. FDEBUG has no such problem.

Listings:

The listing produced by the +ListIng option is left in your AFT with the name "fc*p*". This listing is in Media~3 format, print image BCD. If you wish to list this on the printer, simply use SLIST, as in

slist fc*p*

If you read "fc*p*" into FRED, you will find that each line ends with the cryptic notation "!10000". This happens because FRED is not fully at home with Media~3 files. To eliminate this odd glitch, you might use the L command to list "fc*p*" into another file (thereby performing BCD to ASCII conversion) and then read this converted file into FRED, as in

l fc*p* >temp
fred r temp

Command Options in Source Files:

You may specify additional F77 command options inside the source file itself, on a line that begins with "*!". The compiler ignores such lines because the "*" indicates a comment; however, F77 recognizes the "*!" sequence and scans the rest of the line for command options. A line of this form may have a line number, but the "!" must always be followed by at least one blank. There may be more than one such special comment line, but all must be together, starting with the first line of the file, as in

*! +form
*! -linenum
      print,"hi there"
      stop
      end

When F77 scans a source file line for command options, it displays the line on the terminal. The -Include option tells F77 not to scan for such source file lines.

Options found in source files are processed in the order they appear on the terminal. Options on the command line (other than source or object file names) are processed last, permitting some degree of override on the options found in the source files. For instance, if a numeric or string-valued option like "Object=filename" is given more than once, F77 uses the numeric or string argument that is found last.

Loader Considerations:

Normally when you compile a program, F77 assumes that you want the program loaded and executed. However, if you ask for an object deck, F77 only calls the loader if you also specify an option like Hstar= that directly applies to the loader. If you specify Update=, the library editor is called instead of the loader.

Files Used:

fb*b*, fc*p*, fc*s*, fc*j*, l*

fc*r*, fc*sc, fc*i*, fc**sr, fc**rl

cmdlib/etc/qstar

sys_software/lib_sr/fort77

.h

See Also:

expl f77 include

expl ranedit

expl rename

Copyright © 1996, Thinkage Ltd.