Fortran for Scientific and High Performance Computing

Description: This class attempts to answer the question often asked from the research community: Do you still support FORTRAN? While to many FORTRAN sounds like Latin, a dead, ancient language with its glory in the past, the reality is quite different. Modern Fortran, as its name, is spelled differently today and very much alive, still widely used. Fortran has undergone significant modifications and improvement in the past two decades -- an evolution on a scale rarely seen in any other languages. If you use MATLAB, you will find Fortran has the identical syntax and simplicity in array operations, yet achieves a much higher performance.

With the latest Fortran standard, the language has gained many modern features, become very different from its ancestor, leaving behind archaic ones like column-oriented formatting, common blocks and a proclivity for UPPER CASE EVERYTHING. Inherited from old FORTRAN standards and enhanced by the newer ones, Fortran is still among the top candidates for scientific computing for its strength in REAL and COMPLEX intrinsics, array processing and floating point operations. Its array handling, enhanced by index looping, makes array processing similar or identical to its counterparts, such as MATLAB, hence superior to other programming languages. The unified interface of intrinsic functions for all data types makes translating mathematical expressions to computer programmes much cleaner and easier.

We will focus on the language features supported by the current Fortran standard. In particular we will walk through the following aspects with examples: dynamic allocations, block access of arrays, derived data types and data structures, specifiable precisions, modules, inquiry functions, function overloading and optional arguments, etc. In particular, we will examine the parallel programming features brought into the language: DO CONCURRENT construct for concurrency and Coarray (formerly known as Coarray Fortran) that allows global addressing of arrays on shared and distributed memory architectures. We will present the materials with easy-to-follow examples, with comparison to the closest dialect MATLAB wherever applicable, in hope the attendees, especially those who use MATLAB, could appreciate the clarity, simplicity and similarity.

The class will include lecture and hands-on exercises.

Instructor: Ge Baolai, SHARCNET, Western University.

Prerequisites: No prior experience is required, however, knowing a programming language such as C or C++ would be helpful. Being familiar with MATLAB will be an asset. The attendees are assumed to have some knowledge in numerical methods, as the examples presented in the class will be given in the context of scientific computing.