[comp.lang.fortran] Decent FORTRAN books?

rsc@rsc.boltz.cs.cmu.edu (R Scott Crowder) (06/04/91)

Does anyone have a list of decent fortran reference books?  I am looking for
something like K&R or the Harbison & Steele C reference books.  The style
guides mentioned recently are useful reading, but I want more of a reference
manual.

Thanks

shenkin@cunixf.cc.columbia.edu (Peter S. Shenkin) (06/05/91)

In article <13270@pt.cs.cmu.edu> rsc@rsc.boltz.cs.cmu.edu (R Scott Crowder) writes:
>Does anyone have a list of decent fortran reference books?  I am looking for
>something like K&R or the Harbison & Steele C reference books...

Metcalf, "Effective Fortran 77", Oxford U. Press, is excellent.  It's very
careful with standard conformance, and has some good stylistic hints as
well;  he "deprecates" certain features.

My main problem with it is a poor index;  you pretty much have to read the
whole book to know where to find something.

	-P.
************************f*u*cn*rd*ths*u*cn*gt*a*gd*jb**************************
Peter S. Shenkin, Department of Chemistry, Barnard College, New York, NY  10027
(212)854-1418  shenkin@cunixf.cc.columbia.edu(Internet)  shenkin@cunixf(Bitnet)
***"In scenic New York... where the third world is only a subway ride away."***

bernhold@red8 (David E. Bernholdt) (06/06/91)

In article <13270@pt.cs.cmu.edu> rsc@rsc.boltz.cs.cmu.edu (R Scott Crowder) writes:
>Does anyone have a list of decent fortran reference books?

I strongly recommend

Harry Katzan, Jr., Fortran77, Van Nostrand Reinhold, 1978, ISBN
0-442-25428-8 (pbk)

though I understand it may be out of print.
-- 
David Bernholdt			bernhold@qtp.ufl.edu
Quantum Theory Project		bernhold@ufpine.bitnet
University of Florida
Gainesville, FL  32611		904/392 6365

wsb@boise.Eng.Sun.COM (Walt Brainerd) (06/06/91)

In article <28962@uflorida.cis.ufl.EDU>, bernhold@red8 (David E. Bernholdt) writes:
> I strongly recommend
> Harry Katzan, Jr., Fortran77, Van Nostrand Reinhold, 1978.

I reviewed this book (Computing Reviews) when it came out and there
was a factual error about the language (not just a typo) on about
every page.  Though many may be minor, they probably are significant
to readers of this group.  I would much rather trust Meissner & Organick
or Wagener, even though they are written as textbooks--at least these
guys know the language well.

> though I understand it may be out of print.

But maybe this is all moot.

--
Walt Brainerd               Sun Microsystems, Inc.
walt.brainerd@eng.sun.com   MS MTV 5-40
                            Mountain View, CA 94043
                            415/336-5991

mwette@csi.jpl.nasa.gov (Matt Wette) (06/06/91)

In article <1991Jun5.161838.4436@cunixf.cc.columbia.edu> shenkin@cunixf.cc.columbia.edu (Peter S. Shenkin) writes:
>In article <13270@pt.cs.cmu.edu> rsc@rsc.boltz.cs.cmu.edu (R Scott Crowder) writes:
>>Does anyone have a list of decent fortran reference books?  I am looking for
>>something like K&R or the Harbison & Steele C reference books...
>
>Metcalf, "Effective Fortran 77", Oxford U. Press, is excellent.  It's very
>careful with standard conformance, and has some good stylistic hints as
>well;  he "deprecates" certain features.
>
>My main problem with it is a poor index;  you pretty much have to read the
>whole book to know where to find something.
>
>	-P.
>************************f*u*cn*rd*ths*u*cn*gt*a*gd*jb**************************
>Peter S. Shenkin, Department of Chemistry, Barnard College, New York, NY  10027
>(212)854-1418  shenkin@cunixf.cc.columbia.edu(Internet)  shenkin@cunixf(Bitnet)
>***"In scenic New York... where the third world is only a subway ride away."***

