What is Fortran and where it runs

Contents
What Fortran is
Where Fortran runs
Why Fortran endures
Modern Fortran

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.

Next: Install gfortran

Article author: Arthur Isaev

Related articles
Fortran
Fortran course: zero to hero in 50 lessons
What is Fortran and where it runs
Install gfortran
Your first program
Program structure
Types: integer real complex logical character
Kind parameters
Operators
Conditions
DO loops
Arrays
Array sections
Character strings
Formatted IO
Files
Subroutines and functions
Modules
USE with ONLY
INTENT
OPTIONAL and PRESENT
Explicit interfaces
Derived types
Type-bound procedures
Object orientation
Operator overloading
Finalization
Allocatable arrays
Pointers in Fortran
DO CONCURRENT
Coarrays
OpenMP basics
Namelists
IEEE arithmetic
Intrinsic matrix math
Random numbers
String tools
Command-line arguments
Environment variables
error stop
Testing
Build with gfortran and make
Debugging
C interoperability
From fixed form to free form
Numeric models
Performance
Modern Fortran tour: 2008, 2018, 2023
Capstone: stats tool
Capstone: 1D heat equation
Style guide
Hero roadmap: the whole course on one page
Install gfortran on Windows 11
Install gfortran on Ubuntu
Install gfortran on Rocky Linux
Install gfortran on macOS
Install gfortran on FreeBSD
Fortran in Docker

Search this site

Channel @aofeed Chat @aofeedchat

Contacts and cooperation:
I recommend our hosting beget.com
Write to info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: