From J.Reid@letterbox.rl.ac.uk  Wed Mar 26 19:14:15 1997
Received: from letterbox.rl.ac.uk (letterbox.rl.ac.uk [130.246.8.100]) by dkuug.dk (8.6.12/8.6.12) with SMTP id TAA21533 for <SC22WG5@dkuug.dk>; Wed, 26 Mar 1997 19:14:09 +0100
Received: from jkr.cc.rl.ac.uk by letterbox.rl.ac.uk with SMTP (PP) 
          id <sg.10403-0@letterbox.rl.ac.uk>; Wed, 26 Mar 1997 18:14:02 +0000
Received: by jkr.cc.rl.ac.uk (4.1/SMI-4.1) id AA01300;
          Wed, 26 Mar 97 18:14:00 GMT
Date: Wed, 26 Mar 97 18:14:00 GMT
From: jkr@letterbox.rl.ac.uk (John Reid)
Message-Id: <9703261814.AA01300@jkr.cc.rl.ac.uk>
To: SC22WG5@dkuug.dk
Subject: Fortran Conditional Compilation


I would like to tell you all that David Epstein, Dick Hendrickson and I
have formed a volunteer editorial subgroup to polish the coco document.
We appreciate that this may be wasted effort, but of course hope that
WG5 will not decide to terminate the project.  Note that the WG5 ballot
date has been changed to 20 April at the request of DIN. I hope that
our doing this work will encourage countries to vote YES.

I am doing the typesetting and am putting the latest draft on my 
server. Please have a look: 
jkr.cc.rl.ac.uk (130.246.8.20) in the file pub/wg5/coco.ps
We are still making changes, but the paper already looks much better.
I am also putting a (less readable) text version in the same 
directory in the file coco.text.

We are responding to the pre-LV ballot comments. The main changes
that flow from them are:

1. The description is now independent of part 1. This has only 
lengthened the document slightly and is much more satisfactory
since in most cases coco requires only a simpified version of the
equivalent Fortran feature.

2. The model is now of an independent process that yields a source
program for a Fortran processor. Of course, it is expected that
implementations will usually integrate the two processes and only
optionally provide the coco output code (Fortran source code).

3.  SET is now standardized as a separate SET file that is coco program
that consists entirely of coco type declaration directives and coco
comment lines.

Beyond this, we have made many editorial changes. I attach what we 
now say in the Rationale. It sums up my reasons for working on this.

Best wishes,

John.


...........................

Programmers often need to maintain several versions of code to allow
for different hardware and different applications. Keeping several
copies of the source code is error prone. It is far better to maintain
a master code from which any of the versions may be selected.

This facility has deliberately been kept very simple. The additional
lines inserted to control the process and all the lines that are not
selected are omitted from the output or are replaced by comments. Those
that are selected are copied to the output completely unchanged.

Examples of the need for such a facility are:
  (1) Parametrized types do not solve all the problems associated with
      different precisions. For example, if the Basic Linear Algebra
      Subroutines (BLAS) are in use, the names are different for the
      single and double precision versions.
  (2) A version of a code for complex arithmetic may differ little from the
      version for real arithmetic.
  (3) The  relative  efficiency of  different constructions may vary
      from processor  to processor. While array syntax may be needed on
      a massively  parallel machines, do loops may be more  efficient
      on a scalar processor. Some may benefit from special comments.
  (4) Versions may be required for different message-passing libraries.
  (5) Additional print statements may be inserted into a program when
      under development.  It may be very helpful have these readily
      available in case some unexpected results are found in production
      use.
  (6) Versions may be required for character constants being in
      different languages (internationalization).
  (7) If INCLUDE is in use, the file naming convention varies between systems.
Some of these cases may be addressed within the Fortran code itself by
run-time tests, but this will result in a large object code and some
run-time overhead. Most of them, however, can only be solved without
conditional compilation by keeping separate versions.
