[R] r: fortran help

Mike Prager Mike.Prager at noaa.gov
Fri Jan 9 20:03:34 CET 2004


At 05:16 AM 1/9/2004, allan clark wrote:

>I would like to know if anybody knows of either a good book or web site
>that explains one how to use Fortran. I would like to call some of the
>Fortran subroutines but before I can do that I first want to learn how
>to code in Fortran.

Interesting question.  The name "Fortran" is generally used for the current 
version of the language (Fortran 95), while FORTRAN often means the 
previous version (FORTRAN 77). Despite many advances in Fortran 95 
(whole-array operations, better modularization, many safety features, and 
others), both versions are widely used, probably because a free compiler is 
available for FORTRAN 77 but not yet for Fortran 95.  So the answer to your 
question depends on which language you want to learn.

(By the way, it's not clear to me if routines compiled with a suitable 
modern Fortran (95) compiler can be linked into R. I would love to have 
enough time to find out, but programming is a small part of my job these days.)

Modern Fortran is an excellent scientific programming language.  A very 
good, concise book is Metcalf and Reid, "Fortran 90/95 Explained," 
published by Oxford University Press.

The best book I ever came across for FORTRAN 77 was by someone named 
Calderbank.  It was thin, readable, and complete. However, I've got rid of 
it (since I now use modern Fortran), and it's out of print.

As Tobias Verbeke suggests, there's quite a lot of material on both 
languages on the Web.

A couple of more FYI's:

Fortran 95 is a proper superset of FORTRAN 77.  Therefore, any 
standard-conforming FORTRAN 77 code can be compiled on any Fortran 95 
compiler.  Because FORTRAN 77 was limited in many ways, much code was 
written with vendor extensions.  Many were incorporated into Fortran 95, 
and the most common others are generally available in current Fortran 95 
compilers.

The next version of Fortran, which I believe will be called Fortran 2004, 
is expected soon. My understanding is that it includes (among other things) 
more features for object orientation and features for better (and more 
portable) interoperability with C.

I hope that helps.

Mike



-- 
Michael Prager
NOAA Center for Coastal Fisheries and Habitat Research
Beaufort, North Carolina  28516  USA
http://shrimp.ccfhrb.noaa.gov/~mprager/

NOTE: Opinions expressed are personal, not official. No government
endorsement of any product is made or implied.




More information about the R-help mailing list