Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ftnlist(1) — IRIX 6.5.3f

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cflint(1)

ftnlint(1)

f90(1)

FTNLIST(1)                                            Last changed: 7-25-97


NAME
     ftnlist, cflist - Provides a detailed Fortran program listing

SYNOPSIS
     ftnlist [-a] [-b] [-c] [-C] [-d option_ID] [-e option_ID]
     [-f option_ID] [-g option_ID] [-h] [-H] [-i number] [-n number]
     [-o filename] [-p] [-r number] [-s number] [-v number] [-V] file.f[90]
     [file.T]  ...

     cflist [-a] [-b] [-c] [-C] [-d option_ID] [-e option_ID]
     [-f option_ID] [-g option_ID] [-h] [-H] [-i number] [-n number]
     [-o filename] [-p] [-r number] [-s number] [-v number] [-V] file.f[90]
     [file.T]  ...

IMPLEMENTATION
     ftnlist is supported on UNICOS, UNICOS/mk, and IRIX systems

     cflist is supported on UNICOS and UNICOS/mk systems

DESCRIPTION
     The ftnlist and cflist commands list a Fortran program with
     cross-references, loop and parallel indicators, and reports from a
     static call-tree analysis.  ftnlist and cflist produce a set of
     listings, tables, and reports about the target Fortran programs, as
     follows:

     * A source listing with associated reports, optional INCLUDE file
       expansions, and cross-reference tables using command-line options.

     * A set of reports and cross-reference information for each subprogram
       encountered.

     * A set of reports and cross reference information for each Fortran
       source file encountered.

     * A set of cross-reference tables and reports that are global to the
       application.  You can control these through command-line options.

     * Summary information and a table of contents.

     The ftnlist and cflist commands embed error messages, if any, in the
     source code.  They indicate jump and target directions and produce the
     following tables for each compilation unit.  Note that the exact
     content of the report depends on the compiler you are using:

     * Argument usage

     * Alternate ENTRY point table

     * Named constant usage

     * Common block usage

     * NAMELIST report

     * Parallelism report

     * Externals usage

     * Label table

     * Local variables usage

     * Module usage report

     * Internal subprogram report

     * Interface block report

     * Derived type report

     * Identifier cross-reference

     * ftnlist/cflist message report

     * Compiler messages

     The ftnlist and cflist message report contains information about the
     compilation unit that might bear further investigation (for example,
     arguments that are never used or local variables that are used before
     they are defined).

     When multiple compilation units or multiple files are presented to
     ftnlist or cflist, it also produces a series of global reports,
     including the following:

     * Global call-chain messages (for example, argument type and number
       checking and hidden alias analysis)

     * Table of files encountered, including some statistics about each

     * File/compilation unit cross-reference

     * Table of compilation units encountered, including statistics about
       each

     * Table of external subprograms encountered

     * Table of common blocks encountered

     * Common block/subprogram cross-reference

     * Subprogram - subprogram/common block cross-reference

     * INCLUDE file/subprogram cross-reference

     * NAMELIST/subprogram cross-reference

     * Module cross reference

     * A short identifier cross-reference (including I/O references and
       STOP and INCLUDE statements)

     * A local and global message summary

     * A table of contents for the listing

     * Some statistics per file and for the entire program

     To suppress any or all of the messages, use the -s command-line
     option.

     For each Fortran source file (.f or .f90 suffix) that is listed, you
     must supply a corresponding compiler information file (.T suffix).  On
     UNICOS and UNICOS/mk systems, you can create the CIF by executing the
     f90(1) command with the -Ca option.  On IRIX systems, you can create
     the CIF by executing the f90(1) command with the -cif option.

     The ftnlist and cflist commands support the following options:
     -a        Prints all common block members in the subprogram
               cross-reference in addition to the used ones.  (All members
               are printed for BLOCK DATA routines.)

     -b        Does not print blank lines.  (Always suppresses blank lines
               between subprograms.)

     -c        Does not print blank comment lines.

     -C        Does not print the summary.  Implies that -g 0 and -s501-527
               have also been specified.

     -d option_ID
               Disables subprogram list options; -d 0 disables all options.
               An option_ID is base-sensitive, additive, and processed left
               to right.

     -e option_ID
               Enables subprogram list options; -e 0 enables all options.
               An option_ID is base-sensitive, additive, and processed left
               to right.  The following table shows the ID of each
               subprogram list option in decimal, octal, and hexadecimal.

               Decimal    Octal    Hexadecimal  Default   Description

                     1  0000000001  0x0000001     OFF   Column indicators
                     2  0000000002  0x0000002     ON    Go_to, Come_from
                                                        arrows
                     4  0000000004  0x0000004     ON    Subprogram trailer
                                                        line (enabled when
                                                        source list
                                                        disabled, except
                                                        with -d0)
                     8  0000000010  0x0000008     ON    Alternate entry
                                                        points
                    16  0000000020  0x0000010     ON    Compiler messages
                    32  0000000040  0x0000020     ON    Local variable
                                                        reports
                    64  0000000100  0x0000040     ON    Named constant report
                   128  0000000200  0x0000080     ON    Label table
                   256  0000000400  0x0000100     ON    Common block report
                                                        (enabled when
                                                        cross-reference
                                                        enabled)
                   512  0000001000  0x0000200     OFF   Common block variable
                                                        usage
                  1024  0000002000  0x0000400     ON    Externals
                  2048  0000004000  0x0000800     ON    NAMELIST report
                  4096  0000010000  0x0001000     OFF   Long line indicators
                  8192  0000020000  0x0002000     ON    Derived type report
                                                        (on when
                                                        cross-reference
                                                        is on)
                 16384  0000040000  0x0004000     ON    Interface block
                                                        report
                 32768  0000100000  0x0008000     ON    Internal subprogram
                                                        report
                262144  0001000000  0x0040000     ON    Argument report
                524288  0002000000  0x0080000     ON    Cross-reference map
               8388608    0040000000    0x0800000       ON      ftnlist/cflist
