NAG Fortran Compiler

The checking compiler for improved code portability and detailed error reporting
Unrivalled Reliability
Extensive support for Fortran including parallel programming with coarrays and OpenMP

The NAG Fortran Compiler is robust, highly tested, and valued by developers all over the globe for its checking capabilities and detailed error reporting. The NAG Fortran Compiler is available on Linux, Microsoft Windows and Mac OS X. The latest release (7.0) has extensive support for legacy and modern Fortran features including parallel programming with coarrays, as well as additional support for programming with OpenMP..

Cleaner code = fewer mistakes

My programs are much cleaner thanks to the new features in the NAG Fortran Compiler. This may seem like a minor issue, but there are literally hundreds of routines in my programs which pass arrays between them, and simpler interfaces lead to fewer mistakes. It's also useful to be able to write subroutines which decide the size of their return arrays internally, and to have allocatable arrays as structure components. Ian Thompson, Research Associate at Loughborough University

Fortran 2018 and an integrated suite of tools

The NAG Fortran Compiler provides significant support for Fortran 2018 (atomic operations, events and tasks, plus other smaller features), almost all of Fortran 2008, complete coverage of Fortran 2003, and all of OpenMP 3.1. All platforms include supporting tools for software development: source file polishers, dependency generator for module and include files, call-graph generator, interface builder and a precision unifier.

It is available on Linux, Microsoft Windows and Mac OS X platforms. For users preferring an Integrated Development Environment (IDE) on Microsoft Windows or Apple Mac, NAG has developed NAG Fortran Builder.

How to Use the NAG Compiler and Fortran Builder - Part 1

Fewer mistakes in code
Deliver competitive advantage
Quality assured
Active development
Product Details

The NAG Fortran Compiler is a full standard implementation of the ISO Fortran 2003 language with the addition of most of Fortran 2008, significant parts of Fortran 2018, and all of OpenMP 3.1. Its development is based on the NAGWare f90 Compiler which was the world's first Fortran 90 compiler. Like its predecessor, the NAG Fortran Compiler has been thoroughly tested and widely used since its launch in 1997.

In addition, some common extensions to Fortran 77 are allowed to provide support for legacy code. For example, the NAG Fortran Compiler allows processing of code containing tab format input, byte-sized declarations (e.g INTEGER*2) and DOUBLE COMPLEX.

Extensive error messages are given by the Compiler, both those required by the ISO standard and additional compile and run-time information. The messages are informative rather than cryptic and usually contain context information to assist in identifying and rectifying problems. For this reason the Compiler is particularly suited to teaching and for programmers wishing to update their skills to the new language. Programmers who wish to produce portable, standard-conforming code will benefit from the analysis carried out by the Compiler.

The NAG Fortran Compiler features many optional run-time checks, including - array bounds, pointer association, pointer references, procedure references, dangling pointers and undefined variables. There are also facilities to trace memory allocation and deallocation and help to identify memory leaks.

Compile-time error messages may optionally be colour coded, to highlight serious errors. An option is provided to produce a traceback showing the call stack if a run-time error occurs.

Built-in modules provide an interface to a large number of Posix system calls, e.g. SYSTEM, and many others.

Automatic garbage collection is available as an option. This prevents memory leaks by deallocating memory that can no longer be accessed by the program.

In addition the Compiler provides software tools to: convert fixed-format code to free-format; pretty print ("polish") code; list dependency information of modules and include files; produce callgraphs; and generate explicit procedure interfaces as module or INCLUDE files.

The NAG Fortran Compiler is available on a range of platforms. For up-to-date information see our download page.

If your machine and operating system combination are included in the current list of implementations then the only additional requirement is that you have a C compiler available, except on Microsoft Windows where the required C compiler is included in NAG Fortran Builder. In general this will be the default C compiler for the target machine, e.g. gcc.

If you require any further information on availability then please contact us to advise us of your requirements.

Recent Enhancements
  • Parallel execution of coarray programs on shared-memory machines;
  • Half precision floating-point conforming to the IEEE arithmetic standard, including full support for all exceptions and rounding modes;
  • Submodules, a Fortran 2008 feature for breaking large modules into separately-compilable files;
  • Teams, a Fortran 2018 coarray feature for structuring parallel execution;
  • Events, a Fortran 2018 coarray feature for lightweight single-sided synchronisation;
  • Atomic operations, a Fortran 2018 coarray feature for updating atomic variables without synchronisation.

Services and Support

Outstanding service and support from our expert team
First line technical support when you need it

NAG’s Technical Support Service is provided by a team of specialists in numerical and statistical software development, in fact the NAG Library and Compiler development team share responsibility for the support of our software. We strongly believe that in order to effectively support complex software the technicians must be both experienced and understand the intricacies of the computational techniques. This conviction is reflected in the composition of the team most of whom are qualified to PhD level and have combined experience of software support in excess of 50 years.

NAG accuracy is quality assured

NAG provides accurate, documented, numerical software to help you make sure that your results are accurate. The validity of each NAG routine is tested for each platform that it is enabled for. Only when an implementation satisfies our stringent accuracy standards is it released. As a result, you can rely on the proven accuracy and reliability of NAG to give you the right answers. NAG is an ISO 9001 certified organization.

Reap the benefits of NAG expertise

The numerical codes that underpin the results from your software are not future proof. While the mathematics does not change, the codes have a limited lifespan because of new hardware structures, mathematical innovation and changes in application needs. NAG Numerical Services help you and your organization find and implement the optimum numerical computation solutions. NAG works with your team to impart skills and techniques that will help solve your numerical software problems.

Expert teaching and instruction from numerical experts

Your users, developers and managers can all benefit from NAG's highly regarded training courses. All of the training courses shown below have been delivered successfully either from NAG offices or at client premises. Training courses can be tailored to suit your particular requirements and be targeted to novice, intermediate or experienced levels. Specialized mentoring and development programs are also available for HPC managers.

Working in collaboration with industry and academia

NAG was founded on collaboration as an inter-University collaborative venture combining the talents of mathematicians and computer scientists. NAG has continued to collaborate with individuals and organizations over the past four decades and today longstanding and new partners are delivering tangible benefits to users and students all over the world.