Class Information: 2022

Fortran compilers

The most convenient way to do the exercises is on your own computer after installing a compiler. The main choices are listed below. gfortran is the most universal/popular, is completely free and can be used on Windows, MacOSX or Linux. The Intel compiler is probably the best compiler, is available free to individuals, and also works on Windows, MacOSX and Linux.

gfortran: Developed by the GNU, the free software foundation. See

Intel Fortran Compiler: This is available either (i) free to everyone directly from Intel as part of the oneAPI HPC Toolkit (here), which can use the (Visual Studio 2019) Application Programming Interface (make sure to install "Desktop development with C++") (ii) free to ETH employees (e.g. doctoral students) from the IT shop.

A good editor that highlights Fortran syntax is also very useful. Emacs is a good one: for Mac the Aquamacs version is nice, for Windows download the emacs-w64 version. Another suitable one for Windows is Kate.

Free resources on the internet

1. A manual. A good one is the Intel Fortan Language Reference Manual.

2. Tutorials

3. General information and/or pages of links to relevant sites

4. Unix tutorials (if using MacOS, Linux or Windows+Cygwin)

Provisional schedule (including exercises)

For files go to the MOODLE site

Fortran Topics Numerical Topics
1 (26.09) History, basics, simple programs  
2 (03.10) More basics, interactive I/O, do loops, functions&subroutines Finite differences
3 (10.10) Modules, ascii file I/O, Array functions, assumed size arrays. 1-D & 2-D diffusion equations
4 (17.10) Precision, formatted I/O. Streamfunction. Upwind advection. 2-D advection-diffusion.
5 (24.10) Derived types. Keyword&optional arguments. Character string manipulation. Recursive functions. Iterative & multigrid solvers. Jacobi & Gauss-Seidel iterations. Program 2D Poisson solver.
6 (31.10) Binary I/O. Convection (2-D, infinite-Prandtl).
7 (07.11) Makefiles. Intrinsic functions. Pointers. Writing fast code (optimisation).  
8 (14.11) Pure procedures, elemental procedures, generic procedures, operators and overloading. Finite (low) Prandtl number convection.
9 (21.11) Parallel computing (MPI & Co-array)  
10 (28.11) Object-oriented programming OOP exercises
11 (05.12) Other new features Restructure convection using OOP
12 (12.12) Useful libraries. Summary and review. Implicit time-stepping
13 (19.12) Finalisation of exercises.