From: khb@chiba.Eng.Sun.COM (chiba)
Newsgroups: comp.lang.fortran
Subject: FAQ
Date: 6 Oct 92 00:58:18 GMT
Expires: +1 month
Organization: Sun MegaSystems
NNTP-Posting-Host: chiba


Many of you suggested corrections. Hopefully we will reach a "steady
state" and posting will then be far less frequent.

Here are some answers to frequently asked questions. The "author", as
is the custom, has appropriated posted responses as seemed apt. I have
tried to leave attributions in, as correctly as possible. To anyone
who has been offended by omission or otherwise, my apologies. I shall
give priority to corrections regarding attribution.

No one takes responsibility for any of this text, neither the employer
of the "author", the "author", friends of the "author", pets of the
"author" nor anyone else.

Your milage WILL vary. 

If you have comments/suggestions/edit proposals please send them to me
(keith.bierman@eng.sun.com). I do not promise to accept 'em. I
encourage others to make better faq lists, so I can retire this one.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	Questions:

Q0) How should one spell FORTRAN/Fortran?
Q1) Where can I get a copy of the Fortran 90 Standard?
Q2) What Fortran 90 translators are available?
Q3) I have heard of fortran "lints" what are they, and where can
    I get one?
Q4) "Why do people use FORTRAN?, C is so much better"
Q5)  Why can't I get an electronic version of the standard?
Q6)  Where can I get "foo" (some random package)
Q7)  Where can I get a free compiler?
Q8)  What is the best compiler for a PC?
Q9)  How does Fortran 90 relate to FORTRAN '77
Q10) My compiler is mis-behaving; who enforces the standard?
Q11) What are good books on Fortran? 
Q12) Are there pretty printers for FORTRAN?
Q13) Why are there aimless debates?
Q14) How do I call f77 from C (and visa versa)
Q15) What constitutes good FORTRAN style?
Q16) For whatever reasons, I want to translate my Fortran into C.
     What tools are available?
Q17) For whatever reasons, I want to translate my existing C code
     into Fortran. What tools are available?
Q18) What is preprocessing, how can it help? How can it hurt?
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Q0)  How should one spell FORTRAN/Fortran?

    FORTRAN is generally the preferred spelling for discussions of versions of
    the language prior to the current one ("90"). Fortran is the
    spelling chosen by X3J3 and WG5. In this document a feeble effort
    has been made to capitalize accordingly (e.g. vast existing
    software ... FORTRAN vs. generic Fortran to mean all versions of
    the standard).

From: walt@netcom.com (Walt Brainerd)
	There was an effort to "standardize" on spelling of programming
	languages just after F77 became a standard.  The rule: if you say
	the letters, it is all caps (APL); if you pronounce it as a word,
	it is not (Cobol, Fortran, Ada).  See, for example the difinitive
	article describing Fortran 77 in the Oct 1978 issue of the Comm.
	of the ACM.  The timing was such that FORTRAN got put on the
	standard itself, though many always after that have referred to
	it as Fortran 77.  Of course, there are those who think it is not
	truly Fortran if not written with all caps.


Q1)  Where can I get a copy of the Fortran 90 Standard?

From: julian@cernvax.cern.ch (julian bunn)

         The new Fortran 90 standard has now been formally published
	 and is available from the ISO central secretariat or from the
	 national member bodies. The price is about $120. Some
	 ordering detail follow.  I can supply addresses in other
	 countries not mentioned on request (to METCALF@CERNVM).
 
    The document reference is ISO/IEC 1539 : 1991. There is no ISBN.
 
    ISO
    1, rue de Varembe
    Case postale 56
    1211 Geneva 20
    Switzerland
    Fax: +41 22 734 10 79
 
    ANSI
    1430 Broadway
    New York, NY 10018
 
    BSI
    2 Park Street
    London W1A 2BS
 
    DIN
    Burggrafenstrasse 6
    Postfach 1107
    D-1000 Berlin 30
 
    AFNOR
    Tour Europe
    Cedex 7
    92049 Paris La Defence
 
SCC
1200-45 O'Connor
Ottawa
Ontario  K1P 6N7
 
                            Mike Metcalf
                            (metcalf@cernvm)

and from walt@netcom.com

For those of you who don't read comp.lang.fortran, you might be
interested to know that I (walt brainard) just called Global
Engineering to see if the sell ISO 1539:1991.  They do; the price is
$225.

And 

You can obtain copies through:
	Global Engineering Documents
	2805 McGaw Ave.
	Irvine, CA. 92714
	(714) 261-1455
	(800) 854-7179


New ANSI number 
			ANSI X3.198-1992

Q2) What Fortran 90 translators are available?

From: schumanm@Informatik.TU-Muenchen.DE (Matthias Schumann)
From: macphed@dvinci.USask.Ca (Ian MacPhedran)

This is the promised summary of my request for information about
Fortran 90 (f90) compilers. I am sorry for the delay in getting this
posted, but I was away for a week, and still haven't caught up.

I received a large amount of information, including a previous summary.
Rather than parroting the entire list, I have prepared the following
breakdown of the points which interested me.

------------------------------------------------------------------------------
Product:  NAGware Fortran 90 Compiler
Descript: Compiles f90 code to C source, or directly to executable
          file under MS-DOS. Therefore requires native C compiler
          as back end on most platforms.
