Previous Table of Contents Next


1.1.5. The Fortran 95 Language Standard

The Fortran 95 standard (ISO, 1997) describes the syntax and semantics of the Fortran programming language but only certain, not all, aspects of the Fortran processing system. When specifications are not covered by the standard, the interpretation is processor dependent—that is, the processor defines the interpretation, but the interpretations for any two processors need not be the same. Programs that rely on processor-dependent interpretations typically are not portable.

The specifications included in the standard are

  The syntax of Fortran statements and forms for Fortran programs
  The semantics of Fortran statements and the semantics of Fortran programs
  Specifications for correct input data
  Appearance of standard output data

The specifications not defined in the standard are

  The way in which Fortran compilers are written
  Operating-system facilities defining the computing system
  Methods used to transfer data to and from peripheral storage devices and the nature of the peripheral devices
  Behavior of extensions implemented by vendors
  The size and complexity of a Fortran program and its data
  The hardware or firmware used to run the program
  The way values are represented and the way numeric values are computed
  The physical representation of data
  The characteristics of tapes, disks, and various storage media

1.1.5.1. Program Conformance to the Standard

A program conforms to the standard if the statements are all syntactically correct, execution of the program causes no violations of the standard (for example, numerical overflow), and the input data is all in the correct form. A program that uses a vendor extension is not standard conforming and may not be portable.

1.1.5.2. Processor Conformance to the Standard

In the Fortran 95 standard, the term processor means the combination of a Fortran compiler and the computing system that executes the code. A processor conforms to the standard if it correctly processes any standard-conforming program, provided the Fortran program is not too large or complex for the computer system in question. Except for certain restrictions in format specifications, the processor must be able to flag any nonstandard syntax used in the program. This includes the capability to flag any extensions available in the vendor software (including deleted features) and used in the program. The standard also requires that the processor flag, with appropriate explanation, the following:

  Obsolescent features
  Kind values not supported
  Characters not permitted by the processor
  Illegal source form
  Violations of the scope rules for names, labels, operators, and assignment symbols

Rules for the form of the output are less stringent than for other features of the language in the sense that the processor may have some options about the format of the output and the programmer may not have complete control over which of these options is used.

A processor may include extensions not in the standard; if it processes standard-conforming programs according to the standard, it is considered to be a standard-conforming processor.

1.1.5.3. Portability

One of the main purposes of a standard is to describe how to write portable programs. However, there are some things that are standard conforming but not portable. An example is a program that computes a very large number such as 1010000. Certain computing systems will not accommodate a number this large. Thus, such a number could be a part of a standard-conforming program but may not run on all systems and thus may not be portable. Another example is a program that uses a deeper nesting of control constructs than is allowed by a particular compiler.

1.1.5.4. A Permissive Standard

The primary purpose of the Fortran standard is to describe a language with the property that, if a programmer uses the language, it minimizes the difficulties of porting programs from one computer system to another. To handle the somewhat contradictory goal of permitting experimentation and development of the language, the standard is permissive: That is, a processor can conform to the standard even if it allows features that are not described in the standard. This has its good and bad aspects.

On the positive side, it allows implementers to experiment with features not in the standard; if they are successful and prove useful, they can become candidates for standardization during the next revision. Thus, a vendor of a compiler may choose to add some features not found in the standard and still conform to the standard by correctly processing all the features that are described in the standard.

On the negative side, the burden is on the programmer to know and avoid these extra features when the program is to be ported to a different computer system. The programmer is given some help with this problem in that a Fortran processor is required to recognize and warn the programmer about syntactic constructs in a program that do not conform to the standard. A good Fortran programmer’s manual also points out nonstandard features with some technique, such as shading on the page. But there is no real substitute for knowledge of the standard language itself.

1.1.6. Fortran 2000

The next Fortran standard, due to be completed in the year 2002, is now under development. As of this writing, details of the features are not known, but the major topics being considered include

  Floating-point exception handling
  More allocatable objects
  Interoperability with C
  Interval arithmetic
  Parameterized derived types
  Object-oriented features
  Pointers to procedures
  Asynchronous I/O
  Derived-type I/O


Previous Table of Contents Next