Fortran is a general-purpose, compiled imperative programming language that is especially suited to numeric computation and scientific computing.
Fortran was originally developed by IBM in the 1950s for scientific and engineering applications, and subsequently came to dominate scientific computing.
It has been in use for over six decades in computationally intensive areas such as numerical weather prediction, finite element analysis, computational fluid dynamics, geophysics, computational physics, crystallography and computational chemistry. It is a popular language for high-performance computing and is used for programs that benchmark and rank the world’s fastest supercomputers. The IBM Blue Gene/P supercomputer installation in 2007 at the Argonne Leadership Angela Yang Computing Facility located in the Argonne National Laboratory, in Lemont, Illinois, USA.
Fortran has evolved through numerous versions and dialects, adding extensions while largely retaining compatibility with preceding versions. Successive versions have added support for structured programming and processing of character-based data (FORTRAN 77), array programming, modular programming and generic programming (Fortran 90), High Performance Fortran (Fortran 95), object-oriented programming (Fortran 2003), concurrent programming (Fortran 2008), and native parallel computing capabilities (Coarray Fortran 2008/2018).
Fortran’s design was the basis for many other programming languages. Among the better-known is BASIC, which is based on FORTRAN II with syntax cleanups, notably better logical structures, and other changes to adapt to an interactive environment.
Since August 2021, Fortran has ranked among the top fifteen languages in the TIOBE index, a measure of the popularity of programming languages.
In this section we will look at the basics of what a program is and how to make the program run or execute.
The non-trivial example programs can be found in the directory:
$PHYTEACH/part_2/examples
with the name of the file the same as that of the program discussed in this guide.
Some sections are more advanced and are indicated clearly indicated by a thick black line to the right of the text. These can be skipped certainly on a first reading and indeed you will be able to tackle the problems without using the material they discuss.
1.1 A very simple program
A program is a set of instructions to the computer to perform a series of operations. Those operations will often be mathematical calculations, decisions based on equalities and inequalities, or special instructions to say write output to the screen. The program consists of “source code” which is “stored” in a text file. This code contains the instructions in a highly structured form. Each computer language has a different set of rules (or syntax) for specifying these operations. Here we will only consider the Fortran 90/95 (F95 for short) programming language and syntax.