Platform: Apollo DN10000, DECstations, HP 9000, IBM RS/6000, NeXT,
          Intel 386/486 (MSDOS), Sun 3, Sun 4 (SunOS 4.1)
          VAX/VMS forthcoming.
Pricing:  Varies with platform. Academic Pricing available. Site
          License available
 +------------------------------------------------------------+
 |                    NAGWare F90 Compiler                    |
 +------------------------------------------------------------+
 |          License Fee Options for Initial Computer          |
 +------------------------------------------------------------+
 |        |         Standard        |         Academic        |
 +--------+-------------------------+-------------------------+
 |        |  Perpetual|  Maintenance|  Perpetual|  Maintenance|
 |        |     Fee   |      Fee    |     Fee   |      Fee    |
 +--------+-----------+-------------+-----------+-------------+
 | CLASS 1|      $895 |      $160   |      $537 |       $97   | (MSDOS)
 +--------+-----------+-------------+-------------------------+
 | CLASS 2|    $1,495 |      $270   |      $897 |      $162   | (Low end work-
 +--------+-----------+-------------+-----------+-------------+ stations)
 | CLASS 3|    $1,995 |      $360   |    $1,197 |      $215   |
 +--------+-----------+-------------+-----------+-------------+
 | CLASS 4|    $2,495 |      $450   |    $1,497 |      $270   | (Server class
 +--------+-----------+-------------+-----------+-------------+ computers)
 | CLASS 5|    $3,295 |      $594   |    $1,977 |      $356   |
 +--------+-----------+-------------+-----------+-------------+
 | CLASS 6|    $4,295 |      $774   |    $2,577 |      $464   |
 +--------+-----------+-------------+-----------+-------------+
 | CLASS 7|    $5,295 |      $945   |    $3,177 |      $572   |
 +--------+-----------+-------------+-----------+-------------+
          (US Dollars)
Contact:  Sheila Caswell, Account Manager,
          Numerical Algorithms Group, Inc.

          1400 Opus Place, Suite 200
          Downers Grove, IL, USA
          60515-5702
Phone:    (708) 971-2337
Source:   E-mail messages, postings, and paper mailing
------------------------------------------------------------------------------
Product:  VAST-90
Descript: Converts f77 code to f90, and reverse. Will "de-spaghettify"
          f77 code to a more structured form. Requires native f77 compiler
          to compile f90 programs.
Platform: SPARC (Sun 4), IBM RS/6000
Pricing:  Single Machine: starts at $1900, Sun, IBM HP and DEC
	  workstations. Higher prices for larger machines.
	  Included: VAST-90, f90 driver, f90 library and documentation.
	
          Volume discounts and site license available.

Contact:
Pacific-Sierra Research Corp.               Switchboard:   (310) 314-2300
2901 28th Street                            Fax:           (310) 314-2323
Santa Monica  CA  90405                     VAST-90 e-mail: dave@psrv.com

------------------------------------------------------------------------------
Product:  PF90 Version 2.0
Descript: Converts f90 programs to f77, then compiles with native
          f77 compiler. Therefore native f77 compiler is required.
Platform: Sun 4, IBM RS/6000, Silicon Graphics, DECstations, Convex,
          Alliant, IBM 3090 (AIX), Cray
Pricing:  Sun, RS/6000, SGI, DECstation: $2000
          Convex, Alliant: $5000; IBM 3090, Cray: $10000
          (US Dollars, single machine, multiuser license, must purchase
          f77 compiler separately.)
Contact:  ParaSoft Corporation
          2500 E. Foothill Blvd
          Pasadena, CA 91107
Phone:    (818) 792-9941
E-mail:   f90-info@parasoft.com
Source:   E-mail messages, and PostScript advertisement
------------------------------------------------------------------------------
Product:   PV version 1.1 of Fortran 90 compiler
Descript:  Port of NAG's f90 compiler to MS-DOS, together with Salford
           Software Ltd.
Platform:  Intel 386/486 Computers
Pricing:   $1950.00 (single user, US currency)
Contact:   OTG Systems Inc
Phone:     (717) 222-9100
Source:    E-mail message/summary of previous queries
------------------------------------------------------------------------------
The following is from a previous summary from David Bernholdt:

Convex is reported to have an incomplete f90 compiler in beta.
Other compilers in preparation will be available:
EPC (Edinburgh Portable Compilers) and Lahey            late 1992
Cray Research                                           early 1993
DEC for VMS                                             late 1993
------------------------------------------------------------------------------

I wish to thank the following people for their help, and apologize to any
which I have missed.

psrv!bob@uu.psi.com
naginc!caswell@sunbird.Central.Sun.COM
malcolm@nag.co.uk
roman@parasoft.com
khb@chiba.Eng.Sun.COM
METCALF@crnvma.cern.ch
----------------------------------------------------------------------------
Ian MacPhedran, Engineering Computer Centre, University of Saskatchewan.
2B13 Engineering Building, U. of S. Campus, Saskatoon, Sask., CANADA S7N 0W0
macphed@dvinci.USask.CA  macphedran@sask.USask.CA


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


