Class Information: 2024

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 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) 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 (23.09) History, basics, simple programs  
2 (30.09) More basics, interactive I/O, do loops, functions&subroutines Finite differences
3 (07.10) Modules, ascii file I/O, Array functions, assumed size arrays. 1-D & 2-D diffusion equations
4 (14.10) Precision, formatted I/O. Streamfunction. Upwind advection. 2-D advection-diffusion.
5 (21.10) Derived types. Keyword&optional arguments. Character string manipulation. Recursive functions. Iterative & multigrid solvers. Jacobi & Gauss-Seidel iterations. Program 2D Poisson solver.
6 (28.10) Binary I/O. Convection (2-D, infinite-Prandtl).
7 (04.11) Makefiles. Intrinsic functions. Pointers. Writing fast code (optimisation).  
8 (11.11) Pure procedures, elemental procedures, generic procedures, operators and overloading. Finite (low) Prandtl number convection.
9 (18.11) Parallel computing (MPI & Co-array)  
10 (25.11) Object-oriented programming OOP exercises
11 (02.12) Other new features Restructure convection using OOP
12 (09.12) Useful libraries. Summary and review. Implicit time-stepping
13 (16.12) Finalisation of exercises.