My favorite is
	"Fortran 77," by Harry Katzan, Jr., Van Nostrand Reinhold
	Company, 1978

No style hints. Fortran 77, and all of it, with a few example
fragments to give you the idea.  Too many Fortran programming
books omit the obscure parts of the language.  How many readers
know that the following is legal and know what it is used for?

	SUBROUTINE XYZ(I, *, *, *)

This is covered in the above reference.

Matt
 _________________________________________________________________
 Matthew R. Wette           | Jet Propulsion Laboratory, 198-326
 mwette@csi.jpl.nasa.gov    | 4800 Oak Grove Dr, Pasadena,CA 91109
 -----------------------------------------------------------------

jwe@che.utexas.edu (John W. Eaton) (06/06/91)

In article <1991Jun5.161838.4436@cunixf.cc.columbia.edu>
shenkin@cunixf.cc.columbia.edu (Peter S. Shenkin) writes: 

>> Metcalf, "Effective Fortran 77", Oxford U. Press, is excellent.
>>
>> My main problem with it is a poor index;  you pretty much have to
>> read the whole book to know where to find something.

Yes, but the book is pretty short so it's not terribly difficult to
read the entire thing carefully.

In article <1991Jun6.031122.27876@jato.jpl.nasa.gov>
mwette@csi.jpl.nasa.gov (Matt Wette) prefers:

> "Fortran 77," by Harry Katzan, Jr., Van Nostrand Reinhold Company, 1978
>
> No style hints. Fortran 77, and all of it, with a few example
> fragments to give you the idea.

This sounds very much like Metcalf without style hints.  I agree that
too many style tips are not terribly desirable, but is it really that
bad to be told that excessive use of computed goto statements is
generally considered ugly and hard to maintain?

> Too many Fortran programming books omit the obscure parts of the
> language.  How many readers know that the following is legal and
> know what it is used for? 
>
>	SUBROUTINE XYZ(I, *, *, *)
>
> This is covered in [Katzan].

It is also covered by Metcalf.  He also points out that

   Excessive use of the alternate RETURN feature can lead to a messy
   logic flow between subprograms.  Its use should be reserved for
   exception handling...

Unfortunately, he doesn't point out that the same effect can be
achieved (in a clearer way, IMHO :-) by simply using a single extra
integer parameter, say ERROR, and setting its value before returning.

--
John W. Eaton                       |  If the odds are a million to one
jwe@che.utexas.edu                  |  against something occurring, chances
Department of Chemical Engineering  |  are 50-50 it will.
The University of Texas at Austin   |                         -- fortune(1)

carroll@ssc-vax (Jeff Carroll) (06/06/91)

In article <14612@exodus.Eng.Sun.COM> wsb@boise.Eng.Sun.COM (Walt Brainerd) writes:
>In article <28962@uflorida.cis.ufl.EDU>, bernhold@red8 (David E. Bernholdt) writes:
>> I strongly recommend
>> Harry Katzan, Jr., Fortran77, Van Nostrand Reinhold, 1978.
>
>I reviewed this book (Computing Reviews) when it came out and there
>was a factual error about the language (not just a typo) on about
>every page.  Though many may be minor, they probably are significant
>to readers of this group.  I would much rather trust Meissner & Organick
>or Wagener, even though they are written as textbooks--at least these
>guys know the language well.

Yeah. I was a little surprised to see someone recommending Katzan. I haven't
read the fortran book, but his book on operating systems was entirely
IBM-centric, utterly vague, and worse than useless. (Knowing very little
about the IBM world, I can't vouch for the correctness of his facts.)

Katzan used to work for Boeing, too. Caveat emptor :^).

I have a copy of the Barnes & Noble outline on FORTRAN and have found it
helpful for general reference though probably not detailed enough for
the serious. I've been fortunate enough to have a copy of the ANSI
standard (and someone who understood it) around when I needed it, and
doubly fortunate at having been able to write most of my FORTRAN under
VMS.



-- 
Jeff Carroll		carroll@ssc-vax.boeing.com

"...and of their daughters it is written, 'Cursed be he who lies with 
any manner of animal.'" - Talmud

