Class Information: 2025

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 http://gcc.gnu.org/wiki/GFortran.

Intel Fortran Compiler: This is available either (i) free to everyone for Linux and Windows only directly from Intel as part of the oneAPI HPC Toolkit (here), which can optionally use an Application Programming Interface such as Visual Studio 2019 (make sure to install "Desktop development with C++") or Visual Studio Code (ii) free to ETH employees (e.g. doctoral students) for Linux, Windows and MacOS from the IT shop (Intel Parallel Studio XE 2020).

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. Visual Studio Code is also very useful.

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, Windows+Cygwin or WSL)

Provisional schedule (including exercises)

For files go to the MOODLE site

Fortran Topics Numerical Topics
1 (22.09) History, basics, simple programs  
2 (29.09) More basics, interactive I/O, do loops, functions&subroutines Finite differences
3 (06.10) Modules, ascii file I/O, Array functions, assumed size arrays. 1-D & 2-D diffusion equations
4 (13.10) Precision, formatted I/O. Streamfunction. Upwind advection. 2-D advection-diffusion.
5 (20.10) Derived types. Keyword&optional arguments. Character string manipulation. Recursive functions. Iterative & multigrid solvers. Jacobi & Gauss-Seidel iterations. Program 2D Poisson solver.
6 (27.10) Binary I/O. Convection (2-D, infinite-Prandtl).
7 (03.11) Makefiles. Intrinsic functions. Pointers. Writing fast code (optimisation).  
8 (10.11) Pure procedures, elemental procedures, generic procedures, operators and overloading. Finite (low) Prandtl number convection.
9 (17.11) Parallel computing (MPI & Co-array)  
10 (24.11) Object-oriented programming OOP exercises
11 (01.12) Other new features Restructure convection using OOP
12 (08.12) Useful libraries. Summary and review. Implicit time-stepping
13 (15.12) No class.