Class Information: 2021

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 (27.09) History, basics, simple programs  
2 (04.10) More basics, interactive I/O, do loops, functions&subroutines Finite differences
3 (11.10) Modules, ascii file I/O, Array functions, assumed size arrays. 1-D & 2-D diffusion equations
4 (18.10) Precision, formatted I/O. Streamfunction. Upwind advection. 2-D advection-diffusion.
5 (25.10) Derived types. Keyword&optional arguments. Character string manipulation. Recursive functions. Iterative & multigrid solvers. Jacobi & Gauss-Seidel iterations. Program 2D Poisson solver.
6 (01.11) Binary I/O. Convection (2-D, infinite-Prandtl).
7 (08.11) Makefiles. Intrinsic functions. Pointers. Writing fast code (optimisation).  
8 (15.11) Pure procedures, elemental procedures, generic procedures, operators and overloading. Finite (low) Prandtl number convection.
9 (22.11) Fortran 2003-2018: Advanced type features.  
10 (29.11) Parallel computing. Implicit timestepping.
11 (06.12) More Fortran 2003-2018 features. Useful libraries.  
12 (13.12) Summary and review. To be decided
13 (20.12) Finalisation of exercises.