Fortran 90, 95, 2003, 77 Information Resources

Ian Chivers and Jane Sleightholme

Contents :

  1. The development and evolution of Fortran

  2. Introducing Fortran 95: Ian Chivers and Jane Sleightholme

  3. Introduction to Programming, with coverage of Fortran 90, 95, 2003 and 77
    • Program Examples All of the program examples from this book in simple plain text format.

  4. The following are useful sources of Fortran information.
    • Fortran 90/95 FAQ This is a Fortran 90/95 FAQ, maintained by Michel Olagnon. It contains a wealth of useful information.
    • Fortran Information file This is maintained my Michael Metcalf.
    • Fortran FAQ - USENET News Version This is the USENET News Fortran FAQ. It contains a lot of information about Fortran, with some coverage of Fortran 90, but the main emphasis is Fortran 77.
    • BCS Fortran Specialist Group home page The Group was established in 1970 to provide an open forum for Fortran users. Its main aims are: to disseminate information about Fortran and its application in various fields, to provide a platform for discussion of users' needs and requirements in future versions of Fortran, to encourage the development of the language in collaboration with national and international standardization bodies, to promote the use of the Fortran language.

  5. Fortran 90 List There is a Fortran 90 list that covers all aspects of the new standard.
  6. Object Oriented Programming In Fortran 90 and 95 Here is a link to some current work in oo programming in F90 and details of a book on object oriented programming in Fortran 95.
  7. Computational Science Education Project Paper This paper provides an overview of the features of Fortran 90 and then provides a comparision of Fortran 77, Fortran 90, C and C++.
  8. Interactive Fortran 77: A Hands on Approach, Ian Chivers and Jane Sleightholme. Three electronic versions of this book are avaialble. Adobe Acrobat PDF and two compressed postscript versions, one pkzip, the other unix compress. All files are about 1.5 Mb.
  9. Additional information

  10. Additional sources of information about John Backus.
  11. Top


    1.0 Development and evolution of Fortran

    Fortran was one of the first high level languages developed and widely adopted by the academic and scientific community. It was developed over a three year period (1954-1957) by a team at IBM lead by John Backus. Fortran stands for FORmula TRANslation and was used mainly by people with a scientific background for solving problems with a significant arithmetic content.

    By 1966 and the first standard it was widely used, easy to teach, had demonstrated the benefits of subroutines and independent compilation, was relatively machine independent and often had very efficient implementations.

    By the 1970s it had started to show its age in relation to some of the other languages that had emerged and there was pressure on the X3J3 committee to incorporate changes to bring it more into line with mainstream language development. It was standardised in 1978 (even though the next version was called Fortran 77) and whilst the changes that were made were on the welcome side many felt that they had not gone far enough.

    Other languages emerged and established themselves. Pascal, Ada, Modula 2, C, C++ all became rivals to Fortran in the scientific and academic communities.

    Fortran was next standardised in 1991 (yet again out by one) and called Fortran 90. This was major improvement and the changes are given below.

    Work continued and 1996 saw the publication of the 1995 standard. Details are given below.

    There are also two ISO Technical Reports that have been published on IEEE Floating Point Arithmetic and Allocatable Attributes. Details of these are given later.

    Work on Fortran 2003 is also quite well advanced and information is provided later.

    Top


    1.1 The new features of Fortran 90

    The new language features include:-

    • free source form:
      • names can be up to 31 characters in length
      • blanks are significant
      • lines up to 132 characters in length
      • up to 39 continuation lines
      • ; as statement separator for multiple statements per line
      • ! as comment symbol
      • include option for source text from files.

    • modern control structures
      • Fortran 90 has a modern DO statement, with CYCLE and EXIT options and the control part of the DO can be conventional iteration, WHILE or no control clause. There is also a CASE statement.

    • specification of numeric precision
      • There is now a clean way to control numeric precision.

    • whole array processing
      • It is now possible to treat arrays as whole objects and simply write

        A=B*SIN(A)

        where A and B are arrays.

    • dynamic behaviour, including allocate, deallocate, pointers, recursion

    • user defined data types

    • modules, and with them come
      • operator overloading
      • generic procedures

    Should I move to Fortran 90?

    Yes! In the same way that Fortran 77 displaced Fortran 66, Fortran 90 will displace Fortran 77. How many people are still using Fortran 66 compilers?

    As standard FORTRAN 77 is a complete subset it is possible to simply recompile your old code with the new compiler and develop new code in F90.

    This protects your investment in your old, working Fortran 77 code.

    The new features of the language bring it up to date and increase the range of problems that can be solved easily. The language provides a very good framework for modern software development. The separation of the implementation from the design is a very powerful tools for reliable software development. We see in the language the first steps to object orientation with encapsulation and a limited support for polymorphism, without the steep learning curve demanded by C++.

    Top


    1.2 The new features of Fortran 95

    The last revision was finalised in 1996. It is a relatively small change compared to the changes between the Fortran 77 and Fortran 90 standard. There are some major features and some minor corrections and clarifications. Some of these are to keep Fortran in step with the work in the HPF area.

    The major features include

    • FORALL statement and construct
    • pure and elemental user defined subprograms
    • initial association status for pointers
    • implicit initialisation of dervived type objects

    Minor features include

    • new intrinsic function NULL
    • new intrinsic function CPU_TIME
    • automatic deallocation of allocatable arrays
    • SIGN can distinguish between +0 and -0
    • comments in namelist input data
    • references to pure functions in specification expressions
    • changes to some intrinsic functions

    Details of the work in the areas of IEE Floating Point Arithmetic and Alloctable Attributes can be found at NAG .

    Top


    1.3 The new features of Fortran 2003

    The following is a verbatum extract from the September 2003 draft standard.

      Fortran 2003 contains several extensions to Fortran 95; among them are:

      (1) Derived-type enhancements: parameterized derived types (allows the kind, length, or shape of a derived types components to be chosen when the derived type is used), mixed compo-nent accessibility (allows different components to have different accessibility), public entities of private type, improved structure constructors, and finalizers.

      (2) Object oriented programming support: enhanced data abstraction (allows one type to ex-tend the definition of another type), polymorphism (allows the type of a variable to vary at runtime), dynamic type allocation, SELECT TYPE construct (allows a choice of execu-tion ow depending upon the type a polymorphic object currently has), and type-bound procedures.

      (3) The ASSOCIATE construct (allows a complex expression or object to be denoted by a simple symbol).

      (4) Data manipulation enhancements: allocatable components, deferred type parameters, VOL-ATILE attribute, explicit type specification in array constructors, INTENT specification of pointer arguments, specified lower bounds of pointer assignment and pointer rank remap-ping, extended initialization expressions, MAX and MIN intrinsics for character type, and enhanced complex constants.

      (5) Input/output enhancements: asynchronous transfer operations (allows a program to con-tinue to process data while an input/output transfer occurs), stream access (allows access to a file without reference to any record structure), user specified transfer operations for derived types, user specified control of rounding during format conversions, the FLUSH statement, named constants for preconnected units, regularization of input/output keywords, and ac-cess to input/output error messages.

      (6) Procedure pointers.

      (7) Scoping enhancements: the ability to rename defined operators (supports greater data ab-straction) and control of host association into interface bodies.

      (8) Support for IEC 60559 (IEEE 754) exceptions and arithmetic (to the extent a processors arithmetic supports the IEC standard).

      (9) Interoperability with the C programming language (allows portable access to many libraries and the low-level facilities provided by C and allows the portable use of Fortran libraries by programs written in C).

      (10) Support for international usage: (ISO 10646) and choice of decimal or comma in numeric formatted input/output.

      (11) Enhanced integration with the host operating system: access to command line arguments and environment variables, and access to the processors error messages (improves the ability to handle exceptional conditions).

    A very readable article by John Reid, the Working Group 5 convenor can be found at The new Features of Fortran 2003

    I've updated the original document so that the web links in this document are active, i.e. can be clicked on.

    I've found the pdf version the easiest to work with.

    Top


    2.0 Introducing Fortran 95: Ian Chivers and Jane Sleightholme

    Springer Verlag, ISBN 1-85233-276-X

    This is the recommended text. It is suitable for both beginners and experienced Fortran 77 programmers and some of the early material can be quickly covered in the latter case.

    Top


    4.0 Fortran 90 List

    comp-fortran-90 home page.

    This is a list dedicated to the latest developments with the Fortran language. In particular it looks at the developments that have taken place since the publication of the Fortran 90 standard, including HPF.

    If you want more information then follow the links.

    If you have any comments or suggestions to make regarding this list then please mail me as I am the primary list owner.

    Top


    5.0 Object Oriented Programming In Fortran 90 and 95

    The first reference is a book by Ed Akin called Object Oriented Programming via Fortran 90/95.

    Here is a synopsis from Amazon

    Learn how to write technical applications in a modern object-oriented approach, using Fortran 90 or 95. This book will teach you how to stop focusing on the traditional procedural abilities of Fortran and to employ the principles of object-oriented programming to produce clear, highly efficient executable codes. Get ready now to take advantage of all the features of the finalized, fully object-oriented Fortran 200X! In addition to covering the OOP methodologies the book also covers the basic foundation of the language and good programming skills, making the book valuable also as a good migration tool for experienced Fortran programmers who want to smoothly pick up the OOP paradigm. The author highlights common themes by using comparisons with Matlab and C++ and uses numerous cross-referenced examples to convey all concepts quickly and clearly. Complete code for the examples is included on the accompanying CD-ROM

    Here are links to work carried out in the US at UCLA under contracts from US-DOE and NSF, and at Jet Propulsion Laboratory, CIT under contract within NASA. The work looks at research in oo programming using Fortran 90.

    http://www.cs.rpi.edu/~szymansk/oof90.html

    Home page for this work

    Top


    6.0 Computational Science Education Paper

    Comparision of Fortran 77, Fortran 90, C and C++

    We have put up a postscript version of a paper by the Computational Science Education Project. This paper compares Fortran 77, Fortran 90, C and C++ using five criteria. The criteria are numerical robustness, data parallelism, data abstraction, object oriented programming and functional programming.

    This is an essential read for anyone wanting to know about the strengths and weaknesses of the above four languages in these areas.

    Fortran 90 and Computational Science

    Copyright (C) 1991, 1992, 1993, 1994, 1995 by the Computational Science Education Project.

    This electronic book is copyrighted, and protected by the copyright laws of the United States. This (and all associated documents in the system) must contain the above copyright notice. If this electronic book is used anywhere other than the projects's original system, CSEP must be notified in writing (email is acceptable) and the copyright notice must retain intact.

    The paper provides a brief overview of Fortran 90 before comparing C, C++, Fortran 77 and Fortran 90 using five criteria. The criteria are numerical robustness, data parallelism, data abstraction, object oriented programming and functional programming. They rank the four languages within each criteria. Possibly a little technical for someone with only a limited C or Fortran 77 background.

    Highly recommended for anyone wanting to bring themselves up to date with current language thinking.

    Postscript version of the above paper.

    Top


    7.0 Interactive Fortran 77: A Hands on Approach, Ian Chivers and Jane Sleightholme.

    Copyright on this book has reverted to Jane and I so we are making it available electronically. Further details are given below.

    If you need further information on any of the above then please contact Ian Chivers or Jane Sleightholme.

    Interactive Fortran 77: A Hands on Approach Ian Chivers and Jane Sleightholme.

    Copyright (C) Ian D Chivers and Jane Sleightholme.

    Legal comments

    Unless otherwise specified, Ian D Chivers and Jane Sleightholme hold all rights, including copyright and retains such rights. This work may be distributed in its entirety provided the work is distributed as a whole with this copyright notice intact.

    This work may not be distributed in hard copy or other machine readable form, redistributed, transmitted or translated without prior written authorization from Ian D Chivers and Jane Sleightholme.

    Commercial use can only be allowed by specific license agreements. The accuracy of this document cannot be guaranteed. Ian D Chivers and Jane Sleighthome make no warranty, either express or implied, with respect to the use of any information and assumes no liabilities for loss or damage, whether such loss or damage is caused by error or omission.

    If this electronic book is made available anywhere other than the original system, Ian Chivers or Jane Sleigholme must be notified in writing (email is acceptable) and the copyright notice must retain intact.

    PDF version

    Unix compressed postscript version

    PC pkzip postscript version

    Top


    8.0 Additional Information

    8.1 Fortran 95 Training

    King's College offers two Fortran 95 courses under the Trainit umbrella. These are


    Jane Sleightholme and I are available to deliver courses commercially and to other academic institions in the UK.

    We can also provide customised courses if necessary.

    Top


    8.3 PC Compilers under Microsoft Windows and Linux

    8.3.1 Overview

    There are a number of suppliers for the pc and some are listed alphabetically below:-

    Absoft
    Compaq - Nee Digital
    Intel
    Lahey/Fujitsu
    NAG
    Salford

    We have provided links to a comparision done by Polyhderon.

    8.3.2 Polyhedron PC Compiler Comparison

    Polyhedron are an independent firm of consultants specialising in a number of areas including scientific programming (molecular modelling, oil reservoir simulation, materials science etc), Windows system programming, graphics to name a few.

    They have produced a report comparing a number of pc compilers using quite a wide range of criteria.

    Polyhedron Home Page

    8.3.3 Some Criteria to Think About

    The choice of compiler will depend on your requirements and criteria you might apply and some we identified include:-

    undergraduate use at home
    postgraduate and staff use at home
    postgraduate and staff use at work on their own system
    costs
    numeric library support
    parallel support
    operating system
    technical support and maintenance
    annual upgrade costs

    8.3.4 NAG Library

    Nag provide the complete library for most pc compilers. It represents very good value for money for serious numerical work on the pc.

    King's College staff and students can obtain details about the NAG CHEST licence by emailing Jane Sleightholme

    Top


    8.4 Additional Course Material

    We have made available under licence from Liverpool University their High Performance Fortran Programming Course. The course is in two parts. The first introduces Fortran 90 and the second looks at High Performance Fortran.

    The first part is recommended as additional support material to the local Fortran courses. If you can't get hold of the recommended course text from the library or can't afford it then this is a good cheap alternative.

    The course was developed under funding from JISC/NTI. Home page is

    Note that under the terms of the licence the course can only be accessed from within the King's domain.

    Start the course

    Top


    9.0 Additional sources of information about John Backus.

    Top

    Use of uninitialized value in concatenation (.) or string at E:\listplex\SYSTEM\SCRIPTS\filearea.cgi line 451, line 717.

    StudyWeb Award Winner

    This site has been chosen as a featured site in StudyWeb as one of the best educational resources on the Web by their Researchers.

    StudyWeb StudyWeb

    StudyWeb Home Page

    Top

Last modified: by: Jane Sleightholme
>