What is Fortran and where it runs

What Fortran is

Fortran is a compiled programming language built for numerical work: simulations, engineering models, weather codes, and number crunching.

You write readable source code, the compiler checks it and turns it into fast machine code, and the result runs directly on the processor without a virtual machine.

A complete program can be very short. Here is the classic first example in modern free form Fortran.

program hello implicit none print *, "Hello, Fortran" end program hello

Every lesson in this course uses the same modern style: free form source, implicit none in every program unit, and standard code that gfortran accepts.

Where Fortran runs

Fortran runs on all common desktop and server systems: Linux, macOS, and Windows.

The free gfortran compiler is available on each of them, and the same standard code compiles everywhere with almost no changes.

Large models often run on clusters and supercomputers, while students and engineers run the same language on a laptop for learning and small projects.

Why Fortran endures

Fortran stays popular because arrays and math are built into the language, not added as an afterthought.

Whole-array operations, complex numbers, and modules for large programs make numerical code short and clear, and decades of libraries keep old code useful.

Compilers are excellent at optimization, so straightforward loops and array expressions often run as fast as hand tuned code in other languages.

Modern Fortran

This course teaches modern Fortran as defined by the Fortran 2008 and Fortran 2018 standards.

That means free form source files, modules instead of common blocks, dynamic arrays, and clear procedures. There is no fixed form, no goto, and no legacy tricks.

Start by installing gfortran, then write the first program and build from there lesson by lesson.

The code on this page was run with gfortran 15.2.0 on Alpine Linux 3.24 (x86_64) in a Docker container.

Article author: Arthur Isaev