Navigation: Previous   Up   Next

2.24 Enhanced Source File Polishing

The enhanced polisher takes a set of Fortran source files, which may be in fixed or free form, and produces a free form “polished” version of each file. C files and fpp-processed files are not handled. Unlike the simple polisher, the Fortran source files must be compilable without error; this is because the information needed for enhanced polishing requires successful semantic analysis of the files.

The enhanced polisher understands the following compiler options with the same meaning: -132, -abi, -dcfuns, -double, -dryrun, -dusty, -encoding, -english, -f2003, -f2008, -f95, -fixed, -free, -help, -I, -i8, -indirect, -info, -kind, -max_parameter_size, -maxcontin, -mismatch, -mismatch_all, -nihongo, -nocheck_modtime, -nomod, -noqueue, -o, -openmp, -Qpath, -r8, -strict95, -tempdir, -thread_safe, -u, -u=sharing, -v, -V, -w and -xlicinfo.

The enhanced polisher includes all the simple polish options, which are not repeated here.

Note that unlike nagfor =polish, -name_scopes=Asis acts as if it were -name_scopes=Keywords, which is the default. Similarly, -array_constructor_brackets=Asis acts as if it were -array_constructor_brackets=ParenSlash, and is the default, and -dcolon_in_decls=Asis acts as if it were -dcolon_in_decls=Insert, and is the default.

The default filename extension for the output file is ‘.f90_epo’, used when no -o option is specified.

The following additional options control the operation of this tool.

-add_arg_keywords
Add keywords to actual arguments in references to user-defined procedures with an explicit interface and at least two dummy arguments, and in references to intrinsic procedures and intrinsic module procedures with at least three dummy arguments (except for MAX and MIN, where it is at least three actual arguments).

Keywords are not added to arguments that precede a label argument. The order of the arguments is unchanged.

This option is equivalent to -add_arg_keywords=all2,intrinsic3.

-add_arg_keywords=proc_class_list
Add keywords to actual arguments in procedure references, when the procedure has an explicit interface, for the classes of procedure listed in proc_class_list, which is a comma-separated list that may contain the following suboptions:

all (all classes of procedure),
bound (object-bound and type-bound procedures),
dummy (dummy procedures),
external (external procedures),
internal (internal procedures),
intrinsic (intrinsic procedures and intrinsic module procedures),
module (non-intrinsic module procedures),
user (procedures other than intrinsic procedures and intrinsic module procedures).

Keywords are not added to arguments that precede a label argument. The order of the arguments is unchanged. Procedure pointer components are also known as “object-bound procedures”, and thus included in -add_arg_keywords=bound; named procedure pointers are treated as external procedures and thus included in -add_arg_keywords=external.

A suboption name may be followed by a single nonzero digit (e.g. “intrinsic3”); this specifies that for procedures covered by that suboption, keywords are only to be added if the procedure has at least that many dummy arguments. For type-bound and object-bound procedures, the passed-object dummy argument does not count towards the limit (as it never appears in the argument list). The intrinsic MAX and MIN functions use the number of actual arguments instead.

A suboption name followed by a digit may be further followed by the letter ‘a’ (e.g. “intrinsic3a”; this specifies that the argument limit applies to the number of actual arguments in a reference to the procedure, not the number of dummy arguments (the number of actual arguments will be less than the number of dummy arguments when an optional argument is omitted).

Note that suboptions are parsed from left to right, and later suboptions override earlier ones.

-intrinsic_case=analogy
Specifies whether the case of an intrinsic procedure name should be the same as other names (as_names), or the same as language keywords (as_keywords). The default is -intrinsic_case=as_names.
-remove_intrinsic_stmts
Specifies that intrinsic procedure names that were not passed as actual arguments should be removed from INTRINSIC statements, and that if all the names in an INTRINSIC statement are removed in this way, the INTRINSIC statement itself should be removed. Any comments associated with the INTRINSIC statement will remain.