Go to the first, previous, next, last section, table of contents.
The following notation specifies the storage size for a type:
generic-type*n
generic-type must be a generic type--one of
INTEGER
, REAL
, COMPLEX
, LOGICAL
,
or CHARACTER
.
n must be one or more digits comprising a decimal
integer number greater than zero.
Use the above form where a type name is valid.
The `*n' notation specifies that the amount of storage
occupied by variables and array elements of that type is n
times the storage occupied by a CHARACTER*1
variable.
This notation might indicate a different degree of precision and/or range for such variables and array elements, and the functions that return values of types using this notation. It does not limit the precision or range of values of that type in any particular way--use explicit code to do that.
Further, the GNU Fortran language requires no particular values
for n to be supported by an implementation via the `*n'
notation.
g77
supports INTEGER*1
(as INTEGER(KIND=3)
)
on all systems, for example,
but not all implementations are required to do so, and g77
is known to not support REAL*1
on most (or all) systems.
As a result, except for generic-type of CHARACTER
,
uses of this notation should be limited to isolated
portions of a program that are intended to handle system-specific
tasks and are expected to be non-portable.
(Standard FORTRAN 77 supports the `*n' notation for
only CHARACTER
, where it signifies not only the amount
of storage occupied, but the number of characters in entities
of that type.
However, almost all Fortran compilers have supported this
notation for generic types, though with a variety of meanings
for n.)
Specifications of types using the `*n' notation always are interpreted as specifications of the appropriate types described in this document using the `KIND=n' notation, described below.
While use of this notation is popular, it doesn't serve well in the context of a widely portable dialect of Fortran, such as the GNU Fortran language.
For example, even on one particular machine, two or more popular
Fortran compilers might well disagree on the size of a type
declared INTEGER*2
or REAL*16
.
Certainly there
is known to be disagreement over such things among Fortran
compilers on different systems.
Further, this notation offers no elegant way to specify sizes
that are not even multiples of the "byte size" typically
designated by INTEGER*1
.
Use of "absurd" values (such as INTEGER*1000
) would
certainly be possible, but would perhaps be stretching the original
intent of this notation beyond the breaking point in terms
of widespread readability of documentation and code making use
of it.
Therefore, this document uses "star notation" only on occasion for the benefit of those readers who are accustomed to it.
Go to the first, previous, next, last section, table of contents.