Physics 410: Fortran Programming
Please report all errors/typos. etc to
choptuik@physics.ubc.ca
Last updated September 21 2000
- The source code described below and in class can also be found on
the phys410 account on sgi1 in
~phys410/f77/ex1, ~phys410/f77/ex2, ...
(organized by lecture).
- Some Online References for Fortran 77 Programming
- Professional Programmer's Guide to Fortran 77, by Clive Page,
(PS)
- SGI Fortran 77 Language Reference Manual
(PS)
- SGI Fortran 77 Programmer's Guide
(PS)
- Lecture 1 (Sep 26)
- Combined handouts (PS)
and slides (PS)
for Lectures 2 through 6 (does NOT include Notes
on Fortran 77 arrays from Lecture 5).
- Lecture 2 (Sep 28)
- Handout (PS) and
slides (PS).
-
fdemo1.f: Program demonstrating some essential
Fortran 77 language elements
-
fdemo1-output: 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 (Sep 28)
- Lecture 4 (Oct 3)
- Lecture 5 (Oct 5)
- 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.
- Makefile for
above executable.
- Lecture 6 (Oct 5)
- Handout (PS) and
slides (PS).
- meps.f:
Computes approximate real*8 machine epsilon.
SGI (IEEE) output.
PC Linux output.
- catprec.f:
Illustrates catastrophic precision loss due to subtraction
of nearly-equal floating point values.
Program output.
- 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.
- Makefile for
above executables.