Fortran
Overview
Fortran remains dominant in high-performance computing: weather, finite-element, CFD, and legacy scientific codes. Modern Fortran 2008/2018 adds coarrays, modules, and OO features while keeping array-oriented syntax that maps well to vectorized hardware.
Key concepts
- Array operations — Whole-array math and slicing.
- Modules — Encapsulate procedures and data.
- Kinds — Parameterized numeric precisions (
real(kind=dp)). - Coarrays — Parallel programming without always resorting to MPI.
- Legacy interop — Linking C and Fortran via
iso_c_binding.
Compile workflow
Sample: vector norm
program demo
implicit none
real, dimension(3) :: v = [3.0, 4.0, 0.0]
print *, sqrt(sum(v * v))
end program demo