Home

Fortranstyle

Fortranstyle is a term used to describe a coherent set of coding conventions and practices intended for Fortran software development. It emphasizes readability, portability, and maintainability across Fortran dialects (Fortran 90/95, 2003, 2008, and later) and compiler implementations. While not an official standard, it is adopted by groups and projects to ensure consistent codebases.

Core principles include explicit typing using implicit none; modular design with programs, modules, and procedures; descriptive

Formatting and layout practices typically cover indentation (commonly 2–4 spaces), consistent line breaks, and clear continuation

Adoption varies by project but is common in scientific and high-performance computing where large legacy codebases

identifiers
and
consistent
naming
schemes;
and
documentation
via
inline
comments
using
the
“!”
character
and,
where
appropriate,
external
documentation.
Code
should
minimize
global
state
and
avoid
nonlocal
side
effects;
prefer
explicit
interfaces
for
procedures,
using
modules
and
interface
blocks
rather
than
implicit
interfaces.
Use
of
modern
Fortran
features
such
as
array
operations,
elemental
and
pure
procedures,
and
modules
for
data
encapsulation
is
encouraged.
rules
in
free-form
source
(using
“&”
to
join
lines,
avoiding
hard-wrap
in
the
middle
of
logical
statements).
Local
variable
scope
should
be
clear,
with
explicit
intents
for
dummy
arguments
(intent(in),
intent(out),
intent(inout)).
migrate
to
modern
Fortran.
The
aim
is
to
improve
portability,
error
detection,
and
long-term
maintainability,
while
preserving
the
expressive
power
of
the
language.