Location:

This course will take place face-to-face at Durham

This course will not be streamed online and a recording will not be made.

Target Audience:

This course is aimed at users and developers who know how to program, but have little or no experience in Fortran, and those who may wish to have a refresher in Fortran.

Outline

Fortran (a contraction of Formula Translation) was the first programming langauge to have a standard (in 1954), but has changed significantly over the years. More recent standards (the latest being Fortran 2018) come under the umbrella term “Modern Fortran”. Fortran retains very great significance in many areas of scientific and numerical computing, particularly for applications such as quantum chemistry, plasmas, and in numerical weather prediction and climate models.

This course provides an introduction to the basics of writing Fortran. It will cover basic syntax, variables, expressions and assignments, flow of control, and introductions to i/o and user-defined types. Common Fortran idioms are introduced and contrasted with those available in C-like languages; the course will try to focus on real usage rather than formal descriptions.

At the end of the course you should be able to understand many Fortran programs and be confident to start to write well-structured and portable Fortran. Fortran is a rather “large” language, so it is not possible to cover all its features in a two day course. Further elements of Fortran are discussed in the “Intermediate Modern Fortran” course.

Prerequisites:

Attendees must be familiar which the basic concepts of programming: variables, logic, flow of control, loops, functions and so on. No knowledge of Fortran is assumed. Previous programming experience might typically be in the context C/C++ or python. If you know no programming, we suggest this course on Fortran is not the place to start.

Requirements:

The course requires a Fortran compiler, for which a local machine or laptop may be appropriate [1]. If you do not have access to a Fortran compiler, course training accounts on ARCHER2 will be available which provide access to various compilers. Use of a text editor will be required (some may prefer an IDE, but we do not intend to consider or support IDEs).

[1] This may typically be gfortran, freely available as part of Gnu Compiler Collection (GCC). See e.g., https://gcc.gnu.org/wiki/GFortranBinaries

Participants must bring a laptop with a Mac, Linux, or Windows operating system (not a tablet, Chromebook, etc.) that they have administrative privileges on.

They are also required to abide by the ARCHER2 Code of Conduct.

Timetable:

** DAY ONE

09:30 Getting started
10:00 Background and "Hello World"; variables; logic and flow of control
11:00 Break
11:30 Arrays; loops and flow of control; array notation


13:00 Lunch
14:00 I/O and files
15:00 Break
15:30 Modules and compilation of modules; scope
16:30 Finish

** DAY TWO

09:30 Functions; results, intent, inteface blocks; ...
10:00 Arrays; pointers and targets
11:00 Break
11:30 Structures: types

13:00 Lunch
14:00 Putting it all together: a longer programming exercise
16:00 Other things you may see in real programs; testing; tools.
16:30 Finish

Course materials

Feedback