NAG Fortran Compiler

The checking compiler for improved code portability and detailed error reporting
Unrivalled Reliability
Extensive support for Fortran plus parallel programming with 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 (6.1) has extensive support for both modern and legacy Fortran features, and also supports parallel 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

OpenMP 3.1 and an integrated suite of tools – it’s all in there

The NAG Fortran Compiler provides support for Fortran 2008 (partial), Fortran 2003 (almost complete), Fortran 95 and OpenMP 3.1. All platforms include supporting tools for software development: a Fortran pretty printer, 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 95 language with the addition of almost all Fortran 2003, some Fortran 2008 and OpenMP 3.0 and 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

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
  • Precision unifier (nagfor =unifyprecision)
  • Additional options for the polish tool
  • Improved interface-block generator
  • Full-standard implementation of Fortran 2008 features, almost all of Fortran 2003
  • Complete support for OpenMP 3.1
  • Extensive code analysis with informative diagnostics
  • Wide range of run-time checking options, including for undefined variables and integer overflow
  • Integrated companion tool suite
  • Facility for tracing memory allocation and deallocation

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.