floppy

Section: User Commands (1)
Updated: 3rd May 1990
Index Return to Main Contents
 

NAME

floppy - Fortran coding convention checker and code tidier  

SYNOPSIS

floppy [ -l ] [ -c rules ] [ -f ] [ -o old file ] [ -i names ] [ -j number ] [ -F ] [ -G ] [ -r start[,step] ] [ -s start[,step] ] [ -n new fortran ] [ -t flow file ] [ file ]  

DESCRIPTION

Floppy is a tool which allows a file of Fortran 77 code to be checked against a set of common coding conventions. Floppy also allows the source Fortran to be reformatted and tidied in various ways.

Note that, before passing code through Floppy, it should have been compiled, preferably with the ANSI compiler flag, to check for errors. Otherwise, the results from using Floppy are unpredictable. Note also that non-standard Fortran statements (such as "include" directives or lower-case) are treated as comments by Floppy, and thus ignored.

 

OPTIONS

-l
The logging option causes Floppy to produce a verbose description of the selected options.
-c rules
The checks option indicates which rules Floppy should check. The checks may be specified as a series of comma-separated numbers (see below), or as one of the following:
standard
The standard set of rules will be checked (those marked * in the list below).
a
ALL rules in the available list will be checked.
n
NO rules will be checked. (Useful when just tidying code.)

Note that, if selecting individual rule numbers, 99 is taken to mean ALL rules, and -99 to mean NO rules. Specifying a negative rule number excludes that rule. So to check all rules except 1,5,7 and 31, you can use

-c99,-1,-5,-7,-31

-f
The full qualifier specifies that all source code lines should be listed, rather than just those in breach of any specified rules.

-o old
Use a previously-generated file of rule numbers, ignore names etc. The old tag should be set to the file name, which is generated by appending .old to the previous source Fortran file name.

-i names
Specify a list of Fortran module and variable names to be ignored when the rules are checked. Specify module names by prepending the name with a # sign. The list of names should be separated by commas. Note also that the names should be uppercase, to conform with the F77 standard. For example,
-i#GOOBAR,FOOBAR will cause subroutine GOOBAR to be ignored, and any references to the variable FOOBAR.

The following options apply to code tidying:

-j [number]
The indent option causes all DO loops and IF...THEN...ENDIF clauses to be indented by the specified number of spaces to the right. The default value is 3 spaces, the maximum allowed is 5.

-F
Specifies that all FORMAT statements be grouped together at the end of each module.

-G
Specifies that all GOTO n clauses are right adjusted to column 72.

-s start,[step]
Specify that all labelled statements be re-numbered, starting at start and stepping by step. The default value for step is 10.

-r start,[step]
Specify that all FORMAT statements be re-numbered, starting at start and stepping by step. The default value for step is 10.

-n new
Causes the new Fortran file to be called new fortran. If this option is not given, then the new Fortran file will have the name of the source Fortran, appended by .out

-t Flow
The Flow option specifies that a binary file be written out that may afterwards be processed by the Flow program.

 

CODING CONVENTION LIST

The full list of rules is as follows:
* 1 Avoid comment lines after end of module
* 2 End all program modules with the END statement
* 3 Declared COMMON blocks must be used in the module
* 4 COMPLEX and DOUBLEPRECISION vars at end of COMMON
* 5 COMMON block definitions should not change
* 6 Variable names should be 6 or fewer characters long

   7   Variables in COMMON should be 6 characters long

   8   Variables not in COMMON should be <6 characters
* 9 Integer variables should begin with I to N
* 10 Variable names should not equal FORTRAN keywords
* 11 Avoid comment lines before module declaration
* 12 Module names should not equal intrinsic functions
* 13 First statement in a module should be declaration
* 14 Module should begin with at least 3 comment lines

   15  Comment lines should begin with a C
* 16 No comment lines between continuations
* 17 Avoid non-standard variable types eg INTEGER*2
* 18 Avoid multiple COMMON definitions per line
* 19 Do not dimension COMMON variables outside COMMON
* 20 Avoid embedded blanks in variable names
* 21 Avoid embedded blanks in syntactic entities
* 22 Avoid the use of PRINT statements (use WRITE)

   23  Do not give the END statement a label
* 24 Avoid WRITE(* construction

   25  Avoid WRITE statement in a FUNCTION
* 26 Avoid the use of PAUSE statements
* 27 Statement labels should not begin in column 1
* 28 Always preceede STOP by a descriptive WRITE
* 29 Avoid the use of ENTRY in FUNCTIONS
* 30 Avoid using I/O in FUNCTIONs

   31  Avoid the use of the alternate RETURN statement
* 32 COMMON block names should not equal variable names
* 33 Avoid use of obsolete CERN library routines

   34  Avoid FUNCTION names the same as intrinsics
* 35 Local functions should be declared EXTERNAL
* 36 Module names should all be different
* 37 Avoid expressions of mixed mode eg A=B/I
* 38 Length of passed CHARACTER variables should be *
* 39 Order of statements should conform !
* 40 Separate Statement Functions by comment lines
* 41 No names in Statement Function definitions elsewhere

   42  Use LLT,LGT etc to compare CHARACTER vars. in IFs

   43  Variables (not COMMON, not PARAMs) <6 characters
* 44 Passed arguments should be dimensioned * in module

 

SEE ALSO

flow(l), f77(1)


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
CODING CONVENTION LIST
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 19:22:48 GMT, July 24, 2024