Q3) I have heard of fortran "lints" what are they, and where can
   I get one?

   Fortran compilers are not required (and most do not) to protect
   users from themselves, that is to say

	 call sub(1)
	 ...
	 subroutine sub(i)
	 i=i+10
	 return
	 end

   Is non-standard complying but the compiler need not tell you about
   it. Arguably worse, the compiler can produce any result it deems
   fit, up to and including the start of world war III (assuming the
   right optional hardware has been installed).

   Fortran lint programs focus on searching out search programming
   errors and alerting the user.

   There are a wide variety of commercial and pd products. A partial
   list follows:

   IPT FORTRAN lint 1096 East Meadow Circle, Palo Alto, CA 94303, 415/494-7500.
 
   Forwarn from quibus 719 527 1384.

   QA-FORTRAN from PRL UK 01 942 9242 and perhaps  (817) 589 0949

   FORCHECK from Leiden University ND 31 71 276804

   FTNCHEK from netlib. One may receive FTNCHEK by mailing to
   netlib@ornl.gov the following message:

	send ftnchek from fortran

    And Ajay Shah, (213)749-8133, ajayshah@usc.edu
    You may want to mention f2c followed by an ANSI C compiler as a great
    free fortran lint. I could not have survived writing fortran if it
    were not for f2c.  You need to know some C to deal with the error
    messages, but that's not a bad price to pay.

From: "John D. McCalpin" <mccalpin@perelandra.cms.udel.edu>
Not too many people use it, but you might want to add TOOLPACK to
the list of FORTRAN "lint" packages.  Here is the blurb that I
send to people who are interested:

======================================================================
TOOLPACK is a large set of utilities written in FORTRAN to do FORTRAN
code analysis and transformation.

TOOLPACK begins by actually parsing the program with a fully FORTRAN-
compliant parser and then does all the code transformations on the
parse and comment trees.

This means that you cannot confuse TOOLPACK by silly FORTRAN-isms that
can easily overwhelm more naive utilities (such as ftnchek).  For
example, TOOLPACK correctly handles statements such as:

      D O U B L E  P R E C I S I O N   A(100,100)
      doubleprecision fred

      DO I = 1.2
      READ(I,J) = 10.


The usual interface to TOOLPACK is a set of 'csh' scripts that run the
various TOOLPACK utilities to do specific tasks.

The ones you will find most useful are: pol, polx, apt, dapt, decs, 
getlst, and discard.   These are the prettyprinter, precision converter,
declaration standardizer, and some necessary utilities.  See below for
more details.

By aware that TOOLPACK is *very* rigorous about the FORTRAN-77
standard.  You may or may not consider this an advantage.

The scripts are described by the 'scripts' script, which delivers the
following:
----------------------------------------------------------------------------
In the Toolpack script summaries below, the section numbers refer to
the Unix environment Users' Guide where more detailed information can
be found.  To obtain on-line information about a script's usage, type
its name without any arguments.

FORTRAN Analysis Facilities

  getlst  Produce a listing showing statement and token numbers. Report
          lexical scanning warnings and errors. (3.1.1)

  syn     Report errors and warnings detected by lexical scanning, parsing,
          and examining a set of symbol attributes. (3.1.2)

  sem     Report errors and warnings detected by lexical scanning, parsing,
          and examining an extended set of symbol attributes. (3.1.3)

  pfort   Report errors and warnings detected by lexical scanning, parsing,
          examining an extended set of symbol attributes, checking for unsafe
          references, and checking conformance to a portable subset of
          FORTRAN. (3.1.4)

  statdoc In a user-supplied report template, place information derived from
          static analysis to assist in documenting the program.  Examples of
          information the user may request are COMMON block usage, symbol
          attributes, and a graph of subprogram calls. (3.1.5)

  inst    Instrument a FORTRAN program so that the instrumented program, when
          executed, produces information about program execution. (3.2.1)

  rundoc  Execute a program instrumented by inst and, in a user-supplied
          report template, place information derived from dynamic analysis
          to assist in documenting the program.  For example, the user may
          determine the frequency of execution of program segments. (3.2.2)

FORTRAN Transformation Facilities

  pol     Format a FORTRAN program under control of user-supplied options
          in a Polish option file. (4.1.1)

  polx    Construct a Polish option file via a menu-driven editor. (4.1.2)

  decs    Rebuild the declarative part of a FORTRAN program. (4.2.1)

  apt     Transform a single-precision version of a FORTRAN program to
          double precision or vice versa. (4.3.1)

  dapt    Convert precision and rebuild the declarations, combining the
          functions of apt and decs. (4.3.2)

  cname   Change the names in a FORTRAN program that satisfy conditions
          derived from information in either the lexical token stream or
          the symbol table or both. (4.4.1)

  lname   Transform a FORTRAN program containing long names to a program
          with standard names. (4.4.2)

  stf     Rebuild the flow of control in a FORTRAN program to standardized
          form. (4.5.1)

  ucs     Transform nests of DO loops matching certain paradigms so that
          the transformed code executes more efficiently on vector machines.
          (4.6.1)

