From ljm@slac.stanford.edu Thu Mar 23 05:33:36 1995
Received: from SCSW6.SLAC.Stanford.EDU by dkuug.dk with SMTP id AA21382
  (5.65c8/IDA-1.4.4j for <SC22WG5@dkuug.dk>); Thu, 23 Mar 1995 22:31:08 +0100
Received: from [134.79.128.74] (MOZART.SLAC.Stanford.EDU)
 by SCSW6.SLAC.STANFORD.EDU (PMDF V4.3-10 #6987)
 id <01HOH6Q296DC0033HG@SCSW6.SLAC.STANFORD.EDU>; Thu,
 23 Mar 1995 13:32:00 -0800 (PST)
Date: Thu, 23 Mar 1995 13:33:36 -0800
From: ljm@slac.stanford.edu (Leonard J. Moss)
Subject: REPOST: Conditional Compilation in F90
X-Sender: ljm@popserv
To: SC22WG5@dkuug.dk (SC22/WG5 Mailing List)
Message-Id: <v01510102ab9798d09596@[134.79.128.74]>
X-Envelope-To: SC22WG5@dkuug.dk
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7BIT
X-Charset: ASCII
X-Char-Esc: 29

Here is the complete text, as posted by Mallory to the X3J3 list, of the
request from James Billen for a conditional compilation facility.

                                        -- Len Moss


>Date: Wed, 22 Mar 1995 13:52:02 -0820
>From: NORTHCM%MHS@mhs.rose-hulman.edu
>Subject: (x3j3.1995-131) Conditional Compilation in F90
>To: x3j3@ncsa.uiuc.edu
>
>                                                            X3J3/95-108
>
>To: C. Mallory North, Jr., X3J3 Librarian
>From: James H. Billen, Los Alamos National Laboratory
>Date: March 17, 1995
>
>This message is my formal request to the Standards Committee
>for inclusion of conditional compilation in the F90 standard.  Please
>assign this request a paper number for the next meeting of the
>committee.  Thank you for your assistance.
>
>Several of my colleagues and I develop FORTRAN codes used for
>accelerator design, including rf cavity modeling, static electric and
>magnetic field solvers, beam-dynamics simulations of space-charge
>dominated beams, generation of the machine-tool instructions
>for fabrication of accelerator hardware, and measurement of the
>accelerator fields and other rf-cavity properties.  Our programs,
>which involve a few million lines of code, are used extensively by
>the worldwide accelerator community.  For example, Lloyd Young
>and support the POISSON/SUPERFISH codes, which have become
>popular with over 300 users.
>
>Most of our codes are targeted for the PC platform and for this we
>have been using products from Lahey Computer Systems, Inc.  Our
>codes already include FORTRAN 90 features, such as allocatable
>arrays, that are available as extensions of the FORTRAN 77 standard
>in Lahey's F77L3-EM/32.
>
>We were very disappointed to learn that conditional compilation, an
>extension of the standard available in EM/32, was not added to Lahey's
>new LF90 compiler.  Tom Lahey explained that they were waiting to see
>if conditional compilation became part of the standard so they would not
>have to redo its implementation at a later date.
>
>Conditional compilation is a common extension in implementations
>of high-level languages including FORTRAN.  According to Kernigan
>and Richie (The C Programming Language, Second Edition, Prentice
>Hall, 1988), conditional compilation was (in 1988) part of the proposed
>C-language standard, ANSI X3.159.1989.  A colleague who programs
>in C told me he believes this standard was adopted.
>
>Many people use conditional compilation to produce executable
>versions targeted for different machines.  Our codes make much more
>extensive use of the conditional compilation directives.  For example,
>various SUPERFISH codes include an electromagnetic-field solver that
>can be compiled with either real fields and material properties or with
>complex fields and material properties.  Only a few lines of code need
>to be changed to switch from real to complex and it is very convenient
>to maintain only one source file, using compiler directives to include
>the
>appropriate lines.  There are numerous other examples.  We believe that
>Lahey's implementation of conditional compilation in their EM/32 product
>was instrumental in helping us to develop the POISSON/SUPERFISH
>codes into a robust, self-consistent package.
>
>One can, of course, use a stand-alone or third-party preprocessor to
>handle the compiler directives, but this eliminates some significant
>advantages. The "built-in" feature makes using the debugger more
>straightforward.  When a preprocessor creates a new file, then one
>is debugging and editing a file other than the original source.  Changes
>must be made twice (increasing the possibility of error), or, if one
>edits
>the original file between debugging sessions, one does not have access
>to correct line numbers from the compiled source and the turn-around
>time between tests is longer.
>
>I hope that Standards Committee will be able to consider this request
>for conditional compiler directives as part of this year's agenda.  It
>would seem to be a fairly benign addition to the language standard for
>those programmers who do not use it.  But, it will seriously influence
>how long it takes some programmers to migrate to a new compiler.
>It may decide whether or not some of us make the switch at all.
>
>Thank you for considering this request.
>
>
>__________________________________________________________
>James H. Billen  (jbillen@lanl.gov)
>Los Alamos National Laboratory
>Accelerator Operations and Technology Division
>Group AOT-1, Mailstop H817
>Los Alamos, NM 87545
>Phone:  505-667-6627
>Fax:    505-665-6590
>

--
Leonard J. Moss <ljm@slac.stanford.edu>  | My views don't necessarily
Stanford Linear Accelerator Center       | reflect those of SLAC,
MS 97; P.O. Box 4349; Stanford, CA 94309 | Stanford or the DOE


