Class Information: 2019

Fortran 95 compilers

The most convenient way to do the exercises might be 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. For Windows, the silverfrost compiler seems to work well: this is free on your own computer, but on an ETH-owned machine it would be necessary to buy a license. Possibly the best compiler is the one by Intel, which works on Windows, MacOSX and Linux. ETH has a site license for it that employees can use, but unfortunately this isn't available for masters students. A drawback is that your computer must be networked so it can connect to the central ETH license server.

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

silverfrost (for Windows): free for personal use, download from

Intel Fortran Compiler: ETH employees (e.g. doctoral students) can download from - it is included in the Intel Studio XE package. Documentation here.

Useful editors that highlight Fortran syntax: emacs or xemacs (unix-based); for MacOSX: aquamacs (here)

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

Topics to be covered

Class schedule and handouts (including exercises)

Fortran Topics Numerical Topics Download
1 (23.09) History, basics, simple programs   Class1.pdf
2 (30.09) More basics, interactive I/O, do loops, functions&subroutines Finite differences Class2.pdf MeanStdInput.dat
.. (07.10) NO LECTURE    
3 (14.10) Modules, ascii file I/O, Array functions, assumed size arrays. 1-D & 2-D diffusion equations Class3.pdf Diffusion2D_parameters.dat
.. (21.10) NO LECTURE    
4 (28.10) Precision, formatted I/O. Streamfunction. Upwind advection. 2-D advection-diffusion. Class4.pdf AdvDif_parameters.dat
5 (04.11) Derived types. Keyword&optional arguments. where, forall. Character string manipulation. Recursive functions. Iterative & multigrid solvers. Jacobi & Gauss-Seidel iterations. Program 2D Poisson solver. Class5.pdf relaxIN.txtVcycle.f90
6 (11.11) Binary I/O. Convection (2-D, infinite-Prandtl). Class6.pdf convection_parameters.txt
7 (18.11) Makefiles.Intrinsic functions. Pointers. Writing fast code (optimisation).   Class7.pdf
8 (25.11) Generic procedures, operators and overloading. Finite (low) Prandtl number convection. Class8.pdf lowPrandt_parameters.txt lowPrandt_parameters_EMPTY.txt
9 (02.12) Parallel computing. Implicit timestepping. Class9.pdf
....(09.12) NO LECTURE    
10 (16.12) Review. Fortran 2003, 2008 & 2018 features, discussion. Libraries.   Class10.pdf