Miscellaneous Facilities

  fdiff   Compare two FORTRAN programs at the lexical token level. (5.1.1)

  dac     Compare two data files, neglecting certain formatting differences
          and numerical differences smaller than a given tolerance. (5.1.2)

  vcon    Create, edit, and retrieve versions of a file contained in a
          version file. (5.2.1)

  discard Remove unneeded files created by the above scripts. (5.3.1)

  scripts Print this summary of the scripts. (5.4.1)

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

TOOLPACK can be obtained by anonymous ftp from perelandra.cms.udel.edu
in the directory pub/Lang/Toolpack/.
The UNIX version is in the file toolpack.tar.Z
Serious hackers will want the versions in the Distrib directory.

The package is known to compile on Silicon Graphics and Sun machines,
though the Makefile is reasonably braindamaged.

You will need about 16 MB for the stripped executables on an SGI machine.
Figure on double that for compiling the package.....

Have fun!
--
John D. McCalpin			mccalpin@perelandra.cms.udel.edu
Assistant Professor			mccalpin@brahms.udel.edu
College of Marine Studies, U. Del.	John.McCalpin@mvs.udel.edu



Q4) "Why do people use FORTRAN?, C is so much better"

   One should avoid such pointless arguments .... if you feel this
   way, don't subscribe to comp.lang.fortran.

   This sort of question always triggers off a protracted discussion,
   the highlights of which are typically:

       a) FORTRAN and C have different semantics. A FORTRAN optimizer
	  knows more about aliasing, function interactions, and I/O. A
	  C optimizer has to infer or compute such information. C
	  bigots typically have neither written such optimizers nor
	  worked with folks who do it for a living, and are prone to
	  dismiss such arguments as being petty and neolithic.

	  FORTRAN programmers are often a bit more in touch with high
	  performance computing, and are unwilling to bet that heavily
	  on compiler wizardry. 
	  
	  In addition, ANSI/ISO C has very tight requirements on
	  expression evaluation (an overreaction to the K&R ignore
	  parenthesis days) which cripples an optimizer even further.
	  The restrictions are spelled out in Section 5.1.2.3 of
	  ISO/IEC 9899-1990. Both the '77 and '90 Fortran standards
	  allow the optimizer more latitude.

	  Of course, compiler options, vendor extensions and the like
	  sometimes narrow the difference. Also, some Fortran
	  compilers do not take advantage of all of these features of
	  the language, thus narrowing the gap in the other direction.

	  On any given code, on any given system, all bets are off.

      b)  There is a vast body of existing FORTRAN code. Numerical
	  codes are particularly difficult to "vet", scientific
	  establishments usually do not have large otherwise idle
	  programming staffs, etc.  so massive recoding into any new
	  language is typically resisted quite strongly.

      c)  Fortran tends to meet some of the needs of scientists
	  better; most obviously with built in support for complex
	  numbers. 

      d)  Retraining staff is quite expensive.

     
Q5)  Why can't I get an electronic version of the standard?

    Someday, perhaps you can. However, at the moment the various
    standards bodies finance some fraction of their work via sales of
    standards documents. ISO and ANSI have both claimed copyright to
    the finished standard, so those who would make and distribute
    copies should be forewarned.

    It should be noted that various people are working to correct
    this; but it is unlikely to ever become free.

Q6) Where can I get "foo" (some random package)

    Use archie. archie is an online database of what is available and
    where on the "net". Archie can be used either via telnet or by
    mail. 
    
    For information about archie send 

    mail archie@cs.mcgill.ca 
    subject: help

    And you will get back copious directions on how to use archie.

 

Q7)  Where can I get a free compiler?

    One such is f2c.

From: mwm@a.gp.cs.cmu.edu (Mark Maimone)
Newsgroups: comp.lang.fortran,comp.lang.c
Subject: Re: Fortran to C translator
Keywords: fortran, C, translator, f2c
Date: 13 Sep 90 01:43:30 GMT
Organization: Carnegie-Mellon University, CS/RI


	Since there have been several requests for a Fortran to C translator
in the past week, I'm reposting the announcement about f2c.  The short
answer is you can get f2c by anonymous-ftp from research.att.com in
directory dist/f2c.

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

	Source for f2c, a Fortran 77 to C translator jointly developed by
folks from Bell Labs, Bellcore, and Carnegie Mellon, is now freely
available.

	F2c was derived from the original UNIX operating system's f77(1),
and the generated C follows f77's calling conventions; on some machines, the
resulting object files are interchangeable with (and behave
indistinguishably from) objects compiled by f77.  The main "advantage" of
f2c is that it converts ANSI standard Fortran 77 into C without manual
intervention, at least when invoked by a suitable script or makefile (that
may need to exercise an f2c option to ensure that COMMON blocks are defined
just once).  The main "problems" are that f2c does no code restructuring
(e.g., gotos are preserved) and that Fortran I/O gets converted into a bunch
of calls; thus the translated C code doesn't look too pretty, and in general
one would need to maintain the Fortran rather than its translation into C.
[F2c is not meant to displace the services of commercial vendors whose
business is to convert Fortran into maintainable C.]

	There is a plethora of options, many of which exist to support
different compilation environments for the translated C (e.g., ANSI C or C++
compatibility, different type sizes, separate files for COMMON blocks to
appease "smart" linkers).  So far f2c (and f2c-generated source) has
compiled successfully on many machines:  Sun, Vax, IBMRT, Apollo, SGI, MIPS,
and Cray to name a few.

	F2c has been under test by the net community for over a year
