Introduction to the Compiler
The NAG Fortran Compiler is based on the NAGWare f90 Compiler which was the
world's first Fortran 90 compiler. The design goals of the development were to
produce a compiler with the following characteristics:
compiles standard Fortran to host-compatible C;
good speed of compilation, reasonable efficiency of execution;
good error checking, comprehensible error messages;
full standard implementation, standard-conforming compiler
(i.e. all constraints identified);
compiler written in C;
maintainability, portability and re-usability.
The compiler is multi-pass; the passes have been kept distinct to
improve maintainability and to allow re-use of the components.
- Pass 1:
- Lexical and syntactic analysis, build symbol table and abstract syntax tree.
- Pass 2:
- Semantic analysis, annotate parse tree and fill in symbol table;
all major error and constraint detection takes place in this pass.
- Pass 3:
- Code generation by parse tree transformation.
- Pass 4:
- Code output, generate declarations and flatten transformed parse tree to C
- Pass 5:
- Compilation using the host operating system's C compiler.
- Pass 6:
- Linking to executable code using the host system's linker,
including linking in the Fortran run-time libraries.
Other Fortran-related Activities at NAG
NAG has released several Fortran-based numerical procedure libraries: the
Fortran Library, SMP Library, Parallel Library and the Fortran 90 Library.
A number of implementations of these libraries, using the NAG compiler and
other compilers, are available.
NAG has supported the development and standardisation of Modern Fortran,
participating both in ISO/IEC JTC1/SC22 Working Group 5, and the technical development
The head of the NAG compiler team, Malcolm Cohen, is the current Project Editor of
the ISO/IEC Fortran standard.
From this it can be seen that NAG is committed to Fortran.
This is the documentation for the NAG Fortran Compiler. This is
not intended to be a language description or tutorial, but rather a
guide to the use of the software and a quick reference for some of the
features of the language.
The compiler is a full implementation of the Fortran 2003 programming language
[ISO/IEC 1539-1:2004(E)], with most of the features from the Fortran 2008 standard
[ISO/IEC 1539-1:2010(E)] and some from the latest Fortran 2018 standard