| Fortran Language Reference Manual, Volume 1 - S-3692-51 | ||
|---|---|---|
| Prev Section | Chapter 1. Introduction | Next Section |
The Fortran 90 language standard introduced new data types, new operators, and new meanings for the existing operators and assignment. It provided ways for programmers to extend Fortran. These facilities allow programmers to create abstract data types by defining new types and the operations to be performed on them. Modules were introduced into Fortran as a convenient way to package these new data types and their operations. Modules can be used by the same programmer in different applications or can be distributed to several users on the same or different projects.
The Fortran 90 standard (ISO/IEC 1539:1991) described the syntax and semantics of the Fortran programming language. The standard addressed certain aspects of the Fortran processing system, but it did not address others. When specifications were not covered by the standard, the interpretation was processor dependent; that is, the processor defined the interpretation, but the interpretation for any two processors did not need to be the same. Typically, programs that rely on processor-dependent interpretations are not portable.
The Fortran 90 standard declared several features to be obsolescent. In the Fortran 95 standard, some of Fortran 90's obsolescent features are deleted. The Cray Fortran Compiler has not deleted any features. The compiler issues an ANSI message whenever a deleted feature is used, however. For more information on deleted and obsolescent features, see the Fortran Language Reference Manual, Volume 3.
Fortran 95 continues the evolutionary model introduced in Fortran 90 by deleting several of the features marked as obsolescent in Fortran 90 and identifying a few new obsolescent features. For information on these features, see the Fortran Language Reference Manual, Volume 3.
Fortran 95 is a relatively minor evolution of standard Fortran, with the emphasis in this revision being upon correcting defects in the Fortran 90 standard. This new standard also provides interpretation for a number of questions that have arisen concerning Fortran 90 semantics and syntax. For example, the Fortran 95 SIGN(3i) intrinsic function behaves differently from the Fortran 90 SIGN(3i) function if the second argument is negative real zero.
In addition to corrections and clarifications, Fortran 95 contains several extensions to Fortran 90. The major extensions are as follows:
The FORALL statement and construct.
PURE and ELEMENTAL procedures.
Pointer initialization and structure default initialization.
Additional intrinsic procedures. A Fortran 90 program may have a different interpretation under the Fortran 95 standard if it invokes an external procedure that has the same name as one of the new standard intrinsic procedures unless that procedure is specified in an EXTERNAL statement or an interface body.
The Fortran 95 standard specifies the following information:
Syntax of Fortran statements and forms for Fortran programs
Semantics of Fortran statements and Fortran programs
Specifications for correct input data
Appearance of standard output data
The standard does not specify the following information:
The way in which each Fortran compiler is 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 vendor extensions
Size and complexity of a Fortran program and its data
Hardware or firmware used to run the program
The way values are represented and the way numeric values are computed
Physical representation of data
Characteristics of tapes, disks, and various storage media
A program conforms to the standard if all the statements are syntactically correct, execution of the program causes no violations of the standard (such as dividing by zero), and all the input data is in the correct form.
The compiler extensions to the Fortran standard appear in notes throughout the text.
In the Fortran 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 compiles and executes programs that conform to the standard, provided that the Fortran program is not too large or complex for the computer system in question.
Options on the Cray Fortran command line can direct the compiler to flag nonstandard usage. For more information on the command line, see the Cray Fortran Compiler Commands and Directives Reference Manual or the ftn(1) man page. When the option is in effect, the compiler prints messages for extensions to the standard that are used in the program. As required by the standard, the compiler also flags the following items and provides the reason that the item is being flagged:
Obsolescent features
Deleted features
Kind type parameters not supported
Violations of any syntax rules and the accompanying constraints
Characters not permitted by the processor
Illegal source form
Violations of the scope rules for names, labels, operators, and assignment symbols
The Cray Fortran Compiler includes extensions to the Fortran standard. Because the compiler processes programs according to the standard, it is considered to be a standard-conforming processor. When the option to note deviations from the Fortran standard is in effect, extensions to the standard are flagged with ANSI messages when detected at compile time.
One of the main purposes of a standard is to describe how to write portable programs. However, some things are standard-conforming but not portable; for example, a program that computes a very large number like 10250. Certain computing systems will not accommodate a number this large. Such a number could be part of a standard-conforming program, but it might not run on all systems; therefore, it might not be portable. Another example is a program that uses a deeper nesting of control constructs than is allowed by a particular compiler.
| Prev Section | Table of Contents | Title Page | Index | Next Section |
| Introduction | Up one level | Fortran 2003 Compatibility |