and has been verified on the NBS tests, several large math libraries,
floating point tests, even code for laying cable on the ocean floor!

	To find out about f2c, send the following E-mail message to netlib
(netlib@research.att.com or research!netlib):

	send index from f2c

Your message will be answered automatically (by a program -- see CACM vol.
30 #5 (May, 1987), pp. 403-407).  You will receive a reply explaining how to
automatically acquire f2c source (about 600K), f2c library source (130K),
and supporting info (man page, etc).  Or you can anonymous-FTP to
research.att.com and look in directory dist/f2c at these files:

	all.Z -- 250K compressed shar file for f2c
	f2c.ps.Z -- 24 page tech report describing f2c
	index -- general info about files
	libf77.Z, libi77.Z -- compressed shar files for libraries

****************************** DISCLAIMER ******************************
	     Careful! Anything free comes with no guarantee.
************************************************************************

----------------------------------------------------------------------
Mark Maimone				phone: (412) 268 - 7698
Carnegie Mellon Computer Science	email: mwm@cs.cmu.edu
					       cmcspt!mwm@cs.cmu.edu

Notes: f2c accepts only fairly vanilla FORTRAN; vendor supplied f77's
       usually produce better quality code, and accept a wider variety
       of codes. 

Q8)  What is the best compiler for a PC?

    There are many products, some are quite good. Few are free. 
    f2c and gcc can be had for the PC environment. Popular ones are:

	Lahey (very fast compilation; excellent reputation for support)
	Watcom (touted for good optimization)
	MicroWay (support for odd floating point units)
	LPI  (multi-platform support)
	MicroSoft (various good hooks into windows and such)
	Absoft (multi-platform support)

   It is beyond the scope of a faq to provide a commercial endorsement.

Q9) How does Fortran 90 relate to FORTRAN '77?

Loosely speaking, Fortran 90 is a superset of X3.9-1978 FORTRAN. There
are minor differences, but they are quite minor.

But this does not mean that all "77" codes will port sans changes.
Many (if not most) programmers employed constructs beyond the '77
standard, or rely on unspecified behavior (say, assuming that an OPEN
of an existing file will position the file pointer to just past the
last record already written) which has changed (that is to say, has
become specified). 

Q10) My compiler is mis-behaving; who enforces the standard?

    ANSI and ISO standards do not usually have a particular enforcement
    mechanism. Local bodies sometimes do. 

    However, it should be borne in mind that if *your* source code is
    not standard compliant there is *NO* obligation for a FORTRAN ('77
    and before) compiler to do  *ANYTHING* in particular. In Fortran (90)
    the text in "constraints" must be tested and a warning produced
    (compiler option can be used to evade this, of course).

    Some (notably Guy Steele, with respect to another standard) have
    noted that when non-standard complying code is encountered, a
    compiler may do *ANYTHING* including initation of Global Warfare.
    Keep this in mind.

    When you do find a bona fide compiler bug, you are generally best
    served by reporting it to the *vendor*. If you neglect to tell the
    vendor, how can you complain about it not being fixed?

    When reporting a *suspected* bug be sure to be quite specific
    about the computer system, operating system rev level (patches
    applied if known) and *compiler*version* (and patches thereof).
    It is very hard for people to read your mind; but they will try. 
    The attempts are often entertaining, sometimes helpful, but always
    an inefficient use of people-time and net-bandwidth.

    Also note that it is generally helpful if you cut down the example
    to the smallest size you can. Vendors are developers too; the
    tendency is invest time/money where one can get the biggest bang
    for the buck. 
    

Q11) What are good books on Fortran? 

    Don't know if they are good. Inclusion in the list is not
    endorsement.  Have misplaced name of the compiler of the 
    original list <sorry>


