Learn to Code in 7 Lessons with FORTRAN 90/95

About FORTRAN Tutorial

What this course is for

This FORTRAN study guide is a "hands on" introduction to programming using FORTRAN. The emphasis in this course is to learn how to program rather than to learn FORTRAN. My experience is that most people who need to write computer programs know several languages, and often these are self taught. Once you have a firm concept of what programming is all about you will find it easy to learn other languages. I'm focussing on programming best practice - this is not intended to be an in-depth study of FORTRAN.

Why FORTRAN?

I have chosen FORTRAN for a number of reasons. It’s a good language for beginners as it is easy to learn and widely available. It is particularly useful for scientists and engineers as there are inbuilt functions for handling mathematical constructs such as matrices. The precision of calculation can be selected according to the need of the calculation. There are libraries of numerical algorithms available that shortcut coding. As this is a beginner's guide I have focussed on the core language. The examples will compile perfectly well with FORTRAN 90 or 95.

Why Silverfrost FORTRAN?

There are several free compilers and integrated developer environments available, but I have many years experience of the Silverfrost FORTRAN compiler, and PLATO IDE. They are free for personal home use. I recommend it because it is very easy to use and install. It comes with a built in debugger so you can check your code for errors at run time. The supplied library provides a wealth of high level subroutines and functions such as data sorting routines, serial communications, random numbers, and many more.

In suggesting that you use Silverfrost, I am in no way suggesting that it is in any way superior to other FORTRAN compilers that are on the market. For a good list of compilers I suggest you check http://www.thefreecountry.com/compilers/fortran.shtml.

How to use this course

Before you start the course, you should install the compiler.This is described in Worksheet 1.

It is very likely that if you have come to this site, you may well be inexperienced with programming in general and with FORTRAN in particular. Some of the terms I am using like "IDE" may also be meaningless to you, at this stage. This short course assumes no previous programming knowledge whatsoever, and all the terms will be explained in the worksheets.

The course was originally given as seven one-hour "hands on" programming sessions for second year mathematics and engineering undergraduates. I have rewritten the course for delivery via web pages, but it can also be downloaded in PDF format if you prefer.

The course makes use of several examples programs that are all available for download from this website.

Using the Resources

The worksheets and example programs may be used for educational purposes. Please read the conditions carefully on the downloads page if you wish to redistribute the resources.