% Librarian T09-20i2`35FTNCHEK `3 1 FTNCHEK+ ftnchek - Fortran 77 program checker2 IntroductionF ftnchek (short for Fortran checker) is designed to detect cer-F tain errors in a Fortran program that a compiler usually does not.F ftnchek is not primarily intended to detect syntax errors. Its pur-F pose is to assist the user in finding semantic errors. Semantic er-F rors are legal in the Fortran language but are wasteful or may causeF incorrect operation. For example, variables whic h are never used mayF indicate some omission in the program; uninitialized variables con-F tain garbage which may cause incorrect results to be calculated; andF variables which are not declared may not have the intended type. ft-F nchek is intended to assist users in the debugging of their FortranF program. It is not intended to catch all syntax errors. This is theF function of the compiler. Prior to using ftnchek, the user should, verify that the program compiles correctly.B For more detailed information, consult the printed documentation.2 Invoking_Ftnchek8 ftnchek is invoked through a command of the form:? $ ftnchek [/option /option ...] filename [filename ...]F The brackets indicate something which is optional. The bracketsF themselves are not actually typed. Here options are command-lineF switches or settings, which control the operation of the program andF the amount of information that will be printed out. If no option isF speci fied, the default action is to print error messages, warnings,F and informational messages, but not the program listing or symbol ta- bles.F Each option begins with the '/' character. (ftnchek also allows the '-' character to be used.)F ftnchek options fall into two categories: switches, which areF either true or false, and settings, which have a numeric or stringF value. The name of a switch is prefixed by 'no' or 'no-' to turn itF off: e.g. /nopure would turn off th e warnings about impure functions.F The 'no' prefix can also be used with numeric settings, having theF effect of turning off the corresponding warnings. Settings that con-F trol lists of warnings have a special syntax discussed below. OnlyF the first 3 characters of an option name (not counting the '/') needF be provided. A colon may be used in place of an equals sign for nu-F meric or string setting assignments; however, we show only the equals sign form below.F When more  than one option is used, they should be separated by aF blank space. No blank spaces may be placed around the equals sign (F = ) in a setting. ftnchek "?" will produce a command summary list- ing all options and settings.F For settings that take a list of keywords, namely /arguments,F /array, /calltree, /common, /crossref, /f77, /f90, /f95, /intrinsic,F /makedcls, /mkhtml, /portability, /pretty, /project, /source, /style,F /truncation, and /usage, the list consists of keywords s eparated byF commas or colons. If the list of keywords is omitted, the effect isF to set the option to its turn-on value (same as ``all'' in most cas-F es). Also, if the list is omitted, the setting name can be prefixedF with no or no- to turn off all the options it controls. For example,F /f77 turns on all warnings about nonstandard constructions, while: /nof77 turns them all off. Three special keywords are:F Print out all the option keywords controlled by the setting, withF  a brief explanation of their meanings. This keyword cannot be, given in a list with other keywords.F Set all options. This turns on all options controlled by the set- ting.F Clear all options. This turns off all options controlled by the setting.F These three special keywords must be given in full. For allF other keywords, only as many letters of the keyword as are necessaryF to identify it unambiguously need be given, or a wildcard pattern mayF be used. Including a keyword in the list turns the corresponding op-F tion on. For example, /f77=intrinsic would turn on only the warningsF about use of nonstandard intrinsic functions. Prefixing a keyword byF no- turns its option off. For example, /pretty=no-long-line turnsF off warnings about lines exceeding 72 columns in length while leavingF all other warnings about misleading appearance in effect. If a set-F ting has default none, you can turn on all options except one or twoF by using all first. For example, /f77=all,no-include enables warn-F ings about all nonstandard extensions except INCLUDE statements. IfF a setting has default all, you can turn off all warnings except oneF or two by using none first. For example, /truncation=none,demotionF would turn off all precision related warnings except about demotions.F Wildcard patterns contain an asterisk to stand for any string ofF characters. If a wildcard pattern is used, all the warnings thatF match it are affected. If no- is prefixed to the pattern, all theF matching warnings are turned off, otherwise they are all turned on.F The minimum unambiguous length rule does not apply to wildcard match-F ing. For example, use /usage=no-*var* to turn off all warnings re-F lating to variable usage (both local and common). (Unix users mayF need to quote any options containing wildcards in order to preventF the shell from attempting to expand them.) Wildcards are recognizedF  only in lists of warning keywords, not in the top-level options them- selves.F When ftnchek starts up, it looks for environment variables andF also for a preferences file. Any options defined in the environmentF or in the preferences file are used as defaults in place of theF built-in defaults. They are over-ridden by any command line options.F See the section on changing the defaults for details about the envi-* ronment options and the preferences file.2 FilesF Wh en giving a name of an input file, the extension is optional.F If no extension is given, ftnchek will first look for a project fileF with extension .prj, and will use that if it exists. If not, thenF ftnchek will look for a Fortran source file with the extension .for.F More than one file name can be given to ftnchek, and it will process; the modules in all files as if they were in a single file.F Wildcards are allowed in the specification of filenames on the command line.F  If no filename is given, ftnchek will read input from the stan- dard input. 2 OptionsF ftnchek options fall into two categories: switches, which areF either true or false, and settings, which have a numeric or stringF value. The name of a switch or numeric setting can be preceded byF 'no' to turn it off: e.g. /nocommon would turn off the warnings aboutF common block inconsistencies. Only the first 3 characters of an op-F tion name (not counting the '/') need be prov ided. Most options areF positional: each option remains in effect from the point it is en-4 countered until it is overridden by a later change.3 /arguments=listF Controls warnings about mismatches between actual and dummyF subprogram arguments, and also about mismatches between expected andF actual subprogram type. (An actual argument is an argument passed toF the subprogram by the caller; a dummy argument is an argument re-D ceived by the subprogram.) By default, all warnings are turned on.F The list consists of keywords separated by commas or colons.F Since all these warnings are on by default, include a keyword pre-F fixed by no- to turn off a particular warning. There are three spe-F cial keywords: all to turn on all the warnings about arguments, noneF to turn them all off, and help to print the list of all the keywordsF with a brief explanation of each. If list is omitted, /arguments isF equivalent to /arguments=all, and /noargument s is equivalent to /ar-F guments=none. The warning keywords with their meanings are as fol- lows:F warn about inconsistent use of arguments that are arrays. These@ warnings can be further controlled by the /array option.F warn about dummy arguments of a different data type from the actu- al arguments.F warn if the invocation assumes the function's return value is aF different type than it actually is. Also warns if a function1 is called as a  subroutine, or vice-versa.F warn about invoking a subprogram with a different number of argu-* ments than the subprogram expects.F For compatibility with previous versions of ftnchek, a numericF form of this setting is also accepted: the list is replaced by a num-F ber from 0 to 3. A value of 0 turns all the warnings off, 1 turns onF only number, 2 turns on all except number, and 3 turns all the warn- ings on.F This setting does not apply to checking invocations of  intrinsicF functions or statement functions, which can only be turned off by the /nocheck option.) See also: /array, /library, /usage. 3 /array=listF Controls the degree of strictness in checking agreement betweenF actual and dummy subprogram arguments that are arrays. The warningsF controlled by this setting are for constructions that might legiti-F mately be used by a knowledgeable programmer, but that often indicate= programming errors. By default, all warnings are turned on.F The list consists of keywords separated by commas or colons.F Since all these warnings are on by default, include a keyword pre-F fixed by no- to turn off a particular warning. There are three spe-F cial keywords: all to turn on all the warnings about array arguments,F none to turn them all off, and help to print the list of all the key-F words with a brief explanation of each. If list is omitted, /arrayF is equivalent to /array=all, and /noarray is equivale nt to /ar-D ray=none. The warning keywords with their meanings are as follows:F warn if the arguments differ in their number of dimensions, or ifF the actual argument is an array element while the dummy argu- ment is a whole array.F warn if both arguments are arrays, but they differ in number of elements.F For compatibility with previous versions of ftnchek, a numericF form of this setting is also accepted: the list is replaced by a num-F ber from 0 to 3. A value of 0 turns all the warnings off, 1 turns onF only dimensions, 2 turns on only size, and 3 turns all the warnings on.F Note: A warning is always given regardless of this setting ifF the actual argument is an array while the dummy argument is a scalarF variable, or if the actual argument is a scalar variable or expres-F sion while the dummy argument is an array. These cases are seldomF intentional. (To turn off even these warnings, use /arguments=no-ar-F rayness .) No warning is ever given if the actual argument is an ar-F ray element while the dummy argument is a scalar variable. Variable-F dimensioned arrays and arrays dimensioned with 1 or asterisk matchF any number of array elements. There is no check of whether multi-di-A mensional arrays agree in the size of each dimension separately.- See also: /arguments, /library, /usage.3 /briefF Selects a shorter format for some warning messages. AtF present, the only warnings controlled by this flag are those that areF printed at the end of processing each subprogram. These includeF warnings about variables that are set but not used or used beforeF set, variable names that do not conform to the Fortran 77 standard,F etc. (These warnings may be suppressed entirely depending on otherF flags, such as the /usage or /f77 flags.) In the default format eachF variable is listed on a separate line, along with the line numberF where the variable is dec lared, set or used, according to the natureF of the warning. The briefer format simply lists all variables to< which the warning applies, with up to 4 variables per line. See also: /quiet.3 /calltree=listF Causes ftnchek to print out the call structure of the complete program.F The list consists of keywords separated by commas or colons.F There are two special keywords: none to turn off all the options, andF help to print the list of all the keywords with ! a brief explanationF of each. (The keyword all turns on all the options, but should notF normally be used since only one format should be specified.) If listF is omitted, /calltree is equivalent to /calltree=tree, and /nocall-F tree is equivalent to /calltree=none. By default no call graph is printed.F If the /mkhtml option is invoked and tree is the applied call-F tree option, a file named CallTree.html, will also be produced de-F picting the tree in HTML format. This "file is useful as a startingF point for browsing the HTML files describing each component of the program.E The keywords which control which format is used are as follows:* produce the call graph in tree format.F produce the call graph in who-calls-who format (same as /reference switch).? produce the call graph in VCG format (same as /vcg switch).F Only one of the formats tree, reference, or vcg may be speci- fied.B The following keywords control o #ptions affecting the output:F prune repeated subtrees (applicable only with tree). This the de- fault.F sort children of each routine into alphabetical order. This is the default.F See the discussion of the /reference and /vcg flags for details about these formats.F For tree format, The call graph is printed out starting from theF main program, which is listed on the first line at the left margin.F Then on the following lines, each routine called by $the main programF is listed, indented a few spaces, followed by the subtree starting at that routine.F In the default mode, if a routine is called by more than oneF other routine, its call subtree is printed only the first time it isF encountered Later calls give only the routine name and the noticeF ``(see above)''. To have the subtree printed for each occurrence of" the routine, use option no-prune.F Note that the call tree will be incomplete if any of the inputF fil%es are project files containing more than one module that wereF created in /library mode. See the discussion of project files below.F Technical points: Each list of routines called by a given rou-F tine is printed in alphabetical order unless the no-sort option isF given. If multiple main programs are found, the call tree of each isF printed separately. If no main program is found, a report to thatF effect is printed out, and the call trees of any top-level non-li-F brary& routines are printed. This flag only controls the printing ofF the call tree: ftnchek constructs the call tree in any case becauseF it is used to determine which library modules will be cross-checked.) See the discussion of the /library flag.F For compatibility with previous versions of ftnchek, a numericF form of this setting is also accepted: the list is replaced by a num-F ber from 0 to 15. This number is formed from 1 for tree format, 2F for reference format, or 3 for vcg 'format, plus 4 for no-prune, and 8 for no-sort.F See also: /crossref, /library, /reference, /sort, /symtab, /vcg.3 /checkF This switch is provided so that errors and warning messages canF be turned off when ftnchek is used for purposes other than findingF bugs, such as making declarations or printing the call tree. It isF positional, so after turning all checks off, selected checks can beF turned back on. The effect of /nocheck is to put all switches, nu-F meric s(ettings, and settings controlling lists of warnings to theirF turn-off values, as if they had all been specified with the /no pre-F fix. Switches and settings that specify options and modes of opera-F tion, rather than controlling warnings, are unaffected. These areF /columns, /crossref, /include, /intrinsic, /library, /list, /maked-F cls, /novice, /output, /pointersize, /project, /quiet, /reference,F /resources, /sort, /source, /symtab, /vcg, /version, /wordsize, and /wrap. D)efault = yes.F Parse errors (syntax errors due to unrecognized or malformedF statements) are not suppressed by this switch, since the results may> be incorrect if ftnchek has not parsed the program correctly.F There are some miscellaneous errors and warning messages thatF are not controlled by any other switch, and so can be turned off onlyF by this switch. Note that using /check following /nocheck only hasF the effect of turning these special warnings back on, and does * not; restore all the checks it turned off. These warnings are:/ o Module contains no executable statements.F o In free source form, missing space where space is required (e.g.F between a keyword and an identifier) or space present where4 none is allowed (e.g. within an identifier).F o Zero or negative length specification in a data type declaration of the form type*len. o Array assigned to scalar.0 o Type mismatch between DO index and bounds.8 + o Undefined common block declared in SAVE statement.F o Intrinsic function explicitly declared with an incompatible type.F o Unknown intrinsic function explicitly declared in an INTRINSIC statement.F o Intrinsic function passed as a subprogram argument is not de-) clared in an INTRINSIC statement.C o Intrinsic function or statement function invoked incorrectly.C o Function does not set return value prior to RETURN statement.F o Paramete ,r constant value not evaluated (this is ftnchek's fault,2 and it is just informing you of the fact).F o Entry point of a subprogram is later used as a different subpro- gram's name./ o Unknown keyword used in an I/O statement.F o Illegal label reference (e.g. GOTO refers to a non-executableC statement; I/O statement refers to a non-format statement). See also: /errors.3 /columns=numF Set maximum statement length to num columns. (Beyond -this isF ignored.) This setting is provided to allow checking of programsF which may violate the Fortran standard limit of 72 columns for theF length of a statement. According to the standard, all charactersF past column 72 are ignored. If this setting is used when theF /f77=long-line option is in effect, a warning will be given for anyF lines in which characters past column 72 are processed. Turn-on = max = 132. Default = 72.F This setting does not suppr .ess warnings about the presence ofF characters beyond column 72. To process code with meaningful programF text beyond column 72, use this setting and be sure the /f77F long-line option is off. To process code with sequence numbers inF columns 73 to 80, leave the the columns setting at the default value' and use the /pretty=no-long-line flag. See also: /f77, /pretty.3 /common=listF This setting controls the strictness of checking of COMMONA blocks. By def/ault, all warnings except volatile are turned on.F The list consists of keywords separated by commas or colons.F Since most of these warnings are on by default, include a keywordF prefixed by no- to turn off a particular warning. There are threeF special keywords: all to turn on all the warnings, none to turn themF all off, and help to print the list of all the keywords with a briefF explanation of each. If list is omitted, /common is equivalent toF /common=dimensions,ex 0act,length,type, and /nocommon is equivalent toF /common=none. The warning keywords with their meanings are as fol- lows:F corresponding arrays in each declaration of a block must agree inF size and number of dimensions. This option only has an effect& when used together with exact.F the comparison of two blocks is done variable-by-variable ratherF than simply requiring agreement between corresponding storageF locations. Use this if all declarat 1ions of a given COMMONF block are supposed to be identical, which is a good program- ming practice.F warn if different declarations of the same block are not equal inF total length. The Fortran 77 Standard requires each namedF common block, but not blank common, to be the same length in# all modules of the program.F in each declaration of a given COMMON block, corresponding memoryF locations (words or bytes) must agree in data type 2. If usedF together with exact, this will require that corresponding% variables agree in data type.+ Assume that COMMON blocks are volatile.F Many Fortran programmers assume that variables, whether local orF in COMMON, are static, i.e. that once assigned a value, they retainF that value permanently until assigned a different value by the pro-F gram. However, in fact the Fortran 77 Standard does not require thisF to be the case. Local variables may become und3efined between activa-F tions of a module in which they are declared. Similarly, COMMONF blocks may become undefined if no module in which they are declaredF is active. (The technical term for entities with this behavior isF ``automatic'', but ftnchek uses the word ``volatile'' since it isF clearer to the nonspecialist.) Only COMMON blocks declared in a SAVEF statement, or declared in the main program or in a block data subpro-F gram remain defined as long as the program is run 4ning. Variables andF COMMON blocks that can become undefined at some point are called volatile.F If the /common=volatile flag is turned on, ftnchek will warn youF if it finds a volatile COMMON block. If, at the same time, the /us-F age=com-block-volatile option is turned on (which is the default),F ftnchek will try to check whether such a block can lose its definedF status between activations of the modules where it is declared. ft-F nchek does not do a very good job of 5 this: the rule used is to seeF whether the block is declared in two separated subtrees of the callF tree. For instance, this would be the case if two modules, bothF called from the main program, shared a volatile COMMON block. AF block can also become undefined between two successive calls of theF same subprogram, but ftnchek is not smart enough to tell whether aF subprogram can be called more than once, so this case is not checked for.F The /common=volatile flag do 6es not affect the way ftnchek checks the usage of local variables.F For compatibility with previous versions of ftnchek, a numericF form of this setting is also accepted: the list is replaced by a num-F ber from 0 to 3. A value of 0 turns all the warnings off, 1 orF greater turns on type, 2 or greater turns on length, and 3 turns onF dimensions and exact also. The numeric form cannot turn on the volatile option.! See also: /library, /usage.3 /crossref=list76 Prints cross-reference tables. Default = none.F The list consists of keywords separated by commas or colons.1 The keywords with their meanings are as follows:F table lists each subprogram followed by a list of routines thatF call it. This listing omits library modules that are not inF the call tree of the main program. The list is alphabetized.F table lists each COMMON block followed by a list of the routinesF that access it. These liste 8d routines are those in which someF variables in the COMMON block are accessed, not simply thoseF routines that declare the block. (To find out what routinesF declare a COMMON block but do not use it, see the /usage flag.)F table lists each label followed by a list of all references to it.F A label reference is denoted by the line number and statementF type of the referring statement. The label list is in se-F quential order9. The references are listed in the order they' are encountered in the program.< See also: /calltree, /reference, /sort, /symtab, /vcg. 3 /declareF If this flag is set, all identifiers whose datatype is not de-F clared in each module will be listed. This flag is useful for help-F ing to find misspelled variable names, etc. The same listing will beF given if the module contains an IMPLICIT NONE statement. Default = no.! See also: /sixchar, /usage. 3 :/divisionF This switch is provided to help users spot potential divisionF by zero problems. If this switch is selected, every division exceptF by a constant will be flagged. (It is assumed that the user is in-F telligent enough not to divide by a constant which is equal to zero!) Default = no.* See also: /portability, /truncation. 3 /errors=numF Set the maximum number of error messages in a ``cascade''.F During checking of agreement of subprogram arguments;, common blockF declarations, and so forth, sometimes a single case will generate aF long string of warnings. Often this simply indicates some otherF cause than a genuine item-by-item mismatch, such as for example aF varible missing from one list. So in such cases ftnchek stops print-F ing the warnings after the cascade limit is reached, and the trailerF ``etc...'' is printed to indicate that there were more errors notF printed. If you think that these warnings are likely <to be genuine,F use this setting to see more of them. Turn-on = default = 3, max =# 999. A value of 0 means no limit.F This setting does not set an overall limit on the number of er-F ror messages printed, only the number printed in any one cascade.F Most types of warnings and error messages are not subject to the cas-F cade effect and so are not affected by this setting. To turn offF warnings generally, use the individual warning control options or the /nocheck option. = See also: /check. 3 /externF Causes ftnchek to report whether any subprograms invoked by theF program are never defined. Ordinarily, if ftnchek is being run on aF complete program, each subprogram other than the intrinsic functionsF should be defined somewhere. Turn off this switch if you just wantF to check a subset of files which form part of a larger complete pro-F gram. Subprogram arguments will still be checked for correctness. Default = yes.F The /ext >ern flag is now superseded by the /usage=ext-undefinedF option. For the sake of convenience, the /extern flag is retained,F so that /noextern is equivalent to /usage=no-ext-undefined option.. The /extern switch may be retired eventually. See also: /library. 3 /f77=listF Use this setting to catch language extensions which violate theF Fortran 77 Standard. Such extensions may cause your program not toF be portable. Examples include the use of underscores in vari ?ableF names; variable names longer than six characters; statement linesF longer than 72 characters; and nonstandard statements such as the DOF ... ENDDO structure. ftnchek does not report on the use of lowercase3 letters. By default, all warnings are turned off.F This setting provides detailed control over the warnings aboutF supported extensions to the Fortran 77 Standard. The list consistsF of keywords separated by commas or colons. There are three specialF keywords: all @ to turn on all the warnings about nonstandard exten-F sions, none to turn them all off, and help to print the list of allF the keywords with a brief explanation of each. If list is omitted,F /f77 is equivalent to /f77=all, and /nof77 is equivalent toF /f77=none. The warning keywords with their meanings are as follows.# ACCEPT and TYPE I/O statements.F Expressions defining array bounds that contain array elements or function references.F Assignment state Aments involving arrays. In Fortran 90, an arrayF can be assigned to another array of compatible shape, or aF scalar can be assigned to an array. Neither of these assign-) ments is permitted in Fortran 77.F A related warning occurs when an array is assigned to a scalar.F Since this is illegal also in Fortran 90, it is always warned aboutF regardless of the /f77 setting (unless all checking is turned off with the /nocheck flag).F Type declarationBs in the new Fortran 90 attribute-based style.F This style of declaration is distinguished by the use of aF double colon (::) between the list of attributes and the listF of declared variables. This option also controls warnings forF use of Fortran 90 length or kind specifiers in type declara-F tions. (Although these specifiers can be used in non-at-F tribute-based declarations, they are controlled by this option0 to avoid proli Cferation of /f77 options.)F Local (not dummy) arrays which have variable size. These wouldF correspond to arrays whose storage would have to be dynamical-! ly allocated at run time.F Unix backslash escape in strings. This warning will be given onlyF if the /source=unix-backslash setting is specified to cause0 the escape interpretation of backslash.. BYTE data type declaration. The SELECT CASE construct.5 Common block and subprogram having D the same name.9 Use of a construct-name to label a control statement./ More than 19 successive continuation lines.6 Unix C preprocessor directives in the source code." The CYCLE and EXIT statements.: Debugging comments starting with D in the source code.F DEC Fortran style tab-formatted source code. This warning will beF given only if the /source=dec-tab setting is specified to3 cause interpretation of tabs in this style.F DO loop extensions: ter Eminal statement label omitted, END DO, and WHILE.& Double precision complex datatype.2 Dollar sign control code in FORMAT statements.6 Nonstandard edit descriptors in FORMAT statements., Function definition without parentheses. IMPLICIT NONE statement. INCLUDE statement.7 Inline comments starting with an exclamation point.2 List-directed I/O to or from an internal file.$ Nonstandard intrinsic functions.F Nonstandard keywords used in I/O statements. F These fall intoF three groups. The first group includes keywords that are ac- cepted in Fortran 90:6 ACTION PAD READWRITE1 ADVANCE POSITION SIZE2 DELIM READ WRITE EORF The second group comprises the following VMS Fortran keywords:; BLOCKSIZE EXTENDSIZE READONLY= BUFFERCOUNT INITIALSIZE RECOR GDSIZE= CARRIAGECONTROL MAXREC RECORDTYPE9 DEFAULTFILE NAME (in OPEN) SHARED7 DISP NOSPANBLOCK TYPE. DISPOSE ORGANIZATIONF (The keyword NAME is standard only in the INQUIRE statement.)B The third group consists of the following IBM/MVS keyword:$ NUMF Statements with meaningful code past 72 columns. This warning isF given onl Hy if the /columns setting has been used to increase" the statement field width.' Identifiers over 6 characters long.: Mixed character and noncharacter data in COMMON block.F Nonstandard type combinations in expressions, for example DOUBLEF PRECISION with COMPLEX, assigning hollerith to integer, logi-# cal operations on integers.3 Dollar sign used as a character in identifiers.2 Underscore used as a character in identifiers. NAMELIST statement.FI Implicit typing of a parameter by the data type of the value as-F signed. This warning can only occur if implicit parameterF typing has been turned on by the /source=param-implicit-typeF option, or if the PARAMETER statement is of the nonstandardF form without parentheses. If this option is turned on, thenF any instances where implicit parameter typing occurs will beF warned about. If you want to be warned only in those in-F J stances where the implicit data type differs from the defaultF type, use /portability=param-implicit-type instead. AccordingF to the Fortran 77 standard, the data type of a parameter isF given by the same rules as for a variable, and if necessary a; type conversion is done when the value is assigned.F Intrinsic function or exponentiation by a real used to define the( value of a PARAMETER definition.F PARAMETER statement without parentheses. K The user should be awareF that the semantics of this form of the statement differs fromF that of the standard form: in this form, the parameter takesF its data type from the value assigned, rather than having itsF default data type based on the first letter of the parameterF name. (This form of the PARAMETER statement was introduced byF DEC before the Fortran 77 standard was defined, and should be avoided.) ``Cray pointer'' synta Lx.; Quad precision real constants, e.g. of the form 1.23Q4.= Strings delimited by quote marks rather than apostrophes.F Relational (comparison) operators composed of punctuation, namely: < <= == /= > >=.* Semicolon used as statement separator.F Statements out of the sequence mandated by the Standard. The al-F lowed sequence is illustrated in Table 1 in the section on In- terpreting the Output., Typeless constants, for example Z'19AF'.< Type dec Mlarations specifying a size, for example REAL*8.F Variable repeat specification or field size in FORMAT. These are of the form < expr >.C Obsolete. Now has the same meaning as the io-keywords keyword.F See also: /f90, /f95, /portability, /pretty, /style, /wordsize. 3 /f90=listF This setting provides detailed control over the warnings aboutF supported extensions to the Fortran 77 Standard that were not adoptedF as part of the Fortran 90 Standard. Note that Nftnchek does not sup-F port the full Fortran 90 language. However, it does support someF common extensions to Fortran 77 that were prevalent before Fortran 90F was defined. Some of these extensions became part of the Fortran 90F Standard, but others did not. The /f90 setting warns only about theF latter. That is, this flag covers things that are neither legal For-F tran 77 nor legal Fortran 90. Therefore, the warnings controlled byF this flag are basically a subset of the warningsO controlled by /f77.F There are a few cases, described below, where the circumstances inF which the warning is given are slightly different for the two flags.F The list consists of keywords separated by commas or colons.F There are three special keywords: all to turn on all the warningsF about nonstandard extensions, none to turn them all off, and help toF print the list of all the keywords with a brief explanation of each.F If list is omitted, /f90 is equivalent to /f90=all P, and /nof90 is equivalent to /f90=none.F The following keywords have identical meanings for /f90 as for> /f77. The reader is referred to the explanations under /f77.; accept-type double-complex param-noparen5 backslash format-dollarsign pointer; byte format-edit-descr quad-constant7 cpp function-noparen type-size= d-comment name-dollarsign variable-format4 dec-tab Q param-implicit-type vms-ioF The keywords which differ somewhat from the corresponding /f77 keywords are as follows.F The limit on the number of continuation lines for a statement inF fixed source form is the same, namely 19, in Fortran 90 as inF Fortran 77. For free source form the limit is 39 continuationF lines, and a line containing a continuation mark cannot be2 otherwise empty or contain only a comment.F This is the same as for /Rf77 except for the intrinsic functionsF defined in MIL-STD 1753, which are all included in Fortran 90,B and so are not warned about. (See /intrinsic for a list.)F This is the same as for /f77 except that no warnings are given for9 the I/O keywords that are standard in Fortran 90.F Although the Fortran 90 Standard allows lines longer than 72 char-F acters in free source form, this restriction still applies toF fixed source form. In free source form th Se line length limitF is 132 characters, and unlike fixed form, ftnchek does not al-' low this limit to be increased.F This is the same as for /f77 except for expressions mixing extend-F ed precision real with complex data types, which are permitted in Fortran 90.F This is similar to the corresponding /f77 warning, but applies theF somewhat looser restrictions on statement order of the FortranF 90 Standard. In particular, Fortran 90 allows DAT TA statementsF and statement-function definitions to be intermixed with spec- ification statements.F In Fortran 90, binary, octal, and hexadecimal constants of theF form B'ddd', O'ddd', and Z'ddd', respectively, are permitted.F Here 'ddd' represents a string of digits. ftnchek recognizesF these forms, as well as a variant of the form X'ddd' for aF hexadecimal constant, and other variants in which the base in-F dicator B, O, Z, o Ur X follows the digit string. These vari-F ants were not adopted in Fortran 90, so only they are warned* about when this flag is turned on.F See also: /f77, /f95, /portability, /pretty, /style, /wordsize. 3 /f95=listF This setting provides detailed control over warnings aboutF standard Fortran 77 features that were deleted from the Fortran 95F Standard. Unlike the /f77 and /f90 settings, these warnings apply toF syntax which is legal Fortran 77. HoweVver, since these features haveF been deleted from the Standard, it is possible that programs contain-7 ing them will be unacceptable to some newer compilers.F The list consists of keywords separated by commas or colons.F There are three special keywords: all to turn on all the warningsF about nonstandard extensions, none to turn them all off, and help toF print the list of all the keywords with a brief explanation of each.F If list is omitted, /f95 is equivalent to /f95=all, W and /nof95 isF equivalent to /f95=none. The warning keywords with their meanings are as follows.+ A DO variable of any real numeric type. The PAUSE statement.< The ASSIGN statement, assigned GOTO, or assigned format.& The H edit descriptor in a format.F There is one other Fortran 77 syntax feature that was deleted inF Fortran 95, namely branching to an ENDIF from outside the IF block.F However, ftnchek is unable to analyze program flow, and so it does not provi Xde a warning for this.F See also: /f77, /f90, /portability, /pretty, /style, /wordsize.3 /helpF Prints a list of all the command-line options with a short de-F scription of each along with its default value. This command isF identical in function to the ``?'' argument, and is provided as aF convenience for those systems in which the question mark has special3 meaning to the command interpreter. Default = no.F The help listing also prints the version number Y and patch level# of ftnchek and a copyright notice.F Note: the ``default'' values printed in square brackets in theF help listing are, strictly speaking, not the built-in defaults butF the current values after any environment options and any command-line8 options preceding the /help option have been processed.F See also: /novice, /version, and help option of all settings that take a list of keywords.3 /identifier-chars=listF Define non-alphanumeric characters Zthat may be used in identi-F fiers. By default, ftnchek only accepts the dollar sign and under-F score as non-alphanumeric characters in identifier names. The char-F acters in the list replace whatever set of accepted non-alphanumericF characters was previously in effect. Thus, if dollar sign or under-F score are not included in the list, they lose their status as accept- able characters.F This option is provided to enable ftnchek to handle source filesF containing non-standard [ identifer names that may be needed, for exam-F ple, to access certain operating system services. See the section onF Limitations and Extensions for the treatment of identifiers contain-) ing these characters in implicit typing.F Using /noidentifer-chars turns off acceptance of non-alphanumer- ic characters entirely. See also: /source.3 /include=pathF Specifies a directory to be searched for files specified by IN-F CLUDE statements. Unlike other command-line option\s, this setting isF cumulative; that is, if it is given more than once on the commandF line, all the directories so specified are placed on a list that willF be searched in the same order as they are given. The order in whichF ftnchek searches for a file to be included is: the current directory;F the directory specified by environment variable FTNCHEK_INCLUDE ifF any; the directories specified by any /include options; the directoryF specified by environment variable INCLUDE; and final ]ly in a standardF system-wide directory (/usr/include for UNIX, SYS$LIBRARY for VMS, and \include for MSDOS). See also: /f77, /source.3 /intrinsic=listF Controls whether ftnchek recognizes certain nonstandard intrin-F sic functions as intrinsic. The list consists of keywords separatedF by commas or colons. Some of the keywords control whether to recog-F nize certain groups of functions, and other keywords control the ex-F pected syntax for invoking some nonstand ^ard intrinsics. Include aF keyword to turn on recognition of the corresponding set of intrinsicsF or to allow the corresponding syntax. Include a keyword prefixed by" no- to turn off that recognition.F There are three special keywords: all turns on recognition ofF all the nonstandard intrinsics (listed below) and accepts either syn-F tax for those that have variations. Use none to turn off recognitionF of all nonstandard intrinsics except those noted below. Use help toF print the _ list of all the keywords with a brief explanation of each.F If list is omitted, /intrinsic is equivalent to /intrinsic=all, and/ /nointrinsic is equivalent to /intrinsic=none.F The nonstandard intrinsic functions needed to support the non-F standard extended precision data types (double complex and quad pre-F cision) are always recognized. The intrinsics for the double complex data type are:1 CDABS CDSQRT DREAL ZLOG1 CDCOS DCMPLX ` IMAG ZSIN2 CDEXP DCONJG ZABS ZSQRT1 CDLOG DIMAG ZEXP ZCOS CDSINB The intrinsics for the quad precision and quad complex types are:3 CQABS QARCOS QEXT QNINT3 CQCOS QARSIN QEXTD QPROD3 CQEXP QATAN QFLOAT QREAL3 CQLOG QATAN2 QIMAG QSIGN2 CQSIN QCMPLX QINT QSIN3 C aQSQRT QCONJG QLOG QSINH3 DBLEQ QCOS QLOG10 QSQRT2 IQINT QCOSH QMAX1 QTAN3 IQNINT QDIM QMIN1 QTANH3 QABS QEXP QMOD SNGLQF The keywords controlling recognition of other nonstandard intrinsic functions are as follows:F recognize the following commonly available nonstandard intrinsics> (all except EXIT and LOC are defined in MIL-STD 1753):6 b BTEST IBCLR IEOR ISHFTC3 EXIT IBITS IOR LOC3 IAND IBSET ISHFT NOT= recognize these common Unix-specific intrinsic functions:6 ABORT GMTIME LTIME SRAND7 AND IARGC OR SYSTEM5 GETARG IRAND RAND TIME4 GETENV LSHIFT RSHIFT XOR< recognize these common VMS-specific intrinsic functions:6 c DATE IDATE SECNDS TIME/ ERRSNS RAN SIZEOF8 specify that IARGC may be invoked with no arguments.8 specify that IARGC may be invoked with one argument.A specify that RAND and IRAND may be invoked with no arguments.A specify that RAND and IRAND may be invoked with one argument.F The no-argument and one-argument keywords work as follows: turn-F ing the option on causes ftnchek to accept the corresponding syntaxF for invodcation of the function, without excluding the possibility ofF the alternative syntax. Turning the option off causes the corre-F sponding syntax not to be accepted. If both options are turned on atF once (the default), then either syntax is accepted. Turning both op-F tions off at once would not be meaningful. These options have no ef-< fect if recognition of Unix intrinsics has been turned off.F Note that this setting does not control whether non-standardF warnings are issuede about these functions. It controls whether theF functions are assumed to be intrinsic or not, which determines howF their usage is checked. When functions in any of these sets are in-F cluded, their invocations will be checked according to the rules forF the intrinsic functions; otherwise they will be checked as normalF (user-written) external functions. The non-standard warnings are) controlled by the /f77=intrinsic option.8 The default value of this setting is equivalen ft to /intrinsic=all,no-unix.F Note: In versions of ftnchek prior to 2.10, the /intrinsic flagF took a numeric argument instead of a list of options. For the sakeF of users who may have written scripts invoking ftnchek in this way,F the numeric form is still accepted. The numeric form of the settingF consists of three digits. The ones digit selects the set of intrin-F sic functions to be supported. The digit 0 selects only Fortran 77F standard intrinsics plus those needed gto support the nonstandard ex-F tended precision data types. The digit 1 is equivalent to extra, 2F is equivalent to extra,unix, and 3 is equivalent to extra,vms. TheF tens digit of this setting controls the syntax of the RAND intrinsicF function, and the hundreds digit controls the syntax of the IARGCF function. For these digits, specify 0 to require invocation with noA argument, 1 to require one argument, and 2 to allow either form. See also: /f77. 3 /libraryF h This switch is used when a number of subprograms are containedF in a file, but not all of them are used by the application. Normal-F ly, ftnchek warns you if any subprograms are defined but never used.9 This switch will suppress these warnings. Default = no.F This switch also controls which subprogram calls and COMMONF block declarations are checked. If a file is read with the /libraryF flag in effect, the subprogram calls and COMMON declarations con-F tained in a routinei in that file will be checked only if that routineF is in the main program's call tree. On the other hand, if the /li-F brary switch is turned off, then ftnchek checks the calls of everyF routine by every other routine, regardless of whether those routinesF could ever actually be invoked at run time, and likewise all COMMON/ block declarations are compared for agreement.F The difference between this switch and the /usage=no-ext-unusedF option for subprograms is that the latter s juppresses only the warningF about routines being declared but not used. The /library switch goesF further and excludes unused routines processed while it is in effectF from all cross-checking of arguments and COMMON block declarations as well.F (If there is no main program anywhere in the set of files thatF ftnchek has read, so that there is no call tree, then ftnchek willF look for any non-library routines that are not called by any otherF routine, and use these as substitutes k for the main program in con-F structing the call tree and deciding what to check. If no such top-F level non-library routines are found, then all inter-module calls and* all COMMON declarations will be checked.)@ See also: /arguments, /calltree, /common, /extern, /usage.3 /listF Specifies that a listing of the Fortran program is to be print-F ed out with line numbers. If ftnchek detects an error, the errorF message follows the program line with a caret ( ^ ) spec lifying theF location of the error. If no source listing was requested, ftnchekF will still print out any line containing an error, to aid the user in5 determining where the error occurred. Default = no.. See also: /output, \fB-symtab, fB-quiet.3 /makedcls=listF Prepare a neatly-formatted file of declarations of variables,F common blocks, and namelist lists, for possible merging into theF source code. The declarations are stored in a file of the same nameF as the m source code, but with the extension changed to If no declara-F tions are written to the file, it is deleted to reduce clutter from empty files.F If input comes from standard input, instead of a named file,2 then declarations are written to standard output.F Variables are declared in alphabetical order within each decla-F ration class and type, with integer variables first, because of their( later possible use in array dimensions.F PARAMETER statements are an exception nto the alphabetical orderF rule, because the Fortran 77 Standard requires that the expressionsF defining parameter values refer only to constants and already-definedF parameter names. This forces the original source file order of such5 statements to be preserved in the declaration files.F Explicit declaration of variables is considered good modern pro-F gramming practice. By using compiler options to reject undeclaredF variables, misspelled variable names (or names extending pasto columnF 72) can be caught at compile time. Explicit declarations also great-F ly facilitate changing floating-point precision with filters such asF and These programs are capable of changing types of explicit float-F ing-point type declarations, intrinsic functions, and constants, butF because they do not carry out rigorous lexical and grammatical analy-F sis of the Fortran source code, they cannot provide modified typeF declarations for undeclared variables. Default setting = 0, t purn-on = 1.F Various options for the form of the declarations file are con-F trolled by the list, which consists of keywords separated by commasF or colons. There are three special keywords: all to turn on all theF options, none to turn them all off, and help to print the list of allF the keywords with a brief explanation of each. If list is omitted,F /makedcls is equivalent to /makedcls=declarations (i.e. produce theF declarations file using the default options), and /no qmakedcls is equivalent to /makedcls=none.F For compatibility with previous versions of ftnchek, a numericF form of this setting is also accepted: the list is replaced by aF number which is the sum of the numbers in parentheses beside the key-F words in the following list. The warning keywords with their mean- ings are as follows:F declarations (1): Write a declaration file. (This is implied byF any of the other options, and can be omitted if any other op- r tions are given.)F undeclared-only (2): By default, all variables are included in theF declaration file. With this option, include only variables.F This setting is useful if you want to check for undeclaredF variables, since Fortran source files with all variables prop-F erly declared will not result in a file. With this option,F common blocks and namelist lists will not be included in theF declaration file, since by their nature sthey cannot be unde- clared.F compact (4): The declarations are normally prettyprinted to lineF up neatly in common columns, as in the declaration files out-F put by the Extended PFORT Verifier, This option value selects9 instead compact output, without column alignment.F use-continuation-lines (8): Causes continuation lines to be usedF where permissible. The default is to begin a new declarationF on each line. This option is appropri tate to use together with compact.F keywords-lowercase (16): Output Fortran keywords in lowercase, in-' stead of the default uppercase.F vars-and-consts-lowercase (32): Output variables and constants inF lowercase, instead of the default uppercase. Character9 string constants are not affected by this option.F exclude-sftran3 (64): Omit declarations of internal integer vari-F ables produced by the SFTRAN3 preprocessor, as part of theFu translation of structured Fortran statements to ordinary For-F tran. These variables have six-character names of the formF and where is a decimal digit. Because they are invisible inF the SFTRAN3 source code, and will change if the SFTRAN3 codeF is modified, such variables should not be explicitly declared.F Instead, they should just assume the default Fortran INTEGER0 data type based on their initial letter,F asterisk-comment (1 v28): Use an asterisk as the comment character;% the default is otherwise 'C'.F comment-char-lowercase (256): Use 'c' instead of 'C' or '*' as the comment character.F suppress-array-dimensions (512): Suppress dimensioning of arraysF in the generated declarations. This option is for use withF code lacking type declarations, to allow the declaration filesF to be inserted without change into the code. Since the codeF will have dimension st watements already, dimensioning the arrayF variables in the type statements of the declaration file isF redundant. This option should be used only in conjunctionF with option 2 = undeclared-only because otherwise any arraysF that were dimensioned in a type statement will lose their di- mensioning.F free-form (1024): Produce declarations in free source form. ThisF mode is automatically used if the input source is free form.F Usxe this option to produce declarations in free form even ifF the input is in fixed form. Free form declarations are in-F dented only 2 columns instead of 6, use the exclamation markF as the comment character, and indicate continuation lines by< an ampersand at the end of the line to be continued.F The declaration files contain distinctive comments that mark theF start and end of declarations for each program unit, to facilitateF using text editor mac yros for merging the declarations back into the source code.F The ftnchek distribution includes a program, dcl2inc, which pro-F cesses declaration files to produce files containing declarations ofF all COMMON blocks, in a form suitable for use as INCLUDE files. See) the man page for the details of its use. See also: /mkhtml.3 /mkhtml=listF Produce HTML documentation from source. Creates individual HTMLF files from ftnchek analysis and code comments. All commentsz immedi-F ately preceding and following the function or subroutine definitionF are captured to the HTML file. No reformatting of source comments isF performed other than stripping of FORTRAN comment characters. In ad-F dition, the HTML file lists the local variables declared, commonF block variables used, functions and subroutines called, I/O unit us-F age, and other information about each subprogram. Usually you willF also want to specify /call=tree to create the root HTML file { Call-< Tree.html. (Perhaps this file should be named index.html.)F Various options for the form of the HTML files are controlled byF the list, which consists of keywords separated by commas or colons.F There are three special keywords: all to turn on all the options,F none to turn them all off, and help to print the list of all the key-F words with a brief explanation of each. If list is omitted, /mkhtmlF is equivalent to /mkhtml=documents (i.e. produce the HTML documentF fil |es using the default options), and /nomkhtmls is equivalent to /mkhtml=none.F For the sake of simplicity, the options for /mkhtml are the sameF as those for /makedcls except for those that are inapplicable. Like-F wise, a numeric form of this setting can be used, formed as the sumF of the numbers in parentheses in the list below. The warning key-* words with their meanings are as follows:F documents (1): Create the HTML documents. (This is implied by anyF of the ot }her options, and can be omitted if any other options are given.)F compact (4): The declarations are normally prettyprinted to lineF up neatly in common columns. This option value selects in-7 stead compact output, without column alignment.F use-continuation-lines (8): Causes continuation lines to be usedF instead of beginning a new declaration on each line. This op-9 tion is appropriate to use together with compact.F keywords-lowercase ( ~16): Output Fortran keywords in lowercase, in-' stead of the default uppercase.F vars-and-consts-lowercase (32): Output variables and constants inF lowercase, instead of the default uppercase. Character9 string constants are not affected by this option.F exclude-sftran3 (64): Omit declarations of internal integer vari-F ables produced by the SFTRAN3 preprocessor, (See /makedcls for discussion.)F suppress-array-dimensions (512): Suppres s dimensioning of arraysF in the generated declarations. This is normally undesirable,F but is available if for some reason you do not want the array) dimensions to appear in the HTML.F free-form (1024): Produce variable declarations in free sourceF form. This mode is automatically used if the input source isF free form. This mainly affects the form of continuation lines if they are used.% See also: /calltree, /makedcls. 3 /n oviceF This flag is intended to provide more helpful output for begin- ners. It has two effects:F (a) provides an extra message to the effect that a function thatF is used but not defined anywhere might be an array which theF user forgot to declare in a DIMENSION statement (since theF syntax of an array reference is the same as that of a function reference).F (b) modifies the form of the error messages and warnings. If theF flag i s turned off by /nonovice, these messages are printed in* a style more resembling UNIX lint. Default = yes.3 /output=filenameF This setting is provided for convenience on systems which doF not allow easy redirection of output from programs. When this set-F ting is given, the output which normally appears on the screen willF be sent instead to the named file. Note, however, that operationalF errors of ftnchek itself (e.g. out of space or cannot open file) will F still be sent to the screen. The extension for the filename is op-F tional, and if no extension is given, the extension .lis will be used.3 /pointersize=numF Specifies the size of a ``Cray pointer'' variable to be num% bytes. Default = turn-on = 4 bytes.F The pointer size is used to inform precision mismatch warningsF involving pointer variables, for example when a pointer is assigned aF value from an allocation routine, or passed as a subprogram parame- ter.; See also: /f77, /portability, /truncation, /wordsize.3 /portability=listF ftnchek will give warnings for a variety of non-portable us-F ages. Examples include the use of tabs except in comments or insideF strings, the use of Hollerith constants, and the equivalencing ofF variables of different data types. This option does not produceF warnings for supported extensions to the Fortran 77 Standard, whichF may also cause portability problems. To catch those, use the /f773 setting. By default, all warnings are turned off.F This setting provides detailed control over the warnings aboutF possible portability problems. The list consists of keywords sepa-F rated by commas or colons. There are three special keywords: all toF turn on all the warnings about nonportable usages, none to turn themF all off, and help to print the list of all the keywords with a briefF explanation of each. If list is omitted, /portability is equivalentF to /portability=all, and /noportability is equivalent to /portabili-C ty=none. The warning keywords with their meanings are as follows:F Backslash character in strings. Since some compilers treat theF backslash as an escape character, its presence can cause prob-A lems even though it is used in a standard-conforming way.F COMMON block variables not in descending order of storage size.F Some compilers require this ordering because of storage align- ment requirements.F Hollerith constants (other than within FORMAT specifications).F The Hollerith data type is a feature of Fortran IV that hasF been deleted in the Fortran 77 standard. It is superseded byF the character data type. Storing Hollerith data in variablesF of a numeric or logical data type is nonportable due to dif- fering word sizes.D String constants, variables, or expressions over 255 chars long.3 Variables of different data types equivalenced.F Variables declared with default precision used with variables giv-F en explicit precision, in expressions, assignments, or as ar-F guments. For example, if a variable declared as REAL*8 is2 treated as equivalent to DOUBLE PRECISION.F Non-integer DO loop index and bounds. These can cause a program'sF results to depend on the hardware characteristics of the par- ticular computer used.F Implicit typing of a parameter by the data type of the value as-F signed, if it differs from the default type. This warning canF only occur if implicit parameter typing has been turned on byF the /source=param-implicit-type option, or if the PARAMETERF statement is of the nonstandard form without parentheses. IfF this option is turned on, then any instances where implicitF parameter typing occurs and where the implicit type is differ-F ent from the default type ba sed on the first letter of the pa-F rameter name, will be warned about. Implicit parameter typingF can change the semantics of statements where the parameter is+ used, causing portability problems.F Tabs in source code. Tabs are interpreted differently by differ-F ent compilers. This warning will be given only once, at the end of the file.= See also: /f77, /f90, /f95, /pretty, /style, /wordsize.3 /pretty=listF Controls certain me ssages related to the appearance of theF source code. These warn about things that might make a program lessF readable or be deceptive to the reader. By default, all warnings are turned on.F This setting provides detailed control over the warnings aboutF appearance. The list consists of keywords separated by commas orF colons. Since all warnings are on by default, include a keyword pre-F fixed by no- to turn off a particular warning. There are three spe-F cial keyword s: all to turn on all the warnings about misleading ap-F pearances, none to turn them all off, and help to print the list ofF all the keywords with a brief explanation of each. If list is omit-F ted, /pretty is equivalent to /pretty=all, and /nopretty is equiva-F lent to /pretty=none. The warning keywords with their meanings are as follows:F A RETURN statement has a constant specifying an alternate returnF point that is not between 0 and the number of dummy argumentsF that are labels. This is legal, and has the same effect as aF RETURN with no alternate return expression, but suggests thatF the programmer intended to use an alternate return label that is not provided.F Space embedded in variable names or in multi-character operators such as **./ Continuation mark following a comment line.F Lines (except comments) over 72 columns in width (beyond 72 is& normally ignored by compiler).; Lack o f space between variable and a preceding keyword.F COMMON block declared in multiple statements. No warning is givenC if the statements are consecutive except for comment lines.F NAMELIST declared in multiple statements. No warning is given if@ the statements are consecutive except for comment lines.F Parentheses around a variable by itself. As a subprogram argu-F ment, this makes the argument an expression, not modifiable by the subprogram.F Note that in free source form, extra space and missing space areF forbidden by the Fortran 90 Standard, and are not mere style viola-F tions. In this case the warnings are replaced by syntax error mes-5 sages, and can be turned off only by using /nocheck.+ See also: /f77, /portability, /style.3 /project=listF ftnchek will create a project file from each source file thatF is input while this option is turned on. The project file will beF given the same name as the input file, but with the extension .f orF .for replaced by .prj. (If input is from standard input, the project file is named Default = none.F The list consists of keywords separated by commas or colons.F There are three special keywords: all to turn on all the options,F none to turn them all off, and help to print the list of all the key-F words with a brief explanation of each. If list is omitted, /projectF is equivalent to /project=all, and /noproject is equivalent toA /project=none. The keywords with their meanings are as follows:F create: Produce a project file. The default is not to produce aF project file. If this option is not turned on, the other op- tions have no effect.F trim-calls: Trim the amount of information stored in the projectF file about subprogram declarations and calls. This is the de-F fault. Turn this option off only in rare situations. (SeeF discussion below.) The amount of trimming varies depending onF the /library flag. More information is trimmed if that flag is turned on.F trim-common: Trim the number of common block declarations storedF in the project file. This is the default. Turn this optionF off only in rare situations. (See discussion below.) ThisF option has no effect if the /library flag is turned off: whenF not in library mode, no trimming of common block declarations* is done regardless of this option.F A project file contains a summary of information from the sourceF file, for use in checking agreement among FUNCTION, SUBROUTINE, andF COMMON usages in other files. It allows incremental checking, whichF saves time whenever you have a large set of files containing sharedF subroutines, most of which seldom change. You can run ftnchek onceF on each file with the /project flag set, creating the project files.F Usually you would also set the /library and /no extern flags at thisF time, to suppress messages relating to consistency with other files.F Only error messages pertaining to each file by itself will be printedF at this time. Thereafter, run ftnchek without these flags on all theF project files together, to check consistency among the differentF files. All messages internal to the individual files will now beF omitted. Only when a file is altered will a new project file need to be made for it.F Naturally, when the /project option is turned on, ftnchek will! not read project files as input.F Ordinarily, the trim options should be left on when you intendF to create project files for future input to ftnchek. Since trimmingF is on by default, this means that simply giving the command /projectF with no option list is the recommended mode. The trim options areF provided only as a convenience for those who want to make use ofF project files for purposes other than checking the program with ft-F nchek. To use project files for their intended purpose, the trim op- tions should not be turned off.F Project files contain only information needed for checkingF agreement between files. This means that a project file is of no useF if all modules of the complete program are contained in a single file.F A more detailed discussion is given in the section on Using Project Files.3 /pureF Assume functions are ``pure'', i.e., they will not have sideF effects by modifying their arguments or variables in a COMMON block.F When this flag is in effect, ftnchek will base its determination ofF set and used status of the actual arguments on the assumption thatF arguments passed to a function are not altered. It will also issue aF warning if a function is found to modify any of its arguments or any" COMMON variables. Default = yes.F When this flag is turned off, actual arguments passed to func-F tions will be handled the same way as actual arguments passed to sub-F routines. This means that ftnchek will assume that arguments may beF modified by the functions. No warnings will be given if a functionF is found to have side effects. Because stricter checking is possibleF if functions are assumed to be pure, you should turn this flag off@ only if your program actually uses functions with side effects.3 /quietF This option reduces the amount of output relating to normal op-F eration, so that error messa ges are more apparent. This option isF provided for the convenience of users who are checking large suitesF of files. The eliminated output includes the names of project files,F and the message reporting that no syntax errors were found. It alsoF eliminates some blank lines that are ordinarily included for clarity.F (Some of this output is turned back on by the /list and /symtab op- tions.) Default = no.F Note: the way to remember the difference between the /quiet andF /brief is that /quiet doesn't suppress any warning-related informa- tion, whereas /brief does. See also: /brief. 3 /referenceF Specifies that a who-calls-who table be printed. This tableF lists each subprogram followed by a list of the routines it calls.A This switch is equivalent to /calltree=reference. Default = no.F The reference list omits routines called by unused library mod-F ules. Thus it contains the same information as for the call-treeF format, na mely the hierarchy of subprogram calls, but printed in aF different way. This prints out a breadth-first traversal of the call@ tree whereas /calltree=tree prints out a depth-first traversal.F See also: /calltree, /crossref, /library, /sort, /symtab, /vcg. 3 /resourcesF Prints the amount of resources used by ftnchek in processingF the program. This listing may be useful in analyzing the size andF complexity of a program. It can also help in choosing larger sizesF for ftnchek's internal tables if they are too small to analyze a par- ticular program. Default = no.F In this listing, the term ``chunk size'' is the size of theF blocks of memory allocated to store the item in question, in units ofF the size of one item, not necessarily in bytes. When the initiallyF allocated space is filled up, more memory is allocated in chunks ofB this size. The following is an explanation of the items printed:F Total number of lines of code, with separa te totals for statementF lines and comment lines. Comment lines include lines with 'C'F or '*' in column 1 as well as blank lines and lines containingF only an inline comment. Statement lines are all other lines,F including lines that have an inline comment following someF code. Continuation lines are counted as separate lines.F Lines in include files are counted each time the file is in- cluded.F Number of statements in the program, other than specification, da-B ta, statement-function, FORMAT, ENTRY, and END statements.F A module is any external subprogram, including the main program,F subroutines, functions, and block data units. This count isF of modules defined within the source, not modules referenced.F Statement functions are not included. A subprogram with mul-0 tiple entry points is only counted once.F Number of labels attached to statements (often called statementF numbers). The total label count for the entire program isF given, as well as the maximum number in any single subprogram.F Number of characters used for storing identifier names. An iden-F tifier is a variable, subprogram, or common block name. LocalF names are those of local variables in a subprogram, whereasF global names refer to subprogram and common block names, asF well as dummy argument names and common variable nam es. Actu-F al argument text (up to 15 characters for each argument) isF also included here. The space used for local names is not re-F covered at the end of each module, so this number, like globalF space, grows until the whole program is analyzed. Unfortu-F nately, this figure may include some text stored more thanF once, although a heuristic is used that will avoid duplicates in many cases.F A token is the smallest syntactic unit of the FORTRAN languageF above the level of individual characters. For instance a tokenF can be a variable name, a numerical constant, a quoted textF string, or a punctuation character. Token text is storedF while a module is being processed. For technical reasons,F single-character tokens are not included in this total. ItemsF that are not represented in the symbol table may be duplicat-F ed. The space for token text i s recovered at the end of eachF module, so this figure represents the maximum for any one mod- ule.F This is the largest number of entries in the local symbol tableF for any module. Local symbol table entries include all vari-F ables and parameters, common block names, statement functions,F external subprograms and intrinsic functions referenced by theF module. Literal constants are not stored in the local symbol table.F This is the number of entries in the global symbol table at theF end of processing. Global symbol table entries include exter-F nal subprogram and common block names. Intrinsic functions1 and statement functions are not included.F A token list is a sequence of tokens representing the actual orF dummy argument list of a subprogram, or the list of variablesF in a common block or namelist. Therefore this number repre-F sents the largest sum of COMMON, CALL, NAMELIST and ENTRYF statements and function invocations for any one module. The5 space is recovered at the end of each module.F This is the largest number of tokens in all the token lists andF token trees of any one module. A token tree is formed whenF analyzing an expression: each operand is a leaf of the tree,F and the operators are the nodes. Therefore this number is aF measure of the maximum complexity of an i ndividual module.F For instance a module with many long arithmetic expressionsF will have a high number. Note that unlike token text de-F scribed above, the number of tokens is independent of theF length of the variable names or literal constants in the ex- pressions.F This is the sum over all modules of the number of CALL statementsF and function invocations (except intrinsic functions and statement functions).F  This is the sum over all modules of the number of common blockF declarations. That is, each declaration of a block in a dif-F ferent module is counted separately. (The standard allowsF multiple declarations of a block within the same module; theseF are counted as only one declaration since they are equivalent& to a single long declaration.)F This is the sum over all modules of the number of array dimensionF and parameter definition text strings saved for use by theF /makedcls option. The length of the text strings is notF counted. Each dimension of a multidimensional array is count- ed separately.F These numbers are obviously not the same when project files areF used in place of the original source code. Even the numbers forF global entities may be different, since some redundant information is eliminated in project files. 3 /sixcharF One of the goals of the ftnchek program is to help users toF write portable Fortran programs. One potential source of nonporta-F bility is the use of variable names that are longer than six charac-F ters. Some compilers just ignore the extra characters. This behav-F ior could potentially lead to two different variables being consid-F ered as the same. For instance, variables named AVERAGECOST and AV-F ERAGEPRICE are the same in the first six characters. If you wish to= catch such possible conflicts, use this flag. Default = no.F Use the /f77=long-names if you want to list all variables longerF than six characters, not just those pairs that are the same in the first six.# See also: /f77, /portability.3 /sortF Specifies that a sorted list of all modules used in the programF be printed. This list is in ``prerequisite'' order, i.e. each moduleF is printed only after all the modules from which it is called haveF been printed. This is also called a ``topological sort '' of the callF tree. Each module is listed only once. Routines that are not in theF call tree of the main program are omitted. If there are any cyclesF in the call graph (illegal in standard Fortran) they will be detected and diagnosed. Default = no.@ See also: /calltree, /crossref, /reference, /symtab, /vcg.3 /source=listF This setting controls certain options about the form of theF Fortran source code. The list consists of keywords separated by com-F mas or colons. There are three special keywords: all to turn on allF the options, none to turn them all off, and help to print the list ofF all the keywords with a brief explanation of each. If list is omit-F ted, /source is equivalent to /source=all, and /nosource is equiva- lent to /source=none.F For compatibility with previous versions of ftnchek, a numericF form of this setting is also accepted: the list is replaced by aF number which is the sum of the numbers in parentheses beside the key-F words in the following list. (The fixed and free options do not haveF numeric values.) The warning keywords with their meanings are as follows:F fixed: Interpret the source as fixed form (with supported exten-F sions such as exclamation mark for comments). Statements mustF be in columns 7 to 72 (unless the /cols setting has been usedF to change this), and blanks are not significant outside char-F acter context (but warned about under the /pretty option).F This is the default mode unless the source file extension isF .f90 or .F90. this option cannot be given together with /source=free.F free: Interpret the source as free form. Statements may be any-F where in columns 1 to 132, comments can only begin with an ex-F clamation mark, and blanks are required in some places such asF between identifiers and keywords. This is the default mode ifF the source file extension is .f90 or .F90. This option cannot? be given together with /source=fixed or /source=dec-tabF dec-tab (1): Accept DEC-style tab-formatted source. A line begin-F ning with an initial tab will be treated as a new statementF line unless the character after the tab is a nonzero digit, inF which case it is treated as a continuation line. The nextF column after the tab or continuation mark is taken as columnF 7. A warning will be given in the case where the line is a3 continuation, if /f77=dec-tab is in effect.F vms-include (2): Accept VMS-style INCLUDE statements. These fol-F low the normal syntax, but with the following additional fea-F tures: (1) the file extension, if not given, defaults to theF same as a normal source file extension; and (2) the optionF /LIST or /NOLIST can be appended to the include-file name, to( control listing of its contents.F unix-backslash (4): Handle UNIX-style backslash escapes in charac-F ter strings. The escape sequence following the backslash willF be evaluated according to the ANSI standard for strings in C:F up to three digits signify an octal value, an x signifies theF start of a hexadecimal constant, any of the letters a b f n rF t signify special control codes, and any other character (in-F cluding newline) signifies the character itself. When thisF source cod e option is in effect, a warning will be given if0 the /f77=backslash setting is specified.F The default behavior is to treat the backslash like any otherF normal character, but a warning about portability will be generatedF if the /portability flag is set. Because of the fact that some com-F pilers treat the backslash in a nonstandard way, it is possible forF standard-conforming programs to be non-portable if they use the back- slash character in strings.F Since ftnchek does not do much with the interpreted string, it isF seldom necessary to use this option. It is needed in order to avoidF spurious warnings only if (a) the program being checked uses back-F slash to embed an apostrophe or quote mark in a string instead of us-F ing the standard mechanism of doubling the delimiter; (b) the back-F slash is used to escape the end-of-line in order to continue a stringF across multiple source lines; or (c) a PARAMETER definition uses anF intrinsic string function such as LEN with such a string as argument,> and that value is later used to define array dimensions, etc.F param-implicit-type (8): Implicit typing of a parameter by the da-F ta type of the value assigned. Some non-standard compilersF may allow the data type of the value to override the FortranF 77 default type of a parameter that is based on the first let-F ter of the parameter name. This option only applies to PARAM-F ETER stateme nts of the standard form which has parentheses. AF parameter that has been explicitly declared in a type state-F ment prior to the PARAMETER statement is not affected by thisF option. A warning will be given under the /f77=param-implic-; it-type or /portability=param-implicit-type option.F Note that this implicit typing is treated as equivalent to an ex-F plicit type declaration for the parameter. Therefore, if you useF /makedcls=undeclared-only to generate declarations only of undeclared2 variables, these parameters will not be included.F dec-param-standard-type (16): Follow the Fortran 77 rule for dataF typing of DEC Fortran style parameters. These are declaredF using a nonstandard form of the PARAMETER statement whichF lacks parentheses. According to DEC Fortran, parameters de-F fined by this form of the statement have their data type givenF by the data type of the value assigned. Use this option toF tell ftnchek not to follow this rule but instead to use theF same rule as for standard PARAMETER statements. This optionD does not apply to PARAMETER statements of the standard form.F By default, all these source code options are turned off, exceptF for the vms-include option, which is on by default in the VMS ver- sion..- See also: /f77, /include, /portability. 3 /style=listF Provides extra-picky warnings about obsole scent or old-fash-F ioned programming constructions. This option is helpful for effortsF to follow a modern programming style. (Most of the things complainedF about under this option are forbidden in the F subset language.) By& default, all warnings are turned off.F The list consists of keywords separated by commas or colons.F There are three special keywords: all to turn on all the options,F none to turn them all off, and help to print the list of all the key-F words with a brief explanation of each. If list is omitted, /styleF is equivalent to /style=all, and /nostyle is equivalent toF /style=none. The warning keywords with their meanings are as fol- lows:F Complain about arithmetic IF statement. Accept block IF or logi-3 cal IF (which controls a single statement).F Complain about unnamed block constructs: IF, DO, and SELECT CASE.F Note that if a construct name is present on the opening state-F ment of a construct, then it is required to be present on allF other component statements (ELSE, END IF, etc.) of the con-F struct. In that case a missing construct name on those state-F ments generates a syntax error regardless of this option. TheF purpose of this option is to warn if the construct completely lacks the optional name.A Complain if two DO loops share a common terminator statement.F Complain if terminator of a DO loop is anything other than an E NDF DO or CONTINUE statement. This is the requirement in orderF for the loop to meet the Fortran 90 definition of a do-con- struct.F Complain if terminator of a DO loop is anything other than an ENDF DO statement. (This option overrides the do-construct option, being even stricter.)F Complain about the absence of the subprogram name on structured END statements.F Complain about the presence of FORMAT statements. Only the FO RMATF statements themselves are flagged, not the references to them in I/O lists.F Complain about the presence of unconditional, computed or assignedF GOTO statements. Also complain about alternate returns (but2 not about labels as subprogram arguments).F Complain about the presence of labels (numbers) on statements oth-F er than FORMAT statements. (Since FORMAT statements are ar-F guably convenient and not readily abused, complaints aboutA them are controlled by the separate format-stmt keyword.)F Complain about the absence of a PROGRAM statement at the head of the main program.F Complain about the use of a plain END statement to end a subpro-F gram, rather than a structured END statement (END PROGRAM, END5 SUBROUTINE, END FUNCTION, or END BLOCK DATA).8 See also: /f77, /f90, /f95, /pretty, /portability. 3 /symtabF A symbol table will be printed out for each modul e, listing allF identifiers mentioned in the module. This table gives the name ofF each variable, its datatype, and the number of dimensions for arrays.F An asterisk (*) indicates that the variable has been implicitlyF typed, rather than being named in an explicit type declaration state-F ment. The table also lists all subprograms invoked by the module,0 all COMMON blocks declared, etc. Default = no.F Also, for each module, a label table will be printed. The tableF lists each label defined in the module; the line on which said state-F ment label is defined; and the statement type (executable, format, or< specification). The labels are listed in sequential order.F Also printed is a table describing the I/O units used by theF module, together with information about how they are used: what oper-F ations are performed, whether the access is sequential or direct, and- whether the I/O is formatted or unformatted.F See also: /calltree, /crossref, /list, /reference, /sort, /vcg.3 /truncation=listF Warn about possible truncation (or roundoff) errors. Most ofF these are related to integer arithmetic. By default, all warnings are turned on.F This setting provides detailed control over the warnings aboutF possible truncation errors. The list consists of keywords separatedF by commas or colons. Since all warnings are on by default, include aF keyword prefixed by no- to turn off a particular warning. There areF three special keywords: all to turn on all the warnings about trunca-F tion, none to turn them all off, and help to print the list of allF the keywords with a brief explanation of each. If list is omitted,F /truncation is equivalent to /truncation=all, and /notruncation isF equivalent to /truncation=none. The warning keywords with their meanings are as follows:F use of the result of integer division as an exponent. This sug-F gests that a real quotient is intended. An example would beF writing X**(1/3) to evaluate the cube root of X. The correct! expression is X**(1./3.).F Conversion of an expression involving an integer division to real.7 This suggests that a real quotient is intended.F division in an integer constant expression that yields a result of zero.F exponentiation of an integer by a negative integer (which yieldsF zero unless the base integer is 1 in magnitude). This sug-+ gests that a real base is intended.F automatic conversion of a lower precision quantity to one of high-F er precision. The loss of accuracy for real variables in thisF process is comparable to the corresponding demotion. No warn-F ing is given for promotion of integer quantities to real since! this is ordinarily exact.F use of a non-integer DO index in a loop with integer bounds. AnF integer DO index with real bounds is always warned about re-! gardless of this setting.) use of a non-integer array subscript.F overspecifying a single precision constant. This may indicate6 that a double precision constant was intended.F automatic conversion of a higher precision quantity to one of low-F er precision of the same type. This warning only occurs whenF an explicit size is used in declaring the type of one or bothF operands in an assignment. For example, a warning wil be is-F sued where a REAL*8 variable is assigned to a REAL variable,F if the default wordsize of 4 is in effect. A warning is alsoF issued if a long integer is assigned to a shorter one, for ex-F ample, if an INTEGER expression is assigned to an INTEGER*2F variable. There is one exception to this last case, namely ifF the right hand side of the assignment is a small literal con-F stant (less than 128). automatic conversion of a higher pre-F cision quantity to one of lower precision of different type.F This warning includes conversion of real quantities to inte-F ger, double precision to single precision real, and assignment6 of a longer character string to a shorter one.F The warnings about promotion and demotion also apply to complexF constants, considering the precision to be that of the real or imagi-F nary part. Warnings about promotions and demotions are given onlyF when the conversion is done aut omatically, e.g. in expressions ofF mixed precision or in an assignment statement. If intrinsic func-F tions such as INT are used to perform the conversion, no warning is given.( See also: /portability, /wordsize. 3 /usage=listF Warn about unused or possible uninitialized variables, unusedF common blocks, undefined or unused statement labels, and unused or@ undefined subprograms. By default, all warnings are turned on.F This setting provides detailed control over the warnings aboutF possible usage errors. The list consists of keywords separated byF commas or colons. Since all warnings are on by default, include aF keyword prefixed by no- to turn off a particular warning. There areF three special keywords: all to turn on all the warnings about usage,F none to turn them all off, and help to print the list of all the key-F words with a brief explanation of each. If list is omitted, /usageF is equivalent to /usage=all, and /nousag e is equivalent to /us-F age=none. These warnings cover four main categories of objects: sub-F program dummy arguments, common blocks and variables, subprograms andF functions, and local variables. Warnings include undefined items,F multiply defined items, unused items, etc. The warning keywords with their meanings are as follows:F a scalar dummy argument is actually the same as another and is (orF may be) modified. The Fortran 77 standard (section 15.9.3.6)C prohibits modifying an argument that is aliased to another.F a dummy argument which is an array or array element is in the sameF array as another and is modified. This flag is similar toF arg-alias but provides separate control over array arguments.F It is harder to tell if aliasing is occurring in the case ofF arrays, so if ftnchek gives too many false warnings, this flagF allows the array-related ones to be turned off without sup-* pressing the warnings for scalars.F a scalar dummy argument is the same as a common variable in theF subprogram, and either is modified. This is also prohibitedF by the Fortran 77 standard. If common checking is not exactF (see the /common setting), it is harder to tell if aliasing isF occurring, so the warning is given if the variable is anywhere= in a common block that is declared by the subprogram.F a dummy argument which is an array or array element is in the sameF array as a common variable, and either is modified. If commonF checking is not exact, the variable can be anywhere in a com-5 mon block that is declared by the subprogram.F a subprogram modifies an argument which is a constant or an ex-F pression. Such an action could cause anomalous behavior of the program.F a dummy argument is declared but never used. This is similar toF the var-unused keyword described below, b ut applies only to arguments.F a common block is declared but none of the variables in it areF used by any subprogram. This warning is suppressed if the' common strictness setting is 0.F a common block may lose the definition of its contents if commonF blocks are volatile. This option only has an effect if theF /common=volatile flag is in effect. See the discussion of the /common setting above.F a common variable is assig ned a value, but its value is not usedF by any subprogram. This warning is suppressed if the common strictness setting is 0.F a common variable's value is used in some subprogram, but is notF set anywhere. Unfortunately, ftnchek does not do a thoroughF enough analysis of the calling sequence to know which routinesF are called before others. So warnings about this type of er-F ror will only be given for cases in which a variable is usedF in some routine but not set in any other routine. CheckingF of individual COMMON variables is done only if the /commonF setting is 3 (variable by variable agreement). This warning< is suppressed if the common strictness setting is 0.F a common variable is declared but not used by any subprogram.F This warning is suppressed if the common strictness setting is 0.F a variable that is the index of a DO loop is modified by someF statement within the range of the loop. The Standard permitsF an active DO variable to be modified only by the incrementa-+ tion mechanism of the DO statement.F an external (a subroutine or function) is defined more than once.F Definition of an external means providing the body of its source code.F a name is declared in an EXTERNAL statement in some module, but is% not defined or used anywhere.F an external is used (invoked) but not defined anywhere. This op-F tion is equivalent to the /external flag. If the subprogramF is invoked more than once, those invocations will still be checked for consistency.F an external is defined (its subprogram body is present) but it isF not used. A subprogram is considered unused even if it is in-F voked by some other subprogram, if it cannot be called fromF any thread of execution starting with the main program. TheF  agreement of the subprogram's arguments with its invocationsF is still checked even if this warning is turned off. If thereF is no main program, then this warning is issued only if theF subprogram is not invoked anywhere. This warning is sup-F pressed in library mode, but library mode has the additionalD effect of suppressing argument checking for unused routines.< a statement refers to a label that has not been defined.8 a statement label is defined, but never referred to.F a local variable is assigned a value, but that value is not used.F a local variable's value may be used before it is assigned. Some-F times ftnchek makes a mistake in the warnings about localF variable usage. Usually it errs on the side of giving a warn-F ing where no problem exists, but in rare cases it may fail toF warn where the problem does exist. See the section on BugsF for examples. If variables are equivalenced, the rule used byF ftnchek is that a reference to any variable implies the sameF reference to all variables it is equivalenced to. For arrays,F the rule is that a reference to any array element is treated4 as a reference to all elements of the array.F a local variable is declared (for instance, in a type declaration)F but is not used in the module. Does not apply to dummy argu-F ments: warnings about them are controlled by the keyword# arg-unused described above.F Note: In versions of ftnchek prior to 2.10, the /usage flag tookF a numeric argument instead of a list of options. For the sake ofF users who may have written scripts invoking ftnchek in this way, theF numeric form is still accepted. The numeric setting is composed ofF three digits. The first digit (hundreds place) controls warningsF about subprograms (functions and subroutines), the second digit (tensF place) warnings about common blocks and common variables,, and theF third digit (ones place) warnings about local variables. Each digitF controls warnings according to the convention that a 1 means warnF about undefined items and variables that are used before set, a 2F means warn about items that are unused, and a 3 means warn about bothF types. These numbers are now converted to the appropriate values forF the above-listed keywords, except for com-block-volatile, which is& not affected by the n umeric argument.5 See also: /common, /declare, /extern, /library.3 /vcgF Produce the call graph in the form of a VCG graph description.F This description is written to a separate file, with the same stem asF the file containing the main program, and suffix This file is able toF be given directly to to visualize the call graph. (If input is fromF the standard input, then the graph description is sent to standardF output.) This switch is equivalent to /calltree=vcg. Defa ult = no.F The VCG description as created is more complex than it need be.F VCG allows graphs and nested subgraphs: each subroutine is created asF a subgraph nested inside its calling routines. This allows you to3 interactively display subgraphs or summarise them.F The option for was written by Dr. Philip Rubini (p.rubini@cran- field.ac.uk).F xvcg is a graph visualisation tool which runs under the X win-F dows system. It is freely available from ftp.cs.uni-sb.de. I t was= written by G. Sander of the University of Saarland, Germany.8 See also: /calltree, /crossref, /reference, /sort. 3 /versionF This option causes ftnchek to print a line giving the versionF number, release date, and patch level of the program. If no filesF are given, it then exits. If files are given, the effect of this op-F tion is to include the patch level (normally omitted) in the version? information printed at the start of processing. Default = no. See also: /help. 3 /volatile= Assume that COMMON blocks are volatile. Default = no.F This flag is superseded by /common=volatile, and should noF longer be used. It may be eliminated in a future release of ftnchek. See also: /common, /usage.3 /wordsize=numF Specifies the default word size to be num bytes. This is theF size of logical and single-precision numeric variables that are notF given explicit precisions. (Explicit precisions for non-c haracterF variables are an extension to the Fortran 77 Standard, and are givenF by type declarations such as REAL*8 X.) Double-precision and complexF variables will be twice this value, and double complex variables fourF times. Quad-precision constants and intrinsic function results willF be four times this value. Note that variables declared as REAL*16F will be regarded as quad precision only if the word size is 4 bytes. Default = turn-on = 4 bytes.F The word size value does n ot matter for checking standard-con-F forming programs that do not declare explicit precisions for non-F character variables or store Hollerith data in variables. This set-F ting also does not affect the default size of character variables,F which is always 1 byte. Hollerith constants also are assumed to oc- cupy 1 byte per character.F The word size is used to determine whether truncation occurs inF assignment statements, and to catch precision mismatches in subpro-F gram argument lists and common block lists. The exact warnings thatF are issued will depend on the status of other flags. Under both theF /portability=mixed-size and the /nowordsize flag, any mixing of ex-F plicit with default precision objects (character expressions not in-F cluded) is warned about. This applies to arithmetic expressions con-F taining both types of objects, and to subprogram arguments and COMMONF variables. Under control of the /truncation=demotion and promotionF options, a warning is given for assignment of an expression to aF shorter variable of the same type, or for promotion of a lower preci-F sion value to higher precision in an arithmetic expression or an as- signment statement.F Giving a word size of 0, or equivalently, using /nowordsizeF means that no default value will be assumed. This is equivalent toF specifying /portability=mixed-size. Use it to find cases of mixingF default and explicit precision, for example to flag place s where RE-3 AL*8 is treated as equivalent to DOUBLE PRECISION.8 See also: /pointersize, /portability, /truncation. 3 /wrap=colF Controls the wrapping of error messages. Long error messagesF that would run past the specified column will be broken up into sepa-F rate lines between the words of the message for better readability.F If turned off with /nowrap, each separate error message will beF printed on one line, leaving it up to the display to wrap the message) o r truncate it. Default = turn-on = 79.2 Changing_the_defaultsF ftnchek includes two mechanisms for changing the default valuesF of all options: by defining environment variables or by creating aF preferences file. When ftnchek starts up, it looks in its environ-F ment for any variables whose names are composed by prefixing theF string FTNCHEK_ onto the uppercased version of the option name. IfF such a variable is found, its value is used to specify the defaultF for the corresponding switch or setting. In the case of settingsF (for example, the /common strictness setting) the value of the envi-F ronment variable is read as the default setting value. In the caseF of switches, the default switch will be taken as true or yes unless0 the environment variable has the value 0 or NO.F Note that the environment variable name must be constructed withF the full-length option name, which must be in uppercase. For exam-F ple, to make ftnchek prin t a source listing by default, set the envi-F ronment variable FTNCHEK_LIST to 1 or YES or anything other than 0 orF NO. The names FTNCHEK_LIS (not the full option name) or ftnchek_list& (lower case) would not be recognized.F The way to set the environment variables on the VMS system is by us-F ing the DEFINE command. For example, to set the default /list switch to YES, give the command! $ DEFINE FTNCHEK_LIST 1F After processing any environment variables, ftnchek looks for aF preferences file containing options and settings. It will search inF the following order, using only the first file found: (1) .ftnchekrcF in the current directory, (2) ftnchek.ini in the current directory,F (3) .ftnchekrc in the user's home directory, (4) ftnchek.ini in theF home directory. If such a file is found, the options defined in itF are used as defaults in place of the built-in defaults and overriding& any defaults set in the environment..F Each option or setting in the preferences file must be on a sep-F arate line. They are given in the same form as on the command line,F except without the initial slash. The preferences file can containF blank lines and comments. Comments are introduced at any point in aF line by a space character (blank or tab) or the '#' character, and' are terminated by the end of the line.F Command-line options override the defaults set in the environ-F ment or in the preferences file, in the same way as th ey override the built-in defaults.2 Project_filesF This section contains detailed information on how to use@ project files most effectively, and how to avoid some pitfalls.F One can divide the checks ftnchek does into two categories, lo-F cal and global. Local checking is restricted to within a single rou-F tine, and catches things like uninitialized variables, unintendedF loss of precision in arithmetic expressions, etc. This sort ofF checking can be done on each subprogram independently. Furthermore,F local checking of a subprogram does not need to be repeated when someF other subprogram is changed. Global checking catches things likeF calling a subroutine with the wrong argument types, or disagreeing inF common block declarations. It requires looking at the whole set of) subprograms interacting with each other.F The purpose of project files is to allow the local checking andF global checking steps to be separated. Assuming that each subprogramF is in its own source file, you can run ftnchek once on each one to doF local checking while suppressing global checking. Then ftnchek canF be run once on all the project files together to do the global check-F ing. The sample makefile below shows how to automate this task. TheF ``.f.prj'' target updates a project file for a particular file anyF time the source file changes. The information needed for globalF checking is saved in the project file. The ``che ck'' target does theF combined global checking. Typically ``make check'' would repeat theF ``ftnchek /project'' step only on changed source files, then do theF global check. This is obviously a big advantage for large programs,- when many subprograms seldom if ever change.F It is best when using project files to place each subprogram inF a separate source file. If each source file may contain more thanF one subprogram, it complicates the definition of ``local'' andF ``global'' checking because there is some inter-module checking thatF is contained within a file. ftnchek tries to do the right thing inF this case, but there are some complications (described below) due toF the trade-off between avoiding re-doing cross-checks and preserving+ information about the program's structure.F Ordinarily, to do the least amount of re-checking, project filesF should be created with the /library flag in effect and trimmingF turned on. In this mode, the information saved in the project fileF consists of all subprogram declarations, all subprogram invocationsF not resolved by declarations in the same file, and one instance ofF each COMMON block declaration. This is the minimum amount of infor-0 mation needed to check agreement between files.F If the source file contains more than one routine, there areF some possible problems that can arise from creating the project fileF in library mode, because the calling hierarchy among routines definedF within the file is lost. Also, if the routines in the file make useF of COMMON blocks that are shared with routines in other files, thereF will not be enough information saved for the correct checking of setF and used status of COMMON blocks and COMMON variables according toF the /usage setting. Therefore if you plan to use project files whenF /usage checking is turned on (which is the default situation), and ifF multiple routines in one project file share COMMON blocks with rou-F tines in other files, the project files should be created with theF /library flag turned off. In this mode, ftnchek saves, besides theF information listed above, one invocation of each subprogram by anyF other subprogram in the same file, and all COMMON block declarations.F This means that the project file will be larger than necessary, andF that when it is read in, ftnchek may repeat some inter-module checksF that it already did when the project file was created. If eachF project file contains only one module, there is no loss of informa-4 tion in creating the project files in library mode.F Because of the possible loss of information entailed by creatingF a project file with the /library flag in effect, whenever thatF project file is read in later, it will be treated as a library fileF regardless of the current setting of the /library flag. On the otherF hand, a project file created with library mode turned off can be read in later in either mode.F The foregoing discussion assumes that the trimming options ofF the /project setting are turned on when the project file is created.F This is the normal situation. The no-trim options of the /projectF setting are provided in case one wants to use the project files forF purposes other than checking the program with ftnchek. For instance,F one could write a Perl script to analyze the project files for infor-F mation about how the different subprograms are called. You shouldF not use the no-trim options to deal with the issues of informationF loss discussed above, since they cause more information than neces-F sary to be stored. This makes the project files bigger and causesF ftnchek to do more work later when it reads them to check your com-F plete program. Ordinarily, you should use the /library option toF control how much information to store for later use by ftnchek in checking your program. ww