Author                         Title                                     Year
Kruger			       Efficient Fortran Programming		  1990
Mojena/Ageloff                 FORTRAN 77                                 1990
Metcalf/Reid                   FORTRAN 90 EXPLAINED                       1990
Boyle                          FORTRAN 77 PDQ                             1989
Bezner                         FORTRAN 77                                 1989
Tremblay                       PROGRAMMING IN FORTRAN 77                  1988
Salmon                         ... ENGINEERS & SCIENTISTS WITH FORTRAN 77 1988
Nyhoff/Leestma                 FORTRAN 77 FOR ENGINEERS & SCIENTISTS      1988
McCracken/Salmon               ... ENGINEERS & SCIENTISTS WITH FORTRAN 77 1988
Davis/Hoffman                  FORTRAN 77: A STRUCTURED DISCIPLINED STYLE 1988
Barnard/Skillicorn             FORTRAN 77 FOR ENGINEERS AND SCIENTISTS    1988
Mashaw                         PROGRAMMING STRUCTURED FORTRAN 77          1987
Cole                           FORTRAN 77: A STRUCTURED ... APPROACH      1987
Boillot                        UNDERSTANDING FORTRAN-77                   1987
Starkey/Ross                   FUNDAMENTAL PROGRAMMING WITH FORTRAN 77    1986
Rouse/Bugnitz                  INTRODUCTION TO FORTRAN 77                 1986
Ratzer                         FORTRAN 77 COURSE                          1986
Page                           FORTRAN 77 FOR HUMANS                      1986
Lehman                       ... SOCIAL SCIENCES: ALGORITHMS & FORTRAN 77 1986
Smith                          FORTRAN 77: A PROBLEM-SOLVING APPROACH     1985
Shelly                         FORTRAN 77: AN INTRODUCTION                1985
Nickerson                      FUNDAMENTALS OF FORTRAN 77 PROGRAMMING     1985
Metcalf                        EFFECTIVE FORTRAN 77                       1985
McKeown                        STRUCTURED PROGRAMMING USING FORTRAN 77    1985
Hume                           FORTRAN 77 FOR SCIENTISTS & ENGINEERS      1985
Dillman                        PROBLEM SOLVING WITH FORTRAN 77            1985
Brainerd                       FORTRAN 77 FUNDAMENTALS AND STYLE          1985
Borse                          FORTRAN 77 & NUMERICAL METHODS FOR ENGINEERS1985
Adman                          FORTRAN 77 SOLUTIONS NON-SCIENTIFIC PROBS. 1985
SSI, Inc. Staff                FORTRAN 77 REFERENCE                       1984
Etter                          PROBLEM SOLVING WITH STRUCTURED FORTRAN 77 1984
Etter                          PROBLEM SOLVING USING FORTRAN 77            ?
Dyck                           FORTRAN 77: A STRUCTURED APPROACH ...      1984
Chivers/Clark                  FORTRAN 77: A HANDS ON APPROACH            1984
Adman                          FORTRAN 77 FOR NON-SCIENTISTS              1984
Willamson/Levesque           * A GUIDEBOOK TO FORTRAN ON SUPERCOMPUTER   1989
Rule                           FORTRAN 77: A PRACTICAL APPROACH          1983
Rouse/Bugnitz                  PROGRAMMING THE IBM PC: FORTRAN 77        1983
Nyhoff/Leestma                 PROBLEM SOLVING WITH FORTRAN 77           1983
Marateck                       FORTRAN 77                                1983
Lehmnkuhl                      FORTRAN 77                                1983
Law                            ANSI FORTRAN 77: INTRO. TO SOFTWARE DESIGN 1983
Holoien/Behforooz              ... STRUCTURED PROGRAMMING WITH FORTRAN 77 1983
Grout                        FUNDAMENTAL ... PROGRAMMING USING FORTRAN 77 1983
Fleming/Redish                 THE U. S. MC MASTER GLOSSARY OF FORTRAN-77  1983
Cole                           ANSI FORTRAN IV WITH FORTRAN 77 EXTENSIONS  1983
Wu                             ANSI FORTRAN IV & 77 AND BUSINESS PROGRAMS  1982
Pollack                        STRUCTURED FORTRAN 77 PROGRAMMING           1982
Katzan                         FORTRAN 77                                  1982
Gibson/Young                  INTRODUCTION TO PROGRAMMING USING FORTRAN 77 1982
Ellis                         STRUCTURED APPROACH FORTRAN 77 PROGRAMMING   1982
Durgin                        FORTRAN 77                                   1982
Nanney                        A PROBLEM-SOLVING APPROACH USING FORTRAN 77  1981
Merchant                      FORTRAN 77: LANGUAGE AND STYLE               1981
Khailany                      BUSINESS PROGRAMMING FORTRAN IV/ANSI FORTRAN 1981
Ashcroft                      PROGRAMMING WITH FORTRAN 77                  1981
Wagener                        FORTRAN 77                                    ?
Wagener                       PRINCIPLES OF FORTRAN 77 PROGRAMMING         1980
Meissner/Organick             FORTRAN 77 FEATURING STRUCTURED PROGRAMMING  1980
Hume/Holt                     PROGRAMMING FORTRAN 77                       1979
Balfour                       PROGRAMMING IN STANDARD FORTRAN 77           1979
Brainerd 		      Programmer's guide to Fortran 90            1990
Adams et al                   Fortran 90 Handbook                         1991
Counihan                      Fortran 90                                  1991
O'Reilly&Assoc		      Unix for FORTRAN Programmers                1990

Q12) Are there pretty printers for FORTRAN?

    Yes. 

    One such is SPAG:  OTG <usa> voice 717 222 9100  fax   717 229 9103
    Authors are   

	       Polyhedron Software Ltd
	       Magdalen House
	       98 Abingdon Road
	       Standlake
	       Witney
	       Oxon OX8 7RN

	       Tel 0865 300 579
	       

    Another is Fortran development Tools from  Quibus 714 527 1384

    Also FOR_STRUC from cobalt-blue. 404 518 1116

    These more than pretty print, they optionally restructure your
    code (duplicating code as needed to tidy up strange GOTO lists,
    turning them into IF-THEN chains, and etc.).


From: dappel@grafted.UUCP (Dave Appel)
Newsgroups: comp.lang.fortran
Subject: Re: code beautifier wanted
Date: 4 Mar 92 21:30:25 GMT
Organization: GRAFTED, Central Indiana's Usenet BBS 317-881-4369

