Subject: Fortran for C Programmers?

From: "Dr. Heinz Schiffer" <[email-masked]>
Date: Tue, 22 Jul 1997 09:32:25 +0200

Gabriel Berriz wrote:
> 
> While we're on the subject of mixed-language programming, does anyone
> know of a book (or any other reference) on Fortran for C programmers?

In my view the very best book on FORTRAN is :

	Michael Metcalf
	Effective Fortran 77
	Oxford University Press, Oxford 1987
	ISBN 0-19-853709-3

> would be extremely helpful.  (Unfortunately, there seems to be more
> demand and supply for guides to C for Fortran programmers than the
> other way around... :/ )

I am really looking for a good book on C and C++ for FORTRAN
programmers. I know, that depend on the personal style. So, I
would like to have a Metcalf for C++. I never saw one, so may be
some of you can recommend something.

Thanks a lot,
Ciao
Heinz

-- 
Dr. Heinz Schiffer              Phone   ++49-69-305-2330                        
Hoechst CR&T                    Fax     ++49-69-305-81162                       
Scientific Computing, G864      Email   [email-masked]           
65926 Frankfurt am Main                 [email-masked]

---

From: Bernd R Eggen <[email-masked]>
Date: Tue, 22 Jul 1997 11:36:49 +0000 (BST)

Fortran to C/C++ sounds more like using Fortran 90
to me, which can deal with many of the shortfalls
of FORTRAN 77. Fortran 90 even allows for some OO
programming. There are plenty of good introductions
for Fortran 90 (and 95) around, which can be found
on the FAQ, the original (updated 26 June 97) is at URL
http://www.ifremer.fr/ditigo/molagnon/fortran90/engfaq.html

> 	Oxford University Press, Oxford 1987

With best regards, Bernd Eggen.

-- 

Dr. Bernd R. Eggen
E-mail: [email-masked]
The University of Sussex at Brighton

---

From: Konrad Hinsen <[email-masked]>
Date: Tue, 22 Jul 1997 16:51:23 +0200

> I have read introductory material on Fortran, and written *teeny*
> throaway programs, but I still don't have a very good grasp of the
> structure of Fortran programs.  The examples of Fortran code I've seen
> look like *nothing* else in my experience (mostly C, Perl, and

Fortran (77) or Fortran-90? The differences are enormous. Fortran 77
code looks weird because it has to get around language restrictions
that people who grew up with modern languages can't even imagine.
In fact, Fortran 77 is structurally much closer to assembly languages
than to Algol-like languages (which include C).

Fortran 90, if used properly (i.e. ignoring obsolete features left in
for compatibility only), looks much more like C. The major differences
are in syntax and parameter passing (by value in C, by reference in
Fortran).

In both cases, I recommend reading a good introduction and thinking
at each step about how the same problem would be solved in C. Then
(for Fortran 77) find out why the C solution doesn't work in Fortran.
I did succeed in that way, but obviously I never came to like Fortran
in the least...
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                          | E-Mail: [email-masked]
Laboratoire de Dynamique Moleculaire   | Tel.: +33-4.76.88.99.28
Institut de Biologie Structurale       | Fax:  +33-4.76.88.54.94
41, av. des Martyrs                    | Deutsch/Esperanto/English/
38027 Grenoble Cedex 1, France         | Nederlands/Francais
-------------------------------------------------------------------------------