Class Information: 2012

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 http://gcc.gnu.org/wiki/GFortran. Recent versions of Linux will have this on the installation disk. For MacosX, make sure you first install Xtools (up to Snow Leopard this is on the installation disk; from Lion it is an App that can be downloaded); and a convenient place to download is http://hpc.sourceforge.net. For Windows I recommend using gfortran with the cygwin environment (www.cygwin.com)

silverfrost (for Windows): free for personal use, download from http://www.silverfrost.com/.

Intel Visual Fortran Compiler: download from ides.ethz.ch. Documentation here.

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

Free resources on the internet

1. A manual. A good one is the Intel Fortan Language Reference Manual (download PDF file from Intel).

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)

Main Topics Download
1 (20.09) History, basics, simple programs pdf
2 (27.09) More basics, interactive I/O, do loops, functions&subroutines, finite differences pdf
3 (04.10) Modules, ascii file I/O, Array functions, assumed size arrays. Solve 1-D diffusion equation. pdf
4 (11.10) Precision, namelists, formatted I/O. Solve 2D diffusion. pdf
5 (18.10) Derived types. Binary I/O. Keyword&optional arguments. where, forall. Character string manipulation. Streamfunction, upwind advection, solve advection-diffusion. pdf
6 (25.10) Recursive functions. Iterative & multigrid solvers. Jacobi & Gauss-Seidel iterations. Program 2D Poisson solver. pdf Vcycle2.f90
...(01.11) NO CLASS  
7 (08.11) Pointers. Generic procedures, operators and overloading. Program convection code. pdf
8 (15.11) Makefiles. Finite (low) Prandtl number convection. pdf
9 (22.11) Parallel computing. pdf
10 (29.11) Writing fast code (optimisation). Implicit timestepping. pdf
... (06.12) NO CLASS  
11 (13.12) Libraries. Review, Fortran 2003&2008 features, discussion pdf