wg@cbnewsm.att.com (Bill Gieske) writes:
> I have tons of old FORTRAN code, most of it in upper case, the majority
> of it not indented.  Is there a code beautifier, either PD or $$ that I
> can run the code through to improve the readability, hence the main-
> tainability?
> Reply to me direct.  I will summarize if appropriate.
> Bill Gieske
> AT&T Bell Laboratories
> wg%alux2@att.research.com

     Call "The Connection at 800-336-1166"  and ask for
their software catalog.

     In their catalog that I have, Sprint 1992, there is an
ad on page 39 from AutoCASE Technology.  They have
a product called "AutoFLOW-FORTRAN" that lists for $1,995.
It claims to automatically document your existing source code.
AutoCASE's number is 408-446-2273.
 
      On page 93 is an ad from POWERLINE Software Inc.
Their number is 800-257-5773, 206-623-9204.  They offer
a product called SOURCE PRINT+, which they call a code
management tool with "multi-style formatting with structured
code blocking."  

They have a Fortran/Basic version for $169, and a Delux
Multi-language version for $249.  This program is for
DOS (MS-DOS presumably) Windows, and OS/2.
 
Hope this helps.

--
Dave Appel
The Grafted Branch BBS
317-881-4369
internet: dappel@grafted.UUCP
uucp: ..!uunet!grafted.UUCP!dappel
    -= newsfeeds available, contact robert@towers.rn.com =-

Hindsight/Fortran

		Summary:

	Features include the ability to draw an interactive structure
	chart and display coverage, software complexity and
	performance information on the structure chart. There are also
	code tracing features, for instance 3 logic diagrams are
	produced. Common blocks can be traced through the structure
	charts, including specific variables within common blocks.
	Hindsight is excellent for documentation, code inspection, and
	bringing new software engineers up to speed on new code. 

For more information or a free demo copy, contact:

Dan Zimmerman,  National Account Manager
Advanced Software Automation, Inc.
3130A Coronado Dr
Santa Clara, 95054

Phone: 408 492-1668  Fax: 408 492-1669

Email: zimme@hindsight.com 

Alternative contact (if Dan cannot be reached:
			    manny@hindsight.com (John Mansperger)


Hindsight/FORTRAN Version 1.0 features

Hindsight/FORTRAN Version 1.0 is a fully integrated software
maintenance, testing, and re-engineering environment which addresses
many problems of the software development cycle, from design to
maintenance.

Hindsight/FORTRAN Version 1.0 parses FORTRAN source code, decomposes
system structure, and from this analysis, produces a single database
from which all of Hindsight's charts, diagrams and reports are
produced.  The results of Hindsight's analysis is a detailed picture
of the static structure of the software system, a representation of
the common and local data, and connections to the dynamically
collected run-time data.  From this, Hindsight generates active
structure charts where the user can isolate logical subtrees to
analyze both the parents and the children of a selected function.
Hindsight collects and analyzes performance, complexity, and test
coverage data.  With the structure chart, the user can display this
data in a graphical and easy to use format.  From the structure chart,
the user can edit multiple functions at a time without having to
specify the file or directory path where the file exists.  Hindsight
even displays the use of common blocks on the structure chart.
Lastly, Hindsight generates logic diagrams for the entire program,
provides point-and-click tracing between high-level and detailed logic
with active line numbers, and generates over fifty detailed reports.

All capabilities mentioned above are integrated in a menu
driven environment utilizing the OpenLook or Motif Graphical User
Interface. Engineers only need to specify a list of source files to be
analyzed and select the operation and parameters for their purposes.
Hindsight provides the ability for multiple diagrams and reports to be
produced simultaneously during a single Hindsight session.

Hindsight/FORTRAN Version 1.0 provides an innovative technique to
graphically represent a software system. The structure chart reflects
the system structure, from which the user can get a clear overview of
the program being examined. Hindsight also allows the user to view or
edit the original code with a click on any subprogram box in the
structure chart.  A major time-saving advance is Hindsight's ability
to reanalyze an edited function and update the structural database
without reanalyzing the entire system.  The J-Diagram and ActionPlus
diagram are two graphical representations of the logic in a software
system and can contain a single module or the entire system.  Both
diagrams utilize the active line number technique to link high-level
module calls with detailed module logic.  Hindsight also actively
links computed GOTO statements with their destination labels by
clicking on the label.  Users can walk through programs and trace the
logic without having to memorize the directories and files where
subprograms are defined and called. This technique saves a great deal
of the users time.

Hindsight/FORTRAN Version 1.0 has many integrated automated tools to
generate documents either on-screen or on paper. Because the documents
are automatically generated, they can be updated as soon as engineers
have modified their source code.  This approach guarantees the
consistency between the design documents and the source code.  The
updated and correct documents will be of great value in maintaining
and improving software products.  These documents are available
on-line to the user and readily accessible through Hindsight's
interactive report mechanism.

Hindsight Version 1.0 has the ability to provide segment or line test
coverage data.  Hindsight generates test coverage data and displays
the data on the structure chart in a statistical way.  Hindsight can
also display the precise location of testing deficiencies on the
J-Diagram, which helps engineers find the exact part of the program
where the code has not been tested. Hindsight's ability to display
performance data, complexity metrics, and test coverage data on charts
and diagrams play an important role in controlling program quality.

Hindsight/FORTRAN Version 1.0 uses a new notation for the J-diagram
which accommodates branch test coverage capability.  The new notation
has a better and more precise method of showing control levels,
complexity, and segment number counting.  The branch test coverage
data generation and display is a great enhancement for test coverage
analysis.  Hindsight's branch test coverage is able to detect
invisible branches, finding more problems that would otherwise be
hidden in programs.  With this information, users can add test cases
for covering the untested code.

Hindsight/FORTRAN Version 1.0 contains the ability to speed up the
development process by generating a specific order for coding the
modules of a users system.  By analyzing a group of modules containing
nothing more than empty shells of subprograms that call the other
subprograms in the system, Hindsight generates the coding order for
the modules to ensure that the process will be testable with the use
of a single driver process and without the need to stub out uncoded
subprograms.  The bottom-up coding approach saves time that would be
wasted coding unneeded stubs.  As development proceeds, Hindsight's
ability to verify that calls to other subprograms are utilizing the
proper interface will also save time and improve program quality.

Other tools:

      		Refine/FORTRAN  ("re-engineering tool")
		Reasoning Systems Inc
		415 494 6201

		FORM (graphical interface to toolpack)
		University of Kent 44 227 762811


		pub/fortran/fxref.tar.Z from biome.bio.ns.ca.
		create cross reference of a FORTRAN program.

		CLEAN77 available from Purdue University.
		Mail Greg Flint (afc.klaatu.cc.purdue.edu) for more info.

		There is a program called TIDY that is available via
		FTP from simtel20  pub/msdos/fortran/tidy621.zip on
		oak.oakland.edu 

Q13) Why are there aimless debates?

    There are some  persistent individuals who would like computer systems
    to work in a fashion somewhat unlike they do now. It seems pointless
    to debate with them; the debates (in various groups) always take
    the same form and never result in meaningful dialog.

    One can usually recognize such by reading a week or so's worth of
    postings. Sometimes you may have to read for a month to recognize
    such. When you do, please try to avoid triggering (or responding to)
    such individuals. 

    Many (if not most) newsreaders support a feature entitled KILL files.
    As you recognize individuals, you may wish to put them into your
    local kill file. For example, the style employed by GNUS:

	(gnus-kill "From" "hrubin@pop.stat.purdue.edu")
	(gnus-kill "Subject" "test")

    the first kills off all postings from the named individual,
    the second kills off all postings including the beloved "test" string.
    See your local NewsGod for details suitable for your local system.
	
