home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / fchk294b.zip / ftnchek-2.9.4 / ftnchek.hlp < prev    next >
Text File  |  1996-10-02  |  70KB  |  1,387 lines

  1.  
  2. 1 FTNCHEK
  3.        ftnchek - Fortran 77 program checker
  4.  
  5. 2 Introduction
  6.       ftnchek  (short  for Fortran checker) is designed to detect cer-
  7.  tain errors in a Fortran program that a compiler  usually  does  not.
  8.  ftnchek  is not primarily intended to detect syntax errors.  Its pur-
  9.  pose is to assist the user  in  finding  semantic  errors.   Semantic
  10.  errors  are  legal  in  the  Fortran language but are wasteful or may
  11.  cause incorrect operation.  For example, variables  which  are  never
  12.  used  may  indicate some omission in the program; uninitialized vari-
  13.  ables contain garbage which may cause incorrect results to be  calcu-
  14.  lated; and variables which are not declared may not have the intended
  15.  type.  ftnchek is intended to assist users in the debugging of  their
  16.  Fortran  program.   It  is  not  intended to catch all syntax errors.
  17.  This is the function of the compiler.  Prior to  using  ftnchek,  the
  18.  user should verify that the program compiles correctly.
  19.  
  20.  For more detailed information, consult the printed documentation.
  21.  
  22. 2 Invoking_Ftnchek
  23.        ftnchek is invoked through a command of the form:
  24.  
  25.         $ ftnchek [/option /option ...] filename [filename ...]
  26.       The brackets indicate something which is optional.  The brackets
  27.  themselves are not actually typed.   Here  options  are  command-line
  28.  switches  or settings, which control the operation of the program and
  29.  the amount of information that will be printed out.  If no option  is
  30.  specified,  the  default action is to print error messages, warnings,
  31.  and informational messages, but not the  program  listing  or  symbol
  32.  tables.
  33.  
  34.       Each option begins with the '/' character.  (ftnchek also allows
  35.  the '-' character to be used.)
  36.       ftnchek options fall into two categories:  switches,  which  are
  37.  either  true  or  false, and settings, which have a numeric or string
  38.  value.  The name of a switch is prefixed by 'no' to turn it off: e.g.
  39.  /nopure  would turn off the warnings about impure functions. The 'no'
  40.  prefix can also be used with numeric settings, having the  effect  of
  41.  turning  off the corresponding warnings.  Settings that control lists
  42.  of warnings have a special syntax discussed below.  Only the first  3
  43.  characters of an option name (not counting the '/') need be provided.
  44.  A colon may be used in place of an equals sign for numeric or  string
  45.  setting  assignments;  however,  we  show  only  the equals sign form
  46.  below.
  47.  
  48.       When more than one option is used, they should be separated by a
  49.  blank  space.  No blank spaces may be placed around the equals sign (
  50.  = ) in a setting.  ftnchek "?"  will produce a command summary  list-
  51.  ing all options and settings.
  52.       For settings that take a list of warnings, namely /f77, /pretty,
  53.  /portability, and /truncation, the list consists  of  keywords  sepa-
  54.  rated  by  commas  or  colons.   The  list can be omitted, having the
  55.  effect of turning on all the corresponding warnings.   Also,  if  the
  56.  list is omitted, the setting name can be prefixed with no to turn off
  57.  all the warnings it controls.  For example, /f77 turns on  all  warn-
  58.  ings  about  nonstandard  constructions,  while /nof77 turns them all
  59.  off.    Three special keywords are:
  60.     help Print out all the warning option keywords controlled  by  the
  61.         setting,  with  a  brief  explanation of their meanings.  This
  62.         keyword cannot be given in a list with other keywords.
  63.     all Set all warnings. This turns on all warnings controlled by the
  64.         setting.
  65.     none  Clear  all warnings.  This turns off all warnings controlled
  66.         by the setting.
  67.       These special keywords must be given in  full.   For  all  other
  68.  warning  keywords,  only as many letters of the keyword as are neces-
  69.  sary to identify it unambiguously need be given.  Including a keyword
  70.  in the list turns its warnings on.  For example, /f77=intrinsic would
  71.  turn on only the warnings about use of  nonstandard  intrinsic  func-
  72.  tions.  Prefixing a keyword by no- turns its warnings off.  For exam-
  73.  ple, /pretty=no-long-line turns off warnings about lines exceeding 72
  74.  columns  in  length while leaving all other warnings about misleading
  75.  appearance in effect.  If a setting has default none, you can turn on
  76.  all  warnings  except  one  or  two by using all first.  For example,
  77.  /f77=all,no-include enables warnings about all nonstandard extensions
  78.  except  INCLUDE  statements.   If  a setting has default all, you can
  79.  turn off all warnings except one or two by  using  none  first.   For
  80.  example,  /truncation=none,demotion  would  turn  off  all  precision
  81.  related warnings except about demotions.
  82.       When ftnchek starts up, it looks for environment  variables  and
  83.  also  for a preferences file.  Any options defined in the environment
  84.  or in the preferences file are used  as  defaults  in  place  of  the
  85.  built-in defaults.  They are over-ridden by any command line options.
  86.  See the section on changing the defaults for details about the  envi-
  87.  ronment options and the preferences file.
  88.  
  89. 2 Files
  90.       When  giving a name of an input file, the extension is optional.
  91.  If no extension is given, ftnchek will first look for a project  file
  92.  with  extension  .prj,  and will use that if it exists.  If not, then
  93.  ftnchek will look for a Fortran source file with the extension  .for.
  94.  More  than one file name can be given to ftnchek, and it will process
  95.  the modules in all files as if they were in a single file.
  96.  
  97.       Wildcards are allowed in the specification of filenames  on  the
  98.  command line.
  99.       If  no filename is given, ftnchek will read input from the stan-
  100.  dard input.
  101.  
  102.  
  103. 2 Options
  104.       ftnchek options fall into two categories:  switches,  which  are
  105.  either  true  or  false, and settings, which have a numeric or string
  106.  value.  The name of a switch or numeric setting can  be  preceded  by
  107.  'no'  to turn it off: e.g. /nousage would turn off the warnings about
  108.  variable usage.  Only the first 3 characters of an option  name  (not
  109.  counting  the  '/')  need  be provided.  Most options are positional:
  110.  each option remains in effect from the point it is encountered  until
  111.  it is overridden by a later change.
  112.  
  113.  
  114. 3 /arguments=num
  115.         Controls  warnings  about  mismatches between actual and dummy
  116.  subprogram arguments.  (An actual argument is an argument  passed  to
  117.  the  subprogram  by  the  caller;  a  dummy  argument  is an argument
  118.  received by the subprogram.)
  119.  
  120.      The meanings of the setting values are as follows:
  121.     0: turn off all such warnings.
  122.     1: warn only about different number of arguments.
  123.     2: warn only about mismatch of data type of arguments and of func-
  124.         tion itself.
  125.     3: all warnings.
  126.  
  127.      Default = turn-on = 3.
  128.  
  129.      This  setting does not apply to checking invocations of intrinsic
  130.  functions or statement functions.
  131.  
  132.      See also: /array, /library, /usage.
  133.  
  134.  
  135. 3 /array=num
  136.        Controls the degree of strictness in checking agreement between
  137.  actual  and dummy subprogram arguments that are arrays.  The warnings
  138.  controlled by this setting are for constructions that  might  legiti-
  139.  mately be used by a knowledgeable programmer, but that often indicate
  140.  programming errors.
  141.  
  142.      The meanings of the setting values are as follows:
  143.     0: only warn about cases that are  seldom  intentional  (see  note
  144.         below).
  145.     1:  warn if the arguments differ in their number of dimensions, or
  146.         if the actual argument is an array  element  while  the  dummy
  147.         argument is a whole array.
  148.     2: warn if both arguments are arrays, but they differ in number of
  149.         elements.
  150.     3: give both types of warnings.
  151.  
  152.      Default = turn-on = 3.
  153.  
  154.      Note: A warning is always given regardless of this setting if the
  155.  actual  argument  is  an  array  while the dummy argument is a scalar
  156.  variable, or if the actual argument is a scalar variable  or  expres-
  157.  sion  while the dummy argument is an array.  No warning is ever given
  158.  if the actual argument is an array element while the  dummy  argument
  159.  is  a scalar variable.  Variable-dimensioned arrays and arrays dimen-
  160.  sioned with 1 or asterisk match any number of array elements.   There
  161.  is  no check of whether multi-dimensional arrays agree in the size of
  162.  each dimension separately.
  163.  
  164.      See also: /arguments, /library, /usage.
  165.  
  166.  
  167. 3 /calltree=num
  168.        Causes ftnchek to print out the call structure of the  complete
  169.  program.   The  value  of num is the sum of numbers selected from the
  170.  following list:
  171.     0: do not produce any call graph.
  172.     1: produce the call graph in tree format.
  173.     2: produce the call graph in who-calls-who format (same as /refer-
  174.         ence switch).
  175.     3: produce the call graph in VCG format (same as /vcg switch).
  176.     4:  do not prune repeated subtrees (applicable only for format 1).
  177.     8: do not sort children into alphabetical order.
  178.  
  179.      Only one of the formats 1, 2, or 3 may be included  in  the  sum.
  180.  If  no  format  is specified but one of the other options is given so
  181.  that the number is nonzero, call-tree format will be used.
  182.  
  183.      Default = turn-on = 1.  See the discussion of the /reference  and
  184.  /vcg flags for details about these formats.
  185.  
  186.      For  tree  format, The tree is printed out starting from the main
  187.  program, which is listed on the first line at the left margin.   Then
  188.  on  the  following  lines, each routine called by the main program is
  189.  listed, indented a few spaces, followed by the  subtree  starting  at
  190.  that routine.
  191.  
  192.      In  the  default  mode,  if  a routine is called by more than one
  193.  other routine, its call subtree is printed only the first time it  is
  194.  encountered  Later  calls  give  only the routine name and the notice
  195.  ``(see above)''.  To have the subtree printed for each occurrence  of
  196.  the routine, include 4 (don't-prune) in num.
  197.  
  198.      Note  that  the  call tree will be incomplete if any of the input
  199.  files are project files containing more than  one  module  that  were
  200.  created in /library mode.  See the discussion of project files below.
  201.  
  202.      Technical points: Each list of routines called by a given routine
  203.  is  printed  in  alphabetical  order.   If multiple main programs are
  204.  found, the call tree of each is printed separately.  If no main  pro-
  205.  gram  is  found, a report to that effect is printed out, and the call
  206.  trees of any top-level non-library routines are printed.   This  flag
  207.  only  controls  the printing of the call tree: ftnchek constructs the
  208.  call tree in any case because it is used to determine  which  library
  209.  modules  will  be  cross-checked.  See the discussion of the /library
  210.  flag.
  211.  
  212.      See also: /crossref, /library, /reference, /sort, /symtab,  /vcg.
  213.  
  214.  
  215. 3 /check
  216.        This switch is provided so that errors and warning messages can
  217.  be turned off when ftnchek is used for purposes  other  than  finding
  218.  bugs,  such  as making declarations or printing the call tree.  It is
  219.  positional, so after turning all checks off, selected checks  can  be
  220.  turned  back  on.   The  effect  of  /nocheck is to put all switches,
  221.  numeric settings, and settings controlling lists of warnings to their
  222.  turn-off  values, as if they had all been specified with the /no pre-
  223.  fix.  The only exceptions are /quiet, /source, /wrap  and  /wordsize,
  224.  which are unaffected by this switch.  Default = yes.
  225.  
  226.      Parse  errors  (syntax  errors  due  to unrecognized or malformed
  227.  statements) are not suppressed by this switch, since the results  may
  228.  be  incorrect  if ftnchek has not parsed the program correctly.  Note
  229.  that /check as an option has no  effect:  this  flag  can  only  turn
  230.  checking off, not turn it back on again.
  231.  
  232.  
  233. 3 /columns=num
  234.         Set  maximum statement length to num columns.  (Beyond this is
  235.  ignored.)  This setting is provided to  allow  checking  of  programs
  236.  which  may  violate  the Fortran standard limit of 72 columns for the
  237.  length of a statement.  According to  the  standard,  all  characters
  238.  past  column  72  are  ignored.   If  this  setting  is used when the
  239.  /f77=long-line option is in effect, a warning will be given  for  any
  240.  lines  in  which  characters past column 72 are processed.  Turn-on =
  241.  max = 132.  Default = 72.
  242.  
  243.      This setting does not suppress warnings  about  the  presence  of
  244.  characters beyond column 72.  To process code with meaningful program
  245.  text beyond column  72,  use  this  setting  and  be  sure  the  /f77
  246.  long-line  option  is  off.  To process code with sequence numbers in
  247.  columns 73 to 80, leave the the columns setting at the default  value
  248.  and use the /pretty=no-long-line flag.
  249.  
  250.  
  251. 3 /common=num
  252.         This  setting  varies  the  strictness  of  checking of COMMON
  253.  blocks.
  254.  
  255.      The different levels are:
  256.     0: no checking.
  257.     1: in each declaration of a given COMMON block, corresponding mem-
  258.         ory locations (words or bytes) must agree in data type.
  259.     2:  also  warn if different declarations of the same block are not
  260.         equal in total length.
  261.     3: corresponding variables in each declaration  of  a  block  must
  262.         agree  in  data  type  and  (if  arrays) in size and number of
  263.         dimensions.
  264.  
  265.      Default = turn-on = 3.
  266.  
  267.      The Fortran 77 Standard requires each named common block, but not
  268.  blank  common,  to  be the same length in all modules of the program.
  269.  Level 3 provides an extra degree of checking to  support  a  frequent
  270.  programming practice.
  271.  
  272.      See also: /library, /usage, /volatile.
  273.  
  274.  
  275. 3 /crossref
  276.         Specifies that a cross-reference table be printed.  This table
  277.  lists each subprogram followed by a list of the  routines  that  call
  278.  it.  Also prints a table listing each COMMON block followed by a list
  279.  of the routines that access it.  Default = no.
  280.  
  281.      The cross-reference listing omits library modules that are not in
  282.  the  call  tree  of the main program.  The list is alphabetized.  The
  283.  routines listed as using a COMMON block are those in which some vari-
  284.  ables  in  the  block  are  accessed,  not simply those routines that
  285.  declare the block.  (To find out what routines declare a COMMON block
  286.  but do not use it, see the /usage flag.)
  287.  
  288.      See also: /calltree, /reference, /sort, /symtab, /vcg.
  289.  
  290.  
  291. 3 /declare
  292.         If  this  flag  is  set, all identifiers whose datatype is not
  293.  declared in each module will be listed.   This  flag  is  useful  for
  294.  helping  to  find  misspelled  variable names, etc.  The same listing
  295.  will be given if the module  contains  an  IMPLICIT  NONE  statement.
  296.  Default = no.
  297.  
  298.      See also: /sixchar, /usage.
  299.  
  300.  
  301. 3 /division
  302.         This  switch is provided to help users spot potential division
  303.  by zero problems.  If this switch is selected, every division  except
  304.  by  a  constant  will  be  flagged.   (It is assumed that the user is
  305.  intelligent enough not to divide by a  constant  which  is  equal  to
  306.  zero!)  Default = no.
  307.  
  308.      See also: /portability, /truncation.
  309.  
  310.  
  311. 3 /extern
  312.        Causes ftnchek to report whether any subprograms invoked by the
  313.  program are never defined, or are multiply defined.   Ordinarily,  if
  314.  ftnchek  is  being  run  on a complete program, each subprogram other
  315.  than the intrinsic functions should be defined  once  and  only  once
  316.  somewhere.   Turn  off this switch if you just want to check a subset
  317.  of files which form part of a larger complete program,  or  to  check
  318.  all  at  once a number of unrelated files which might each contain an
  319.  unnamed main program.  Subprogram arguments will still be checked for
  320.  correctness.  Default = yes.
  321.  
  322.      The  /extern flag is now superseded by the Level 1 usage checking
  323.  of subprograms.  For the sake of compatibility with earlier  versions
  324.  of  ftnchek,  the  /extern  flag  is  retained, so that  /noextern is
  325.  equivalent to a 0 or 2 in the hundreds place of the  /usage  setting.
  326.  However, to avoid anomalous behavior, you should not use both /extern
  327.  and /usage on the command line.  Probably the /extern switch will  be
  328.  retired eventually.
  329.  
  330.      See also: /library.
  331.  
  332.  
  333. 3 /f77=list
  334.        Use this setting to catch language extensions which violate the
  335.  Fortran 77 Standard.  Such extensions may cause your program  not  to
  336.  be  portable.   Examples  include  the use of underscores in variable
  337.  names; variable names longer than  six  characters;  statement  lines
  338.  longer  than 72 characters; and nonstandard statements such as the DO
  339.  ... ENDDO structure.  ftnchek does not report on the use of lowercase
  340.  letters.  By default, all warnings are turned off.
  341.  
  342.      This  setting  provides  detailed control over the warnings about
  343.  supported extensions to the Fortran 77 Standard.  The  list  consists
  344.  of  keywords  separated by commas or colons.  There are three special
  345.  keywords: all to turn on all the warnings  about  nonstandard  exten-
  346.  sions,  none  to turn them all off, and help to print the list of all
  347.  the keywords with a brief explanation of each.  If list  is  omitted,
  348.  /f77   is  equivalent  to  /f77=all,  and  /nof77  is  equivalent  to
  349.  /f77=none.  The warning keywords with their meanings are as  follows.
  350.     accept-type: ACCEPT and TYPE I/O statements.
  351.     backslash: Unix backslash escape in strings.  This warning will be
  352.         given only if the /source setting value 4 (UNIX backslash)  is
  353.         specified to cause the escape interpretation of backslash..
  354.     byte: BYTE data type declaration.
  355.     common-subprog-name:  Common  block and subprogram having the same
  356.         name.
  357.     continuation: More than 19 successive continuation lines.
  358.     cpp: Unix C preprocessor directives in the source code.
  359.     d-comment: Debugging comments starting with D in the source  code.
  360.     dec-tab:  DEC Fortran style tab-formatted source code.  This warn-
  361.         ing will be given only if the /source setting value 1 is spec-
  362.         ified to cause interpretation of tabs in this style.
  363.     do-enddo:  DO  loop  extensions: terminal statement label omitted,
  364.         END DO, and WHILE.
  365.     double-complex: Double precision complex datatype.
  366.     format-dollarsign: Dollar sign control code in FORMAT  statements.
  367.     format-edit-descr:  Nonstandard  edit descriptors in FORMAT state-
  368.         ments.
  369.     function-noparen: Function definition without parentheses.
  370.     implicit-none: IMPLICIT NONE statement.
  371.     include: INCLUDE statement.
  372.     inline-comment:  Inline  comments  starting  with  an  exclamation
  373.         point.
  374.     internal-list-io: List-directed I/O to or from an internal file.
  375.     intrinsic: Nonstandard intrinsic functions.
  376.     long-line:  Statements with meaningful code past 72 columns.  This
  377.         warning is given only if the /columns setting has been used to
  378.         increase the statement field width.
  379.     long-name: Identifiers over 6 characters long.
  380.     mixed-common:  Mixed  character  and  noncharacter  data in COMMON
  381.         block.
  382.     mixed-expr: Nonstandard  type  combinations  in  expressions,  for
  383.         example  DOUBLE PRECISION with COMPLEX, assigning hollerith to
  384.         integer, logical operations on integers.
  385.     name-dollarsign: Dollar sign used as a character in identifiers.
  386.     name-underscore: Underscore used as a character in identifiers.
  387.     namelist: NAMELIST statement.
  388.     param-intrinsic: Intrinsic function or exponentiation  by  a  real
  389.         used to define the value of a PARAMETER definition.
  390.     param-noparen: PARAMETER statement without parentheses.
  391.     pointer: ``Cray pointer'' syntax.
  392.     quad-constant:  Quad  precision  real  constants, e.g. of the form
  393.         1.23Q4.
  394.     quotemark: Strings delimited by quote marks rather  than  apostro-
  395.         phes.
  396.     statement-order  Statements  out  of  the sequence mandated by the
  397.         Standard.  The allowed sequence is illustrated in Table  1  in
  398.         the section on Interpreting the Output.
  399.     typeless-constant: Typeless constants, for example Z'19AF.
  400.     type-size:  Type  declarations  specifying  a  size,  for  example
  401.         REAL*8.
  402.     variable-format: Variable repeat specification or  field  size  in
  403.         FORMAT.  These are of the form < expr >.
  404.     vms-io: The following VMS Fortran keywords used in I/O statements:
  405.  
  406.         NAME (in OPEN; it is standard only in INQUIRE)
  407.         BLOCKSIZE         EXTENDSIZE        READONLY
  408.         BUFFERCOUNT       INITIALSIZE       RECORDSIZE
  409.         CARRIAGECONTROL   MAXREC            RECORDTYPE
  410.         DEFAULTFILE       NOSPANBLOCK       SHARED
  411.         DISP              ORGANIZATION      TYPE
  412.         DISPOSE
  413.  
  414.  
  415.      See also: /portability, /pretty, /wordsize.
  416.  
  417.  
  418. 3 /help
  419.        Prints a list of all the  command-line  options  with  a  short
  420.  description  of  each  along with its default value.  This command is
  421.  identical in function to the ``?''  argument, and is  provided  as  a
  422.  convenience  for those systems in which the question mark has special
  423.  meaning to the command interpreter.  Default = no.
  424.  
  425.      The help listing also prints the version number and  patch  level
  426.  of ftnchek and a copyright notice.
  427.  
  428.      Note:  the  ``default''  values printed in square brackets in the
  429.  help listing are, strictly speaking, not the  built-in  defaults  but
  430.  the current values after any environment options and any command-line
  431.  options preceding the /help option have been processed.
  432.  
  433.      See also: /version, /f77=help,  /portability=help,  /pretty=help,
  434.  /truncation=help.
  435.  
  436.  
  437. 3 /include=path
  438.         Specifies  a  directory  to be searched for files specified by
  439.  INCLUDE statements.  Unlike other command-line options, this  setting
  440.  is  cumulative; that is, if it is given more than once on the command
  441.  line, all the directories so specified are placed on a list that will
  442.  be  searched in the same order as they are given.  The order in which
  443.  ftnchek searches for a file to be included is: the current directory;
  444.  the  directory  specified  by environment variable FTNCHEK_INCLUDE if
  445.  any; the directories specified by any /include options; the directory
  446.  specified  by environment variable INCLUDE; and finally in a standard
  447.  systemwide directory (/usr/include for UNIX, SYS$LIBRARY for VMS, and
  448.  \include for MSDOS).
  449.  
  450.  
  451. 3 /intrinsic=num
  452.         Controls  treatment  of  nonstandard intrinsic functions.  The
  453.  setting consists of three digits.  The ones digit selects the set  of
  454.  intrinsic  functions  to be supported.  Set 0 selects only Fortran 77
  455.  standard intrinsics plus those  needed  to  support  the  nonstandard
  456.  extended precision data types.  These include intrinsics for the dou-
  457.  ble complex data type:
  458.  
  459.      CDABS    CDSQRT   DREAL    ZLOG
  460.      CDCOS    DCMPLX   IMAG     ZSIN
  461.      CDEXP    DCONJG   ZABS     ZSQRT
  462.      CDLOG    DIMAG    ZEXP     ZCOS
  463.      CDSIN
  464.  
  465.  and for the quad precision and quad complex types:
  466.  
  467.      CQABS    QARCOS   QEXT     QNINT
  468.      CQCOS    QARSIN   QEXTD    QPROD
  469.      CQEXP    QATAN    QFLOAT   QREAL
  470.      CQLOG    QATAN2   QIMAG    QSIGN
  471.      CQSIN    QCMPLX   QINT     QSIN
  472.      CQSQRT   QCONJG   QLOG     QSINH
  473.      DBLEQ    QCOS     QLOG10   QSQRT
  474.      IQINT    QCOSH    QMAX1    QTAN
  475.      IQNINT   QDIM     QMIN1    QTANH
  476.      QABS     QEXP     QMOD     SNGLQ
  477.  
  478.  Set 1 includes set 0 as well  as  the  following  commonly  available
  479.  intrinsics  (all except EXIT and LOC are defined in MIL-STD 1753):
  480.  
  481.      BTEST    IBCLR    IEOR     ISHFTC
  482.      EXIT     IBITS    IOR      LOC
  483.      IAND     IBSET    ISHFT    NOT
  484.  
  485.  Set 2 includes set 1, plus these common Unix intrinsic functions:
  486.  
  487.      ABORT    GMTIME   LTIME    SRAND
  488.      AND      IARGC    OR       SYSTEM
  489.      GETARG   IRAND    RAND     TIME
  490.      GETENV   LSHIFT   RSHIFT   XOR
  491.  
  492.  Set 3 includes set 1, plus these common VMS functions:
  493.  
  494.      DATE     IDATE    SECNDS   TIME
  495.      ERRSNS   RAN      SIZEOF
  496.  
  497.  The  tens  digit  of  this  setting  controls  the syntax of the RAND
  498.  intrinsic function.  Specify 0 to require invocation  with  no  argu-
  499.  ment,  1  to  require  one argument, and 2 to allow either form.  The
  500.  hundreds digits controls the syntax of the IARGC function in the same
  501.  way.
  502.  
  503.      Note  that  this  setting  does  not control whether non-standard
  504.  warnings are issued about these functions.  It controls  whether  the
  505.  functions  are  assumed  to be intrinsic or not, which determines how
  506.  their usage is checked.  When functions in  any  of  these  sets  are
  507.  included,  their  invocations  will be checked according to the rules
  508.  for the intrinsic functions; otherwise they will be checked as normal
  509.  (user-written)  external  functions.   The  non-standard warnings are
  510.  controlled by the /f77=intrinsic option.
  511.  
  512.      Default setting = turn-on = 222 for the Unix version, 223 for the
  513.  VMS  version,  and 221 for all other versions of ftnchek.  Turn-off =
  514.  0.
  515.  
  516.  
  517. 3 /library
  518.        This switch is used when a number of subprograms are  contained
  519.  in  a  file,  but  not all of them are used by the application.  Nor-
  520.  mally, ftnchek warns you if any subprograms  are  defined  but  never
  521.  used.  This switch will suppress these warnings.  Default = no.
  522.  
  523.      This switch also controls which subprogram calls and COMMON block
  524.  declarations are checked.  If a file is read with the  /library  flag
  525.  in  effect, the subprogram calls and COMMON declarations contained in
  526.  a routine in that file will be checked only if that routine is in the
  527.  main  program's call tree.  On the other hand, if the /library switch
  528.  is turned off, then ftnchek checks the  calls  of  every  routine  by
  529.  every  other routine, regardless of whether those routines could ever
  530.  actually be invoked at run time, and likewise all COMMON block decla-
  531.  rations are compared for agreement.
  532.  
  533.      The difference between this switch and the /usage level 2 setting
  534.  for subprograms is that the latter suppresses only the warning  about
  535.  routines  being declared but not used.  The /library switch goes fur-
  536.  ther and excludes unused routines processed while  it  is  in  effect
  537.  from all cross-checking of arguments and COMMON block declarations as
  538.  well.
  539.  
  540.      (If there is no main program anywhere in the set  of  files  that
  541.  ftnchek  has  read,  so that there is no call tree, then ftnchek will
  542.  look for any non-library routines that are not called  by  any  other
  543.  routine,  and  use  these as substitutes for the main program in con-
  544.  structing the call tree and deciding what to check.  If no such  top-
  545.  level non-library routines are found, then all inter-module calls and
  546.  all COMMON declarations will be checked.)
  547.  
  548.      See also: /arguments, /calltree, /common, /extern, /usage.
  549.  
  550.  
  551. 3 /list
  552.        Specifies that a listing  of  the  Fortran  program  is  to  be
  553.  printed  out  with  line  numbers.   If ftnchek detects an error, the
  554.  error message follows the program line with a caret ( ^ )  specifying
  555.  the  location  of  the  error.   If  no source listing was requested,
  556.  ftnchek will still print out any line containing an error, to aid the
  557.  user in determining where the error occurred.  Default = no.
  558.  
  559.      See also: /symtab, /quiet.
  560.  
  561.  
  562. 3 /makedcls=num
  563.         Prepare  a neatly-formatted file of declarations of variables,
  564.  common blocks, and namelist lists,  for  possible  merging  into  the
  565.  source  code.  The declarations are stored in a file of the same name
  566.  as the source code, but with the extension changed to  .dcl.   If  no
  567.  declarations are written to the file, it is deleted to reduce clutter
  568.  from empty files.
  569.  
  570.      If input comes from standard input, instead of a named file, then
  571.  declarations are written to standard output.
  572.  
  573.      Variables are declared in alphabetical order within each declara-
  574.  tion class and type, with integer variables first, because  of  their
  575.  later possible use in array dimensions.
  576.  
  577.      PARAMETER  statements  are an exception to the alphabetical order
  578.  rule, because the Fortran 77 Standard requires that  the  expressions
  579.  defining parameter values refer only to constants and already-defined
  580.  parameter names.  This forces the original source file order of  such
  581.  statements to be preserved in the declaration files.
  582.  
  583.      Explicit  declaration  of all variables is considered good modern
  584.  programming practice.  By using compiler options to reject undeclared
  585.  variables,  misspelled variable names (or names extending past column
  586.  72) can be  caught  at  compile  time.   Explicit  declarations  also
  587.  greatly  facilitate  changing  floating-point  precision with filters
  588.  such  as  dtoq(1L),  dtos(1L),  fd2s(1L),  fs2d(1L),  qtod(1L),   and
  589.  stod(1L).   These  programs are capable of changing types of explicit
  590.  floating-point type declarations, intrinsic functions, and constants,
  591.  but  because  they  do not carry out rigorous lexical and grammatical
  592.  analysis of the Fortran source code,  they  cannot  provide  modified
  593.  type  declarations  for  undeclared  variables.  Default setting = 0,
  594.  turn-on = 1.
  595.  
  596.      The setting values are given by the sum of selected option values
  597.  from the following list:
  598.     0: Do not write a declaration file.
  599.     1: Write a declaration file.
  600.     2:  Normally,  all variables are included in the declaration file.
  601.         With this option, include  only  undeclared  variables.   This
  602.         setting  is  useful  if you want to check for undeclared vari-
  603.         ables, since Fortran source files with all variables  properly
  604.         declared  will  not  result in a .dcl file.  With this option,
  605.         common blocks and namelist lists will not be included  in  the
  606.         declaration  file,  since by their nature they cannot be unde-
  607.         clared.
  608.     4: The declarations are normally prettyprinted to line  up  neatly
  609.         in  common  columns, as in the declaration files output by the
  610.         Extended PFORT Verifier, pfort(1L).  This option value selects
  611.         instead compact output, without column alignment.
  612.     8:  Causes  continuation  lines to be used where permissible.  The
  613.         default is to begin a new  declaration  on  each  line.   This
  614.         option  is appropriate to use with the option for compact out-
  615.         put.
  616.     16: Output Fortran keywords in lowercase, instead of  the  default
  617.         uppercase.
  618.     32:  Output  variables  and constants in lowercase, instead of the
  619.         default  uppercase.    Character  string  constants  are   not
  620.         affected by this option.
  621.     64:  Omit  declarations  of internal integer variables produced by
  622.         the SFTRAN3 preprocessor, xsf3(1L), as part of the translation
  623.         of  structured  Fortran statements to ordinary Fortran.  These
  624.         variables have six-character names of the form NPRddd, NXdddd,
  625.         N2dddd,  and N3dddd, where d is a decimal digit.  Because they
  626.         are invisible in the SFTRAN3 source code, and will  change  if
  627.         the  SFTRAN3  code  is  modified, such variables should not be
  628.         explicitly declared.  Instead, they  should  just  assume  the
  629.         default  Fortran INTEGER data type based on their initial let-
  630.         ter, N.
  631.     128: Use an asterisk as the comment character; the default is oth-
  632.         erwise 'C'.
  633.     256: Use 'c' instead of 'C' or '*' as the comment character.
  634.     512:  Suppress  dimensioning  of  arrays in the generated declara-
  635.         tions.  This option is for use with code lacking type declara-
  636.         tions,  to  allow the declaration files to be inserted without
  637.         change into the code.  Since  the  code  will  have  dimension
  638.         statements  already,  dimensioning  the array variables in the
  639.         type statements of the declaration file  is  redundant.   This
  640.         option  should  be  used  only  in conjunction with option 2 =
  641.         undeclared-only because otherwise any arrays that were  dimen-
  642.         sioned in a type statement will lose their dimensioning.
  643.  
  644.      If  any  non-zero  value is specified, then declaration output is
  645.  selected, even if the value 1 was not included in the sum.
  646.  
  647.      The declaration files contain distinctive comments that mark  the
  648.  start  and  end  of declarations for each program unit, to facilitate
  649.  using text editor macros for merging the declarations back  into  the
  650.  source code.
  651.  
  652.      The  ftnchek distribution includes a program, dcl2inc, which pro-
  653.  cesses declaration files to produce files containing declarations  of
  654.  all  COMMON blocks, in a form suitable for use as INCLUDE files.  See
  655.  the dcl2inc man page for the details of its use.
  656.  
  657.  
  658. 3 /novice
  659.        This flag is intended to provide more helpful output for begin-
  660.  ners.  It has two effects:
  661.     (a)  provides  an extra message to the effect that a function that
  662.         is used but not defined anywhere might be an array  which  the
  663.         user  forgot  to  declare  in a DIMENSION statement (since the
  664.         syntax of an array reference is the same as that of a function
  665.         reference).
  666.     (b)  modifies the form of the error messages and warnings.  If the
  667.         flag is turned off by /nonovice, these messages are printed in
  668.         a style more resembling UNIX lint.
  669.  
  670.      Default = yes.
  671.  
  672.  
  673.  
  674. 3 /output=filename
  675.         This  setting  is provided for convenience on systems which do
  676.  not allow easy redirection of output from programs.  When  this  set-
  677.  ting  is  given, the output which normally appears on the screen will
  678.  be sent instead to the named file.  Note, however,  that  operational
  679.  errors of ftnchek itself (e.g. out of space or cannot open file) will
  680.  still be sent to the screen.   The  extension  for  the  filename  is
  681.  optional,  and  if  no extension is given, the extension .lis will be
  682.  used.
  683.  
  684.  
  685. 3 /portability=list
  686.        ftnchek will  give  warnings  for  a  variety  of  non-portable
  687.  usages.   Examples  include  the  use  of  tabs except in comments or
  688.  inside strings, the use of Hollerith constants, and the equivalencing
  689.  of  variables  of different data types.  This option does not produce
  690.  warnings for supported extensions to the Fortran 77  Standard,  which
  691.  may  also  cause  portability problems.  To catch those, use the /f77
  692.  setting.  By default, all warnings are turned off.
  693.  
  694.      This setting provides detailed control over  the  warnings  about
  695.  possible  portability  problems.  The list consists of keywords sepa-
  696.  rated by commas or colons.  There are three special keywords: all  to
  697.  turn  on all the warnings about nonportable usages, none to turn them
  698.  all off, and help to print the list of all the keywords with a  brief
  699.  explanation  of each.  If list is omitted, /portability is equivalent
  700.  to /portability=all, and /noportability is equivalent  to  /portabil-
  701.  ity=none.  The warning keywords with their meanings are as follows:
  702.     backslash:  Backslash  character in strings.  Since some compilers
  703.         treat the backslash as an escape character, its  presence  can
  704.         cause problems even though it is used in a standard-conforming
  705.         way.
  706.     common-alignment: COMMON block variables not in  descending  order
  707.         of storage size.  Some compilers require this ordering because
  708.         of storage alignment requirements.
  709.     hollerith: Hollerith constants (other than within FORMAT  specifi-
  710.         cations).   The Hollerith data type is a feature of Fortran IV
  711.         that has been deleted in  the  Fortran  77  standard.   It  is
  712.         superseded by the character data type.  Storing Hollerith data
  713.         in variables of a numeric or logical data type is  nonportable
  714.         due to differing word sizes.
  715.     long-string:  String constants, variables, or expressions over 255
  716.         chars long.
  717.     mixed-equivalence: Variables of different data types equivalenced.
  718.     mixed-size:  Variables  declared  with default precision used with
  719.         variables given explicit precision,  in  expressions,  assign-
  720.         ments,  or  as arguments.  For example, if a variable declared
  721.         as REAL*8 is treated as equivalent to DOUBLE PRECISION.
  722.     real-do: Non-integer DO loop index and bounds.  These can cause  a
  723.         program's results to depend on the hardware characteristics of
  724.         the particular computer used.
  725.     tab: Tabs in source code.  Tabs  are  interpreted  differently  by
  726.         different compilers.  This warning will be given only once, at
  727.         the end of the file.
  728.  
  729.      See also: /f77, /hollerith, /pretty, /wordsize.
  730.  
  731.  
  732. 3 /pretty=list
  733.        Controls certain messages related  to  the  appearance  of  the
  734.  source  code.  These warn about things that might make a program less
  735.  readable or be deceptive to the reader.  By default, all warnings are
  736.  turned on.
  737.  
  738.      This  setting  provides  detailed control over the warnings about
  739.  appearance.  The list consists of keywords  separated  by  commas  or
  740.  colons.  Since all warnings are on by default, include a keyword pre-
  741.  fixed by no- to turn off a particular warning.  There are three  spe-
  742.  cial  keywords:  all  to  turn  on  all the warnings about misleading
  743.  appearances, none to turn them all off, and help to print the list of
  744.  all  the keywords with a brief explanation of each.  If list is omit-
  745.  ted, /pretty is equivalent to /pretty=all, and /nopretty  is  equiva-
  746.  lent  to  /pretty=none.  The warning keywords with their meanings are
  747.  as follows:
  748.     embedded-space: Space embedded in variable names.
  749.     continuation: Continuation mark following a comment line.
  750.     long-line: Lines  (except  comments)  over  72  columns  in  width
  751.         (beyond 72 is normally ignored by compiler).
  752.     missing-space: Lack of space between variable and a preceding key-
  753.         word.
  754.     multiple-common: COMMON block declared in multiple statements.  No
  755.         warning  is given if the statements are consecutive except for
  756.         comment lines.
  757.     multiple-namelist: NAMELIST declared in multiple  statements.   No
  758.         warning  is given if the statements are consecutive except for
  759.         comment lines.
  760.     parentheses: Parentheses around a variable by itself.  As  a  sub-
  761.         program  argument,  this makes the argument an expression, not
  762.         modifiable by the subprogram.
  763.  
  764.      See also: /f77, /portability.
  765.  
  766.  
  767. 3 /project
  768.        ftnchek will create a project file from each source  file  that
  769.  is  input  while  this  flag  is in effect.  The project file will be
  770.  given the same name as the input file, but with the extension  .f  or
  771.  .for replaced by .prj.  (If input is from standard input, the project
  772.  file is named ftnchek.prj.)  Default = no.
  773.  
  774.      A project file contains a summary of information from the  source
  775.  file,  for  use in checking agreement among FUNCTION, SUBROUTINE, and
  776.  COMMON usages in other files.  It allows incremental checking,  which
  777.  saves  time  whenever you have a large set of files containing shared
  778.  subroutines, most of which seldom change.  You can run  ftnchek  once
  779.  on  each file with the /project flag set, creating the project files.
  780.  Usually you would also set the /library and /noextern flags  at  this
  781.  time,  to suppress messages relating to consistency with other files.
  782.  Only error messages pertaining to each file by itself will be printed
  783.  at this time.  Thereafter, run ftnchek without these flags on all the
  784.  project files together, to  check  consistency  among  the  different
  785.  files.   All  messages  internal  to the individual files will now be
  786.  omitted.  Only when a file is altered will a new project file need to
  787.  be made for it.
  788.  
  789.      Naturally,  when  the /project flag is set, ftnchek will not read
  790.  project files as input.
  791.  
  792.      Project  files  contain  only  information  needed  for  checking
  793.  agreement between files.  This means that a project file is of no use
  794.  if all modules of the complete program  are  contained  in  a  single
  795.  file.
  796.  
  797.      A  more detailed discussion is given in the section on Using Pro-
  798.  ject Files.
  799.  
  800.  
  801. 3 /pure
  802.        Assume functions are ``pure'', i.e., they will  not  have  side
  803.  effects  by modifying their arguments or variables in a COMMON block.
  804.  When this flag is in effect, ftnchek will base its  determination  of
  805.  set  and  used  status of the actual arguments on the assumption that
  806.  arguments passed to a function are not altered.  It will also issue a
  807.  warning  if a function is found to modify any of its arguments or any
  808.  COMMON variables.  Default = yes.
  809.  
  810.      When this flag is turned off, actual arguments  passed  to  func-
  811.  tions will be handled the same way as actual arguments passed to sub-
  812.  routines.  This means that ftnchek will assume that arguments may  be
  813.  modified  by  the functions.  No warnings will be given if a function
  814.  is found to have side effects.  Because stricter checking is possible
  815.  if  functions  are  assumed to be pure, you should turn this flag off
  816.  only if your program actually uses functions with side effects.
  817.  
  818.  
  819. 3 /quiet
  820.        This option reduces the amount of  output  relating  to  normal
  821.  operation,  so that error messages are more apparent.  This option is
  822.  provided for the convenience of users who are checking  large  suites
  823.  of files.  The eliminated output includes the names of project files,
  824.  and the message reporting that no syntax errors were found.  (Some of
  825.  this  output  is  turned  back  on by the /list and /symtab options.)
  826.  Default = no.
  827.  
  828.  
  829. 3 /reference
  830.        Specifies that a who-calls-who table be  printed.   This  table
  831.  lists  each  subprogram  followed by a list of the routines it calls.
  832.  This switch is equivalent to /calltree=2.  Default = no.
  833.  
  834.      The reference list omits routines called by unused  library  mod-
  835.  ules.   Thus  it  contains  the same information as for the call-tree
  836.  format, namely the hierarchy of subprogram calls, but  printed  in  a
  837.  different way.  This prints out a breadth-first traversal of the call
  838.  tree whereas /calltree prints out a depth-first traversal.  Only  one
  839.  format is printed.  If both /calltree and /reference flags are given,
  840.  the former will take precedence.
  841.  
  842.      See also: /calltree, /crossref, /library, /sort, /symtab, /vcg.
  843.  
  844.  
  845. 3 /resources
  846.        Prints the amount of resources used by  ftnchek  in  processing
  847.  the  program.   This  listing may be useful in analyzing the size and
  848.  complexity of a program.  It can also help in choosing  larger  sizes
  849.  for ftnchek's internal tables if they are too small to analyze a par-
  850.  ticular program.  Default = no.
  851.  
  852.      In this listing, the term ``chunk  size''  is  the  size  of  the
  853.  blocks of memory allocated to store the item in question, in units of
  854.  the size of one item, not necessarily in bytes.  When  the  initially
  855.  allocated  space  is filled up, more memory is allocated in chunks of
  856.  this size.  The following is an explanation of the items printed:
  857.     Source lines processed: Total number of lines of code, with  sepa-
  858.         rate  totals  for  statement lines and comment lines.  Comment
  859.         lines include lines with 'C' or '*' in column  1  as  well  as
  860.         blank  lines  and  lines  containing  only  an inline comment.
  861.         Statement lines are all other lines, including lines that have
  862.         an inline comment following some code.  Continuation lines are
  863.         counted as separate lines.  Lines in include files are counted
  864.         each time the file is included.
  865.     Total  executable statements: Number of statements in the program,
  866.         other than specification,  data,  statement-function,  FORMAT,
  867.         ENTRY, and END statements.
  868.     Total  number  of  modules:  A  module is any external subprogram,
  869.         including the main program, subroutines, functions, and  block
  870.         data  units.   This  count  is  of  modules defined within the
  871.         source, not modules referenced.  Statement functions  are  not
  872.         included.   A  subprogram  with  multiple entry points is only
  873.         counted once.
  874.     Max identifier name chars: Number of characters used  for  storing
  875.         identifier names.  An identifier is a variable, subprogram, or
  876.         common block name.  Local names are those of  local  variables
  877.         in  a subprogram, whereas global names refer to subprogram and
  878.         common block names, as well as dummy argument names and common
  879.         variable names.  Actual argument text (up to 15 characters for
  880.         each argument) is also included  here.   The  space  used  for
  881.         local  names  is  recovered at the end of each module, whereas
  882.         the global space grows until the whole  program  is  analyzed.
  883.         Unfortunately, this figure may include some common block names
  884.         and arguments stored more than once, although a  heuristic  is
  885.         used that will avoid duplicates in many cases.
  886.     Max  token  text  chars: A token is the smallest syntactic unit of
  887.         the FORTRAN language above the level of individual characters.
  888.         For  instance a token can be a variable name, a numerical con-
  889.         stant, a quoted  text  string,  or  a  punctuation  character.
  890.         Token  text  is stored while a module is being processed.  For
  891.         technical reasons, single-character tokens are not included in
  892.         this  total.   Items  that  are  not represented in the symbol
  893.         table may be duplicated.  The space for token text  is  recov-
  894.         ered  at the end of each module, so this figure represents the
  895.         maximum for any one module.
  896.     Max local symbols: This is the largest number of  entries  in  the
  897.         local symbol table for any module.  Local symbol table entries
  898.         include all variables  and  parameters,  common  block  names,
  899.         statement  functions, external subprograms and intrinsic func-
  900.         tions referenced by the module.   Literal  constants  are  not
  901.         stored in the local symbol table.
  902.     Max  global  symbols:  This is the number of entries in the global
  903.         symbol table at the end of processing.   Global  symbol  table
  904.         entries  include  external  subprogram and common block names.
  905.         Intrinsic functions and statement functions are not  included.
  906.     Max  number  of  tokenlists:  A token list is a sequence of tokens
  907.         representing the actual or dummy argument list  of  a  subpro-
  908.         gram,  or the list of variables in a common block or namelist.
  909.         Therefore this number represents the largest  sum  of  COMMON,
  910.         CALL,  NAMELIST  and ENTRY statements and function invocations
  911.         for any one module.  The space is recovered at the end of each
  912.         module.
  913.     Max token list/tree space: This is the largest number of tokens in
  914.         all the token lists and token trees  of  any  one  module.   A
  915.         token  tree  is  formed  when  analyzing  an  expression: each
  916.         operand is a leaf of the  tree,  and  the  operators  are  the
  917.         nodes.  Therefore this number is a measure of the maximum com-
  918.         plexity of an individual module.  For instance a  module  with
  919.         many  long  arithmetic  expressions  will  have a high number.
  920.         Note that unlike token text described  above,  the  number  of
  921.         tokens  is  independent of the length of the variable names or
  922.         literal constants in the expressions.
  923.     Number of subprogram invocations: This is the sum over all modules
  924.         of  the  number  of  CALL  statements and function invocations
  925.         (except intrinsic functions and statement functions).
  926.     Number of common block decls: This is the sum over all modules  of
  927.         the number of common block declarations.  That is, each decla-
  928.         ration of a block in a different module is counted separately.
  929.         (The  standard  allows multiple declarations of a block within
  930.         the same module; these are counted  as  only  one  declaration
  931.         since they are equivalent to a single long declaration.)
  932.     Number of array dim & param ptrs: This is the sum over all modules
  933.         of the number of array dimension and parameter definition text
  934.         strings  saved for use by the /makedcls option.  The length of
  935.         the text strings is not counted.  Each dimension of a multidi-
  936.         mensional array is counted separately.
  937.  
  938.      These  numbers  are obviously not the same when project files are
  939.  used in place of the original source  code.   Even  the  numbers  for
  940.  global entities may be different, since some redundant information is
  941.  eliminated in project files.
  942.  
  943.  
  944. 3 /sixchar
  945.        One of the goals of the ftnchek program is  to  help  users  to
  946.  write  portable  Fortran programs.  One potential source of nonporta-
  947.  bility is the use of variable names that are longer than six  charac-
  948.  ters.   Some compilers just ignore the extra characters.  This behav-
  949.  ior could potentially lead to two different variables  being  consid-
  950.  ered  as  the  same.   For  instance, variables named AVERAGECOST and
  951.  AVERAGEPRICE are the same in the first six characters.  If  you  wish
  952.  to catch such possible conflicts, use this flag.  Default = no.
  953.  
  954.      Use  the /f77=long-names if you want to list all variables longer
  955.  than six characters, not just those pairs that are the  same  in  the
  956.  first six.
  957.  
  958.      See also: /f77, /portability.
  959.  
  960.  
  961. 3 /sort
  962.        Specifies that a sorted list of all modules used in the program
  963.  be printed.  This list is in ``prerequisite'' order, i.e. each module
  964.  is  printed  only  after all the modules from which it is called have
  965.  been printed.  This is also called a ``topological sort'' of the call
  966.  tree.  Each module is listed only once.  Routines that are not in the
  967.  call tree of the main program are omitted.  If there are  any  cycles
  968.  in the call graph (illegal in standard Fortran) they will be detected
  969.  and diagnosed.  Default = no.
  970.  
  971.      See also: /calltree, /crossref, /reference, /symtab, /vcg.
  972.  
  973.  
  974. 3 /source=num
  975.        This setting controls certain options about  the  form  of  the
  976.  Fortran  source  code.   The setting value is the sum of numbers from
  977.  the following list:
  978.     1: Accept DEC-style tab-formatted source.  A line  beginning  with
  979.         an  initial tab will be treated as a new statement line unless
  980.         the character after the tab is a nonzero digit, in which  case
  981.         it  is  treated as a continuation line.  The next column after
  982.         the tab or continuation mark is taken as column 7.  A  warning
  983.         will be given in the case where the line is a continuation, if
  984.         /f77=dec-tab is in effect.
  985.     2: Accept VMS-style INCLUDE statements.  These follow  the  normal
  986.         syntax,  but  with  the following additional features: (1) the
  987.         file extension, if not given, defaults to the same as a normal
  988.         source file extension; and (2) the option /LIST or /NOLIST can
  989.         be appended to the include-file name, to  control  listing  of
  990.         its contents.
  991.     4:  Handle UNIX-style backslash escapes in character strings.  The
  992.         escape sequence following  the  backslash  will  be  evaluated
  993.         according  to  the ANSI standard for strings in C: up to three
  994.         digits signify an octal value, an x signifies the start  of  a
  995.         hexadecimal  constant,  any of the letters a b f n r t signify
  996.         special control codes, and any other character (including new-
  997.         line)  signifies  the character itself.  When this source code
  998.         option is in effect, a warning will be given if the /f77=back-
  999.         slash setting is specified.
  1000.  
  1001.      The  default  behavior  is  to treat the backslash like any other
  1002.  normal character, but a warning about portability will  be  generated
  1003.  if  the /portability flag is set.  Because of the fact that some com-
  1004.  pilers treat the backslash in a nonstandard way, it is  possible  for
  1005.  standard-conforming programs to be non-portable if they use the back-
  1006.  slash character in strings.
  1007.  
  1008.      Since ftnchek does not do much with the interpreted string, it is
  1009.  seldom  necessary to use this option.  It is needed in order to avoid
  1010.  spurious warnings only if (a) the program being  checked  uses  back-
  1011.  slash  to  embed  an  apostrophe or quote mark in a string instead of
  1012.  using the standard mechanism of doubling the delimiter; (b) the back-
  1013.  slash is used to escape the end-of-line in order to continue a string
  1014.  across multiple source lines; or (c) a PARAMETER definition  uses  an
  1015.  intrinsic string function such as LEN with such a string as argument,
  1016.  and that value is later used to define array dimensions, etc.
  1017.  
  1018.      Default setting = 0, turn-on = 7.
  1019.  
  1020.  
  1021. 3 /symtab
  1022.        A symbol table will be printed out for each module, listing all
  1023.  identifiers  mentioned  in  the module.  This table gives the name of
  1024.  each variable, its datatype, and the number of dimensions for arrays.
  1025.  An  asterisk  (*)  indicates  that  the  variable has been implicitly
  1026.  typed, rather than being named in an explicit type declaration state-
  1027.  ment.   The  table  also lists all subprograms invoked by the module,
  1028.  all COMMON blocks declared, etc.  Default = no.
  1029.  
  1030.      See also: /calltree, /crossref, /list, /reference, /sort, /vcg.
  1031.  
  1032.  
  1033. 3 /truncation=list
  1034.        Warn about possible truncation (or roundoff) errors.   Most  of
  1035.  these  are  related  to integer arithmetic.  By default, all warnings
  1036.  are turned on.
  1037.  
  1038.      This setting provides detailed control over  the  warnings  about
  1039.  possible  truncation errors.  The list consists of keywords separated
  1040.  by commas or colons.  Since all warnings are on by default, include a
  1041.  keyword  prefixed by no- to turn off a particular warning.  There are
  1042.  three special keywords: all to turn on all the warnings about trunca-
  1043.  tion,  none  to  turn them all off, and help to print the list of all
  1044.  the keywords with a brief explanation of each.  If list  is  omitted,
  1045.  /truncation  is  equivalent  to /truncation=all, and /notruncation is
  1046.  equivalent to /truncation=none.   The  warning  keywords  with  their
  1047.  meanings are as follows:
  1048.     int-div-exponent:  use  of  the  result  of integer division as an
  1049.         exponent.  This suggests that a real quotient is intended.  An
  1050.         example would be writing X**(1/3) to evaluate the cube root of
  1051.         X. The correct expression is X**(1./3.).
  1052.     int-div-real: Conversion of an  expression  involving  an  integer
  1053.         division  to  real.   This  suggests  that  a real quotient is
  1054.         intended.
  1055.     int-div-zero: division in  an  integer  constant  expression  that
  1056.         yields a result of zero.
  1057.     int-neg-power:  exponentiation of an integer by a negative integer
  1058.         (which yields zero unless the base integer is 1 in magnitude).
  1059.         This suggests that a real base is intended.
  1060.     promotion:  automatic  conversion of a lower precision quantity to
  1061.         one of higher precision.  The loss of accuracy for real  vari-
  1062.         ables in this process is comparable to the corresponding demo-
  1063.         tion.  No warning is given for promotion of integer quantities
  1064.         to real since this is ordinarily exact.
  1065.     real-do-index:  use of a non-integer DO index in a loop with inte-
  1066.         ger bounds.  An integer DO index with real  bounds  is  always
  1067.         warned about regardless of this setting.
  1068.     real-subscript: use of a non-integer array subscript.
  1069.     significant-figures:  overspecifying  a single precision constant.
  1070.         This  may  indicate  that  a  double  precision  constant  was
  1071.         intended.
  1072.     size-demotion: automatic conversion of a higher precision quantity
  1073.         to one of lower precision of the same type.  This warning only
  1074.         occurs  when an explicit size is used in declaring the type of
  1075.         one or both operands in an assignment.  For example, a warning
  1076.         wil  be  issued  where a REAL*8 variable is assigned to a REAL
  1077.         variable,  if  the  default  wordsize  of  4  is  in   effect.
  1078.         type-demotion:  automatic  conversion  of  a  higher precision
  1079.         quantity to one of lower precision of  different  type.   This
  1080.         warning  includes  conversion  of  real quantities to integer,
  1081.         double precision to single precision real, and assignment of a
  1082.         longer character string to a shorter one.
  1083.  
  1084.      The  warnings  about promotion and demotion also apply to complex
  1085.  constants, considering the precision to be that of the real or imagi-
  1086.  nary  part.   Warnings  about promotions and demotions are given only
  1087.  when the conversion is done automatically,  e.g.  in  expressions  of
  1088.  mixed  precision  or  in an assignment statement.  If intrinsic func-
  1089.  tions such as INT are used to perform the conversion, no  warning  is
  1090.  given.
  1091.  
  1092.      See also: /portability, /wordsize.
  1093.  
  1094.  
  1095. 3 /usage=num
  1096.         Warn  about unused or possible uninitialized variables, unused
  1097.  common blocks, and unused or undefined subprograms.
  1098.  
  1099.      This setting is composed of three digits.  The first digit  (hun-
  1100.  dreds  place) controls warnings about subprograms (functions and sub-
  1101.  routines), the second digit (tens place) warnings about common blocks
  1102.  and  common  variables,,  and  the  third digit (ones place) warnings
  1103.  about local variables.  Each digit controls warnings according to the
  1104.  following scale:
  1105.     0: no warnings.
  1106.     1: warn about undefined items: subprograms that are used but never
  1107.         defined, common block variables that are used but  never  set,
  1108.         or  local  variables that are (or may be) used before they are
  1109.         set.
  1110.     2: warn about unused items: subprograms that are defined but never
  1111.         used  (unless taken in library mode), common blocks and common
  1112.         variables  that  are  unused,  or  local  variables  that  are
  1113.         declared or set but never used.
  1114.     3: give both types of warnings.
  1115.  
  1116.      Default = turn-on = 333.
  1117.  
  1118.      Sometimes  ftnchek  makes  a  mistake in the warnings about local
  1119.  variable usage.  Usually it errs on the  side  of  giving  a  warning
  1120.  where  no problem exists, but in rare cases it may fail to warn where
  1121.  the problem does exist.  See the section on Bugs  for  examples.   If
  1122.  variables  are  equivalenced,  the  rule  used  by  ftnchek is that a
  1123.  reference to any variable implies the same reference to all variables
  1124.  it  is  equivalenced to.  For arrays, the rule is that a reference to
  1125.  any array element is treated as a reference to all  elements  of  the
  1126.  array.
  1127.  
  1128.      When  checking  for used-before-set errors involving COMMON vari-
  1129.  ables, ftnchek does not do a thorough enough analysis of the  calling
  1130.  sequence  to  know which routines are called before others.  So warn-
  1131.  ings about this type of error will only be given for cases in which a
  1132.  variable  is  used  in some routine but not set in any other routine.
  1133.  Checking of individual COMMON variables is done only if  the  /common
  1134.  setting is 3 (variable by variable agreement).
  1135.  
  1136.      The Level 1 value for subprogram usage checking controls warnings
  1137.  about routines that are invoked by the program but never defined,  or
  1138.  are  multiply defined.  Ordinarily, if ftnchek is being run on a com-
  1139.  plete program, each subprogram other  than  the  intrinsic  functions
  1140.  should  be defined once and only once somewhere.  Set this digit to 0
  1141.  or 2 if you just want to check a subset of files which form part of a
  1142.  larger  complete  program,  or to check all at once a number of unre-
  1143.  lated files which might each contain an unnamed main  program.   Sub-
  1144.  program arguments will still be checked for correctness.
  1145.  
  1146.      See also: /common, /declare, /extern, /library, /volatile.
  1147.  
  1148.  
  1149. 3 /vcg
  1150.         Produce the call graph in the form of a VCG graph description.
  1151.  This description is written to a separate file, with the same stem as
  1152.  the  file containing the main program, and suffix .vcg.  This file is
  1153.  able to be given directly to xvcg(1L) to visualize  the  call  graph.
  1154.  (If  input  is from the standard input, then the graph description is
  1155.  sent to standard output.)  This switch is equivalent to  /calltree=3.
  1156.  Default = no.
  1157.  
  1158.      The  VCG  description as created is more complex than it need be.
  1159.  VCG allows graphs and nested subgraphs: each subroutine is created as
  1160.  a  subgraph  nested  inside its calling routines.  This allows you to
  1161.  interactively display subgraphs or summarise them.
  1162.  
  1163.      The /vcg option for ftnchek was  written  by  Dr.  Philip  Rubini
  1164.  (p.rubini@cranfield.ac.uk).
  1165.  
  1166.      xvcg is a graph visualisation tool which runs under the X windows
  1167.  system.  It is freely available from ftp.cs.uni-sb.de. It was written
  1168.  by G. Sander of the University of Saarland, Germany.
  1169.  
  1170.  
  1171. 3 /version
  1172.         This  option causes ftnchek to print a line giving the version
  1173.  number, release date, and patch level of the program.   If  no  files
  1174.  are  given,  it  then  exits.  If files are given, the effect of this
  1175.  option is to include the patch level (normally omitted) in  the  ver-
  1176.  sion information printed at the start of processing.  Default = no.
  1177.  
  1178.      See also: /help.
  1179.  
  1180.  
  1181. 3 /volatile
  1182.        Assume that COMMON blocks are volatile.  Default = no.
  1183.  
  1184.      Many  Fortran programmers assume that variables, whether local or
  1185.  in COMMON, are static, i.e. that once assigned a value,  they  retain
  1186.  that  value  permanently until assigned a different value by the pro-
  1187.  gram.  However, in fact the Fortran 77 Standard does not require this
  1188.  to  be  the  case.   Local  variables  may  become  undefined between
  1189.  activations of a module in which they are declared.  Similarly,  COM-
  1190.  MON  blocks  may  become  undefined  if  no  module in which they are
  1191.  declared is active.  (The  technical  term  for  entities  with  this
  1192.  behavior  is  ``automatic'',  but  ftnchek uses the word ``volatile''
  1193.  since it is  clearer  to  the  nonspecialist.)   Only  COMMON  blocks
  1194.  declared in a SAVE statement, or declared in the main program or in a
  1195.  block data subprogram remain defined as long as the program  is  run-
  1196.  ning.   Variables and COMMON blocks that can become undefined at some
  1197.  point are called volatile.
  1198.  
  1199.      If the /volatile flag is turned on, ftnchek will warn you  if  it
  1200.  finds a volatile COMMON block.  If, at the same time, the /usage set-
  1201.  ting is 1 or 3 (check used before set), ftnchek  will  try  to  check
  1202.  whether  such a block can lose its defined status between activations
  1203.  of the modules where it is declared.  ftnchek does not do a very good
  1204.  job of this: the rule used is to see whether the block is declared in
  1205.  two separated subtrees of the call tree.  For instance, this would be
  1206.  the  case if two modules, both called from the main program, shared a
  1207.  volatile COMMON block.  A block can also become undefined between two
  1208.  successive  calls  of  the  same subprogram, but ftnchek is not smart
  1209.  enough to tell whether a subprogram can be called more than once,  so
  1210.  this case is not checked for.
  1211.  
  1212.      The  /volatile  flag  does  not affect the way ftnchek checks the
  1213.  usage of local variables.
  1214.  
  1215.      See also: /common, /usage.
  1216.  
  1217.  
  1218. 3 /wordsize=num
  1219.        Specifies the default word size to be num bytes.  This  is  the
  1220.  size  of  logical and single-precision numeric variables that are not
  1221.  given explicit precisions.  (Explicit  precisions  for  non-character
  1222.  variables  are an extension to the Fortran 77 Standard, and are given
  1223.  by type declarations such as REAL*8 X.)  Double-precision and complex
  1224.  variables will be twice this value, and double complex variables four
  1225.  times.  Quad-precision constants and intrinsic function results  will
  1226.  be  four  times  this value.  Note that variables declared as REAL*16
  1227.  will be regarded as quad precision only if the word size is 4  bytes.
  1228.  Default = turn-on = 4 bytes.
  1229.  
  1230.      The  word  size  value does not matter for checking standard-con-
  1231.  forming programs that do not declare  explicit  precisions  for  non-
  1232.  character  variables or store Hollerith data in variables.  This set-
  1233.  ting also does not affect the default size  of  character  variables,
  1234.  which  is  always  1  byte.   Hollerith constants also are assumed to
  1235.  occupy 1 byte per character.
  1236.  
  1237.      The word size is used to determine whether truncation  occurs  in
  1238.  assignment  statements,  and to catch precision mismatches in subpro-
  1239.  gram argument lists and common block lists.  The exact warnings  that
  1240.  are  issued will depend on the status of other flags.  Under both the
  1241.  /portability=mixed-size and  the  /nowordsize  flag,  any  mixing  of
  1242.  explicit  with  default  precision objects (character expressions not
  1243.  included) is warned about.  This applies  to  arithmetic  expressions
  1244.  containing  both  types  of  objects, and to subprogram arguments and
  1245.  COMMON variables.  Under control of the /truncation=demotion and pro-
  1246.  motion options, a warning is given for assignment of an expression to
  1247.  a shorter variable of the same type, or for promotion of a lower pre-
  1248.  cision  value  to  higher precision in an arithmetic expression or an
  1249.  assignment statement.
  1250.  
  1251.      Giving a word size of 0, or equivalently, using /nowordsize means
  1252.  that  no default value will be assumed.  This is equivalent to speci-
  1253.  fying /portability=mixed-size.   Use  it  to  find  cases  of  mixing
  1254.  default  and  explicit  precision,  for  example to flag places where
  1255.  REAL*8 is treated as equivalent to DOUBLE PRECISION.
  1256.  
  1257.      See also: /portability, /truncation.
  1258.  
  1259.  
  1260. 3 /wrap=col
  1261.        Controls the wrapping of error messages.  Long  error  messages
  1262.  that would run past the specified column will be broken up into sepa-
  1263.  rate lines between the words of the message for  better  readability.
  1264.  If  turned  off  with  /nowrap,  each  separate error message will be
  1265.  printed on one line, leaving it up to the display to wrap the message
  1266.  or truncate it.  Default = turn-on = 79.
  1267.  
  1268.  
  1269. 2 Changing_the_defaults
  1270.        ftnchek includes two mechanisms for changing the default values
  1271.  of all options: by defining environment variables or  by  creating  a
  1272.  preferences  file.   When ftnchek starts up, it looks in its environ-
  1273.  ment for any variables whose names  are  composed  by  prefixing  the
  1274.  string  FTNCHEK_  onto the uppercased version of the option name.  If
  1275.  such a variable is found, its value is used to  specify  the  default
  1276.  for  the  corresponding  switch  or setting.  In the case of settings
  1277.  (for example, the /common strictness setting) the value of the  envi-
  1278.  ronment  variable  is read as the default setting value.  In the case
  1279.  of switches, the default switch will be taken as true or  yes  unless
  1280.  the environment variable has the value 0 or NO.
  1281.       Note that the environment variable name must be constructed with
  1282.  the full-length option name, which must be in uppercase.   For  exam-
  1283.  ple, to make ftnchek print a source listing by default, set the envi-
  1284.  ronment variable FTNCHEK_LIST to 1 or YES or anything other than 0 or
  1285.  NO.  The names FTNCHEK_LIS (not the full option name) or ftnchek_list
  1286.  (lower case) would not be recognized.
  1287.  
  1288.  The way to set the environment variables on  the  VMS  system  is  by
  1289.  using  the  DEFINE  command.   For  example, to set the default /list
  1290.  switch to YES, give the command
  1291.  
  1292.           $ DEFINE FTNCHEK_LIST 1
  1293.       After processing any environment variables, ftnchek looks for  a
  1294.  preferences  file containing options and settings.  It will search in
  1295.  the following order, using only the first file found: (1)  .ftnchekrc
  1296.  in  the  current directory, (2) ftnchek.ini in the current directory,
  1297.  (3) .ftnchekrc in the user's home directory, (4) ftnchek.ini  in  the
  1298.  home  directory.   If such a file is found, the options defined in it
  1299.  are used as defaults in place of the built-in defaults and overriding
  1300.  any defaults set in the environment..
  1301.       Each option or setting in the preferences file must be on a sep-
  1302.  arate line.  They are given in the same form as on the command  line,
  1303.  except  without  the initial slash.  The preferences file can contain
  1304.  blank lines and comments.  Comments are introduced at any point in  a
  1305.  line  by  a  space character (blank or tab) or the '#' character, and
  1306.  are terminated by the end of the line.
  1307.       Command-line options override the defaults set in  the  environ-
  1308.  ment  or  in  the preferences file, in  the same way as they override
  1309.  the built-in defaults.
  1310.  
  1311.  
  1312. 2 Project_files
  1313.        This section contains detailed information on how to  use  pro-
  1314.  ject files most effectively, and how to avoid some pitfalls.
  1315.       Ordinarily,  project  files  should be created with the /library
  1316.  flag in effect.  In this mode, the information saved in  the  project
  1317.  file  consists of all subprogram declarations, all subprogram invoca-
  1318.  tions not resolved by declarations in the same file, and one instance
  1319.  of  each  COMMON  block  declaration.   This is the minimum amount of
  1320.  information needed to check agreement between files.
  1321.       If the file contains more than one routine, there are some  pos-
  1322.  sible  problems  that  can  arise  from  creating the project file in
  1323.  library mode, because the calling hierarchy  among  routines  defined
  1324.  within  the file is lost.  Also, if the routines in the file make use
  1325.  of COMMON blocks that are shared with routines in other files,  there
  1326.  will  not be enough information saved for the correct checking of set
  1327.  and used status of COMMON blocks and COMMON  variables  according  to
  1328.  the  /usage setting.  Therefore if you plan to use project files when
  1329.  the /usage setting is nonzero (which is the default  situation),  and
  1330.  if  multiple  routines  in  one project file share COMMON blocks with
  1331.  routines in other files, the project files should be created with the
  1332.  /library  flag  turned off.  In this mode, ftnchek saves, besides the
  1333.  information listed above, one invocation of each  subprogram  by  any
  1334.  other subprogram in the same file, and all COMMON block declarations.
  1335.  This means that the project file will be larger than  necessary,  and
  1336.  that  when it is read in, ftnchek may repeat some inter-module checks
  1337.  that it already did when the project file was created.  If each  pro-
  1338.  ject  file  contains only one module, there is no loss of information
  1339.  in creating the project files in library mode.
  1340.       Because of the possible loss of information entailed by creating
  1341.  a  project  file with the /library flag in effect, whenever that pro-
  1342.  ject file is read in later, it will be  treated  as  a  library  file
  1343.  regardless of the current setting of the /library flag.  On the other
  1344.  hand, a project file created with library mode turned off can be read
  1345.  in later in either mode.
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.