Physics 410: Fortran Programming
Please report all errors/typos. etc to
choptuik@physics.ubc.ca
Last updated October 1 2001
- The source code described below and in class can also be found on
the phys410 account on the lnx machines in
~phys410/f77/ex1, ~phys410/f77/ex2, ...
(organized by lecture).
- Some Online References for Fortran 77 Programming
- Lecture 1 (Sep 27 & Oct 2)
- Combined handouts (PS)
for Lectures 2 through 6 (does NOT include Notes
on Fortran 77 arrays from Lecture 5).
- Lecture 2 (Oct 2 & 4)
-
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 (Oct 2 & 4)
- Lecture 4 (Oct 4 & 9)
- Lecture 5 (Oct 11)
- Notes on Fortran 77 arrays:
(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 16)
- meps.f:
Computes approximate real*8 machine epsilon.
Sun (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.
- Miscellaneous
- t2d.f: Program to test
understanding of Fortran 77 array storage scheme. Output on
lnx1.