Instructions for Installing Floppy
----------------------------------

o  Floppy is a Fortran Coding Convention Checker and Fortran
   code tidier. Floppy understands standard Fortran 77 code.

o  This version of Floppy also understands lower-case source
   form, and variables with length up to 31 characters.

o  The user may specify any combination of a total of 44
   different coding conventions. These are described fully 
   in the Floppy guide, which comes as a PostScript file in
   the posting. (I also include the list of checks at the
   end of this article, those marked with an asterisk 
   correspond to those CERN considers to be a "standard" set.)

o  Users may tidy their code by renumbering all
   statement labels, renumbering all FORMAT statements, 
   indenting DO and IF clauses, right-adjusting GOTOs and
   by moving all FORMAT statements to the end of each program
   module. Any combination of these tidy options is possible.

Floppy was initially written for VMS systems. The posting
includes routines and execs that allow Floppy to be built
for VM/CMS, OpenVMS and Unix systems. The procedure for
each system is described briefly below. 

Floppy was written by Julian Bunn and Hans Grote, at CERN, the
European Centre for Particle Physics in Geneva, Switzerland.

First Steps
-----------

There is a document in PostScript form, called "floppy.ps", 
which describes in detail how Floppy works and is used on
Unix, OpenVMS and VM/CMS systems.

Please read the file called "copyright". 

(Please also note that the source code for Floppy does
 NOT necessarily conform to the coding conventions it
 itself checks ! You may draw whatever conclusions you
 wish from this fact !)

Installing on Unix Systems
--------------------------
1)  After unpacking the source files, you should type "make".
2)  If your Fortran compiler is not called "f77" then you
    should first edit the file called "makefile" accordingly. 
3)  If your f77 compiler will only accept files with extension
    .f, then modify the makefile according to the instructions
    therein.
4)  If you are building Floppy on the HP-UX operating system,
    then remove the reference to "ior.o" in the makefile, and
    add the following compiler directive after the declarations
    in "unixfloppy.for":

    $HP9000_800 INTRINSICS ON

    and add the following before the "end" statement in the same
    file:

    $HP9000_800 INTRINSICS OFF

As installation has not been checked on all of Unix platforms, 
you may also have to fiddle a bit with the makefile, and possibly 
with the syntax of the "include" directives in the .for files.

The "man" page for Floppy is called "floppy.l". 

Installing on VMS Systems
-------------------------
0)  Unpack the source by whatever method you have.
1)  Copy all the files to a dedicated directory on your VMS system. 
2)  Type @MAKE_VMS.
3)  Take the "floppy.cld" file, and edit it so that the 
    image name is correct for your .EXE. 
4)  Then type "$ set command floppy". 
5)  Run a simple test on one of your Fortran files, for example:
    $ floppy myfile.for /log /checks /tidy/indent=1
    This test should produce some convention check messages and
    then produce a new Fortran file containing IF,DO clauses re-
    indented by one space.
9)  Refer to the VMS help file in "floppy.hlp" for the 
    syntax of the command. 

To make Floppy available for all users on your VMS system, you
will need privilege to update DCLTABLES with the "set command" command.
Briefly, the procedure is like this:
    $ set comm/table=sys$common:[syslib]dcltables -
      /out=sys$common:[syslib]dcltables floppy
    $ install replace sys$library:dcltables

Installing on VM/CMS
--------------------
Note that this version of Floppy has not been tested on VM/CMS.
1)  Copy all the files to your CMS minidisk. 
3)  Make one big file out of all the .for files.
4)  Globally edit the INCLUDE directives in this file so
    that you can use a MACLIB. This might be easier on a Unix
    system with "awk", or you might like to try MAKE_CMS.COM
    on a VMS system, depending on your expertise ...
5)  Create a CMS MACLIB, and place all the .h files in it.
6)  Issue the GLOBAL MACLIB command to make the MACLIB available.
7)  Then compile the Fortran, and load it. 
    No libraries should be required. 
8)  Generate a LOAD module called FLOPPY$M using the GENMOD
    command. 

Note that, for full-screen interaction, you need
the IOS3270 Program Offering from IBM. But Floppy also
works in command line mode. Refer to the HELPCMS file
for details. The CMS helpfile for Floppy is called FLOPPY.HELPCMS
in the posting. The IOS3270 panel is called FLOPPY.PANEL.

Disclaimer
----------
Although Floppy has been in constant use for some years at
CERN, we make no guarantees of its correctness or "buglessness".
If you manage to port Floppy to another platform, I would be
very interested to hear details. Unfortunately, I cannot assist
in any way with such exercises. Please read the file called
"copyright" in the posting.

-------------------------------------------------------------------

Julian Bunn
Computing and Networks Division
CERN
Geneva
Switzerland
Email: julian@vxcern.cern.ch
16th. April 1993

List of Coding Conventions in Floppy

*  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  Use IMPLICIT NONE in each module
*  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