messages
              16777216  0100000000  0x1000000     ON    Source

               On UNICOS and UNICOS/mk systems, the following additional
               list options are available:
                Decimal    Octal    Hexadecimal  Default   Description

                1048576  0004000000  0x0100000     ON    Parallelism marks
                2097152  0010000000  0x0200000     ON    Parallelism report
                4194304  0020000000  0x0400000     ON    Loop marks

               To select more than one list option, add the IDs of those
               options and specify the total.  For example, to enable
               column indicators (ID = 1) and to disable compiler messages
               (ID = 16) and the NAMELIST report (ID = 2048), specify one
               of the following:

                    ftnlist -e1 -d2064
                    ftnlist -e1 -d0000004020
                    ftnlist -e1 -d0x0000810

     -f option_ID
               Enables global list options; -f 0 enables all options.  An
               option_ID is base-sensitive, additive, and processed left to
               right.

     -g option_ID
               Disables global list options; -g 0 disables all options.  An
               option_ID is base-sensitive, additive, and processed left to
               right.  To select more than one list option, add the IDs of
               those options and specify the total.  The following table
               shows the ID of each global list option in decimal, octal,
               and hexadecimal.

            Decimal    Octal  Hexadecimal  Default  Description

                  1   0000001   0x00001      ON     File header
                  2   0000002   0x00002      ON     File common block
                                                    and NAMELIST reports
                  4   0000004   0x00004      ON     File subprogram
                                                    report
                  8   0000010   0x00008      ON     File statistics
                 16   0000020   0x00010      ON     Files encountered
                 32   0000040   0x00020      ON     File/subprogram
                                                    cross-reference
                 64   0000100   0x00040      ON     Subprograms
                                                    encountered
                128   0000200   0x00080      ON     Externals
                                                    encountered
                256   0000400   0x00100      ON     Common block report
                512   0001000   0x00200      OFF    (Unused)
               1024   0002000   0x00400      ON     Common/subprogram
                                                    cross-reference
               2048   0004000   0x00800      ON     Subprogram
                                                    cross-reference
               4096   0010000   0x01000      ON     Identifier
                                                    cross-reference
               8192   0020000   0x02000      OFF    (Unused)
              16384   0040000   0x04000      ON     ftnlist/cflist messages
              32768   0100000   0x08000      ON     INCLUDE file
                                                    cross-reference
              65536   0200000   0x10000      ON     NAMELIST
                                                    cross-reference
             131072   0400000   0x20000      ON     Module report

     -h        (Help)  Displays only command-line options, suppressible
               message IDs, and the list option IDs (no program execution).

     -H        (Help)  Displays the following abbreviated command line
               options (no program execution):
               a   AllXRefPrint                   i:  IncludeFileExpansion

               b   BlankPrintSuppress             n:  NewPagePerSubPgm

               c   CommentNullSuppress            o:  OutputFile

               C   CompendiumDisable              p:  PackSourceList

               d:  DisableSubrListOptions         r:  RestoreMessages

               e:  EnableSubrListOptions          s:  SuppressMessages

               f:  FnableGlobalListOptions        v:  VarLinesPerPage

               g:  GlobalListOptionsDisable       V   Print VersNo (stderr)

               hH  Help (no execution)

     -i number INCLUDE file expansion option.  Errors follow the INCLUDE
               data.  For number, enter the number that corresponds to the
               type of INCLUDE file expansion you want.

               number    INCLUDE file expansion

               0         No INCLUDE file expansion.  (default)

               1         Expands first appearance of first level only.

               2         Expands first appearance of all first-level and
                         inner-level INCLUDE files.

               3         Expands first appearance of INCLUDE files with
                         errors.

               4         Expands all appearances of first-level INCLUDE
                         files.

               5         Expands all appearances of all levels.

     -n number Sets pagination for the printing of external subprograms, as
               follows:

               number    Pagination

               1         If less than one-half page remains, go to a new
                         page.

               2-20      Each subprogram is printed on a new page
                         (default).

               20-n      If less than number+5 lines remain, go to a new
                         page.

     -o filename
               Writes the output to filename instead of stdout.

     -p        Allows page breaks to occur within multiline statements.

     -r number Restores/enables subprogram or global message number, which
               can be a range (for example, -r22-51 or -r503-507).  The
               valid values for number range from 1 through 77 and 501
               through 531.  -r 0 restores all messages.  See individual
               message IDs for local and global messages in the table that
               follows (with -s option).

     -s number Suppresses subprogram or global message number, which can be
               a range (for example, -s22-51 or -s503-507).  The valid
               ranges for number are 1 through 77 and 501 through 531.  -s
               0 suppresses all messages.

               The following lists show the message IDs for local and
               global messages.  You can suppress any or all of them.

               Message IDs per subprogram encountered:


          1    Local Variable ____ may be used before it is defined
          2    Local Variable ____ is declared but never used
          3    Local Variable ____ is used but never defined
          4    Local Variable ____ is defined but never used
          5    Local Variable ____ is DATA-initialized but may be redefined
                    before used
          6    Local Variable ____ is DATA-initialized but never used
          7    Local Variable ____ is EQUIVALENCEd but never used
          8    Multiword Variable ____ is EQUIVALENCEd but may overrun its
                    COMMON block-partner
          9    Module Local Variable never used
          10   Local Variable ____, IntSubPgm ____ overrides host version
          11   No references to COMMON /____/
          12   No references to the INCLUDEd COMMON /____/
          13   COMMON /____/ is both INCLUDEd and explicitly declared
          14   COMMON /____/ is both explicitly declared and available via
                    a MODULE
          15   COMMON /____/ is never referenced in parent Module
          21   Argument ____ is never used
          22   CALL ____ has a different ArgCnt than previous CALL
                    encountered
          23   Argument ____ is used as a dimension and is modified
          24   Argument ____ has INTENT(OUT) but is neither written nor
                    passed
          31   Warning: DO-Loop Index __ (line ___) is in COMMON
          32   Warning: DO-Loop Index __ (line ___) is an Argument
          33   Warning: DO-Loop Index __ (line ___) is a Module variable
          41   No references to PARAMETER ____
          42   No references to the INCLUDEd PARAMETER ____
          43   No references to the Module PARAMETER ____
          51   Subprogram ____ has neither a RETURN nor a STOP statement
          52   Subprogram ____ appears to not do anything
          53   __ Unused label(s)
          54   FUNCTION ____ side-effect:  Argument(s) are written
          55   FUNCTION ____ side-effect:  COMMON Block(s) are written
          56   Subprogram ____ has excessive trailing blanks (off by
                    default)
          57   Internal subprogram ____ is never called
          58   Duplicate subprogram name ____
          61   No references to Statement Function ____
          62   Line ____ is not reachable
          63   NAMELIST /____/ is never used
          64   __ Longline(s) (off by default)
          65   Cray Pointer/ee ____ may be used before it is defined
          66   Cray Pointer/ee ____ is declared but never used
          67   Cray Pointer/ee ____ is used but never defined
          68   Cray Pointee ____ is defined but never used
          69   Cray Pointee ____ is used but associated Pointer ____ not
                    defined
          71   EQUIVALENCEd LocalVar ____ has same name as MODULE variable
          72   EQUIVALENCEd LocalVar ____ has same name as MODULE ComBlk
                    variable
          73   No references to imported Module ____
          74   No references to USEd Module ____
          75   Module ____ USEd more than once
          76   USEd Module ____ also imported into parent Module
          77   Duplicate Module name ____

               Message ID for global call-chain concerns:


               501  No callers
               502  Argument count mismatch
               503  Argument type mismatch
               504  Expression passed as argument, Callee writes/passes
               505  Expression passed as argument, Callee expects array
               506  DO-Loop index sent as Argument, Callee writes/passes it
               507  Argument dimensionality mismatch
               508  Duplicate argument sent, Callee writes/passes one
               509  Argument sent from COMMON, Callee writes that COMMON
               510  Possible hidden alias
               511  COMMON block length mismatch
               512  COMMON block is never used
               513  COMMON block is read-only
               514  COMMON block is write-only
               515  NAMELIST length mismatch
               516  FUNCTION return value mismatch
               517  F90 argument attribute mismatch
               518  F90 caller:  required explicit interface block missing
               519  F90 dummy argument INTENT error
               520  Subprogram needs RECURSIVE keyword
               521  SUBROUTINE/FUNCTION CALL mismatch
               522  Duplicate Subprogram name
               523  Duplicate Module name
               524  Argument (Subprogram) mismatch (e.g. scalar passed,
                         SUBROUTINE expected, etc.)
               525  Argument (Derived Type) mismatch
               526  Possible argument (SUBROUTINE/FUNCTION) mismatch
               527  Alternate ENTRY has no callers
               528  Subprogram/Interface Block mismatch
               529  Common block has multiple SubPgm DATA initialization
               530  Argtype (Alternate-RETURN-label) mismatch
               531  FUNCTION return value dimension mismatch

     -v number Sets the maximum lines per page to number.  The default is
               the value of the LPP environment variable if it is set;
               otherwise, the value is 63.  The valid range for number is
               50 through 200.

     -V        Prints version information to stderr.

     file.f[90] [file.T]
               Specifies the set of target Fortran source files and their
               derived Compiler Information Files.  Source file names can
               end with either .f or .f90.  When the .T file name can be
               generated by replacing the .f (or .f90) with a .T, you do
               not have to list the .T file name explicitly.

