Physics 410: Fortran Programming
Please report all errors/typos. etc to firstname.lastname@example.org
Last updated October 12, 2005
- The source code described below and in class can also be found
on the phys410 account on the lnx machines in
~phys410/f77/ex2, ... (organized by lecture).
- Some Online References for Fortran 77 Programming
- Lecture 1 (Oct 11)
- Combined handouts: (PDF)
Lectures 2 through 6 (does NOT include Notes on Fortran arrays
from Lecture 5)
- Lecture 2 (Oct 18)
Program demonstrating some essential Fortran 77 language elements
Output from fdemo1
- Makefile: Note:
Beware of cutting-and-pasting text to and from Makefiles.
All lines which specify an action (shell command) for updating a target
must begin with a TAB character.
- Lecture 3 (Oct 20 & Oct 25)
- Lecture 4 (Oct 25)
- Lecture 5 (Oct 27)
- Notes on Fortran 77 arrays: (PDF)
Demonstrates a general technique for writing Fortran 77 programs which
define and manipulate multi-dimensional arrays whose bounds are
determined at run time. Program
- Makefile for
Fortran 90 implementation of above example, illustrating
f90's dynamical memory allocation facilities. Makefile for this
- Lecture 6 (Oct 27)
- A brief synopsis of the IEEE
floating point standard from the PSC.
with links to much more additional information, including What
Every Computer Scientist Should Know About Floating-Point Arithmetic,
by David Goldberg (PS).
Computes approximate real*8 machine epsilon. Sun (IEEE) output. PC Linux output.
Illustrates catastrophic precision loss due to subtraction of
nearly-equal floating point values. Program output.
Two dimensional array (matrix) routines:
- dmmmult: Matrix-matrix multiply (square
- dmfrom: Read matrix from file or stdin
- dmto: Write matrix to file or stdout
- tdm.f: Test
driver for dmroutines.f. Program
- Makefile for
- Miscellaneous programs and scripts
- t2d.f: Program
to test understanding of Fortran 77 array storage scheme.
- Sample output from nth,
a filter (shell-script) which selects specified columns (separated by
white space) from standard output and writes them to standard output.
- Additional Material