The following Fortran 90 features are new to Fortran:
Fortran 90 provides a new free source form where line positions
have no special meaning. There are no reserved columns, trailing
comments can appear, and blanks have significance under certain
circumstances (for example, P R O G R A M
is not
allowed as an alternative for PROGRAM
).
For more information, see Section 2.3.1.
Fortran 90 provides a new form of program unit called a module, which is more powerful than (and overcomes limitations of) FORTRAN 77 block data program units.
A module is a set of declarations that are grouped together under a single, global name. Modules let you encapsulate a set of related items such as data, procedures, and procedure interfaces, and make them available to another program unit.
Module items can be made private to limit accessibility, provide data abstraction, and to create more secure and portable programs.
For more information, see Section 8.2.
Fortran 90 lets you define new data types derived from any combination of the intrinsic data types and derived types. The derived-type object can be accessed as a whole, or its individual components can be accessed directly.
You can extend the intrinsic operators (such as + and *) to user- defined data types, and also define new operators for operands of any type.
In Fortran 90, intrinsic operators and intrinsic functions can operate on array-valued operands (whole arrays or array sections).
New features for arrays include whole, partial, and masked array assignment (including the WHERE statement for selective assignment), and array-valued constants and expressions. You can create user-defined array-valued functions, use array constructors to specify values of a one-dimensional array, and allocate arrays dynamically (using ALLOCATABLE and POINTER attributes).
New intrinsic procedures create multidimensional arrays, manipulate arrays, perform operations on arrays, and support computations involving arrays (for example, SUM sums the elements of an array).
In Fortran 90, user-defined procedures can be placed in generic interface blocks. This allows the procedures to be referenced using the generic name of the block.
Selection of a specific procedure within the block is based on the properties of the argument, the same way as specific intrinsic functions are selected based on the properties of the argument when generic intrinsic function names are used.
For more information, see Section 8.8.3.
Fortran 90 pointers are mechanisms that allow dynamic access and processing of data. They allow arrays to be sized dynamically and they allow structures to be linked together.
A pointer can be of any intrinsic or derived type. When a pointer is associated with a target, it can appear in most expressions and assignments.
Fortran 90 procedures can be recursive if the keyword RECURSIVE is specified on the FUNCTION or SUBROUTINE statement line.
For more information, see Chapter 8.
A Fortran 90 procedure can contain an interface block. Interface blocks can be used to do the following:
For more information, see Section 8.8.
By using user-defined data types, operators, and meanings, you can extend Fortran to suit your needs. These new data types and their operations can be packaged in modules, which can be used by one or more program units to provide data abstraction.
With the addition of new features and capabilities, some old features become redundant and may eventually be removed from the language. For example, the functionality of the ASSIGN and assigned GO TO statements can be replaced more effectively by internal procedures. The use of certain old features of Fortran can result in less than optimal performance on newer hardware architectures.
For more information, see your user manual or programmer's guide. For a list of obsolescent features, see Appendix A.