FILES
     These commands look for files named .ftnlistrc or .cflistrc in your
     home directory and the current working directory; they concatenate
     them (in that order); and they prepend the resulting string to the
     command line options.  The .ftnlistrc or .cflistrc file can contain
     any combination of command line options, but a maximum of one
     -o filename option is allowed.  The .ftnlistrc or .cflistrc file
     cannot contain file names.  Newline characters are silently converted
     to blanks.  The command line options are processed left to right, so
     options included in the .ftnlistrc or .cflistrc file can be
     overridden.

EXAMPLES
     The following is an example of the cross-reference map, which is part
     of the listing generated by ftnlist:

     Type    Usage  EqDSv Offset  Home      Name           References
    ------   -----  ----- ------ ------    ------        --------------
    Real    1-D Arr            2  Arg      A              1     2     5=
    Real    1-D Arr            1  Arg      B              1     2     5
    Real    1-D Arr            3  Arg      C              1     2     5
    Int64   Scalar    -        0  Stack    I              4=    5+
    Int64   Scalar             4  Arg      N              1     4
                                           {Return}       7

    Prioritized Reference Legend:  "Nc"  where "N" is the local line number
    and "c" is one of "=-+.".
    = means set,  - means passed,  + means multiple references,  . means
    INCLUDEd reference.

     The following list explains each column:

     Type           The type of the entity being reported

     Usage          How the entity is being used.  Scalar means a simple
                    (not dimensioned) variable, and 3-D Arr means a three-
                    dimensional array.

     EqDSv          Gives the EQUIVALENCE, DATA, or SAVE status (if any) of
                    the entity.

     Offset         The offset of the entity from the base of its home.
                    For example, for an Arg, a 3 means it is the third
                    argument, and for a common block reference, a 7 means
                    it is 7 words from the base address of the common block
                    (which can be found from a load map).

     Home           Indicates where the entity is located.  For example,
                    Arg means it is an argument to this procedure; stack
                    means it is on the stack for this procedure; /2/ means
                    it is in common block 2 (see common block table), and
                    so on.  Not all entities have a home.

     Name           The variable name, or another reported cross reference
                    entity, such as {Return}.

     References     The line numbers at which the entity can be found.  The
                    symbols following line numbers, such as = and  +, are
                    explained in the footnote following the cross-reference
                    table.

