home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS - Coast to Coast
/
simteldosarchivecoasttocoast2.iso
/
fortran
/
tidy64.zip
/
TIDYHELP.CMS
< prev
next >
Wrap
Text File
|
1993-10-13
|
12KB
|
293 lines
.cm Local Help
The TIDY program renumbers and otherwise cleans up old and tired
FORTRAN source programs. TIDY accepts ANSI FORTRAN with up to 19
continuation cards as well as some IBM and CDC dialect FORTRAN
statements. It is designed to work with ANSI FORTRAN-77, and will
also accept FORTRAN II and FORTRAN IV statements. Certain
FORTRAN II statements (such as READ INPUT TAPE) are automatically
translated to their FORTRAN IV equivalents. All lower case
alphabetic characters are normally translated to upper case except for
those in strings, Hollerith constants, and comment statements.
It is executed by:
TIDY FILENAME FILETYPE FILEMODE
where
filename is the name of the file containing the FORTRAN
source
filetype is the type of the file containing the FORTRAN
source
filemode is the mode of the file containing the FORTRAN
source
The user can also have a file of TIDY control cards on the same disk as
the FORTRAN source program. This file, if used, is named:
PROFILE TIDY filemode
TIDY produces two files:
filename TIDYLIST filemode containing a diagnostic listing
from the TIDY run
filename TIDYFORT filemode containing the cleaned up FORTRAN
source from the TIDY run
TIDY uses two scratch files which are deleted at the end of the run:
$SCRTCH1 TIDYFILE filemode
$SCRTCH2 TIDYFILE filemode
II. TIDY Control Cards:
TIDY has certain commands which control the program's
operation and output file formats. These commands may occur
in the user control file, or anywhere in the FORTRAN source
file, and may be used to negate a previous command. Default
settings are listed where meaningful.
TIDY commands must begin with an asterisk in column 1. The
remainder of the command consists of a four-letter keyword
and possibly an equal sign followed by a numeric or
alphabetic argument. Commands are negated by prefacing the
keyword with the letters NO.
The commands which control statement numbering, indentation,
and serial numbering are grouped separately, followed by
miscellaneous commands.
II.1. Statement number control:
TIDY numbers all statements in increasing order. The user
can specify the starting number for each routine, and the
increment between statement numbers. Additionally, the
statement numbers can be left- or right-justified as
desired. The commands controlling statement numbering are:
Command Description
******* ***********
*LEFT=n. / Left adjust statement numbers to column n.
*RIGHT=n. *RIGHT right adjusts statement numbers to end
in column n. Default is *LEFT=2.
*BASE=n. / Initializes counter for statement label
*NOBASE numbers to n for each program unit. *NOBASE
is equivalent to *BASE=0. Default is
*NOBASE.
*STAT=n. Set the increment for statement numbers to n.
Default is *STAT=10.
*REFE / Make a cross-reference table between new
*NOREFE labels and old labels. *NOREFE suppresses the
cross-reference table. Default is *NOREFE.
II.2. Indentation:
TIDY controls the starting column for FORTRAN statements
with the *COLUMN option. The default starting column is 7.
If desired, the *INDENT option may be used to automatically
indent the contents of DO-loops and IF-blocks. The commands
which control statement positioning are:
Command Description
******* ***********
*COLU=n./ Start FORTRAN statements in column n. *NOCOLU
*NOCOLU leaves the first letter of the FORTRAN
statement in place. Default is *COLU=7.
*INDEN=n. Indents statements within DO-loops and IF-
*NOINDEN blocks. Maximum value for n is 10. *NOINDEN
turns this option off. Default is *NOINDEN.
*FSPL / This option controls the treatment of strings
*NOFSPL in FORMAT statements when indentation is used
and the FORMAT statements are not collected
at the end of each routine. If *FSPL is
selected, a string which spans two cards will
be broken into two strings, and the
continuation card will be indented under the
FORMAT statement. If *NOFSPL is selected,
the string will not be split into two parts,
and the continuation card's text will begin
in column 7. Since splitting strings in a
FORMAT statement may adversely affect
readability, the default is *NOFSPL.
II.3. Serialization control:
Serialization consists of a 1-3 letter code in columns 73-
75, a 4-digit serial number in columns 76-79, and a minus
sign in column 80 of the END card. The *SERIAL card is the
master card which must be used to enable any of the
serialization options.
The label field can either be copied from columns 73-75 of
each FUNCTION, SUBROUTINE, or PROGRAM card (*LABEL option),
or it can be generated automatically (*NOLABEL option). The
automatic label sequence is A, B, ... , Z, AA, AB, ... .
The user can choose where to start in this sequence with the
*ROUT= card.
To prepare a deck with serial numbers in columns 76-79, but
with no label, use the *LABE option and leave columns 73-75
of each FUNCTION, SUBROUTINE, or PROGRAM card blank.
Command Description
******* ***********
*SERI / Begin or restore the punching of
*NOSERI serialization in columns 73-79. *NOSERI
cancels all labelling in columns 73-80.
Default is *NOSERI.
*ROUT=xy Reset the alphabetic label in columns 73 - 80
to the characters xy.
*LABE / Use the labelling from columns 73-75 of the
*NOLABE current FUNCTION, SUBROUTINE or PROGRAM card
for the sequencing in columns 73-80. *NOLABE
turns this option off. Default is *NOLABE.
*IDST=n. / Set the serial number increment. *IDST and
*IDIN=n. *IDIN are identical. This option works only
when *SERI is in effect. Default is *IDST=1.
II.4. String translation:
Since the Hollerith constant (nHf) is being phased out as a
way to define strings, this version of TIDY can translate
Hollerith constants to strings delimited by apostrophes.
Any apostrophes embedded in such strings will be doubled
(e.g. 1H' becomes '''').
The following options control this process:
Command Description
******* ***********
*HTRAN=n./ Selects types of Hollerith constants to be
*NOHTRAN changed to apostrophe-delimited strings. 1 =
Hollerith constants only, 2 = nLf and nRf
(CDC variants) only, 3 = all types. *NOHTRAN
turns this option off. Default is *HTRAN=1.
*HLOG / As an aid to identifying variables which
*NOHLOG should be typed as CHARACTER in Fortran-77,
executable statements in which Hollerith
constants have been converted to delimited
strings can be identified in the listing
file. Default is *NOHLOG.
*DEL1=x Defines the primary character used to delimit
strings. Default is apostrophe.
*DEL2=x / Defines an alternate character used to
*NODEL2 delimit strings. These strings may be
translated by the *DTRAN option. *NODEL2
means no alternate string delimiter is
defined. Default is *NODEL2.
*DTRAN / Causes strings delimited by a second type of
*NODTRAN delimiter (for example an asterisk) to be
changed to strings delimited by the primary
delimiter (normally an apostrophe). Any
occurrences of the primary delimiter within
such strings will be properly duplicated (for
example *'* becomes ''''). *NODTRAN turns
this option off. Default is *NODTRAN.
II.5. Miscellaneous commands:
Command Description
******* ***********
*ANSI / Issue warning messages for statements which
*NOANSI are not part of ANSI Standard FORTRAN-77.
*NOANSI suppresses such messages. Default is
*ANSI.
*ARET=x The character used to denote alternate return
addresses in CALL statements (e.g. CALL F
(*1,*2) ) is set to x. Default is * (ANSI
standard).
*ARTRAN=x / On output, the character used to denote
*NOARTRAN alternate return addresses in CALL statements
(see *ARET above) will be changed to x.
*NOARTRAN prevents this translation. Default
is *NOARTRAN.
*CARD / Produce a punch file (file containing TIDY'd
*NOCARD code). *NOCARD suppresses the creation of the
punch file. Default is *CARD.
*UCASE / Translate all characters which are not in
*LCASE / strings or comment statements to upper case
*NOCASE (*UCASE), or to lower case(*LCASE). *NOCASE
suppresses case translation, thus allowing
mixed-case statements (such as Total=0).
Default is *UCASE.
*CCHR=x / Use the character specified as x as the
*NOCCHR continuation character for all continuation
lines of a statement. Default (*NOCCHR) is
to number continuation lines as (1, 2, ... 9,
X).
*COLL / Collect format statements at the end of the
*NOCOLL routine. *NOCOLL leaves the format
statements in place. Default is *NOCOLL.
*COMM / Transmit comments to the output. *NOCOMM
*NOCOMM deletes comments from output files. Default
is *COMM.
*BLAN / Retain blank lines in output files. *NOBLAN
*NOBLAN deletes blank lines. Default is *BLAN.
*CONT / Leave GOTO's and labeled CONTINUE's which are
*NOCONT not DO-loop terminators in the code. *NOCONT
deletes such CONTINUE's and re-routes GOTO's,
unless they are within an IF-block. Default
is *NOCONT.
*ENDO / Leave DO-END DO loops in the code. *NOENDO
*NOENDO causes these loops to be converted to
conventional numbered DO-loops which
terminate with CONTINUE statements. Default
is *NOENDO.
*EXEM / Exempt non-executable statements from
*NOEXEM processing. *NOEXEM forces processing of all
statements. Default is *NOEXEM.
*FEND / *FEND forces an END statement to be written
*NOFEND at the end of each routine. *NOFEND prevents
forcing an END statement if one is not needed
(such as in an INCLUDE file). Default is
*FEND.
*LIST / Write original source to the TIDY listing
*NOLIST file. *NOLIST suppresses inclusion of the
original source. Default is *LIST.
*LIST = 2. / Write out TIDY'd code to listing file.
*NOLIST = 2. *NOLIST=2 suppresses the TIDY'd listing.
Default is LIST=2.
*NEWRO Reset everything to starting values.
*SKIP Skip processing to the end of the current
routine.