Getting started

Fortran is the language numerical code still reaches for, and these ten lessons put a compiler on the machine and a first program through it. They cover what the language is and which standard a compiler follows, the install pages, the edit-build-run loop with gfortran and gdb, the program units and source forms, and IMPLICIT NONE, which every later lesson assumes.

001 What Fortran is and where it runs the language, the standards from FORTRAN 77 to Fortran 2023, where numerical code still uses it, gfortran and a first build Open 002 Install gfortran on Linux, macOS and Windows the packages per system, the install pages of the course, the version this course uses and a first compile Open 003 An editor, gfortran and gdb the edit-build-run loop, gfortran diagnostics while writing, gdb in batch mode and what this toolchain lacks Open 004 Your first Fortran program hello.f90 line by line, PROGRAM and END PROGRAM, PRINT *, the exit status and a missing END Open 005 Warnings, errors and gfortran diagnostics unused names, uninitialised values, -Wall -Wextra and the first error line read in full Open 006 Program units: program, module, subroutine, function the four units, what each one may hold, and the order gfortran compiles them in Open 007 Free form and fixed form columns 1 to 6, the C comment, the continuation column, -ffixed-form and why .f90 is free form Open 008 IMPLICIT NONE and implicit typing implicit typing by first letter, the typo it hides, IMPLICIT NONE in every unit and the error it gives Open 009 Declarations, initialisation and SAVE type declarations, ::, initialisation in the declaration, SAVE and the value that survives a call Open 010 Style and modern practice names, indentation, one idea per line, IMPLICIT NONE and INTENT as rules, and the features to prefer Open

Lessons