jlg@cochiti.lanl.gov (Jim Giles) (06/06/91)

In article <50082@ut-emx.uucp>, jwe@che.utexas.edu (John W. Eaton) writes:
|> [...]
|>    Excessive use of the alternate RETURN feature can lead to a messy
|>    logic flow between subprograms.  Its use should be reserved for
|>    exception handling...
|> 
|> Unfortunately, he doesn't point out that the same effect can be
|> achieved (in a clearer way, IMHO :-) by simply using a single extra
|> integer parameter, say ERROR, and setting its value before returning.

I disagree.  Any user of Fortran should know what an alternate return
means and an IF statement in the same context would be no clearer (in
fact, it would be less clear in the case for which alternate return was
intended - see below).

Further, the IF statement is much less efficient: you are going to
make a test for error in the caller when the subroutine has already
made such a test.  Further, you will be making a test which fails
99.99% of the time (assuming that you really are using alternate
return only for exception handling).  This means that your test is 
doubly wasted: it's seldom true (so it wastes time) and it actually 
obscures the _usual_ flow of control through your code.

Exception handling is a problem for which _everyone_ agrees that
non-local control flow is the _natural_ way to handle it.  Ada 
exceptions don't explicitly test at each level, you "raise" an
exception and the currently active handler (wherever that is)
get control.  Even C has setjump/longjump (a very clumsy but 
effective mechanism).  Nobody wants their code strewn with 
constantly interspersed testS for conditions that hardly ever
arise (and which the explicit IF test, when successful, would
either return or GOTO anyway - so it's still non-local even
with the explicit tests).

J. Giles

latenser@hoss.unl.edu (Dan Latenser) (06/07/91)

>In article .....edu> rsc@rsc.boltz.cs.cmu.edu (R Scott Crowder) writes:
>>Does anyone have a list of decent fortran reference books?  I am looking for
>>something like K&R or the Harbison & Steele C reference books...

Any comments on:

	Structured Fortran 77 Programming    
	by Seymour Pollack
	496 pages  (seems complete to me) 
	Boyd & Fraser Publishing Company
	3627 Sacramento Street
	San Francisco CA  94118

	copyright 1982 (my copy)

	    Pollack was/is in the 
		Department of Computer Science 
		School of Engineering and Applied Science
		Washingto University in St. Louis
		
and another favorite of mine

	Advanced problem solving with Fortran 77
		(including a preview of Fortran 8x)
	Stacey L. Edgar
	445 pages ( not very much introductory )
	Science Research Associates, INC.
	(Pergamon)
	Chicago etc.....

	copyright 1989



and yet another useful book

	Fortran Tools for VAX/VMS and MS-DOS
	R.K. Jones and T. Crabtree
	446 pages ( full of tools - not math tools - that I often use on
			our HP 9000 unix box with little or no trouble.  This is
			a different type of book  -  does not teach fortran.)
	Wiley and Sons

	copyright 1988




Dan Latenser
latenser@hoss.unl.edu

wws@raphael.cray.com (Walter Spector) (06/07/91)

In article <1991Jun5.161838.4436@cunixf.cc.columbia.edu>, shenkin@cunixf.cc.columbia.edu (Peter S. Shenkin) writes:
|> In article <13270@pt.cs.cmu.edu> rsc@rsc.boltz.cs.cmu.edu (R Scott Crowder) writes:
|> >Does anyone have a list of decent fortran reference books?  I am looking for
|> >something like K&R or the Harbison & Steele C reference books...
|> 
|> Metcalf, "Effective Fortran 77", Oxford U. Press, is excellent.  It's very
|> careful with standard conformance, and has some good stylistic hints as
|> well;  he "deprecates" certain features.

I also enjoy Metcalf's "Fortran Optimisation" book.  It was published in
about '82 and is starting to get a bit dated though.  Apparently he has
also recently published a book on Fortran-90.  Metcalf works at CERN and
knows Fortran quite well.

Walt
-- 
Walt Spector
(wws@renaissance.cray.com)                       "Parity is for farmers"
Sunnyvale, California                                    - Seymour Cray
_._ _._ _.... _. ._.