Fortran Workshop: An Introduction to Fortran77

by Dr. A. Brown

Welcome to the first Fortran Workshop (based upon the Computational Physics Workshop written by Dr. S. Hanna). During this workshop, you will be given an introductory talk after which you will be expected to read through the following document (Introduction to Fortran), which takes the form of a tutorial. When you come to them, you should attempt the programming exercises.

Model answers to the programming exercises are provided in the Appendix. NOTE: The model answers are password protected. You will be provided with a password at the end of the workshop or email me and I will be happy to provide you with one.

NOTE: Model answers no longer password protected (Feb 13, 2002).

If at any time you get into difficulties, you should ask a staff member for assistance.

Hopefully, these notes will provide you with sufficient information to construct your own Fortran programs. However, if you need further information there are many books on the subject as well as web sites. One book is by T.M.R. Ellis, Fortran 77 Programming (2nd Edition, Addison-Wesley, 1990), and there are copies available in the Physics library.


Why Fortran?

Fortran (the name derives from FORmula TRANslation) is still the most important scientific programming language. It is the oldest language in current use, and with the recent publication of a new standard (Fortran 90) it is likely to continue in use for many years. Fortran is also the language of choice for most final year projects.

Also, experience has shown that the older generation of computer languages, such as Basic, Fortran and Pascal, are much easier to learn than the newer object oriented languages, such as C++.

We will be using Fortran 77, which is an industry standard. However, everything we cover is also included in the new Fortran 90 standard.


Introduction to Fortran

  1. Getting Started

  2. Arrays and Intrinsic Functions

  3. IF Statements and Subroutines

  4. Parameter Statements and User Defined Functions

  5. Use of External Files

  6. Conclusions

Appendix A: Model answers
Solution to Exercise 1(a).
Solution to Exercise 1(b).
Solution to Exercise 2.
Solution to Exercise 3(a).
Solution to Exercise 3(b).
Solution to Exercise 4.
Solution to Exercise 5(a).
Solution to Exercise 5(b).


Return to Dr. Alex Brown's Home Page

This page maintained by alex.brown@ualberta.ca
of the Department of Chemistry, University of Alberta

Last updated August 8, 2003.