Q14) How do I call f77 from C (and visa versa)
     This is quite platform dependent. For Suns see the FORTRAN User's
     Guide, Chapter 14.

    There is a package available from usenet which attempts to make
    this "quick and easy" for a wide range of platforms:

   ftp.uu.net   (137.39.1.9) Location: /comp.sources.misc/volume20
      DIRECTORY rwxr-xr-x       512  Jun 27  1991   cfortran

   It is on many other sites (around the world) too. See archie if
   you need other pointers.


Q15) What constitutes good FORTRAN style?

One rendition of a FORTRAN 77 style guide is available through anonymous
ftp from ics.uci.edu (128.195.1.1).  To retrieve (please note that it's
not really "anonymous", that's just the Name that you'll be using):

% ftp ics.uci.edu
anonymous
<enter your e-mail address at Password: prompt>
cd pub/levine
ascii
get F77_Style_Guide
bye

If you can't access this site directly, please send an e-mail request to
levine@ics.uci.edu (BITNET: levine@uci, UUCP: ...!uunet!ucivax!levine).

Q16) For whatever reasons, I want to translate my Fortran into C.
    What tools are available?

    f90 from NAG, see above
    f2c see above.

    FORTRAN=C=FORTRIX=Rapitech Rapitech (914) 368-3000
    FORTRAN=C=FOR_C=Cobalt Blue  404 518 1116
    FORTRAN=C=PROMULA.FORTRAN=Promula (614) 263-5512

Q17) For whatever reasons, I want to translate my existing C code
     into Fortran. What tools are available?

Regretably none. This is indeed unfortunate, as even a limited
translator could help with typical C header files.

Q18) What is preprocessing, how can it help? How can it hurt?
     
Preprocessing often refers to usage of a Macro-prepressor upon ones
source code prior to compilation. 

       How can this help?

It can make it easier to move code between machines.

       How can this hurt?
  
It can cause difficulties in compilation of the processed code; most (if
not all) macro-preprocessors know nothing about Fortran syntax and
code layout rules. So, a common problem is that after preprocessing
some text may be lost past "sacred" column 72. Those working with
compilers that optionally compile *past* line 72 should probably
employ that option when using a preprocessor.

Common prepressors are: cpp, m4, and ratfor. Many sites have their
own custom prepressors. Basic functions are:

    1) definition of a symbol
    2) conditional code selection based on a symbol
    3) substition of a symbol by its definition

Traditional BSD Unix f77 processors treat a file named foo.F (as
opposed to foo.f) as one that should be run through cpp prior to
compilation "automatically".



--
----------------------------------------------------------------
Keith H. Bierman    keith.bierman@Sun.COM| khb@chiba.Eng.Sun.COM
SunPro 2550 Garcia MTV 12-40             | (415 336 2648) fax 964 0946
Mountain View, CA 94043  <speaking for myself, not Sun*> Copyright 1992