NOTES
     ftnlist and cflist output is not designed to be used as input to other
     tools.

     For more information about writing and using tools based on output
     from an f90 compilation, see the Compiler Information File (CIF)
     Reference Manual, publication SR-2401.  SR-2401, a Cray Research
     publication, contains information for UNICOS and UNICOS/mk systems
     only.

     These commands display 132 characters per output line.

     These commands perform limited EQUIVALENCE analysis, which assumes
     that if a local variable appears in an EQUIVALENCE statement, it is
     not subject to analysis (for example, use before definition).

     These commands produce source listings, but they do not produce
     reports for any subprograms that contain errors.
ENVIRONMENT VARIABLES
     The ftnlist and cflist commands check your environment for several
     strings to help control its output.  If the CCTL environment variable
     is set to FORTRAN, Fortran-style carriage control (a 1 in column one)
     initiates a new page; otherwise, the ASCII form-feed character is
     used.  The default is ASCII.  If the LPP environment variable is set
     to an integer in the range 50 to 200, these commands put out a maximum
     of integer lines per page.  The default is 63 lines per page.  To
     override the LPP or default value, use the -v option.  If the
     FTNLISTRC environment variable is set to OFF or the CFLISTRC
     environment variable is set to OFF, all .ftnlistrc and .cflistrc files
     are silently ignored.

RETURN VALUES
     The ftnlist and cflist commands return 0 on normal completion and
     nonzero for abnormal termination.

BUGS
     ftnlist and cflist accept Fortran program source files that end in .F
     or .F90, but some of the functionality described on this man page is
     not present for files with .F and .F90 suffixes.

SEE ALSO
     cflint(1), ftnlint(1), f90(1)

     Compiler Information File (CIF) Reference Manual, publication SR-2401

     SR-2401, a Cray Research publication, describes the CIF only for
     UNICOS and UNICOS/mk systems.

     This man page is available only online.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026