Physics 329: Fortran Programming
Please report all errors/typos. etc to
matt@infeld.ph.utexas.edu
- Most of the source code covered in class can be found on
the phy329 account on einstein in
~phy329/f77/ex1, ~phy329/f77/ex2, ... (organized by lecture).
- IMPORTANT: You can refer to the on-line (postscript) version of the SGI
Fortran 77 Language Reference Manual
for full details of Fortran syntax.
- Lecture 1 (Sep 16)
- Lecture 2 (Sep 18)
-
fdemo1.f: Program demonstrating some essential
Fortran 77 language elements
(PS).
-
fdemo1_output: Output from fdemo1
(PS).
- 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 (Sep 21)
- Lecture 4 (Sep 23)
- Lecture 5 (Sep 25)
- Handout (PS) and
slides (PS).
- Notes on Fortran 77 arrays: handout
(PS)
and slides
(PS).
-
arraydemo.f Demonstrates a general technique
for writing Fortran programs which define and manipulate
multi-dimensional arrays whose bounds are determined at
run time.
Program output.
- 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.
- Lecture 6 (Sep 28)
- Handout (PS) and
slides (PS).
- meps.f:
Computes approximate real*8 machine epsilon.
SGI (IEEE) output.
Cray output and
Cray Makefile.
- tfpe.f: Illustrates
SGI (IEEE) real*8 floating-point exceptional values.
Normal output and
output with
FPE trapping enabled. Program
output on Cray.
- catprec.f:
Illustrates catastrophic precision loss due to subtraction
of nearly-equal floating point values.
Program output.
- Lecture 7 (Sep 30)
- Handout (PS) and
slides (PS).
- dmroutines.f:
Two dimensional array (matrix) routines:
- dmmmult: Matrix-matrix multiply (square matrices only)
- dmfrom: Read matrix from file or stdin
- dmto: Write matrix to file or stdout
- tdm.f: Test
driver for dmroutines.f.
Program output on SGIs.
Program output on Cray J90.
Note that this last document also contains general instructions
for 'porting' a Fortran code to the Cray.
- Makefile for the
application. Note that, provided the appropriate environment
variables are set, this Makefile will work on both
the SGIs and the Cray J90.