[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8. The GNU Fortran Language

GNU Fortran supports a variety of extensions to, and dialects of, the Fortran language. Its primary base is the ANSI FORTRAN 77 standard, currently available on the network at http://www.fortran.com/fortran/F77_std/rjcnf0001.html or as monolithic text at http://www.fortran.com/fortran/F77_std/f77_std.html. It offers some extensions that are popular among users of UNIX f77 and f2c compilers, some that are popular among users of other compilers (such as Digital products), some that are popular among users of the newer Fortran 90 standard, and some that are introduced by GNU Fortran.

(If you need a text on Fortran, a few freely available electronic references have pointers from http://www.fortran.com/fortran/Books/. There is a `cooperative net project', User Notes on Fortran Programming at ftp://vms.huji.ac.il/fortran/ and mirrors elsewhere; some of this material might not apply specifically to g77.)

Part of what defines a particular implementation of a Fortran system, such as g77, is the particular characteristics of how it supports types, constants, and so on. Much of this is left up to the implementation by the various Fortran standards and accepted practice in the industry.

The GNU Fortran language is described below. Much of the material is organized along the same lines as the ANSI FORTRAN 77 standard itself.

See section 9. Other Dialects, for information on features g77 supports that are not part of the GNU Fortran language.

Note: This portion of the documentation definitely needs a lot of work!

Relationship to the ANSI FORTRAN 77 standard:
8.1 Direction of Language Development  Where GNU Fortran is headed.
8.2 ANSI FORTRAN 77 Standard Support  Degree of support for the standard.

Extensions to the ANSI FORTRAN 77 standard:
8.3 Conformance  
8.4 Notation Used in This Chapter  
8.5 Fortran Terms and Concepts  
8.6 Characters, Lines, and Execution Sequence  
8.7 Data Types and Constants  
8.8 Expressions  
8.9 Specification Statements  
8.10 Control Statements  
8.11 Functions and Subroutines  
8.12 Scope and Classes of Symbolic Names  
8.13 I/O  
8.14 Fortran 90 Features  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.1 Direction of Language Development

The purpose of the following description of the GNU Fortran language is to promote wide portability of GNU Fortran programs.

GNU Fortran is an evolving language, due to the fact that g77 itself is in beta test. Some current features of the language might later be redefined as dialects of Fortran supported by g77 when better ways to express these features are added to g77, for example. Such features would still be supported by g77, but would be available only when one or more command-line options were used.

The GNU Fortran language is distinct from the GNU Fortran compilation system (g77).

For example, g77 supports various dialects of Fortran--in a sense, these are languages other than GNU Fortran--though its primary purpose is to support the GNU Fortran language, which also is described in its documentation and by its implementation.

On the other hand, non-GNU compilers might offer support for the GNU Fortran language, and are encouraged to do so.

Currently, the GNU Fortran language is a fairly fuzzy object. It represents something of a cross between what g77 accepts when compiling using the prevailing defaults and what this document describes as being part of the language.

Future versions of g77 are expected to clarify the definition of the language in the documentation. Often, this will mean adding new features to the language, in the form of both new documentation and new support in g77. However, it might occasionally mean removing a feature from the language itself to "dialect" status. In such a case, the documentation would be adjusted to reflect the change, and g77 itself would likely be changed to require one or more command-line options to continue supporting the feature.

The development of the GNU Fortran language is intended to strike a balance between:

One of the biggest practical challenges for the developers of the GNU Fortran language is meeting the sometimes contradictory demands of the above items.

For example, a feature might be widely used in one popular environment, but the exact same code that utilizes that feature might not work as expected--perhaps it might mean something entirely different--in another popular environment.

Traditionally, Fortran compilers--even portable ones--have solved this problem by simply offering the appropriate feature to users of the respective systems. This approach treats users of various Fortran systems and dialects as remote "islands", or camps, of programmers, and assume that these camps rarely come into contact with each other (or, especially, with each other's code).

Project GNU takes a radically different approach to software and language design, in that it assumes that users of GNU software do not necessarily care what kind of underlying system they are using, regardless of whether they are using software (at the user-interface level) or writing it (for example, writing Fortran or C code).

As such, GNU users rarely need consider just what kind of underlying hardware (or, in many cases, operating system) they are using at any particular time. They can use and write software designed for a general-purpose, widely portable, heterogenous environment--the GNU environment.

In line with this philosophy, GNU Fortran must evolve into a product that is widely ported and portable not only in the sense that it can be successfully built, installed, and run by users, but in the larger sense that its users can use it in the same way, and expect largely the same behaviors from it, regardless of the kind of system they are using at any particular time.

This approach constrains the solutions g77 can use to resolve conflicts between various camps of Fortran users. If these two camps disagree about what a particular construct should mean, g77 cannot simply be changed to treat that particular construct as having one meaning without comment (such as a warning), lest the users expecting it to have the other meaning are unpleasantly surprised that their code misbehaves when executed.

The use of the ASCII backslash character in character constants is an excellent (and still somewhat unresolved) example of this kind of controversy. See section 16.5.1 Backslash in Constants. Other examples are likely to arise in the future, as g77 developers strive to improve its ability to accept an ever-wider variety of existing Fortran code without requiring significant modifications to said code.

Development of GNU Fortran is further constrained by the desire to avoid requiring programmers to change their code. This is important because it allows programmers, administrators, and others to more faithfully evaluate and validate g77 (as an overall product and as new versions are distributed) without having to support multiple versions of their programs so that they continue to work the same way on their existing systems (non-GNU perhaps, but possibly also earlier versions of g77).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.2 ANSI FORTRAN 77 Standard Support

GNU Fortran supports ANSI FORTRAN 77 with the following caveats. In summary, the only ANSI FORTRAN 77 features g77 doesn't support are those that are probably rarely used in actual code, some of which are explicitly disallowed by the Fortran 90 standard.

8.2.1 No Passing External Assumed-length  CHAR*(*) CFUNC restriction.
8.2.2 No Passing Dummy Assumed-length  CHAR*(*) CFUNC restriction.
8.2.3 No Pathological Implied-DO  No `((..., I=...), I=...)'.
8.2.4 No Useless Implied-DO  No `(A, I=1, 1)'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.2.1 No Passing External Assumed-length

g77 disallows passing of an external procedure as an actual argument if the procedure's type is declared CHARACTER*(*). For example:

 
CHARACTER*(*) CFUNC
EXTERNAL CFUNC
CALL FOO(CFUNC)
END

It isn't clear whether the standard considers this conforming.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.2.2 No Passing Dummy Assumed-length

g77 disallows passing of a dummy procedure as an actual argument if the procedure's type is declared CHARACTER*(*).

 
SUBROUTINE BAR(CFUNC)
CHARACTER*(*) CFUNC
EXTERNAL CFUNC
CALL FOO(CFUNC)
END

It isn't clear whether the standard considers this conforming.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.2.3 No Pathological Implied-DO

The DO variable for an implied-DO construct in a DATA statement may not be used as the DO variable for an outer implied-DO construct. For example, this fragment is disallowed by g77:

 
DATA ((A(I, I), I= 1, 10), I= 1, 10) /.../

This also is disallowed by Fortran 90, as it offers no additional capabilities and would have a variety of possible meanings.

Note that it is very unlikely that any production Fortran code tries to use this unsupported construct.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.2.4 No Useless Implied-DO

An array element initializer in an implied-DO construct in a DATA statement must contain at least one reference to the DO variables of each outer implied-DO construct. For example, this fragment is disallowed by g77:

 
DATA (A, I= 1, 1) /1./

This also is disallowed by Fortran 90, as FORTRAN 77's more permissive requirements offer no additional capabilities. However, g77 doesn't necessarily diagnose all cases where this requirement is not met.

Note that it is very unlikely that any production Fortran code tries to use this unsupported construct.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.3 Conformance

(The following information augments or overrides the information in Section 1.4 of ANSI X3.9-1978 FORTRAN 77 in specifying the GNU Fortran language. Chapter 1 of that document otherwise serves as the basis for the relevant aspects of GNU Fortran.)

The definition of the GNU Fortran language is akin to that of the ANSI FORTRAN 77 language in that it does not generally require conforming implementations to diagnose cases where programs do not conform to the language.

However, g77 as a compiler is being developed in a way that is intended to enable it to diagnose such cases in an easy-to-understand manner.

A program that conforms to the GNU Fortran language should, when compiled, linked, and executed using a properly installed g77 system, perform as described by the GNU Fortran language definition. Reasons for different behavior include, among others:

Despite these "loopholes", the availability of a clear specification of the language of programs submitted to g77, as this document is intended to provide, is considered an important aspect of providing a robust, clean, predictable Fortran implementation.

The definition of the GNU Fortran language, while having no special legal status, can therefore be viewed as a sort of contract, or agreement. This agreement says, in essence, "if you write a program in this language, and run it in an environment (such as a g77 system) that supports this language, the program should behave in a largely predictable way".


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.4 Notation Used in This Chapter

(The following information augments or overrides the information in Section 1.5 of ANSI X3.9-1978 FORTRAN 77 in specifying the GNU Fortran language. Chapter 1 of that document otherwise serves as the basis for the relevant aspects of GNU Fortran.)

In this chapter, "must" denotes a requirement, "may" denotes permission, and "must not" and "may not" denote prohibition. Terms such as "might", "should", and "can" generally add little or nothing in the way of weight to the GNU Fortran language itself, but are used to explain or illustrate the language.

For example:

 
``The FROBNITZ statement must precede all executable
statements in a program unit, and may not specify any dummy
arguments.  It may specify local or common variables and arrays.
Its use should be limited to portions of the program designed to
be non-portable and system-specific, because it might cause the
containing program unit to behave quite differently on different
systems.''

Insofar as the GNU Fortran language is specified, the requirements and permissions denoted by the above sample statement are limited to the placement of the statement and the kinds of things it may specify. The rest of the statement--the content regarding non-portable portions of the program and the differing behavior of program units containing the FROBNITZ statement--does not pertain the GNU Fortran language itself. That content offers advice and warnings about the FROBNITZ statement.

Remember: The GNU Fortran language definition specifies both what constitutes a valid GNU Fortran program and how, given such a program, a valid GNU Fortran implementation is to interpret that program.

It is not incumbent upon a valid GNU Fortran implementation to behave in any particular way, any consistent way, or any predictable way when it is asked to interpret input that is not a valid GNU Fortran program.

Such input is said to have undefined behavior when interpreted by a valid GNU Fortran implementation, though an implementation may choose to specify behaviors for some cases of inputs that are not valid GNU Fortran programs.

Other notation used herein is that of the GNU texinfo format, which is used to generate printed hardcopy, on-line hypertext (Info), and on-line HTML versions, all from a single source document. This notation is used as follows:


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.5 Fortran Terms and Concepts

(The following information augments or overrides the information in Chapter 2 of ANSI X3.9-1978 FORTRAN 77 in specifying the GNU Fortran language. Chapter 2 of that document otherwise serves as the basis for the relevant aspects of GNU Fortran.)

8.5.1 Syntactic Items  
8.5.2 Statements, Comments, and Lines  
8.5.3 Scope of Symbolic Names and Statement Labels  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.5.1 Syntactic Items

(Corresponds to Section 2.2 of ANSI X3.9-1978 FORTRAN 77.)

In GNU Fortran, a symbolic name is at least one character long, and has no arbitrary upper limit on length. However, names of entities requiring external linkage (such as external functions, external subroutines, and COMMON areas) might be restricted to some arbitrary length by the system. Such a restriction is no more constrained than that of one through six characters.

Underscores (`_') are accepted in symbol names after the first character (which must be a letter).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.5.2 Statements, Comments, and Lines

(Corresponds to Section 2.3 of ANSI X3.9-1978 FORTRAN 77.)

Use of an exclamation point (`!') to begin a trailing comment (a comment that extends to the end of the same source line) is permitted under the following conditions:

Use of a semicolon (`;') as a statement separator is permitted under the following conditions:


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.5.3 Scope of Symbolic Names and Statement Labels

(Corresponds to Section 2.9 of ANSI X3.9-1978 FORTRAN 77.)

Included in the list of entities that have a scope of a program unit are construct names (a Fortran 90 feature). See section 8.10.3 Construct Names, for more information.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.6 Characters, Lines, and Execution Sequence

(The following information augments or overrides the information in Chapter 3 of ANSI X3.9-1978 FORTRAN 77 in specifying the GNU Fortran language. Chapter 3 of that document otherwise serves as the basis for the relevant aspects of GNU Fortran.)

8.6.1 GNU Fortran Character Set  
8.6.2 Lines  
8.6.3 Continuation Line  
8.6.4 Statements  
8.6.5 Statement Labels  
8.6.6 Order of Statements and Lines  
8.6.7 Including Source Text  
8.6.8 Cpp-style directives  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.6.1 GNU Fortran Character Set

(Corresponds to Section 3.1 of ANSI X3.9-1978 FORTRAN 77.)

Letters include uppercase letters (the twenty-six characters of the English alphabet) and lowercase letters (their lowercase equivalent). Generally, lowercase letters may be used in place of uppercase letters, though in character and Hollerith constants, they are distinct.

Special characters include:

Note that this document refers to SPC as space, while X3.9-1978 FORTRAN 77 refers to it as blank.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.6.2 Lines

(Corresponds to Section 3.2 of ANSI X3.9-1978 FORTRAN 77.)

The way a Fortran compiler views source files depends entirely on the implementation choices made for the compiler, since those choices are explicitly left to the implementation by the published Fortran standards.

The GNU Fortran language mandates a view applicable to UNIX-like text files--files that are made up of an arbitrary number of lines, each with an arbitrary number of characters (sometimes called stream-based files).

This view does not apply to types of files that are specified as having a particular number of characters on every single line (sometimes referred to as record-based files).

Because a "line in a program unit is a sequence of 72 characters", to quote X3.9-1978, the GNU Fortran language specifies that a stream-based text file is translated to GNU Fortran lines as follows:

For the purposes of the remainder of this description of the GNU Fortran language, the translation described above has already taken place, unless otherwise specified.

The result of the above translation is that the source file appears, in terms of the remainder of this description of the GNU Fortran language, as if it had an arbitrary number of 72-character lines, each character being among the GNU Fortran character set.

For example, if the source file itself has two newlines in a row, the second newline becomes, after the above translation, a single line containing 72 spaces.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.6.3 Continuation Line

(Corresponds to Section 3.2.3 of ANSI X3.9-1978 FORTRAN 77.)

A continuation line is any line that both

A continuation character is any character of the GNU Fortran character set other than space (SPC) or zero (`0') in column 6, or a digit (`0' through `9') in column 7 through 72 of a line that has only spaces to the left of that digit.

The continuation character is ignored as far as the content of the statement is concerned.

The GNU Fortran language places no limit on the number of continuation lines in a statement. In practice, the limit depends on a variety of factors, such as available memory, statement content, and so on, but no GNU Fortran system may impose an arbitrary limit.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.6.4 Statements

(Corresponds to Section 3.3 of ANSI X3.9-1978 FORTRAN 77.)

Statements may be written using an arbitrary number of continuation lines.

Statements may be separated using the semicolon (`;'), except that the logical IF and non-construct WHERE statements may not be separated from subsequent statements using only a semicolon as statement separator.

The END PROGRAM, END SUBROUTINE, END FUNCTION, and END BLOCK DATA statements are alternatives to the END statement. These alternatives may be written as normal statements--they are not subject to the restrictions of the END statement.

However, no statement other than END may have an initial line that appears to be an END statement--even END PROGRAM, for example, must not be written as:

 
      END
     &PROGRAM


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.6.5 Statement Labels

(Corresponds to Section 3.4 of ANSI X3.9-1978 FORTRAN 77.)

A statement separated from its predecessor via a semicolon may be labeled as follows:

A statement may have only one label defined for it.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.6.6 Order of Statements and Lines

(Corresponds to Section 3.5 of ANSI X3.9-1978 FORTRAN 77.)

Generally, DATA statements may precede executable statements. However, specification statements pertaining to any entities initialized by a DATA statement must precede that DATA statement. For example, after `DATA I/1/', `INTEGER I' is not permitted, but `INTEGER J' is permitted.

The last line of a program unit may be an END statement, or may be:


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.6.7 Including Source Text

Additional source text may be included in the processing of the source file via the INCLUDE directive:

 
INCLUDE filename

The source text to be included is identified by filename, which is a literal GNU Fortran character constant. The meaning and interpretation of filename depends on the implementation, but typically is a filename.

(g77 treats it as a filename that it searches for in the current directory and/or directories specified via the `-I' command-line option.)

The effect of the INCLUDE directive is as if the included text directly replaced the directive in the source file prior to interpretation of the program. Included text may itself use INCLUDE. The depth of nested INCLUDE references depends on the implementation, but typically is a positive integer.

This virtual replacement treats the statements and INCLUDE directives in the included text as syntactically distinct from those in the including text.

Therefore, the first non-comment line of the included text must not be a continuation line. The included text must therefore have, after the non-comment lines, either an initial line (statement), an INCLUDE directive, or nothing (the end of the included text).

Similarly, the including text may end the INCLUDE directive with a semicolon or the end of the line, but it cannot follow an INCLUDE directive at the end of its line with a continuation line. Thus, the last statement in an included text may not be continued.

Any statements between two INCLUDE directives on the same line are treated as if they appeared in between the respective included texts. For example:

 
INCLUDE 'A'; PRINT *, 'B'; INCLUDE 'C'; END PROGRAM

If the text included by `INCLUDE 'A'' constitutes a `PRINT *, 'A'' statement and the text included by `INCLUDE 'C'' constitutes a `PRINT *, 'C'' statement, then the output of the above sample program would be

 
A
B
C

(with suitable allowances for how an implementation defines its handling of output).

Included text must not include itself directly or indirectly, regardless of whether the filename used to reference the text is the same.

Note that INCLUDE is not a statement. As such, it is neither a non-executable or executable statement. However, if the text it includes constitutes one or more executable statements, then the placement of INCLUDE is subject to effectively the same restrictions as those on executable statements.

An INCLUDE directive may be continued across multiple lines as if it were a statement. This permits long names to be used for filename.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.6.8 Cpp-style directives

cpp output-style # directives (see section `C Preprocessor Output' in The C Preprocessor) are recognized by the compiler even when the preprocessor isn't run on the input (as it is when compiling `.F' files). (Note the distinction between these cpp # output directives and #line input directives.)


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7 Data Types and Constants

(The following information augments or overrides the information in Chapter 4 of ANSI X3.9-1978 FORTRAN 77 in specifying the GNU Fortran language. Chapter 4 of that document otherwise serves as the basis for the relevant aspects of GNU Fortran.)

To more concisely express the appropriate types for entities, this document uses the more concise Fortran 90 nomenclature such as INTEGER(KIND=1) instead of the more traditional, but less portably concise, byte-size-based nomenclature such as INTEGER*4, wherever reasonable.

When referring to generic types--in contexts where the specific precision and range of a type are not important--this document uses the generic type names INTEGER, LOGICAL, REAL, COMPLEX, and CHARACTER.

In some cases, the context requires specification of a particular type. This document uses the `KIND=' notation to accomplish this throughout, sometimes supplying the more traditional notation for clarification, though the traditional notation might not work the same way on all GNU Fortran implementations.

Use of `KIND=' makes this document more concise because g77 is able to define values for `KIND=' that have the same meanings on all systems, due to the way the Fortran 90 standard specifies these values are to be used.

(In particular, that standard permits an implementation to arbitrarily assign nonnegative values. There are four distinct sets of assignments: one to the CHARACTER type; one to the INTEGER type; one to the LOGICAL type; and the fourth to both the REAL and COMPLEX types. Implementations are free to assign these values in any order, leave gaps in the ordering of assignments, and assign more than one value to a representation.)

This makes `KIND=' values superior to the values used in non-standard statements such as `INTEGER*4', because the meanings of the values in those statements vary from machine to machine, compiler to compiler, even operating system to operating system.

However, use of `KIND=' is not generally recommended when writing portable code (unless, for example, the code is going to be compiled only via g77, which is a widely ported compiler). GNU Fortran does not yet have adequate language constructs to permit use of `KIND=' in a fashion that would make the code portable to Fortran 90 implementations; and, this construct is known to not be accepted by many popular FORTRAN 77 implementations, so it cannot be used in code that is to be ported to those.

The distinction here is that this document is able to use specific values for `KIND=' to concisely document the types of various operations and operands.

A Fortran program should use the FORTRAN 77 designations for the appropriate GNU Fortran types--such as INTEGER for INTEGER(KIND=1), REAL for REAL(KIND=1), and DOUBLE COMPLEX for COMPLEX(KIND=2)---and, where no such designations exist, make use of appropriate techniques (preprocessor macros, parameters, and so on) to specify the types in a fashion that may be easily adjusted to suit each particular implementation to which the program is ported. (These types generally won't need to be adjusted for ports of g77.)

Further details regarding GNU Fortran data types and constants are provided below.

8.7.1 Data Types  
8.7.2 Constants  
8.7.3 Integer Type  
8.7.4 Character Type  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.1 Data Types

(Corresponds to Section 4.1 of ANSI X3.9-1978 FORTRAN 77.)

GNU Fortran supports these types:

  1. Integer (generic type INTEGER)

  2. Real (generic type REAL)

  3. Double precision

  4. Complex (generic type COMPLEX)

  5. Logical (generic type LOGICAL)

  6. Character (generic type CHARACTER)

  7. Double Complex

(The types numbered 1 through 6 above are standard FORTRAN 77 types.)

The generic types shown above are referred to in this document using only their generic type names. Such references usually indicate that any specific type (kind) of that generic type is valid.

For example, a context described in this document as accepting the COMPLEX type also is likely to accept the DOUBLE COMPLEX type.

The GNU Fortran language supports three ways to specify a specific kind of a generic type.

8.7.1.1 Double Notation  As in DOUBLE COMPLEX.
8.7.1.2 Star Notation  As in INTEGER*4.
8.7.1.3 Kind Notation  As in INTEGER(KIND=1).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.1.1 Double Notation

The GNU Fortran language supports two uses of the keyword DOUBLE to specify a specific kind of type:

Use one of the above forms where a type name is valid.

While use of this notation is popular, it doesn't scale well in a language or dialect rich in intrinsic types, as is the case for the GNU Fortran language (especially planned future versions of it).

After all, one rarely sees type names such as `DOUBLE INTEGER', `QUADRUPLE REAL', or `QUARTER INTEGER'. Instead, INTEGER*8, REAL*16, and INTEGER*1 often are substituted for these, respectively, even though they do not always have the same meanings on all systems. (And, the fact that `DOUBLE REAL' does not exist as such is an inconsistency.)

Therefore, this document uses "double notation" only on occasion for the benefit of those readers who are accustomed to it.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.1.2 Star Notation

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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.1.3 Kind Notation

The following notation specifies the kind-type selector of a type:

 
generic-type(KIND=n)

Use the above form where a type name is valid.

generic-type must be a generic type--one of INTEGER, REAL, COMPLEX, LOGICAL, or CHARACTER. n must be an integer initialization expression that is a positive, nonzero value.

Programmers are discouraged from writing these values directly into their code. Future versions of the GNU Fortran language will offer facilities that will make the writing of code portable to g77 and Fortran 90 implementations simpler.

However, writing code that ports to existing FORTRAN 77 implementations depends on avoiding the `KIND=' construct.

The `KIND=' construct is thus useful in the context of GNU Fortran for two reasons:

The values of n in the GNU Fortran language are assigned using a scheme that:

The assignment system accomplishes this by assigning to each "fundamental meaning" of a specific type a unique prime number. Combinations of fundamental meanings--for example, a type that is two times the size of some other type--are assigned values of n that are the products of the values for those fundamental meanings.

A prime value of n is never given more than one fundamental meaning, to avoid situations where some code or system cannot reasonably provide those meanings in the form of a single type.

The values of n assigned so far are:

KIND=0
This value is reserved for future use.

The planned future use is for this value to designate, explicitly, context-sensitive kind-type selection. For example, the expression `1D0 * 0.1_0' would be equivalent to `1D0 * 0.1D0'.

KIND=1
This corresponds to the default types for REAL, INTEGER, LOGICAL, COMPLEX, and CHARACTER, as appropriate.

These are the "default" types described in the Fortran 90 standard, though that standard does not assign any particular `KIND=' value to these types.

(Typically, these are REAL*4, INTEGER*4, LOGICAL*4, and COMPLEX*8.)

KIND=2
This corresponds to types that occupy twice as much storage as the default types. REAL(KIND=2) is DOUBLE PRECISION (typically REAL*8), COMPLEX(KIND=2) is DOUBLE COMPLEX (typically COMPLEX*16),

These are the "double precision" types described in the Fortran 90 standard, though that standard does not assign any particular `KIND=' value to these types.

n of 4 thus corresponds to types that occupy four times as much storage as the default types, n of 8 to types that occupy eight times as much storage, and so on.

The INTEGER(KIND=2) and LOGICAL(KIND=2) types are not necessarily supported by every GNU Fortran implementation.

KIND=3
This corresponds to types that occupy as much storage as the default CHARACTER type, which is the same effective type as CHARACTER(KIND=1) (making that type effectively the same as CHARACTER(KIND=3)).

(Typically, these are INTEGER*1 and LOGICAL*1.)

n of 6 thus corresponds to types that occupy twice as much storage as the n=3 types, n of 12 to types that occupy four times as much storage, and so on.

These are not necessarily supported by every GNU Fortran implementation.

KIND=5
This corresponds to types that occupy half the storage as the default (n=1) types.

(Typically, these are INTEGER*2 and LOGICAL*2.)

n of 25 thus corresponds to types that occupy one-quarter as much storage as the default types.

These are not necessarily supported by every GNU Fortran implementation.

KIND=7
This is valid only as INTEGER(KIND=7) and denotes the INTEGER type that has the smallest storage size that holds a pointer on the system.

A pointer representable by this type is capable of uniquely addressing a CHARACTER*1 variable, array, array element, or substring.

(Typically this is equivalent to INTEGER*4 or, on 64-bit systems, INTEGER*8. In a compatible C implementation, it typically would be the same size and semantics of the C type void *.)

Note that these are proposed correspondences and might change in future versions of g77---avoid writing code depending on them while g77, and therefore the GNU Fortran language it defines, is in beta testing.

Values not specified in the above list are reserved to future versions of the GNU Fortran language.

Implementation-dependent meanings will be assigned new, unique prime numbers so as to not interfere with other implementation-dependent meanings, and offer the possibility of increasing the portability of code depending on such types by offering support for them in other GNU Fortran implementations.

Other meanings that might be given unique values are:

Future prime numbers should be given meanings in as incremental a fashion as possible, to allow for flexibility and expressiveness in combining types.

For example, instead of defining a prime number for little-endian IEEE doubles, one prime number might be assigned the meaning "little-endian", another the meaning "IEEE double", and the value of n for a little-endian IEEE double would thus naturally be the product of those two respective assigned values. (It could even be reasonable to have IEEE values result from the products of prime values denoting exponent and fraction sizes and meanings, hidden bit usage, availability and representations of special values such as subnormals, infinities, and Not-A-Numbers (NaNs), and so on.)

This assignment mechanism, while not inherently required for future versions of the GNU Fortran language, is worth using because it could ease management of the "space" of supported types much easier in the long run.

The above approach suggests a mechanism for specifying inheritance of intrinsic (built-in) types for an entire, widely portable product line. It is certainly reasonable that, unlike programmers of other languages offering inheritance mechanisms that employ verbose names for classes and subclasses, along with graphical browsers to elucidate the relationships, Fortran programmers would employ a mechanism that works by multiplying prime numbers together and finding the prime factors of such products.

Most of the advantages for the above scheme have been explained above. One disadvantage is that it could lead to the defining, by the GNU Fortran language, of some fairly large prime numbers. This could lead to the GNU Fortran language being declared "munitions" by the United States Department of Defense.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.2 Constants

(Corresponds to Section 4.2 of ANSI X3.9-1978 FORTRAN 77.)

A typeless constant has one of the following forms:

 
'binary-digits'B
'octal-digits'O
'hexadecimal-digits'Z
'hexadecimal-digits'X

binary-digits, octal-digits, and hexadecimal-digits are nonempty strings of characters in the set `01', `01234567', and `0123456789ABCDEFabcdef', respectively. (The value for `A' (and `a') is 10, for `B' and `b' is 11, and so on.)

A prefix-radix constant, such as `Z'ABCD'', can optionally be treated as typeless. See section Options Controlling Fortran Dialect, for information on the `-ftypeless-boz' option.

Typeless constants have values that depend on the context in which they are used.

All other constants, called typed constants, are interpreted--converted to internal form--according to their inherent type. Thus, context is never a determining factor for the type, and hence the interpretation, of a typed constant. (All constants in the ANSI FORTRAN 77 language are typed constants.)

For example, `1' is always type INTEGER(KIND=1) in GNU Fortran (called default INTEGER in Fortran 90), `9.435784839284958' is always type REAL(KIND=1) (even if the additional precision specified is lost, and even when used in a REAL(KIND=2) context), `1E0' is always type REAL(KIND=2), and `1D0' is always type REAL(KIND=2).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.3 Integer Type

(Corresponds to Section 4.3 of ANSI X3.9-1978 FORTRAN 77.)

An integer constant also may have one of the following forms:

 
B'binary-digits'
O'octal-digits'
Z'hexadecimal-digits'
X'hexadecimal-digits'

binary-digits, octal-digits, and hexadecimal-digits are nonempty strings of characters in the set `01', `01234567', and `0123456789ABCDEFabcdef', respectively. (The value for `A' (and `a') is 10, for `B' and `b' is 11, and so on.)


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7.4 Character Type

(Corresponds to Section 4.8 of ANSI X3.9-1978 FORTRAN 77.)

A character constant may be delimited by a pair of double quotes (`"') instead of apostrophes. In this case, an apostrophe within the constant represents a single apostrophe, while a double quote is represented in the source text of the constant by two consecutive double quotes with no intervening spaces.

A character constant may be empty (have a length of zero).

A character constant may include a substring specification, The value of such a constant is the value of the substring--for example, the value of `'hello'(3:5)' is the same as the value of `'llo''.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.8 Expressions

(The following information augments or overrides the information in Chapter 6 of ANSI X3.9-1978 FORTRAN 77 in specifying the GNU Fortran language. Chapter 6 of that document otherwise serves as the basis for the relevant aspects of GNU Fortran.)

8.8.1 The %LOC() Construct  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.8.1 The %LOC() Construct

 
%LOC(arg)

The %LOC() construct is an expression that yields the value of the location of its argument, arg, in memory. The size of the type of the expression depends on the system--typically, it is equivalent to either INTEGER(KIND=1) or INTEGER(KIND=2), though it is actually type INTEGER(KIND=7).

The argument to %LOC() must be suitable as the left-hand side of an assignment statement. That is, it may not be a general expression involving operators such as addition, subtraction, and so on, nor may it be a constant.

Use of %LOC() is recommended only for code that is accessing facilities outside of GNU Fortran, such as operating system or windowing facilities. It is best to constrain such uses to isolated portions of a program--portions that deal specifically and exclusively with low-level, system-dependent facilities. Such portions might well provide a portable interface for use by the program as a whole, but are themselves not portable, and should be thoroughly tested each time they are rebuilt using a new compiler or version of a compiler.

Do not depend on %LOC() returning a pointer that can be safely used to define (change) the argument. While this might work in some circumstances, it is hard to predict whether it will continue to work when a program (that works using this unsafe behavior) is recompiled using different command-line options or a different version of g77.

Generally, %LOC() is safe when used as an argument to a procedure that makes use of the value of the corresponding dummy argument only during its activation, and only when such use is restricted to referencing (reading) the value of the argument to %LOC().

Implementation Note: Currently, g77 passes arguments (those not passed using a construct such as %VAL()) by reference or descriptor, depending on the type of the actual argument. Thus, given `INTEGER I', `CALL FOO(I)' would seem to mean the same thing as `CALL FOO(%VAL(%LOC(I)))', and in fact might compile to identical code.

However, `CALL FOO(%VAL(%LOC(I)))' emphatically means "pass, by value, the address of `I' in memory". While `CALL FOO(I)' might use that same approach in a particular version of g77, another version or compiler might choose a different implementation, such as copy-in/copy-out, to effect the desired behavior--and which will therefore not necessarily compile to the same code as would `CALL FOO(%VAL(%LOC(I)))' using the same version or compiler.

See section 14. Debugging and Interfacing, for detailed information on how this particular version of g77 implements various constructs.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.9 Specification Statements

(The following information augments or overrides the information in Chapter 8 of ANSI X3.9-1978 FORTRAN 77 in specifying the GNU Fortran language. Chapter 8 of that document otherwise serves as the basis for the relevant aspects of GNU Fortran.)

8.9.1 NAMELIST Statement  
8.9.2 DOUBLE COMPLEX Statement  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.9.1 NAMELIST Statement

The NAMELIST statement, and related I/O constructs, are supported by the GNU Fortran language in essentially the same way as they are by f2c.

This follows Fortran 90 with the restriction that on NAMELIST input, subscripts must have the form
 
subscript [ : subscript [ : stride]]
i.e.
 
&xx x(1:3,8:10:2)=1,2,3,4,5,6/
is allowed, but not, say,
 
&xx x(:3,8::2)=1,2,3,4,5,6/

As an extension of the Fortran 90 form, $ and $END may be used in place of & and / in NAMELIST input, so that
 
$&xx x(1:3,8:10:2)=1,2,3,4,5,6 $end
could be used instead of the example above.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.9.2 DOUBLE COMPLEX Statement

DOUBLE COMPLEX is a type-statement (and type) that specifies the type COMPLEX(KIND=2) in GNU Fortran.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.10 Control Statements

(The following information augments or overrides the information in Chapter 11 of ANSI X3.9-1978 FORTRAN 77 in specifying the GNU Fortran language. Chapter 11 of that document otherwise serves as the basis for the relevant aspects of GNU Fortran.)

8.10.1 DO WHILE  
8.10.2 END DO  
8.10.3 Construct Names  
8.10.4 The CYCLE and EXIT Statements  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.10.1 DO WHILE

The DO WHILE statement, a feature of both the MIL-STD 1753 and Fortran 90 standards, is provided by the GNU Fortran language. The Fortran 90 "do forever" statement comprising just DO is also supported.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.10.2 END DO

The END DO statement is provided by the GNU Fortran language.

This statement is used in one of two ways:


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.10.3 Construct Names

The GNU Fortran language supports construct names as defined by the Fortran 90 standard. These names are local to the program unit and are defined as follows:

 
construct-name: block-statement

Here, construct-name is the construct name itself; its definition is connoted by the single colon (`:'); and block-statement is an IF, DO, or SELECT CASE statement that begins a block.

A block that is given a construct name must also specify the same construct name in its termination statement:

 
END block construct-name

Here, block must be IF, DO, or SELECT, as appropriate.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.10.4 The CYCLE and EXIT Statements

The CYCLE and EXIT statements specify that the remaining statements in the current iteration of a particular active (enclosing) DO loop are to be skipped.

CYCLE specifies that these statements are skipped, but the END DO statement that marks the end of the DO loop be executed--that is, the next iteration, if any, is to be started. If the statement marking the end of the DO loop is not END DO---in other words, if the loop is not a block DO---the CYCLE statement does not execute that statement, but does start the next iteration (if any).

EXIT specifies that the loop specified by the DO construct is terminated.

The DO loop affected by CYCLE and EXIT is the innermost enclosing DO loop when the following forms are used:

 
CYCLE
EXIT

Otherwise, the following forms specify the construct name of the pertinent DO loop:

 
CYCLE construct-name
EXIT construct-name

CYCLE and EXIT can be viewed as glorified GO TO statements. However, they cannot be easily thought of as GO TO statements in obscure cases involving FORTRAN 77 loops. For example:

 
      DO 10 I = 1, 5
      DO 10 J = 1, 5
         IF (J .EQ. 5) EXIT
      DO 10 K = 1, 5
         IF (K .EQ. 3) CYCLE
10    PRINT *, 'I=', I, ' J=', J, ' K=', K
20    CONTINUE

In particular, neither the EXIT nor CYCLE statements above are equivalent to a GO TO statement to either label `10' or `20'.

To understand the effect of CYCLE and EXIT in the above fragment, it is helpful to first translate it to its equivalent using only block DO loops:

 
      DO I = 1, 5
         DO J = 1, 5
            IF (J .EQ. 5) EXIT
            DO K = 1, 5
               IF (K .EQ. 3) CYCLE
10             PRINT *, 'I=', I, ' J=', J, ' K=', K
            END DO
         END DO
      END DO
20    CONTINUE

Adding new labels allows translation of CYCLE and EXIT to GO TO so they may be more easily understood by programmers accustomed to FORTRAN coding:

 
      DO I = 1, 5
         DO J = 1, 5
            IF (J .EQ. 5) GOTO 18
            DO K = 1, 5
               IF (K .EQ. 3) GO TO 12
10             PRINT *, 'I=', I, ' J=', J, ' K=', K
12          END DO
         END DO
18    END DO
20    CONTINUE

Thus, the CYCLE statement in the innermost loop skips over the PRINT statement as it begins the next iteration of the loop, while the EXIT statement in the middle loop ends that loop but not the outermost loop.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11 Functions and Subroutines

(The following information augments or overrides the information in Chapter 15 of ANSI X3.9-1978 FORTRAN 77 in specifying the GNU Fortran language. Chapter 15 of that document otherwise serves as the basis for the relevant aspects of GNU Fortran.)

8.11.1 The %VAL() Construct  
8.11.2 The %REF() Construct  
8.11.3 The %DESCR() Construct  
8.11.4 Generics and Specifics  
8.11.5 REAL() and AIMAG() of Complex  
8.11.6 CMPLX() of DOUBLE PRECISION  
8.11.7 MIL-STD 1753 Support  
8.11.8 f77/f2c Intrinsics  
8.11.9 Table of Intrinsic Functions  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.1 The %VAL() Construct

 
%VAL(arg)

The %VAL() construct specifies that an argument, arg, is to be passed by value, instead of by reference or descriptor.

%VAL() is restricted to actual arguments in invocations of external procedures.

Use of %VAL() is recommended only for code that is accessing facilities outside of GNU Fortran, such as operating system or windowing facilities. It is best to constrain such uses to isolated portions of a program--portions the deal specifically and exclusively with low-level, system-dependent facilities. Such portions might well provide a portable interface for use by the program as a whole, but are themselves not portable, and should be thoroughly tested each time they are rebuilt using a new compiler or version of a compiler.

Implementation Note: Currently, g77 passes all arguments either by reference or by descriptor.

Thus, use of %VAL() tends to be restricted to cases where the called procedure is written in a language other than Fortran that supports call-by-value semantics. (C is an example of such a language.)

See section Procedures (SUBROUTINE and FUNCTION), for detailed information on how this particular version of g77 passes arguments to procedures.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.2 The %REF() Construct

 
%REF(arg)

The %REF() construct specifies that an argument, arg, is to be passed by reference, instead of by value or descriptor.

%REF() is restricted to actual arguments in invocations of external procedures.

Use of %REF() is recommended only for code that is accessing facilities outside of GNU Fortran, such as operating system or windowing facilities. It is best to constrain such uses to isolated portions of a program--portions the deal specifically and exclusively with low-level, system-dependent facilities. Such portions might well provide a portable interface for use by the program as a whole, but are themselves not portable, and should be thoroughly tested each time they are rebuilt using a new compiler or version of a compiler.

Do not depend on %REF() supplying a pointer to the procedure being invoked. While that is a likely implementation choice, other implementation choices are available that preserve Fortran pass-by-reference semantics without passing a pointer to the argument, arg. (For example, a copy-in/copy-out implementation.)

Implementation Note: Currently, g77 passes all arguments (other than variables and arrays of type CHARACTER) by reference. Future versions of, or dialects supported by, g77 might not pass CHARACTER functions by reference.

Thus, use of %REF() tends to be restricted to cases where arg is type CHARACTER but the called procedure accesses it via a means other than the method used for Fortran CHARACTER arguments.

See section Procedures (SUBROUTINE and FUNCTION), for detailed information on how this particular version of g77 passes arguments to procedures.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.3 The %DESCR() Construct

 
%DESCR(arg)

The %DESCR() construct specifies that an argument, arg, is to be passed by descriptor, instead of by value or reference.

%DESCR() is restricted to actual arguments in invocations of external procedures.

Use of %DESCR() is recommended only for code that is accessing facilities outside of GNU Fortran, such as operating system or windowing facilities. It is best to constrain such uses to isolated portions of a program--portions the deal specifically and exclusively with low-level, system-dependent facilities. Such portions might well provide a portable interface for use by the program as a whole, but are themselves not portable, and should be thoroughly tested each time they are rebuilt using a new compiler or version of a compiler.

Do not depend on %DESCR() supplying a pointer and/or a length passed by value to the procedure being invoked. While that is a likely implementation choice, other implementation choices are available that preserve the pass-by-reference semantics without passing a pointer to the argument, arg. (For example, a copy-in/copy-out implementation.) And, future versions of g77 might change the way descriptors are implemented, such as passing a single argument pointing to a record containing the pointer/length information instead of passing that same information via two arguments as it currently does.

Implementation Note: Currently, g77 passes all variables and arrays of type CHARACTER by descriptor. Future versions of, or dialects supported by, g77 might pass CHARACTER functions by descriptor as well.

Thus, use of %DESCR() tends to be restricted to cases where arg is not type CHARACTER but the called procedure accesses it via a means similar to the method used for Fortran CHARACTER arguments.

See section Procedures (SUBROUTINE and FUNCTION), for detailed information on how this particular version of g77 passes arguments to procedures.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.4 Generics and Specifics

The ANSI FORTRAN 77 language defines generic and specific intrinsics. In short, the distinctions are:

The GNU Fortran language generalizes these concepts somewhat, especially by providing intrinsic subroutines and generic intrinsics that are treated as either a specific intrinsic subroutine or a specific intrinsic function (e.g. SECOND).

However, GNU Fortran avoids generalizing this concept to the point where existing code would be accepted as meaning something possibly different than what was intended.

For example, ABS is a generic intrinsic, so all working code written using ABS of an INTEGER argument expects an INTEGER return value. Similarly, all such code expects that ABS of an INTEGER*2 argument returns an INTEGER*2 return value.

Yet, IABS is a specific intrinsic that accepts only an INTEGER(KIND=1) argument. Code that passes something other than an INTEGER(KIND=1) argument to IABS is not valid GNU Fortran code, because it is not clear what the author intended.

For example, if `J' is INTEGER(KIND=6), `IABS(J)' is not defined by the GNU Fortran language, because the programmer might have used that construct to mean any of the following, subtly different, things:

The distinctions matter especially when types and values wider than INTEGER(KIND=1) (such as INTEGER(KIND=2)), or when operations performing more "arithmetic" than absolute-value, are involved.

The following sample program is not a valid GNU Fortran program, but might be accepted by other compilers. If so, the output is likely to be revealing in terms of how a given compiler treats intrinsics (that normally are specific) when they are given arguments that do not conform to their stated requirements:

 
      PROGRAM JCB002
C Version 1:
C Modified 1999-02-15 (Burley) to delete my email address.
C Modified 1997-05-21 (Burley) to accommodate compilers that implement
C INT(I1-I2) as INT(I1)-INT(I2) given INTEGER*2 I1,I2.
C
C Version 0:
C Written by James Craig Burley 1997-02-20.
C
C Purpose:
C Determine how compilers handle non-standard IDIM
C on INTEGER*2 operands, which presumably can be
C extrapolated into understanding how the compiler
C generally treats specific intrinsics that are passed
C arguments not of the correct types.
C
C If your compiler implements INTEGER*2 and INTEGER
C as the same type, change all INTEGER*2 below to
C INTEGER*1.
C
      INTEGER*2 I0, I4
      INTEGER I1, I2, I3
      INTEGER*2 ISMALL, ILARGE
      INTEGER*2 ITOOLG, ITWO
      INTEGER*2 ITMP
      LOGICAL L2, L3, L4
C
C Find smallest INTEGER*2 number.
C
      ISMALL=0
 10   I0 = ISMALL-1
      IF ((I0 .GE. ISMALL) .OR. (I0+1 .NE. ISMALL)) GOTO 20
      ISMALL = I0
      GOTO 10
 20   CONTINUE
C
C Find largest INTEGER*2 number.
C
      ILARGE=0
 30   I0 = ILARGE+1
      IF ((I0 .LE. ILARGE) .OR. (I0-1 .NE. ILARGE)) GOTO 40
      ILARGE = I0
      GOTO 30
 40   CONTINUE
C
C Multiplying by two adds stress to the situation.
C
      ITWO = 2
C
C Need a number that, added to -2, is too wide to fit in I*2.
C
      ITOOLG = ISMALL
C
C Use IDIM the straightforward way.
C
      I1 = IDIM (ILARGE, ISMALL) * ITWO + ITOOLG
C
C Calculate result for first interpretation.
C
      I2 = (INT (ILARGE) - INT (ISMALL)) * ITWO + ITOOLG
C
C Calculate result for second interpretation.
C
      ITMP = ILARGE - ISMALL
      I3 = (INT (ITMP)) * ITWO + ITOOLG
C
C Calculate result for third interpretation.
C
      I4 = (ILARGE - ISMALL) * ITWO + ITOOLG
C
C Print results.
C
      PRINT *, 'ILARGE=', ILARGE
      PRINT *, 'ITWO=', ITWO
      PRINT *, 'ITOOLG=', ITOOLG
      PRINT *, 'ISMALL=', ISMALL
      PRINT *, 'I1=', I1
      PRINT *, 'I2=', I2
      PRINT *, 'I3=', I3
      PRINT *, 'I4=', I4
      PRINT *
      L2 = (I1 .EQ. I2)
      L3 = (I1 .EQ. I3)
      L4 = (I1 .EQ. I4)
      IF (L2 .AND. .NOT.L3 .AND. .NOT.L4) THEN
         PRINT *, 'Interp 1: IDIM(I*2,I*2) => IDIM(INT(I*2),INT(I*2))'
         STOP
      END IF
      IF (L3 .AND. .NOT.L2 .AND. .NOT.L4) THEN
         PRINT *, 'Interp 2: IDIM(I*2,I*2) => INT(DIM(I*2,I*2))'
         STOP
      END IF
      IF (L4 .AND. .NOT.L2 .AND. .NOT.L3) THEN
         PRINT *, 'Interp 3: IDIM(I*2,I*2) => DIM(I*2,I*2)'
         STOP
      END IF
      PRINT *, 'Results need careful analysis.'
      END

No future version of the GNU Fortran language will likely permit specific intrinsic invocations with wrong-typed arguments (such as IDIM in the above example), since it has been determined that disagreements exist among many production compilers on the interpretation of such invocations. These disagreements strongly suggest that Fortran programmers, and certainly existing Fortran programs, disagree about the meaning of such invocations.

The first version of JCB002 didn't accommodate some compilers' treatment of `INT(I1-I2)' where `I1' and `I2' are INTEGER*2. In such a case, these compilers apparently convert both operands to INTEGER*4 and then do an INTEGER*4 subtraction, instead of doing an INTEGER*2 subtraction on the original values in `I1' and `I2'.

However, the results of the careful analyses done on the outputs of programs compiled by these various compilers show that they all implement either `Interp 1' or `Interp 2' above.

Specifically, it is believed that the new version of JCB002 above will confirm that:

If you get different results than the above for the stated compilers, or have results for other compilers that might be worth adding to the above list, please let us know the details (compiler product, version, machine, results, and so on).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.5 REAL() and AIMAG() of Complex

The GNU Fortran language disallows REAL(expr) and AIMAG(expr), where expr is any COMPLEX type other than COMPLEX(KIND=1), except when they are used in the following way:

 
REAL(REAL(expr))
REAL(AIMAG(expr))

The above forms explicitly specify that the desired effect is to convert the real or imaginary part of expr, which might be some REAL type other than REAL(KIND=1), to type REAL(KIND=1), and have that serve as the value of the expression.

The GNU Fortran language offers clearly named intrinsics to extract the real and imaginary parts of a complex entity without any conversion:

 
REALPART(expr)
IMAGPART(expr)

To express the above using typical extended FORTRAN 77, use the following constructs (when expr is COMPLEX(KIND=2)):

 
DBLE(expr)
DIMAG(expr)

The FORTRAN 77 language offers no way to explicitly specify the real and imaginary parts of a complex expression of arbitrary type, apparently as a result of requiring support for only one COMPLEX type (COMPLEX(KIND=1)). The concepts of converting an expression to type REAL(KIND=1) and of extracting the real part of a complex expression were thus "smooshed" by FORTRAN 77 into a single intrinsic, since they happened to have the exact same effect in that language (due to having only one COMPLEX type).

Note: When `-ff90' is in effect, g77 treats `REAL(expr)', where expr is of type COMPLEX, as `REALPART(expr)', whereas with `-fugly-complex -fno-f90' in effect, it is treated as `REAL(REALPART(expr))'.

See section 9.9.3 Ugly Complex Part Extraction, for more information.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.6 CMPLX() of DOUBLE PRECISION

In accordance with Fortran 90 and at least some (perhaps all) other compilers, the GNU Fortran language defines CMPLX() as always returning a result that is type COMPLEX(KIND=1).

This means `CMPLX(D1,D2)', where `D1' and `D2' are REAL(KIND=2) (DOUBLE PRECISION), is treated as:

 
CMPLX(SNGL(D1), SNGL(D2))

(It was necessary for Fortran 90 to specify this behavior for DOUBLE PRECISION arguments, since that is the behavior mandated by FORTRAN 77.)

The GNU Fortran language also provides the DCMPLX() intrinsic, which is provided by some FORTRAN 77 compilers to construct a DOUBLE COMPLEX entity from of DOUBLE PRECISION operands. However, this solution does not scale well when more COMPLEX types (having various precisions and ranges) are offered by Fortran implementations.

Fortran 90 extends the CMPLX() intrinsic by adding an extra argument used to specify the desired kind of complex result. However, this solution is somewhat awkward to use, and g77 currently does not support it.

The GNU Fortran language provides a simple way to build a complex value out of two numbers, with the precise type of the value determined by the types of the two numbers (via the usual type-promotion mechanism):

 
COMPLEX(real, imag)

When real and imag are the same REAL types, COMPLEX() performs no conversion other than to put them together to form a complex result of the same (complex version of real) type.

See section 8.11.9.44 Complex Intrinsic, for more information.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.7 MIL-STD 1753 Support

The GNU Fortran language includes the MIL-STD 1753 intrinsics BTEST, IAND, IBCLR, IBITS, IBSET, IEOR, IOR, ISHFT, ISHFTC, MVBITS, and NOT.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.8 f77/f2c Intrinsics

The bit-manipulation intrinsics supported by traditional f77 and by f2c are available in the GNU Fortran language. These include AND, LSHIFT, OR, RSHIFT, and XOR.

Also supported are the intrinsics CDABS, CDCOS, CDEXP, CDLOG, CDSIN, CDSQRT, DCMPLX, DCONJG, DFLOAT, DIMAG, DREAL, and IMAG, ZABS, ZCOS, ZEXP, ZLOG, ZSIN, and ZSQRT.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9 Table of Intrinsic Functions

(Corresponds to Section 15.10 of ANSI X3.9-1978 FORTRAN 77.)

The GNU Fortran language adds various functions, subroutines, types, and arguments to the set of intrinsic functions in ANSI FORTRAN 77. The complete set of intrinsics supported by the GNU Fortran language is described below.

Note that a name is not treated as that of an intrinsic if it is specified in an EXTERNAL statement in the same program unit; if a command-line option is used to disable the groups to which the intrinsic belongs; or if the intrinsic is not named in an INTRINSIC statement and a command-line option is used to hide the groups to which the intrinsic belongs.

So, it is recommended that any reference in a program unit to an intrinsic procedure that is not a standard FORTRAN 77 intrinsic be accompanied by an appropriate INTRINSIC statement in that program unit. This sort of defensive programming makes it more likely that an implementation will issue a diagnostic rather than generate incorrect code for such a reference.

The terminology used below is based on that of the Fortran 90 standard, so that the text may be more concise and accurate:

(Note that the empty lines appearing in the menu below are not intentional--they result from a bug in the GNU makeinfo program...a program that, if it did not exist, would leave this document in far worse shape!)

8.11.9.1 Abort Intrinsic  Abort the program.
8.11.9.2 Abs Intrinsic  Absolute value.
8.11.9.3 Access Intrinsic  Check file accessibility.
8.11.9.4 AChar Intrinsic  ASCII character from code.
8.11.9.5 ACos Intrinsic  Arc cosine.
8.11.9.6 AdjustL Intrinsic  (Reserved for future use.)
8.11.9.7 AdjustR Intrinsic  (Reserved for future use.)
8.11.9.8 AImag Intrinsic  Convert/extract imaginary part of complex.
8.11.9.9 AInt Intrinsic  Truncate to whole number.
8.11.9.10 Alarm Intrinsic  Execute a routine after a given delay.
8.11.9.11 All Intrinsic  (Reserved for future use.)
8.11.9.12 Allocated Intrinsic  (Reserved for future use.)
8.11.9.13 ALog Intrinsic  Natural logarithm (archaic).
8.11.9.14 ALog10 Intrinsic  Common logarithm (archaic).
8.11.9.15 AMax0 Intrinsic  Maximum value (archaic).
8.11.9.16 AMax1 Intrinsic  Maximum value (archaic).
8.11.9.17 AMin0 Intrinsic  Minimum value (archaic).
8.11.9.18 AMin1 Intrinsic  Minimum value (archaic).
8.11.9.19 AMod Intrinsic  Remainder (archaic).
8.11.9.20 And Intrinsic  Boolean AND.
8.11.9.21 ANInt Intrinsic  Round to nearest whole number.
8.11.9.22 Any Intrinsic  (Reserved for future use.)
8.11.9.23 ASin Intrinsic  Arc sine.
8.11.9.24 Associated Intrinsic  (Reserved for future use.)
8.11.9.25 ATan Intrinsic  Arc tangent.
8.11.9.26 ATan2 Intrinsic  Arc tangent.
8.11.9.27 BesJ0 Intrinsic  Bessel function.
8.11.9.28 BesJ1 Intrinsic  Bessel function.
8.11.9.29 BesJN Intrinsic  Bessel function.
8.11.9.30 BesY0 Intrinsic  Bessel function.
8.11.9.31 BesY1 Intrinsic  Bessel function.
8.11.9.32 BesYN Intrinsic  Bessel function.
8.11.9.33 Bit_Size Intrinsic  Number of bits in argument's type.
8.11.9.34 BTest Intrinsic  Test bit.
8.11.9.35 CAbs Intrinsic  Absolute value (archaic).
8.11.9.36 CCos Intrinsic  Cosine (archaic).
8.11.9.37 Ceiling Intrinsic  (Reserved for future use.)
8.11.9.38 CExp Intrinsic  Exponential (archaic).
8.11.9.39 Char Intrinsic  Character from code.
8.11.9.40 ChDir Intrinsic (subroutine)  Change directory.
8.11.9.41 ChMod Intrinsic (subroutine)  Change file modes.
8.11.9.42 CLog Intrinsic  Natural logarithm (archaic).
8.11.9.43 Cmplx Intrinsic  Construct COMPLEX(KIND=1) value.
8.11.9.44 Complex Intrinsic  Build complex value from real and imaginary parts.
8.11.9.45 Conjg Intrinsic  Complex conjugate.
8.11.9.46 Cos Intrinsic  Cosine.
8.11.9.47 CosH Intrinsic  Hyperbolic cosine.
8.11.9.48 Count Intrinsic  (Reserved for future use.)
8.11.9.49 CPU_Time Intrinsic  Get current CPU time.
8.11.9.50 CShift Intrinsic  (Reserved for future use.)
8.11.9.51 CSin Intrinsic  Sine (archaic).
8.11.9.52 CSqRt Intrinsic  Square root (archaic).
8.11.9.53 CTime Intrinsic (subroutine)  Convert time to Day Mon dd hh:mm:ss yyyy.
8.11.9.54 CTime Intrinsic (function)  Convert time to Day Mon dd hh:mm:ss yyyy.
8.11.9.55 DAbs Intrinsic  Absolute value (archaic).
8.11.9.56 DACos Intrinsic  Arc cosine (archaic).
8.11.9.57 DASin Intrinsic  Arc sine (archaic).
8.11.9.58 DATan Intrinsic  Arc tangent (archaic).
8.11.9.59 DATan2 Intrinsic  Arc tangent (archaic).
8.11.9.60 Date_and_Time Intrinsic  Get the current date and time.
8.11.9.61 DbesJ0 Intrinsic  Bessel function (archaic).
8.11.9.62 DbesJ1 Intrinsic  Bessel function (archaic).
8.11.9.63 DbesJN Intrinsic  Bessel function (archaic).
8.11.9.64 DbesY0 Intrinsic  Bessel function (archaic).
8.11.9.65 DbesY1 Intrinsic  Bessel function (archaic).
8.11.9.66 DbesYN Intrinsic  Bessel function (archaic).
8.11.9.67 Dble Intrinsic  Convert to double precision.
8.11.9.68 DCos Intrinsic  Cosine (archaic).
8.11.9.69 DCosH Intrinsic  Hyperbolic cosine (archaic).
8.11.9.70 DDiM Intrinsic  Difference magnitude (archaic).
8.11.9.71 DErF Intrinsic  Error function (archaic).
8.11.9.72 DErFC Intrinsic  Complementary error function (archaic).
8.11.9.73 DExp Intrinsic  Exponential (archaic).
8.11.9.74 Digits Intrinsic  (Reserved for future use.)
8.11.9.75 DiM Intrinsic  Difference magnitude (non-negative subtract).
8.11.9.76 DInt Intrinsic  Truncate to whole number (archaic).
8.11.9.77 DLog Intrinsic  Natural logarithm (archaic).
8.11.9.78 DLog10 Intrinsic  Common logarithm (archaic).
8.11.9.79 DMax1 Intrinsic  Maximum value (archaic).
8.11.9.80 DMin1 Intrinsic  Minimum value (archaic).
8.11.9.81 DMod Intrinsic  Remainder (archaic).
8.11.9.82 DNInt Intrinsic  Round to nearest whole number (archaic).
8.11.9.83 Dot_Product Intrinsic  (Reserved for future use.)
8.11.9.84 DProd Intrinsic  Double-precision product.
8.11.9.85 DSign Intrinsic  Apply sign to magnitude (archaic).
8.11.9.86 DSin Intrinsic  Sine (archaic).
8.11.9.87 DSinH Intrinsic  Hyperbolic sine (archaic).
8.11.9.88 DSqRt Intrinsic  Square root (archaic).
8.11.9.89 DTan Intrinsic  Tangent (archaic).
8.11.9.90 DTanH Intrinsic  Hyperbolic tangent (archaic).
8.11.9.91 DTime Intrinsic (subroutine)  Get elapsed time since last time.
8.11.9.92 EOShift Intrinsic  (Reserved for future use.)
8.11.9.93 Epsilon Intrinsic  (Reserved for future use.)
8.11.9.94 ErF Intrinsic  Error function.
8.11.9.95 ErFC Intrinsic  Complementary error function.
8.11.9.96 ETime Intrinsic (subroutine)  Get elapsed time for process.
8.11.9.97 ETime Intrinsic (function)  Get elapsed time for process.
8.11.9.98 Exit Intrinsic  Terminate the program.
8.11.9.99 Exp Intrinsic  Exponential.
8.11.9.100 Exponent Intrinsic  (Reserved for future use.)
8.11.9.101 FDate Intrinsic (subroutine)  Get current time as Day Mon dd hh:mm:ss yyyy.
8.11.9.102 FDate Intrinsic (function)  Get current time as Day Mon dd hh:mm:ss yyyy.
8.11.9.103 FGet Intrinsic (subroutine)  Read a character from unit 5 stream-wise.
8.11.9.104 FGetC Intrinsic (subroutine)  Read a character stream-wise.
8.11.9.105 Float Intrinsic  Conversion (archaic).
8.11.9.106 Floor Intrinsic  (Reserved for future use.)
8.11.9.107 Flush Intrinsic  Flush buffered output.
8.11.9.108 FNum Intrinsic  Get file descriptor from Fortran unit number.
8.11.9.109 FPut Intrinsic (subroutine)  Write a character to unit 6 stream-wise.
8.11.9.110 FPutC Intrinsic (subroutine)  Write a character stream-wise.
8.11.9.111 Fraction Intrinsic  (Reserved for future use.)
8.11.9.112 FSeek Intrinsic  Position file (low-level).
8.11.9.113 FStat Intrinsic (subroutine)  Get file information.
8.11.9.114 FStat Intrinsic (function)  Get file information.
8.11.9.115 FTell Intrinsic (subroutine)  Get file position (low-level).
8.11.9.116 FTell Intrinsic (function)  Get file position (low-level).
8.11.9.117 GError Intrinsic  Get error message for last error.
8.11.9.118 GetArg Intrinsic  Obtain command-line argument.
8.11.9.119 GetCWD Intrinsic (subroutine)  Get current working directory.
8.11.9.120 GetCWD Intrinsic (function)  Get current working directory.
8.11.9.121 GetEnv Intrinsic  Get environment variable.
8.11.9.122 GetGId Intrinsic  Get process group id.
8.11.9.123 GetLog Intrinsic  Get login name.
8.11.9.124 GetPId Intrinsic  Get process id.
8.11.9.125 GetUId Intrinsic  Get process user id.
8.11.9.126 GMTime Intrinsic  Convert time to GMT time info.
8.11.9.127 HostNm Intrinsic (subroutine)  Get host name.
8.11.9.128 HostNm Intrinsic (function)  Get host name.
8.11.9.129 Huge Intrinsic  (Reserved for future use.)
8.11.9.130 IAbs Intrinsic  Absolute value (archaic).
8.11.9.131 IAChar Intrinsic  ASCII code for character.
8.11.9.132 IAnd Intrinsic  Boolean AND.
8.11.9.133 IArgC Intrinsic  Obtain count of command-line arguments.
8.11.9.134 IBClr Intrinsic  Clear a bit.
8.11.9.135 IBits Intrinsic  Extract a bit subfield of a variable.
8.11.9.136 IBSet Intrinsic  Set a bit.
8.11.9.137 IChar Intrinsic  Code for character.
8.11.9.138 IDate Intrinsic (UNIX)  Get local time info.
8.11.9.139 IDiM Intrinsic  Difference magnitude (archaic).
8.11.9.140 IDInt Intrinsic  Convert to INTEGER value truncated to whole number (archaic).
8.11.9.141 IDNInt Intrinsic  Convert to INTEGER value rounded to nearest whole number (archaic).
8.11.9.142 IEOr Intrinsic  Boolean XOR.
8.11.9.143 IErrNo Intrinsic  Get error number for last error.
8.11.9.144 IFix Intrinsic  Conversion (archaic).
8.11.9.145 Imag Intrinsic  Extract imaginary part of complex.
8.11.9.146 ImagPart Intrinsic  Extract imaginary part of complex.
8.11.9.147 Index Intrinsic  Locate a CHARACTER substring.
8.11.9.148 Int Intrinsic  Convert to INTEGER value truncated to whole number.
8.11.9.149 Int2 Intrinsic  Convert to INTEGER(KIND=6) value truncated to whole number.
8.11.9.150 Int8 Intrinsic  Convert to INTEGER(KIND=2) value truncated to whole number.
8.11.9.151 IOr Intrinsic  Boolean OR.
8.11.9.152 IRand Intrinsic  Random number.
8.11.9.153 IsaTty Intrinsic  Is unit connected to a terminal?
8.11.9.154 IShft Intrinsic  Logical bit shift.
8.11.9.155 IShftC Intrinsic  Circular bit shift.
8.11.9.156 ISign Intrinsic  Apply sign to magnitude (archaic).
8.11.9.157 ITime Intrinsic  Get local time of day.
8.11.9.158 Kill Intrinsic (subroutine)  Signal a process.
8.11.9.159 Kind Intrinsic  (Reserved for future use.)
8.11.9.160 LBound Intrinsic  (Reserved for future use.)
8.11.9.161 Len Intrinsic  Length of character entity.
8.11.9.162 Len_Trim Intrinsic  Get last non-blank character in string.
8.11.9.163 LGe Intrinsic  Lexically greater than or equal.
8.11.9.164 LGt Intrinsic  Lexically greater than.
8.11.9.165 Link Intrinsic (subroutine)  Make hard link in file system.
8.11.9.166 LLe Intrinsic  Lexically less than or equal.
8.11.9.167 LLt Intrinsic  Lexically less than.
8.11.9.168 LnBlnk Intrinsic  Get last non-blank character in string.
8.11.9.169 Loc Intrinsic  Address of entity in core.
8.11.9.170 Log Intrinsic  Natural logarithm.
8.11.9.171 Log10 Intrinsic  Common logarithm.
8.11.9.172 Logical Intrinsic  (Reserved for future use.)
8.11.9.173 Long Intrinsic  Conversion to INTEGER(KIND=1) (archaic).
8.11.9.174 LShift Intrinsic  Left-shift bits.
8.11.9.175 LStat Intrinsic (subroutine)  Get file information.
8.11.9.176 LStat Intrinsic (function)  Get file information.
8.11.9.177 LTime Intrinsic  Convert time to local time info.
8.11.9.178 MatMul Intrinsic  (Reserved for future use.)
8.11.9.179 Max Intrinsic  Maximum value.
8.11.9.180 Max0 Intrinsic  Maximum value (archaic).
8.11.9.181 Max1 Intrinsic  Maximum value (archaic).
8.11.9.182 MaxExponent Intrinsic  (Reserved for future use.)
8.11.9.183 MaxLoc Intrinsic  (Reserved for future use.)
8.11.9.184 MaxVal Intrinsic  (Reserved for future use.)
8.11.9.185 MClock Intrinsic  Get number of clock ticks for process.
8.11.9.186 MClock8 Intrinsic  Get number of clock ticks for process.
8.11.9.187 Merge Intrinsic  (Reserved for future use.)
8.11.9.188 Min Intrinsic  Minimum value.
8.11.9.189 Min0 Intrinsic  Minimum value (archaic).
8.11.9.190 Min1 Intrinsic  Minimum value (archaic).
8.11.9.191 MinExponent Intrinsic  (Reserved for future use.)
8.11.9.192 MinLoc Intrinsic  (Reserved for future use.)
8.11.9.193 MinVal Intrinsic  (Reserved for future use.)
8.11.9.194 Mod Intrinsic  Remainder.
8.11.9.195 Modulo Intrinsic  (Reserved for future use.)
8.11.9.196 MvBits Intrinsic  Moving a bit field.
8.11.9.197 Nearest Intrinsic  (Reserved for future use.)
8.11.9.198 NInt Intrinsic  Convert to INTEGER value rounded to nearest whole number.
8.11.9.199 Not Intrinsic  Boolean NOT.
8.11.9.200 Or Intrinsic  Boolean OR.
8.11.9.201 Pack Intrinsic  (Reserved for future use.)
8.11.9.202 PError Intrinsic  Print error message for last error.
8.11.9.203 Precision Intrinsic  (Reserved for future use.)
8.11.9.204 Present Intrinsic  (Reserved for future use.)
8.11.9.205 Product Intrinsic  (Reserved for future use.)
8.11.9.206 Radix Intrinsic  (Reserved for future use.)
8.11.9.207 Rand Intrinsic  Random number.
8.11.9.208 Random_Number Intrinsic  (Reserved for future use.)
8.11.9.209 Random_Seed Intrinsic  (Reserved for future use.)
8.11.9.210 Range Intrinsic  (Reserved for future use.)
8.11.9.211 Real Intrinsic  Convert value to type REAL(KIND=1).
8.11.9.212 RealPart Intrinsic  Extract real part of complex.
8.11.9.213 Rename Intrinsic (subroutine)  Rename file.
8.11.9.214 Repeat Intrinsic  (Reserved for future use.)
8.11.9.215 Reshape Intrinsic  (Reserved for future use.)
8.11.9.216 RRSpacing Intrinsic  (Reserved for future use.)
8.11.9.217 RShift Intrinsic  Right-shift bits.
8.11.9.218 Scale Intrinsic  (Reserved for future use.)
8.11.9.219 Scan Intrinsic  (Reserved for future use.)
8.11.9.220 Second Intrinsic (function)  Get CPU time for process in seconds.
8.11.9.221 Second Intrinsic (subroutine)  Get CPU time for process in seconds.
8.11.9.222 Selected_Int_Kind Intrinsic  (Reserved for future use.)
8.11.9.223 Selected_Real_Kind Intrinsic  (Reserved for future use.)
8.11.9.224 Set_Exponent Intrinsic  (Reserved for future use.)
8.11.9.225 Shape Intrinsic  (Reserved for future use.)
8.11.9.226 Short Intrinsic  Convert to INTEGER(KIND=6) value truncated to whole number.
8.11.9.227 Sign Intrinsic  Apply sign to magnitude.
8.11.9.228 Signal Intrinsic (subroutine)  Muck with signal handling.
8.11.9.229 Sin Intrinsic  Sine.
8.11.9.230 SinH Intrinsic  Hyperbolic sine.
8.11.9.231 Sleep Intrinsic  Sleep for a specified time.
8.11.9.232 Sngl Intrinsic  Convert (archaic).
8.11.9.233 Spacing Intrinsic  (Reserved for future use.)
8.11.9.234 Spread Intrinsic  (Reserved for future use.)
8.11.9.235 SqRt Intrinsic  Square root.
8.11.9.236 SRand Intrinsic  Random seed.
8.11.9.237 Stat Intrinsic (subroutine)  Get file information.
8.11.9.238 Stat Intrinsic (function)  Get file information.
8.11.9.239 Sum Intrinsic  (Reserved for future use.)
8.11.9.240 SymLnk Intrinsic (subroutine)  Make symbolic link in file system.
8.11.9.241 System Intrinsic (subroutine)  Invoke shell (system) command.
8.11.9.242 System_Clock Intrinsic  Get current system clock value.
8.11.9.243 Tan Intrinsic  Tangent.
8.11.9.244 TanH Intrinsic  Hyperbolic tangent.
8.11.9.245 Time Intrinsic (UNIX)  Get current time as time value.
8.11.9.246 Time8 Intrinsic  Get current time as time value.
8.11.9.247 Tiny Intrinsic  (Reserved for future use.)
8.11.9.248 Transfer Intrinsic  (Reserved for future use.)
8.11.9.249 Transpose Intrinsic  (Reserved for future use.)
8.11.9.250 Trim Intrinsic  (Reserved for future use.)
8.11.9.251 TtyNam Intrinsic (subroutine)  Get name of terminal device for unit.
8.11.9.252 TtyNam Intrinsic (function)  Get name of terminal device for unit.
8.11.9.253 UBound Intrinsic  (Reserved for future use.)
8.11.9.254 UMask Intrinsic (subroutine)  Set file creation permissions mask.
8.11.9.255 Unlink Intrinsic (subroutine)  Unlink file.
8.11.9.256 Unpack Intrinsic  (Reserved for future use.)
8.11.9.257 Verify Intrinsic  (Reserved for future use.)
8.11.9.258 XOr Intrinsic  Boolean XOR.
8.11.9.259 ZAbs Intrinsic  Absolute value (archaic).
8.11.9.260 ZCos Intrinsic  Cosine (archaic).
8.11.9.261 ZExp Intrinsic  Exponential (archaic).
8.11.9.262 ZLog Intrinsic  Natural logarithm (archaic).
8.11.9.263 ZSin Intrinsic  Sine (archaic).
8.11.9.264 ZSqRt Intrinsic  Square root (archaic).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.1 Abort Intrinsic

 
CALL Abort()

Intrinsic groups: unix.

Description:

Prints a message and potentially causes a core dump via abort(3).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.2 Abs Intrinsic

 
Abs(A)

Abs: INTEGER or REAL function. The exact type depends on that of argument A---if A is COMPLEX, this function's type is REAL with the same `KIND=' value as the type of A. Otherwise, this function's type is the same as that of A.

A: INTEGER, REAL, or COMPLEX; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the absolute value of A.

If A is type COMPLEX, the absolute value is computed as:

 
SQRT(REALPART(A)**2, IMAGPART(A)**2)

Otherwise, it is computed by negating the A if it is negative, or returning A.

See section 8.11.9.227 Sign Intrinsic, for how to explicitly compute the positive or negative form of the absolute value of an expression.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.3 Access Intrinsic

 
Access(Name, Mode)

Access: INTEGER(KIND=1) function.

Name: CHARACTER; scalar; INTENT(IN).

Mode: CHARACTER; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Checks file Name for accessibility in the mode specified by Mode and returns 0 if the file is accessible in that mode, otherwise an error code if the file is inaccessible or Mode is invalid. See access(2). A null character (`CHAR(0)') marks the end of the name in Name---otherwise, trailing blanks in Name are ignored. Mode may be a concatenation of any of the following characters:

`r'
Read permission

`w'
Write permission

`x'
Execute permission

`SPC'
Existence


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.4 AChar Intrinsic

 
AChar(I)

AChar: CHARACTER*1 function.

I: INTEGER; scalar; INTENT(IN).

Intrinsic groups: f2c, f90.

Description:

Returns the ASCII character corresponding to the code specified by I.

See section 8.11.9.131 IAChar Intrinsic, for the inverse of this function.

See section 8.11.9.39 Char Intrinsic, for the function corresponding to the system's native character set.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.5 ACos Intrinsic

 
ACos(X)

ACos: REAL function, the `KIND=' value of the type being that of argument X.

X: REAL; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the arc-cosine (inverse cosine) of X in radians.

See section 8.11.9.46 Cos Intrinsic, for the inverse of this function.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.6 AdjustL Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL AdjustL' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.7 AdjustR Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL AdjustR' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.8 AImag Intrinsic

 
AImag(Z)

AImag: REAL function. This intrinsic is valid when argument Z is COMPLEX(KIND=1). When Z is any other COMPLEX type, this intrinsic is valid only when used as the argument to REAL(), as explained below.

Z: COMPLEX; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the (possibly converted) imaginary part of Z.

Use of AIMAG() with an argument of a type other than COMPLEX(KIND=1) is restricted to the following case:

 
REAL(AIMAG(Z))

This expression converts the imaginary part of Z to REAL(KIND=1).

See section 8.11.5 REAL() and AIMAG() of Complex, for more information.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.9 AInt Intrinsic

 
AInt(A)

AInt: REAL function, the `KIND=' value of the type being that of argument A.

A: REAL; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns A with the fractional portion of its magnitude truncated and its sign preserved. (Also called "truncation towards zero".)

See section 8.11.9.21 ANInt Intrinsic, for how to round to nearest whole number.

See section 8.11.9.148 Int Intrinsic, for how to truncate and then convert number to INTEGER.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.10 Alarm Intrinsic

 
CALL Alarm(Seconds, Handler, Status)

Seconds: INTEGER; scalar; INTENT(IN).

Handler: Signal handler (INTEGER FUNCTION or SUBROUTINE) or dummy/global INTEGER(KIND=1) scalar.

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Causes external subroutine Handler to be executed after a delay of Seconds seconds by using alarm(1) to set up a signal and signal(2) to catch it. If Status is supplied, it will be returned with the number of seconds remaining until any previously scheduled alarm was due to be delivered, or zero if there was no previously scheduled alarm. See section 8.11.9.228 Signal Intrinsic (subroutine).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.11 All Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL All' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.12 Allocated Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Allocated' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.13 ALog Intrinsic

 
ALog(X)

ALog: REAL(KIND=1) function.

X: REAL(KIND=1); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of LOG() that is specific to one type for X. See section 8.11.9.170 Log Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.14 ALog10 Intrinsic

 
ALog10(X)

ALog10: REAL(KIND=1) function.

X: REAL(KIND=1); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of LOG10() that is specific to one type for X. See section 8.11.9.171 Log10 Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.15 AMax0 Intrinsic

 
AMax0(A-1, A-2, ..., A-n)

AMax0: REAL(KIND=1) function.

A: INTEGER(KIND=1); at least two such arguments must be provided; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of MAX() that is specific to one type for A and a different return type. See section 8.11.9.179 Max Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.16 AMax1 Intrinsic

 
AMax1(A-1, A-2, ..., A-n)

AMax1: REAL(KIND=1) function.

A: REAL(KIND=1); at least two such arguments must be provided; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of MAX() that is specific to one type for A. See section 8.11.9.179 Max Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.17 AMin0 Intrinsic

 
AMin0(A-1, A-2, ..., A-n)

AMin0: REAL(KIND=1) function.

A: INTEGER(KIND=1); at least two such arguments must be provided; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of MIN() that is specific to one type for A and a different return type. See section 8.11.9.188 Min Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.18 AMin1 Intrinsic

 
AMin1(A-1, A-2, ..., A-n)

AMin1: REAL(KIND=1) function.

A: REAL(KIND=1); at least two such arguments must be provided; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of MIN() that is specific to one type for A. See section 8.11.9.188 Min Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.19 AMod Intrinsic

 
AMod(A, P)

AMod: REAL(KIND=1) function.

A: REAL(KIND=1); scalar; INTENT(IN).

P: REAL(KIND=1); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of MOD() that is specific to one type for A. See section 8.11.9.194 Mod Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.20 And Intrinsic

 
And(I, J)

And: INTEGER or LOGICAL function, the exact type being the result of cross-promoting the types of all the arguments.

I: INTEGER or LOGICAL; scalar; INTENT(IN).

J: INTEGER or LOGICAL; scalar; INTENT(IN).

Intrinsic groups: f2c.

Description:

Returns value resulting from boolean AND of pair of bits in each of I and J.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.21 ANInt Intrinsic

 
ANInt(A)

ANInt: REAL function, the `KIND=' value of the type being that of argument A.

A: REAL; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns A with the fractional portion of its magnitude eliminated by rounding to the nearest whole number and with its sign preserved.

A fractional portion exactly equal to `.5' is rounded to the whole number that is larger in magnitude. (Also called "Fortran round".)

See section 8.11.9.9 AInt Intrinsic, for how to truncate to whole number.

See section 8.11.9.198 NInt Intrinsic, for how to round and then convert number to INTEGER.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.22 Any Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Any' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.23 ASin Intrinsic

 
ASin(X)

ASin: REAL function, the `KIND=' value of the type being that of argument X.

X: REAL; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the arc-sine (inverse sine) of X in radians.

See section 8.11.9.229 Sin Intrinsic, for the inverse of this function.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.24 Associated Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Associated' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.25 ATan Intrinsic

 
ATan(X)

ATan: REAL function, the `KIND=' value of the type being that of argument X.

X: REAL; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the arc-tangent (inverse tangent) of X in radians.

See section 8.11.9.243 Tan Intrinsic, for the inverse of this function.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.26 ATan2 Intrinsic

 
ATan2(Y, X)

ATan2: REAL function, the exact type being the result of cross-promoting the types of all the arguments.

Y: REAL; scalar; INTENT(IN).

X: REAL; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the arc-tangent (inverse tangent) of the complex number (Y, X) in radians.

See section 8.11.9.243 Tan Intrinsic, for the inverse of this function.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.27 BesJ0 Intrinsic

 
BesJ0(X)

BesJ0: REAL function, the `KIND=' value of the type being that of argument X.

X: REAL; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Calculates the Bessel function of the first kind of order 0 of X. See bessel(3m), on whose implementation the function depends.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.28 BesJ1 Intrinsic

 
BesJ1(X)

BesJ1: REAL function, the `KIND=' value of the type being that of argument X.

X: REAL; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Calculates the Bessel function of the first kind of order 1 of X. See bessel(3m), on whose implementation the function depends.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.29 BesJN Intrinsic

 
BesJN(N, X)

BesJN: REAL function, the `KIND=' value of the type being that of argument X.

N: INTEGER; scalar; INTENT(IN).

X: REAL; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Calculates the Bessel function of the first kind of order N of X. See bessel(3m), on whose implementation the function depends.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.30 BesY0 Intrinsic

 
BesY0(X)

BesY0: REAL function, the `KIND=' value of the type being that of argument X.

X: REAL; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Calculates the Bessel function of the second kind of order 0 of X. See bessel(3m), on whose implementation the function depends.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.31 BesY1 Intrinsic

 
BesY1(X)

BesY1: REAL function, the `KIND=' value of the type being that of argument X.

X: REAL; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Calculates the Bessel function of the second kind of order 1 of X. See bessel(3m), on whose implementation the function depends.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.32 BesYN Intrinsic

 
BesYN(N, X)

BesYN: REAL function, the `KIND=' value of the type being that of argument X.

N: INTEGER; scalar; INTENT(IN).

X: REAL; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Calculates the Bessel function of the second kind of order N of X. See bessel(3m), on whose implementation the function depends.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.33 Bit_Size Intrinsic

 
Bit_Size(I)

Bit_Size: INTEGER function, the `KIND=' value of the type being that of argument I.

I: INTEGER; scalar.

Intrinsic groups: f90.

Description:

Returns the number of bits (integer precision plus sign bit) represented by the type for I.

See section 8.11.9.34 BTest Intrinsic, for how to test the value of a bit in a variable or array.

See section 8.11.9.136 IBSet Intrinsic, for how to set a bit in a variable to 1.

See section 8.11.9.134 IBClr Intrinsic, for how to set a bit in a variable to 0.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.34 BTest Intrinsic

 
BTest(I, Pos)

BTest: LOGICAL(KIND=1) function.

I: INTEGER; scalar; INTENT(IN).

Pos: INTEGER; scalar; INTENT(IN).

Intrinsic groups: mil, f90, vxt.

Description:

Returns .TRUE. if bit Pos in I is 1, .FALSE. otherwise.

(Bit 0 is the low-order (rightmost) bit, adding the value 2**0, or 1, to the number if set to 1; bit 1 is the next-higher-order bit, adding 2**1, or 2; bit 2 adds 2**2, or 4; and so on.)

See section 8.11.9.33 Bit_Size Intrinsic, for how to obtain the number of bits in a type. The leftmost bit of I is `BIT_SIZE(I-1)'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.35 CAbs Intrinsic

 
CAbs(A)

CAbs: REAL(KIND=1) function.

A: COMPLEX(KIND=1); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of ABS() that is specific to one type for A. See section 8.11.9.2 Abs Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.36 CCos Intrinsic

 
CCos(X)

CCos: COMPLEX(KIND=1) function.

X: COMPLEX(KIND=1); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of COS() that is specific to one type for X. See section 8.11.9.46 Cos Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.37 Ceiling Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Ceiling' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.38 CExp Intrinsic

 
CExp(X)

CExp: COMPLEX(KIND=1) function.

X: COMPLEX(KIND=1); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of EXP() that is specific to one type for X. See section 8.11.9.99 Exp Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.39 Char Intrinsic

 
Char(I)

Char: CHARACTER*1 function.

I: INTEGER; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the character corresponding to the code specified by I, using the system's native character set.

Because the system's native character set is used, the correspondence between character and their codes is not necessarily the same between GNU Fortran implementations.

Note that no intrinsic exists to convert a numerical value to a printable character string. For example, there is no intrinsic that, given an INTEGER or REAL argument with the value `154', returns the CHARACTER result `'154''.

Instead, you can use internal-file I/O to do this kind of conversion. For example:

 
INTEGER VALUE
CHARACTER*10 STRING
VALUE = 154
WRITE (STRING, '(I10)'), VALUE
PRINT *, STRING
END

The above program, when run, prints:

 
        154

See section 8.11.9.137 IChar Intrinsic, for the inverse of the CHAR function.

See section 8.11.9.4 AChar Intrinsic, for the function corresponding to the ASCII character set.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.40 ChDir Intrinsic (subroutine)

 
CALL ChDir(Dir, Status)

Dir: CHARACTER; scalar; INTENT(IN).

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Sets the current working directory to be Dir. If the Status argument is supplied, it contains 0 on success or a non-zero error code otherwise upon return. See chdir(3).

Caution: Using this routine during I/O to a unit connected with a non-absolute file name can cause subsequent I/O on such a unit to fail because the I/O library might reopen files by name.

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine, or do not support the (optional) Status argument.

For information on other intrinsics with the same name: See section 10.5.2.17 ChDir Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.41 ChMod Intrinsic (subroutine)

 
CALL ChMod(Name, Mode, Status)

Name: CHARACTER; scalar; INTENT(IN).

Mode: CHARACTER; scalar; INTENT(IN).

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Changes the access mode of file Name according to the specification Mode, which is given in the format of chmod(1). A null character (`CHAR(0)') marks the end of the name in Name---otherwise, trailing blanks in Name are ignored. Currently, Name must not contain the single quote character.

If the Status argument is supplied, it contains 0 on success or a non-zero error code upon return.

Note that this currently works by actually invoking /bin/chmod (or the chmod found when the library was configured) and so might fail in some circumstances and will, anyway, be slow.

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine, or do not support the (optional) Status argument.

For information on other intrinsics with the same name: See section 10.5.2.18 ChMod Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.42 CLog Intrinsic

 
CLog(X)

CLog: COMPLEX(KIND=1) function.

X: COMPLEX(KIND=1); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of LOG() that is specific to one type for X. See section 8.11.9.170 Log Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.43 Cmplx Intrinsic

 
Cmplx(X, Y)

Cmplx: COMPLEX(KIND=1) function.

X: INTEGER, REAL, or COMPLEX; scalar; INTENT(IN).

Y: INTEGER or REAL; OPTIONAL (must be omitted if X is COMPLEX); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

If X is not type COMPLEX, constructs a value of type COMPLEX(KIND=1) from the real and imaginary values specified by X and Y, respectively. If Y is omitted, `0.' is assumed.

If X is type COMPLEX, converts it to type COMPLEX(KIND=1).

See section 8.11.9.44 Complex Intrinsic, for information on easily constructing a COMPLEX value of arbitrary precision from REAL arguments.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.44 Complex Intrinsic

 
Complex(Real, Imag)

Complex: COMPLEX function, the exact type being the result of cross-promoting the types of all the arguments.

Real: INTEGER or REAL; scalar; INTENT(IN).

Imag: INTEGER or REAL; scalar; INTENT(IN).

Intrinsic groups: gnu.

Description:

Returns a COMPLEX value that has `Real' and `Imag' as its real and imaginary parts, respectively.

If Real and Imag are the same type, and that type is not INTEGER, no data conversion is performed, and the type of the resulting value has the same kind value as the types of Real and Imag.

If Real and Imag are not the same type, the usual type-promotion rules are applied to both, converting either or both to the appropriate REAL type. The type of the resulting value has the same kind value as the type to which both Real and Imag were converted, in this case.

If Real and Imag are both INTEGER, they are both converted to REAL(KIND=1), and the result of the COMPLEX() invocation is type COMPLEX(KIND=1).

Note: The way to do this in standard Fortran 90 is too hairy to describe here, but it is important to note that `CMPLX(D1,D2)' returns a COMPLEX(KIND=1) result even if `D1' and `D2' are type REAL(KIND=2). Hence the availability of COMPLEX() in GNU Fortran.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.45 Conjg Intrinsic

 
Conjg(Z)

Conjg: COMPLEX function, the `KIND=' value of the type being that of argument Z.

Z: COMPLEX; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the complex conjugate:

 
COMPLEX(REALPART(Z), -IMAGPART(Z))


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.46 Cos Intrinsic

 
Cos(X)

Cos: REAL or COMPLEX function, the exact type being that of argument X.

X: REAL or COMPLEX; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the cosine of X, an angle measured in radians.

See section 8.11.9.5 ACos Intrinsic, for the inverse of this function.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.47 CosH Intrinsic

 
CosH(X)

CosH: REAL function, the `KIND=' value of the type being that of argument X.

X: REAL; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the hyperbolic cosine of X.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.48 Count Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Count' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.49 CPU_Time Intrinsic

 
CALL CPU_Time(Seconds)

Seconds: REAL; scalar; INTENT(OUT).

Intrinsic groups: f90.

Description:

Returns in Seconds the current value of the system time. This implementation of the Fortran 95 intrinsic is just an alias for second See section 8.11.9.221 Second Intrinsic (subroutine).

On some systems, the underlying timings are represented using types with sufficiently small limits that overflows (wraparounds) are possible, such as 32-bit types. Therefore, the values returned by this intrinsic might be, or become, negative, or numerically less than previous values, during a single run of the compiled program.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.50 CShift Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL CShift' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.51 CSin Intrinsic

 
CSin(X)

CSin: COMPLEX(KIND=1) function.

X: COMPLEX(KIND=1); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of SIN() that is specific to one type for X. See section 8.11.9.229 Sin Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.52 CSqRt Intrinsic

 
CSqRt(X)

CSqRt: COMPLEX(KIND=1) function.

X: COMPLEX(KIND=1); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of SQRT() that is specific to one type for X. See section 8.11.9.235 SqRt Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.53 CTime Intrinsic (subroutine)

 
CALL CTime(STime, Result)

STime: INTEGER; scalar; INTENT(IN).

Result: CHARACTER; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Converts STime, a system time value, such as returned by TIME8(), to a string of the form `Sat Aug 19 18:13:14 1995', and returns that string in Result.

See section 8.11.9.246 Time8 Intrinsic.

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine.

For information on other intrinsics with the same name: See section 8.11.9.54 CTime Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.54 CTime Intrinsic (function)

 
CTime(STime)

CTime: CHARACTER*(*) function.

STime: INTEGER; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Converts STime, a system time value, such as returned by TIME8(), to a string of the form `Sat Aug 19 18:13:14 1995', and returns that string as the function value.

See section 8.11.9.246 Time8 Intrinsic.

For information on other intrinsics with the same name: See section 8.11.9.53 CTime Intrinsic (subroutine).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.55 DAbs Intrinsic

 
DAbs(A)

DAbs: REAL(KIND=2) function.

A: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of ABS() that is specific to one type for A. See section 8.11.9.2 Abs Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.56 DACos Intrinsic

 
DACos(X)

DACos: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of ACOS() that is specific to one type for X. See section 8.11.9.5 ACos Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.57 DASin Intrinsic

 
DASin(X)

DASin: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of ASIN() that is specific to one type for X. See section 8.11.9.23 ASin Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.58 DATan Intrinsic

 
DATan(X)

DATan: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of ATAN() that is specific to one type for X. See section 8.11.9.25 ATan Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.59 DATan2 Intrinsic

 
DATan2(Y, X)

DATan2: REAL(KIND=2) function.

Y: REAL(KIND=2); scalar; INTENT(IN).

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of ATAN2() that is specific to one type for Y and X. See section 8.11.9.26 ATan2 Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.60 Date_and_Time Intrinsic

 
CALL Date_and_Time(Date, Time, Zone, Values)

Date: CHARACTER; scalar; INTENT(OUT).

Time: CHARACTER; OPTIONAL; scalar; INTENT(OUT).

Zone: CHARACTER; OPTIONAL; scalar; INTENT(OUT).

Values: INTEGER(KIND=1); OPTIONAL; DIMENSION(8); INTENT(OUT).

Intrinsic groups: f90.

Description:

Returns:

Date
The date in the form ccyymmdd: century, year, month and day;
Time
The time in the form `hhmmss.ss': hours, minutes, seconds and milliseconds;
Zone
The difference between local time and UTC (GMT) in the form Shhmm: sign, hours and minutes, e.g. `-0500' (winter in New York);
Values
The year, month of the year, day of the month, time difference in minutes from UTC, hour of the day, minutes of the hour, seconds of the minute, and milliseconds of the second in successive values of the array.

Programs making use of this intrinsic might not be Year 10000 (Y10K) compliant. For example, the date might appear, to such programs, to wrap around (change from a larger value to a smaller one) as of the Year 10000.

On systems where a millisecond timer isn't available, the millisecond value is returned as zero.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.61 DbesJ0 Intrinsic

 
DbesJ0(X)

DbesJ0: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Archaic form of BESJ0() that is specific to one type for X. See section 8.11.9.27 BesJ0 Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.62 DbesJ1 Intrinsic

 
DbesJ1(X)

DbesJ1: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Archaic form of BESJ1() that is specific to one type for X. See section 8.11.9.28 BesJ1 Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.63 DbesJN Intrinsic

 
DbesJN(N, X)

DbesJN: REAL(KIND=2) function.

N: INTEGER; scalar; INTENT(IN).

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Archaic form of BESJN() that is specific to one type for X. See section 8.11.9.29 BesJN Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.64 DbesY0 Intrinsic

 
DbesY0(X)

DbesY0: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Archaic form of BESY0() that is specific to one type for X. See section 8.11.9.30 BesY0 Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.65 DbesY1 Intrinsic

 
DbesY1(X)

DbesY1: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Archaic form of BESY1() that is specific to one type for X. See section 8.11.9.31 BesY1 Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.66 DbesYN Intrinsic

 
DbesYN(N, X)

DbesYN: REAL(KIND=2) function.

N: INTEGER; scalar; INTENT(IN).

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Archaic form of BESYN() that is specific to one type for X. See section 8.11.9.32 BesYN Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.67 Dble Intrinsic

 
Dble(A)

Dble: REAL(KIND=2) function.

A: INTEGER, REAL, or COMPLEX; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns A converted to double precision (REAL(KIND=2)). If A is COMPLEX, the real part of A is used for the conversion and the imaginary part disregarded.

See section 8.11.9.232 Sngl Intrinsic, for the function that converts to single precision.

See section 8.11.9.148 Int Intrinsic, for the function that converts to INTEGER.

See section 8.11.9.44 Complex Intrinsic, for the function that converts to COMPLEX.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.68 DCos Intrinsic

 
DCos(X)

DCos: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of COS() that is specific to one type for X. See section 8.11.9.46 Cos Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.69 DCosH Intrinsic

 
DCosH(X)

DCosH: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of COSH() that is specific to one type for X. See section 8.11.9.47 CosH Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.70 DDiM Intrinsic

 
DDiM(X, Y)

DDiM: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Y: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of DIM() that is specific to one type for X and Y. See section 8.11.9.75 DiM Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.71 DErF Intrinsic

 
DErF(X)

DErF: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Archaic form of ERF() that is specific to one type for X. See section 8.11.9.94 ErF Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.72 DErFC Intrinsic

 
DErFC(X)

DErFC: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Archaic form of ERFC() that is specific to one type for X. See section 8.11.9.95 ErFC Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.73 DExp Intrinsic

 
DExp(X)

DExp: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of EXP() that is specific to one type for X. See section 8.11.9.99 Exp Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.74 Digits Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Digits' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.75 DiM Intrinsic

 
DiM(X, Y)

DiM: INTEGER or REAL function, the exact type being the result of cross-promoting the types of all the arguments.

X: INTEGER or REAL; scalar; INTENT(IN).

Y: INTEGER or REAL; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns `X-Y' if X is greater than Y; otherwise returns zero.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.76 DInt Intrinsic

 
DInt(A)

DInt: REAL(KIND=2) function.

A: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of AINT() that is specific to one type for A. See section 8.11.9.9 AInt Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.77 DLog Intrinsic

 
DLog(X)

DLog: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of LOG() that is specific to one type for X. See section 8.11.9.170 Log Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.78 DLog10 Intrinsic

 
DLog10(X)

DLog10: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of LOG10() that is specific to one type for X. See section 8.11.9.171 Log10 Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.79 DMax1 Intrinsic

 
DMax1(A-1, A-2, ..., A-n)

DMax1: REAL(KIND=2) function.

A: REAL(KIND=2); at least two such arguments must be provided; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of MAX() that is specific to one type for A. See section 8.11.9.179 Max Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.80 DMin1 Intrinsic

 
DMin1(A-1, A-2, ..., A-n)

DMin1: REAL(KIND=2) function.

A: REAL(KIND=2); at least two such arguments must be provided; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of MIN() that is specific to one type for A. See section 8.11.9.188 Min Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.81 DMod Intrinsic

 
DMod(A, P)

DMod: REAL(KIND=2) function.

A: REAL(KIND=2); scalar; INTENT(IN).

P: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of MOD() that is specific to one type for A. See section 8.11.9.194 Mod Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.82 DNInt Intrinsic

 
DNInt(A)

DNInt: REAL(KIND=2) function.

A: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of ANINT() that is specific to one type for A. See section 8.11.9.21 ANInt Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.83 Dot_Product Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Dot_Product' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.84 DProd Intrinsic

 
DProd(X, Y)

DProd: REAL(KIND=2) function.

X: REAL(KIND=1); scalar; INTENT(IN).

Y: REAL(KIND=1); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns `DBLE(X)*DBLE(Y)'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.85 DSign Intrinsic

 
DSign(A, B)

DSign: REAL(KIND=2) function.

A: REAL(KIND=2); scalar; INTENT(IN).

B: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of SIGN() that is specific to one type for A and B. See section 8.11.9.227 Sign Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.86 DSin Intrinsic

 
DSin(X)

DSin: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of SIN() that is specific to one type for X. See section 8.11.9.229 Sin Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.87 DSinH Intrinsic

 
DSinH(X)

DSinH: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of SINH() that is specific to one type for X. See section 8.11.9.230 SinH Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.88 DSqRt Intrinsic

 
DSqRt(X)

DSqRt: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of SQRT() that is specific to one type for X. See section 8.11.9.235 SqRt Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.89 DTan Intrinsic

 
DTan(X)

DTan: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of TAN() that is specific to one type for X. See section 8.11.9.243 Tan Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.90 DTanH Intrinsic

 
DTanH(X)

DTanH: REAL(KIND=2) function.

X: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of TANH() that is specific to one type for X. See section 8.11.9.244 TanH Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.91 DTime Intrinsic (subroutine)

 
CALL DTime(TArray, Result)

TArray: REAL(KIND=1); DIMENSION(2); INTENT(OUT).

Result: REAL(KIND=1); scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Initially, return the number of seconds of runtime since the start of the process's execution in Result, and the user and system components of this in `TArray(1)' and `TArray(2)' respectively. The value of Result is equal to `TArray(1) + TArray(2)'.

Subsequent invocations of `DTIME()' set values based on accumulations since the previous invocation.

On some systems, the underlying timings are represented using types with sufficiently small limits that overflows (wraparounds) are possible, such as 32-bit types. Therefore, the values returned by this intrinsic might be, or become, negative, or numerically less than previous values, during a single run of the compiled program.

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine.

For information on other intrinsics with the same name: See section 10.5.2.36 DTime Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.92 EOShift Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL EOShift' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.93 Epsilon Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Epsilon' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.94 ErF Intrinsic

 
ErF(X)

ErF: REAL function, the `KIND=' value of the type being that of argument X.

X: REAL; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Returns the error function of X. See erf(3m), which provides the implementation.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.95 ErFC Intrinsic

 
ErFC(X)

ErFC: REAL function, the `KIND=' value of the type being that of argument X.

X: REAL; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Returns the complementary error function of X: `ERFC(R) = 1 - ERF(R)' (except that the result might be more accurate than explicitly evaluating that formulae would give). See erfc(3m), which provides the implementation.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.96 ETime Intrinsic (subroutine)

 
CALL ETime(TArray, Result)

TArray: REAL(KIND=1); DIMENSION(2); INTENT(OUT).

Result: REAL(KIND=1); scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Return the number of seconds of runtime since the start of the process's execution in Result, and the user and system components of this in `TArray(1)' and `TArray(2)' respectively. The value of Result is equal to `TArray(1) + TArray(2)'.

On some systems, the underlying timings are represented using types with sufficiently small limits that overflows (wraparounds) are possible, such as 32-bit types. Therefore, the values returned by this intrinsic might be, or become, negative, or numerically less than previous values, during a single run of the compiled program.

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine.

For information on other intrinsics with the same name: See section 8.11.9.97 ETime Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.97 ETime Intrinsic (function)

 
ETime(TArray)

ETime: REAL(KIND=1) function.

TArray: REAL(KIND=1); DIMENSION(2); INTENT(OUT).

Intrinsic groups: unix.

Description:

Return the number of seconds of runtime since the start of the process's execution as the function value, and the user and system components of this in `TArray(1)' and `TArray(2)' respectively. The functions' value is equal to `TArray(1) + TArray(2)'.

On some systems, the underlying timings are represented using types with sufficiently small limits that overflows (wraparounds) are possible, such as 32-bit types. Therefore, the values returned by this intrinsic might be, or become, negative, or numerically less than previous values, during a single run of the compiled program.

For information on other intrinsics with the same name: See section 8.11.9.96 ETime Intrinsic (subroutine).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.98 Exit Intrinsic

 
CALL Exit(Status)

Status: INTEGER; OPTIONAL; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Exit the program with status Status after closing open Fortran I/O units and otherwise behaving as exit(2). If Status is omitted the canonical `success' value will be returned to the system.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.99 Exp Intrinsic

 
Exp(X)

Exp: REAL or COMPLEX function, the exact type being that of argument X.

X: REAL or COMPLEX; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns `e**X', where e is approximately 2.7182818.

See section 8.11.9.170 Log Intrinsic, for the inverse of this function.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.100 Exponent Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Exponent' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.101 FDate Intrinsic (subroutine)

 
CALL FDate(Date)

Date: CHARACTER; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Returns the current date (using the same format as CTIME()) in Date.

Equivalent to:

 
CALL CTIME(Date, TIME8())

Programs making use of this intrinsic might not be Year 10000 (Y10K) compliant. For example, the date might appear, to such programs, to wrap around (change from a larger value to a smaller one) as of the Year 10000.

See section 8.11.9.53 CTime Intrinsic (subroutine).

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine.

For information on other intrinsics with the same name: See section 8.11.9.102 FDate Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.102 FDate Intrinsic (function)

 
FDate()

FDate: CHARACTER*(*) function.

Intrinsic groups: unix.

Description:

Returns the current date (using the same format as CTIME()).

Equivalent to:

 
CTIME(TIME8())

Programs making use of this intrinsic might not be Year 10000 (Y10K) compliant. For example, the date might appear, to such programs, to wrap around (change from a larger value to a smaller one) as of the Year 10000.

See section 8.11.9.54 CTime Intrinsic (function).

For information on other intrinsics with the same name: See section 8.11.9.101 FDate Intrinsic (subroutine).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.103 FGet Intrinsic (subroutine)

 
CALL FGet(C, Status)

C: CHARACTER; scalar; INTENT(OUT).

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Reads a single character into C in stream mode from unit 5 (by-passing normal formatted output) using getc(3). Returns in Status 0 on success, -1 on end-of-file, and the error code from ferror(3) otherwise.

Stream I/O should not be mixed with normal record-oriented (formatted or unformatted) I/O on the same unit; the results are unpredictable.

For information on other intrinsics with the same name: See section 10.5.2.37 FGet Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.104 FGetC Intrinsic (subroutine)

 
CALL FGetC(Unit, C, Status)

Unit: INTEGER; scalar; INTENT(IN).

C: CHARACTER; scalar; INTENT(OUT).

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Reads a single character into C in stream mode from unit Unit (by-passing normal formatted output) using getc(3). Returns in Status 0 on success, -1 on end-of-file, and the error code from ferror(3) otherwise.

Stream I/O should not be mixed with normal record-oriented (formatted or unformatted) I/O on the same unit; the results are unpredictable.

For information on other intrinsics with the same name: See section 10.5.2.38 FGetC Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.105 Float Intrinsic

 
Float(A)

Float: REAL(KIND=1) function.

A: INTEGER; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of REAL() that is specific to one type for A. See section 8.11.9.211 Real Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.106 Floor Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Floor' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.107 Flush Intrinsic

 
CALL Flush(Unit)

Unit: INTEGER; OPTIONAL; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Flushes Fortran unit(s) currently open for output. Without the optional argument, all such units are flushed, otherwise just the unit specified by Unit.

Some non-GNU implementations of Fortran provide this intrinsic as a library procedure that might or might not support the (optional) Unit argument.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.108 FNum Intrinsic

 
FNum(Unit)

FNum: INTEGER(KIND=1) function.

Unit: INTEGER; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Returns the Unix file descriptor number corresponding to the open Fortran I/O unit Unit. This could be passed to an interface to C I/O routines.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.109 FPut Intrinsic (subroutine)

 
CALL FPut(C, Status)

C: CHARACTER; scalar; INTENT(IN).

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Writes the single character C in stream mode to unit 6 (by-passing normal formatted output) using putc(3). Returns in Status 0 on success, the error code from ferror(3) otherwise.

Stream I/O should not be mixed with normal record-oriented (formatted or unformatted) I/O on the same unit; the results are unpredictable.

For information on other intrinsics with the same name: See section 10.5.2.41 FPut Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.110 FPutC Intrinsic (subroutine)

 
CALL FPutC(Unit, C, Status)

Unit: INTEGER; scalar; INTENT(IN).

C: CHARACTER; scalar; INTENT(IN).

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Writes the single character Unit in stream mode to unit 6 (by-passing normal formatted output) using putc(3). Returns in C 0 on success, the error code from ferror(3) otherwise.

Stream I/O should not be mixed with normal record-oriented (formatted or unformatted) I/O on the same unit; the results are unpredictable.

For information on other intrinsics with the same name: See section 10.5.2.42 FPutC Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.111 Fraction Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Fraction' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.112 FSeek Intrinsic

 
CALL FSeek(Unit, Offset, Whence, ErrLab)

Unit: INTEGER; scalar; INTENT(IN).

Offset: INTEGER; scalar; INTENT(IN).

Whence: INTEGER; scalar; INTENT(IN).

ErrLab: `*label', where label is the label of an executable statement; OPTIONAL.

Intrinsic groups: unix.

Description:

Attempts to move Fortran unit Unit to the specified Offset: absolute offset if Whence=0; relative to the current offset if Whence=1; relative to the end of the file if Whence=2. It branches to label ErrLab if Unit is not open or if the call otherwise fails.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.113 FStat Intrinsic (subroutine)

 
CALL FStat(Unit, SArray, Status)

Unit: INTEGER; scalar; INTENT(IN).

SArray: INTEGER(KIND=1); DIMENSION(13); INTENT(OUT).

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Obtains data about the file open on Fortran I/O unit Unit and places them in the array SArray. The values in this array are extracted from the stat structure as returned by fstat(2) q.v., as follows:

  1. Device ID

  2. Inode number

  3. File mode

  4. Number of links

  5. Owner's uid

  6. Owner's gid

  7. ID of device containing directory entry for file (0 if not available)

  8. File size (bytes)

  9. Last access time

  10. Last modification time

  11. Last file status change time

  12. Preferred I/O block size (-1 if not available)

  13. Number of blocks allocated (-1 if not available)

Not all these elements are relevant on all systems. If an element is not relevant, it is returned as 0.

If the Status argument is supplied, it contains 0 on success or a non-zero error code upon return.

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine, or do not support the (optional) Status argument.

For information on other intrinsics with the same name: See section 8.11.9.114 FStat Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.114 FStat Intrinsic (function)

 
FStat(Unit, SArray)

FStat: INTEGER(KIND=1) function.

Unit: INTEGER; scalar; INTENT(IN).

SArray: INTEGER(KIND=1); DIMENSION(13); INTENT(OUT).

Intrinsic groups: unix.

Description:

Obtains data about the file open on Fortran I/O unit Unit and places them in the array SArray. The values in this array are extracted from the stat structure as returned by fstat(2) q.v., as follows:

  1. Device ID

  2. Inode number

  3. File mode

  4. Number of links

  5. Owner's uid

  6. Owner's gid

  7. ID of device containing directory entry for file (0 if not available)

  8. File size (bytes)

  9. Last access time

  10. Last modification time

  11. Last file status change time

  12. Preferred I/O block size (-1 if not available)

  13. Number of blocks allocated (-1 if not available)

Not all these elements are relevant on all systems. If an element is not relevant, it is returned as 0.

Returns 0 on success or a non-zero error code.

For information on other intrinsics with the same name: See section 8.11.9.113 FStat Intrinsic (subroutine).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.115 FTell Intrinsic (subroutine)

 
CALL FTell(Unit, Offset)

Unit: INTEGER; scalar; INTENT(IN).

Offset: INTEGER(KIND=1); scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Sets Offset to the current offset of Fortran unit Unit (or to -1 if Unit is not open).

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine.

For information on other intrinsics with the same name: See section 8.11.9.116 FTell Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.116 FTell Intrinsic (function)

 
FTell(Unit)

FTell: INTEGER(KIND=1) function.

Unit: INTEGER; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Returns the current offset of Fortran unit Unit (or -1 if Unit is not open).

For information on other intrinsics with the same name: See section 8.11.9.115 FTell Intrinsic (subroutine).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.117 GError Intrinsic

 
CALL GError(Message)

Message: CHARACTER; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Returns the system error message corresponding to the last system error (C errno).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.118 GetArg Intrinsic

 
CALL GetArg(Pos, Value)

Pos: INTEGER; scalar; INTENT(IN).

Value: CHARACTER; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Sets Value to the Pos-th command-line argument (or to all blanks if there are fewer than Value command-line arguments); CALL GETARG(0, value) sets value to the name of the program (on systems that support this feature).

See section 8.11.9.133 IArgC Intrinsic, for information on how to get the number of arguments.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.119 GetCWD Intrinsic (subroutine)

 
CALL GetCWD(Name, Status)

Name: CHARACTER; scalar; INTENT(OUT).

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Places the current working directory in Name. If the Status argument is supplied, it contains 0 success or a non-zero error code upon return (ENOSYS if the system does not provide getcwd(3) or getwd(3)).

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine, or do not support the (optional) Status argument.

For information on other intrinsics with the same name: See section 8.11.9.120 GetCWD Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.120 GetCWD Intrinsic (function)

 
GetCWD(Name)

GetCWD: INTEGER(KIND=1) function.

Name: CHARACTER; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Places the current working directory in Name. Returns 0 on success, otherwise a non-zero error code (ENOSYS if the system does not provide getcwd(3) or getwd(3)).

For information on other intrinsics with the same name: See section 8.11.9.119 GetCWD Intrinsic (subroutine).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.121 GetEnv Intrinsic

 
CALL GetEnv(Name, Value)

Name: CHARACTER; scalar; INTENT(IN).

Value: CHARACTER; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Sets Value to the value of environment variable given by the value of Name ($name in shell terms) or to blanks if $name has not been set. A null character (`CHAR(0)') marks the end of the name in Name---otherwise, trailing blanks in Name are ignored.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.122 GetGId Intrinsic

 
GetGId()

GetGId: INTEGER(KIND=1) function.

Intrinsic groups: unix.

Description:

Returns the group id for the current process.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.123 GetLog Intrinsic

 
CALL GetLog(Login)

Login: CHARACTER; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Returns the login name for the process in Login.

Caution: On some systems, the getlogin(3) function, which this intrinsic calls at run time, is either not implemented or returns a null pointer. In the latter case, this intrinsic returns blanks in Login.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.124 GetPId Intrinsic

 
GetPId()

GetPId: INTEGER(KIND=1) function.

Intrinsic groups: unix.

Description:

Returns the process id for the current process.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.125 GetUId Intrinsic

 
GetUId()

GetUId: INTEGER(KIND=1) function.

Intrinsic groups: unix.

Description:

Returns the user id for the current process.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.126 GMTime Intrinsic

 
CALL GMTime(STime, TArray)

STime: INTEGER(KIND=1); scalar; INTENT(IN).

TArray: INTEGER(KIND=1); DIMENSION(9); INTENT(OUT).

Intrinsic groups: unix.

Description:

Given a system time value STime, fills TArray with values extracted from it appropriate to the GMT time zone using gmtime(3).

The array elements are as follows:

  1. Seconds after the minute, range 0--59 or 0--61 to allow for leap seconds

  2. Minutes after the hour, range 0--59

  3. Hours past midnight, range 0--23

  4. Day of month, range 0--31

  5. Number of months since January, range 0--12

  6. Years since 1900

  7. Number of days since Sunday, range 0--6

  8. Days since January 1

  9. Daylight savings indicator: positive if daylight savings is in effect, zero if not, and negative if the information isn't available.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.127 HostNm Intrinsic (subroutine)

 
CALL HostNm(Name, Status)

Name: CHARACTER; scalar; INTENT(OUT).

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Fills Name with the system's host name returned by gethostname(2). If the Status argument is supplied, it contains 0 on success or a non-zero error code upon return (ENOSYS if the system does not provide gethostname(2)).

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine, or do not support the (optional) Status argument.

On some systems (specifically SCO) it might be necessary to link the "socket" library if you call this routine. Typically this means adding `-lg2c -lsocket -lm' to the g77 command line when linking the program.

For information on other intrinsics with the same name: See section 8.11.9.128 HostNm Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.128 HostNm Intrinsic (function)

 
HostNm(Name)

HostNm: INTEGER(KIND=1) function.

Name: CHARACTER; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Fills Name with the system's host name returned by gethostname(2), returning 0 on success or a non-zero error code (ENOSYS if the system does not provide gethostname(2)).

On some systems (specifically SCO) it might be necessary to link the "socket" library if you call this routine. Typically this means adding `-lg2c -lsocket -lm' to the g77 command line when linking the program.

For information on other intrinsics with the same name: See section 8.11.9.127 HostNm Intrinsic (subroutine).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.129 Huge Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Huge' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.130 IAbs Intrinsic

 
IAbs(A)

IAbs: INTEGER(KIND=1) function.

A: INTEGER(KIND=1); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of ABS() that is specific to one type for A. See section 8.11.9.2 Abs Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.131 IAChar Intrinsic

 
IAChar(C)

IAChar: INTEGER(KIND=1) function.

C: CHARACTER; scalar; INTENT(IN).

Intrinsic groups: f2c, f90.

Description:

Returns the code for the ASCII character in the first character position of C.

See section 8.11.9.4 AChar Intrinsic, for the inverse of this function.

See section 8.11.9.137 IChar Intrinsic, for the function corresponding to the system's native character set.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.132 IAnd Intrinsic

 
IAnd(I, J)

IAnd: INTEGER function, the exact type being the result of cross-promoting the types of all the arguments.

I: INTEGER; scalar; INTENT(IN).

J: INTEGER; scalar; INTENT(IN).

Intrinsic groups: mil, f90, vxt.

Description:

Returns value resulting from boolean AND of pair of bits in each of I and J.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.133 IArgC Intrinsic

 
IArgC()

IArgC: INTEGER(KIND=1) function.

Intrinsic groups: unix.

Description:

Returns the number of command-line arguments.

This count does not include the specification of the program name itself.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.134 IBClr Intrinsic

 
IBClr(I, Pos)

IBClr: INTEGER function, the `KIND=' value of the type being that of argument I.

I: INTEGER; scalar; INTENT(IN).

Pos: INTEGER; scalar; INTENT(IN).

Intrinsic groups: mil, f90, vxt.

Description:

Returns the value of I with bit Pos cleared (set to zero). See section 8.11.9.34 BTest Intrinsic, for information on bit positions.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.135 IBits Intrinsic

 
IBits(I, Pos, Len)

IBits: INTEGER function, the `KIND=' value of the type being that of argument I.

I: INTEGER; scalar; INTENT(IN).

Pos: INTEGER; scalar; INTENT(IN).

Len: INTEGER; scalar; INTENT(IN).

Intrinsic groups: mil, f90, vxt.

Description:

Extracts a subfield of length Len from I, starting from bit position Pos and extending left for Len bits. The result is right-justified and the remaining bits are zeroed. The value of `Pos+Len' must be less than or equal to the value `BIT_SIZE(I)'. See section 8.11.9.33 Bit_Size Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.136 IBSet Intrinsic

 
IBSet(I, Pos)

IBSet: INTEGER function, the `KIND=' value of the type being that of argument I.

I: INTEGER; scalar; INTENT(IN).

Pos: INTEGER; scalar; INTENT(IN).

Intrinsic groups: mil, f90, vxt.

Description:

Returns the value of I with bit Pos set (to one). See section 8.11.9.34 BTest Intrinsic, for information on bit positions.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.137 IChar Intrinsic

 
IChar(C)

IChar: INTEGER(KIND=1) function.

C: CHARACTER; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the code for the character in the first character position of C.

Because the system's native character set is used, the correspondence between character and their codes is not necessarily the same between GNU Fortran implementations.

Note that no intrinsic exists to convert a printable character string to a numerical value. For example, there is no intrinsic that, given the CHARACTER value `'154'', returns an INTEGER or REAL value with the value `154'.

Instead, you can use internal-file I/O to do this kind of conversion. For example:

 
INTEGER VALUE
CHARACTER*10 STRING
STRING = '154'
READ (STRING, '(I10)'), VALUE
PRINT *, VALUE
END

The above program, when run, prints:

 
 154

See section 8.11.9.39 Char Intrinsic, for the inverse of the ICHAR function.

See section 8.11.9.131 IAChar Intrinsic, for the function corresponding to the ASCII character set.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.138 IDate Intrinsic (UNIX)

 
CALL IDate(TArray)

TArray: INTEGER(KIND=1); DIMENSION(3); INTENT(OUT).

Intrinsic groups: unix.

Description:

Fills TArray with the numerical values at the current local time of day, month (in the range 1--12), and year in elements 1, 2, and 3, respectively. The year has four significant digits.

Programs making use of this intrinsic might not be Year 10000 (Y10K) compliant. For example, the date might appear, to such programs, to wrap around (change from a larger value to a smaller one) as of the Year 10000.

For information on other intrinsics with the same name: See section 10.5.2.43 IDate Intrinsic (VXT).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.139 IDiM Intrinsic

 
IDiM(X, Y)

IDiM: INTEGER(KIND=1) function.

X: INTEGER(KIND=1); scalar; INTENT(IN).

Y: INTEGER(KIND=1); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of DIM() that is specific to one type for X and Y. See section 8.11.9.75 DiM Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.140 IDInt Intrinsic

 
IDInt(A)

IDInt: INTEGER(KIND=1) function.

A: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of INT() that is specific to one type for A. See section 8.11.9.148 Int Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.141 IDNInt Intrinsic

 
IDNInt(A)

IDNInt: INTEGER(KIND=1) function.

A: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of NINT() that is specific to one type for A. See section 8.11.9.198 NInt Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.142 IEOr Intrinsic

 
IEOr(I, J)

IEOr: INTEGER function, the exact type being the result of cross-promoting the types of all the arguments.

I: INTEGER; scalar; INTENT(IN).

J: INTEGER; scalar; INTENT(IN).

Intrinsic groups: mil, f90, vxt.

Description:

Returns value resulting from boolean exclusive-OR of pair of bits in each of I and J.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.143 IErrNo Intrinsic

 
IErrNo()

IErrNo: INTEGER(KIND=1) function.

Intrinsic groups: unix.

Description:

Returns the last system error number (corresponding to the C errno).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.144 IFix Intrinsic

 
IFix(A)

IFix: INTEGER(KIND=1) function.

A: REAL(KIND=1); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of INT() that is specific to one type for A. See section 8.11.9.148 Int Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.145 Imag Intrinsic

 
Imag(Z)

Imag: REAL function, the `KIND=' value of the type being that of argument Z.

Z: COMPLEX; scalar; INTENT(IN).

Intrinsic groups: f2c.

Description:

The imaginary part of Z is returned, without conversion.

Note: The way to do this in standard Fortran 90 is `AIMAG(Z)'. However, when, for example, Z is DOUBLE COMPLEX, `AIMAG(Z)' means something different for some compilers that are not true Fortran 90 compilers but offer some extensions standardized by Fortran 90 (such as the DOUBLE COMPLEX type, also known as COMPLEX(KIND=2)).

The advantage of IMAG() is that, while not necessarily more or less portable than AIMAG(), it is more likely to cause a compiler that doesn't support it to produce a diagnostic than generate incorrect code.

See section 8.11.5 REAL() and AIMAG() of Complex, for more information.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.146 ImagPart Intrinsic

 
ImagPart(Z)

ImagPart: REAL function, the `KIND=' value of the type being that of argument Z.

Z: COMPLEX; scalar; INTENT(IN).

Intrinsic groups: gnu.

Description:

The imaginary part of Z is returned, without conversion.

Note: The way to do this in standard Fortran 90 is `AIMAG(Z)'. However, when, for example, Z is DOUBLE COMPLEX, `AIMAG(Z)' means something different for some compilers that are not true Fortran 90 compilers but offer some extensions standardized by Fortran 90 (such as the DOUBLE COMPLEX type, also known as COMPLEX(KIND=2)).

The advantage of IMAGPART() is that, while not necessarily more or less portable than AIMAG(), it is more likely to cause a compiler that doesn't support it to produce a diagnostic than generate incorrect code.

See section 8.11.5 REAL() and AIMAG() of Complex, for more information.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.147 Index Intrinsic

 
Index(String, Substring)

Index: INTEGER(KIND=1) function.

String: CHARACTER; scalar; INTENT(IN).

Substring: CHARACTER; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the position of the start of the first occurrence of string Substring as a substring in String, counting from one. If Substring doesn't occur in String, zero is returned.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.148 Int Intrinsic

 
Int(A)

Int: INTEGER(KIND=1) function.

A: INTEGER, REAL, or COMPLEX; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns A with the fractional portion of its magnitude truncated and its sign preserved, converted to type INTEGER(KIND=1).

If A is type COMPLEX, its real part is truncated and converted, and its imaginary part is disregarded.

See section 8.11.9.198 NInt Intrinsic, for how to convert, rounded to nearest whole number.

See section 8.11.9.9 AInt Intrinsic, for how to truncate to whole number without converting.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.149 Int2 Intrinsic

 
Int2(A)

Int2: INTEGER(KIND=6) function.

A: INTEGER, REAL, or COMPLEX; scalar; INTENT(IN).

Intrinsic groups: gnu.

Description:

Returns A with the fractional portion of its magnitude truncated and its sign preserved, converted to type INTEGER(KIND=6).

If A is type COMPLEX, its real part is truncated and converted, and its imaginary part is disgregarded.

See section 8.11.9.148 Int Intrinsic.

The precise meaning of this intrinsic might change in a future version of the GNU Fortran language, as more is learned about how it is used.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.150 Int8 Intrinsic

 
Int8(A)

Int8: INTEGER(KIND=2) function.

A: INTEGER, REAL, or COMPLEX; scalar; INTENT(IN).

Intrinsic groups: gnu.

Description:

Returns A with the fractional portion of its magnitude truncated and its sign preserved, converted to type INTEGER(KIND=2).

If A is type COMPLEX, its real part is truncated and converted, and its imaginary part is disgregarded.

See section 8.11.9.148 Int Intrinsic.

The precise meaning of this intrinsic might change in a future version of the GNU Fortran language, as more is learned about how it is used.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.151 IOr Intrinsic

 
IOr(I, J)

IOr: INTEGER function, the exact type being the result of cross-promoting the types of all the arguments.

I: INTEGER; scalar; INTENT(IN).

J: INTEGER; scalar; INTENT(IN).

Intrinsic groups: mil, f90, vxt.

Description:

Returns value resulting from boolean OR of pair of bits in each of I and J.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.152 IRand Intrinsic

 
IRand(Flag)

IRand: INTEGER(KIND=1) function.

Flag: INTEGER; OPTIONAL; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Returns a uniform quasi-random number up to a system-dependent limit. If Flag is 0, the next number in sequence is returned; if Flag is 1, the generator is restarted by calling the UNIX function `srand(0)'; if Flag has any other value, it is used as a new seed with srand().

See section 8.11.9.236 SRand Intrinsic.

Note: As typically implemented (by the routine of the same name in the C library), this random number generator is a very poor one, though the BSD and GNU libraries provide a much better implementation than the `traditional' one. On a different system you almost certainly want to use something better.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.153 IsaTty Intrinsic

 
IsaTty(Unit)

IsaTty: LOGICAL(KIND=1) function.

Unit: INTEGER; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Returns .TRUE. if and only if the Fortran I/O unit specified by Unit is connected to a terminal device. See isatty(3).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.154 IShft Intrinsic

 
IShft(I, Shift)

IShft: INTEGER function, the `KIND=' value of the type being that of argument I.

I: INTEGER; scalar; INTENT(IN).

Shift: INTEGER; scalar; INTENT(IN).

Intrinsic groups: mil, f90, vxt.

Description:

All bits representing I are shifted Shift places. `Shift.GT.0' indicates a left shift, `Shift.EQ.0' indicates no shift and `Shift.LT.0' indicates a right shift. If the absolute value of the shift count is greater than `BIT_SIZE(I)', the result is undefined. Bits shifted out from the left end or the right end are lost. Zeros are shifted in from the opposite end.

See section 8.11.9.155 IShftC Intrinsic, for the circular-shift equivalent.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.155 IShftC Intrinsic

 
IShftC(I, Shift, Size)

IShftC: INTEGER function, the `KIND=' value of the type being that of argument I.

I: INTEGER; scalar; INTENT(IN).

Shift: INTEGER; scalar; INTENT(IN).

Size: INTEGER; scalar; INTENT(IN).

Intrinsic groups: mil, f90, vxt.

Description:

The rightmost Size bits of the argument I are shifted circularly Shift places, i.e. the bits shifted out of one end are shifted into the opposite end. No bits are lost. The unshifted bits of the result are the same as the unshifted bits of I. The absolute value of the argument Shift must be less than or equal to Size. The value of Size must be greater than or equal to one and less than or equal to `BIT_SIZE(I)'.

See section 8.11.9.154 IShft Intrinsic, for the logical shift equivalent.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.156 ISign Intrinsic

 
ISign(A, B)

ISign: INTEGER(KIND=1) function.

A: INTEGER(KIND=1); scalar; INTENT(IN).

B: INTEGER(KIND=1); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of SIGN() that is specific to one type for A and B. See section 8.11.9.227 Sign Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.157 ITime Intrinsic

 
CALL ITime(TArray)

TArray: INTEGER(KIND=1); DIMENSION(3); INTENT(OUT).

Intrinsic groups: unix.

Description:

Returns the current local time hour, minutes, and seconds in elements 1, 2, and 3 of TArray, respectively.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.158 Kill Intrinsic (subroutine)

 
CALL Kill(Pid, Signal, Status)

Pid: INTEGER; scalar; INTENT(IN).

Signal: INTEGER; scalar; INTENT(IN).

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Sends the signal specified by Signal to the process Pid. If the Status argument is supplied, it contains 0 on success or a non-zero error code upon return. See kill(2).

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine, or do not support the (optional) Status argument.

For information on other intrinsics with the same name: See section 10.5.2.93 Kill Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.159 Kind Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Kind' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.160 LBound Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL LBound' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.161 Len Intrinsic

 
Len(String)

Len: INTEGER(KIND=1) function.

String: CHARACTER; scalar.

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the length of String.

If String is an array, the length of an element of String is returned.

Note that String need not be defined when this intrinsic is invoked, since only the length, not the content, of String is needed.

See section 8.11.9.33 Bit_Size Intrinsic, for the function that determines the size of its argument in bits.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.162 Len_Trim Intrinsic

 
Len_Trim(String)

Len_Trim: INTEGER(KIND=1) function.

String: CHARACTER; scalar; INTENT(IN).

Intrinsic groups: f90.

Description:

Returns the index of the last non-blank character in String. LNBLNK and LEN_TRIM are equivalent.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.163 LGe Intrinsic

 
LGe(String_A, String_B)

LGe: LOGICAL(KIND=1) function.

String_A: CHARACTER; scalar; INTENT(IN).

String_B: CHARACTER; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns `.TRUE.' if `String_A.GE.String_B', `.FALSE.' otherwise. String_A and String_B are interpreted as containing ASCII character codes. If either value contains a character not in the ASCII character set, the result is processor dependent.

If the String_A and String_B are not the same length, the shorter is compared as if spaces were appended to it to form a value that has the same length as the longer.

The lexical comparison intrinsics LGe, LGt, LLe, and LLt differ from the corresponding intrinsic operators .GE., .GT., .LE., .LT.. Because the ASCII collating sequence is assumed, the following expressions always return `.TRUE.':

 
LGE ('0', ' ')
LGE ('A', '0')
LGE ('a', 'A')

The following related expressions do not always return `.TRUE.', as they are not necessarily evaluated assuming the arguments use ASCII encoding:

 
'0' .GE. ' '
'A' .GE. '0'
'a' .GE. 'A'

The same difference exists between LGt and .GT.; between LLe and .LE.; and between LLt and .LT..


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.164 LGt Intrinsic

 
LGt(String_A, String_B)

LGt: LOGICAL(KIND=1) function.

String_A: CHARACTER; scalar; INTENT(IN).

String_B: CHARACTER; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns `.TRUE.' if `String_A.GT.String_B', `.FALSE.' otherwise. String_A and String_B are interpreted as containing ASCII character codes. If either value contains a character not in the ASCII character set, the result is processor dependent.

If the String_A and String_B are not the same length, the shorter is compared as if spaces were appended to it to form a value that has the same length as the longer.

See section 8.11.9.163 LGe Intrinsic, for information on the distinction between the LGT intrinsic and the .GT. operator.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.165 Link Intrinsic (subroutine)

 
CALL Link(Path1, Path2, Status)

Path1: CHARACTER; scalar; INTENT(IN).

Path2: CHARACTER; scalar; INTENT(IN).

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Makes a (hard) link from file Path1 to Path2. A null character (`CHAR(0)') marks the end of the names in Path1 and Path2---otherwise, trailing blanks in Path1 and Path2 are ignored. If the Status argument is supplied, it contains 0 on success or a non-zero error code upon return. See link(2).

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine, or do not support the (optional) Status argument.

For information on other intrinsics with the same name: See section 10.5.2.94 Link Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.166 LLe Intrinsic

 
LLe(String_A, String_B)

LLe: LOGICAL(KIND=1) function.

String_A: CHARACTER; scalar; INTENT(IN).

String_B: CHARACTER; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns `.TRUE.' if `String_A.LE.String_B', `.FALSE.' otherwise. String_A and String_B are interpreted as containing ASCII character codes. If either value contains a character not in the ASCII character set, the result is processor dependent.

If the String_A and String_B are not the same length, the shorter is compared as if spaces were appended to it to form a value that has the same length as the longer.

See section 8.11.9.163 LGe Intrinsic, for information on the distinction between the LLE intrinsic and the .LE. operator.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.167 LLt Intrinsic

 
LLt(String_A, String_B)

LLt: LOGICAL(KIND=1) function.

String_A: CHARACTER; scalar; INTENT(IN).

String_B: CHARACTER; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns `.TRUE.' if `String_A.LT.String_B', `.FALSE.' otherwise. String_A and String_B are interpreted as containing ASCII character codes. If either value contains a character not in the ASCII character set, the result is processor dependent.

If the String_A and String_B are not the same length, the shorter is compared as if spaces were appended to it to form a value that has the same length as the longer.

See section 8.11.9.163 LGe Intrinsic, for information on the distinction between the LLT intrinsic and the .LT. operator.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.168 LnBlnk Intrinsic

 
LnBlnk(String)

LnBlnk: INTEGER(KIND=1) function.

String: CHARACTER; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Returns the index of the last non-blank character in String. LNBLNK and LEN_TRIM are equivalent.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.169 Loc Intrinsic

 
Loc(Entity)

Loc: INTEGER(KIND=7) function.

Entity: Any type; cannot be a constant or expression.

Intrinsic groups: unix.

Description:

The LOC() intrinsic works the same way as the %LOC() construct. See section The %LOC() Construct, for more information.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.170 Log Intrinsic

 
Log(X)

Log: REAL or COMPLEX function, the exact type being that of argument X.

X: REAL or COMPLEX; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the natural logarithm of X, which must be greater than zero or, if type COMPLEX, must not be zero.

See section 8.11.9.99 Exp Intrinsic, for the inverse of this function.

See section 8.11.9.171 Log10 Intrinsic, for the `common' (base-10) logarithm function.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.171 Log10 Intrinsic

 
Log10(X)

Log10: REAL function, the `KIND=' value of the type being that of argument X.

X: REAL; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the common logarithm (base 10) of X, which must be greater than zero.

The inverse of this function is `10. ** LOG10(X)'.

See section 8.11.9.170 Log Intrinsic, for the natural logarithm function.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.172 Logical Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Logical' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.173 Long Intrinsic

 
Long(A)

Long: INTEGER(KIND=1) function.

A: INTEGER(KIND=6); scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Archaic form of INT() that is specific to one type for A. See section 8.11.9.148 Int Intrinsic.

The precise meaning of this intrinsic might change in a future version of the GNU Fortran language, as more is learned about how it is used.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.174 LShift Intrinsic

 
LShift(I, Shift)

LShift: INTEGER function, the `KIND=' value of the type being that of argument I.

I: INTEGER; scalar; INTENT(IN).

Shift: INTEGER; scalar; INTENT(IN).

Intrinsic groups: f2c.

Description:

Returns I shifted to the left Shift bits.

Although similar to the expression `I*(2**Shift)', there are important differences. For example, the sign of the result is not necessarily the same as the sign of I.

Currently this intrinsic is defined assuming the underlying representation of I is as a two's-complement integer. It is unclear at this point whether that definition will apply when a different representation is involved.

See section 8.11.9.174 LShift Intrinsic, for the inverse of this function.

See section 8.11.9.154 IShft Intrinsic, for information on a more widely available left-shifting intrinsic that is also more precisely defined.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.175 LStat Intrinsic (subroutine)

 
CALL LStat(File, SArray, Status)

File: CHARACTER; scalar; INTENT(IN).

SArray: INTEGER(KIND=1); DIMENSION(13); INTENT(OUT).

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Obtains data about the given file File and places them in the array SArray. A null character (`CHAR(0)') marks the end of the name in File---otherwise, trailing blanks in File are ignored. If File is a symbolic link it returns data on the link itself, so the routine is available only on systems that support symbolic links. The values in this array are extracted from the stat structure as returned by fstat(2) q.v., as follows:

  1. Device ID

  2. Inode number

  3. File mode

  4. Number of links

  5. Owner's uid

  6. Owner's gid

  7. ID of device containing directory entry for file (0 if not available)

  8. File size (bytes)

  9. Last access time

  10. Last modification time

  11. Last file status change time

  12. Preferred I/O block size (-1 if not available)

  13. Number of blocks allocated (-1 if not available)

Not all these elements are relevant on all systems. If an element is not relevant, it is returned as 0.

If the Status argument is supplied, it contains 0 on success or a non-zero error code upon return (ENOSYS if the system does not provide lstat(2)).

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine, or do not support the (optional) Status argument.

For information on other intrinsics with the same name: See section 8.11.9.176 LStat Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.176 LStat Intrinsic (function)

 
LStat(File, SArray)

LStat: INTEGER(KIND=1) function.

File: CHARACTER; scalar; INTENT(IN).

SArray: INTEGER(KIND=1); DIMENSION(13); INTENT(OUT).

Intrinsic groups: unix.

Description:

Obtains data about the given file File and places them in the array SArray. A null character (`CHAR(0)') marks the end of the name in File---otherwise, trailing blanks in File are ignored. If File is a symbolic link it returns data on the link itself, so the routine is available only on systems that support symbolic links. The values in this array are extracted from the stat structure as returned by fstat(2) q.v., as follows:

  1. Device ID

  2. Inode number

  3. File mode

  4. Number of links

  5. Owner's uid

  6. Owner's gid

  7. ID of device containing directory entry for file (0 if not available)

  8. File size (bytes)

  9. Last access time

  10. Last modification time

  11. Last file status change time

  12. Preferred I/O block size (-1 if not available)

  13. Number of blocks allocated (-1 if not available)

Not all these elements are relevant on all systems. If an element is not relevant, it is returned as 0.

Returns 0 on success or a non-zero error code (ENOSYS if the system does not provide lstat(2)).

For information on other intrinsics with the same name: See section 8.11.9.175 LStat Intrinsic (subroutine).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.177 LTime Intrinsic

 
CALL LTime(STime, TArray)

STime: INTEGER(KIND=1); scalar; INTENT(IN).

TArray: INTEGER(KIND=1); DIMENSION(9); INTENT(OUT).

Intrinsic groups: unix.

Description:

Given a system time value STime, fills TArray with values extracted from it appropriate to the GMT time zone using localtime(3).

The array elements are as follows:

  1. Seconds after the minute, range 0--59 or 0--61 to allow for leap seconds

  2. Minutes after the hour, range 0--59

  3. Hours past midnight, range 0--23

  4. Day of month, range 0--31

  5. Number of months since January, range 0--12

  6. Years since 1900

  7. Number of days since Sunday, range 0--6

  8. Days since January 1

  9. Daylight savings indicator: positive if daylight savings is in effect, zero if not, and negative if the information isn't available.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.178 MatMul Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL MatMul' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.179 Max Intrinsic

 
Max(A-1, A-2, ..., A-n)

Max: INTEGER or REAL function, the exact type being the result of cross-promoting the types of all the arguments.

A: INTEGER or REAL; at least two such arguments must be provided; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the argument with the largest value.

See section 8.11.9.188 Min Intrinsic, for the opposite function.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.180 Max0 Intrinsic

 
Max0(A-1, A-2, ..., A-n)

Max0: INTEGER(KIND=1) function.

A: INTEGER(KIND=1); at least two such arguments must be provided; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of MAX() that is specific to one type for A. See section 8.11.9.179 Max Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.181 Max1 Intrinsic

 
Max1(A-1, A-2, ..., A-n)

Max1: INTEGER(KIND=1) function.

A: REAL(KIND=1); at least two such arguments must be provided; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of MAX() that is specific to one type for A and a different return type. See section 8.11.9.179 Max Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.182 MaxExponent Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL MaxExponent' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.183 MaxLoc Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL MaxLoc' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.184 MaxVal Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL MaxVal' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.185 MClock Intrinsic

 
MClock()

MClock: INTEGER(KIND=1) function.

Intrinsic groups: unix.

Description:

Returns the number of clock ticks since the start of the process. Supported on systems with clock(3) (q.v.).

This intrinsic is not fully portable, such as to systems with 32-bit INTEGER types but supporting times wider than 32 bits. Therefore, the values returned by this intrinsic might be, or become, negative, or numerically less than previous values, during a single run of the compiled program.

See section 8.11.9.186 MClock8 Intrinsic, for information on a similar intrinsic that might be portable to more GNU Fortran implementations, though to fewer Fortran compilers.

If the system does not support clock(3), -1 is returned.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.186 MClock8 Intrinsic

 
MClock8()

MClock8: INTEGER(KIND=2) function.

Intrinsic groups: unix.

Description:

Returns the number of clock ticks since the start of the process. Supported on systems with clock(3) (q.v.).

Warning: this intrinsic does not increase the range of the timing values over that returned by clock(3). On a system with a 32-bit clock(3), MCLOCK8 will return a 32-bit value, even though converted to an `INTEGER(KIND=2)' value. That means overflows of the 32-bit value can still occur. Therefore, the values returned by this intrinsic might be, or become, negative, or numerically less than previous values, during a single run of the compiled program.

No Fortran implementations other than GNU Fortran are known to support this intrinsic at the time of this writing. See section 8.11.9.185 MClock Intrinsic, for information on a similar intrinsic that might be portable to more Fortran compilers, though to fewer GNU Fortran implementations.

If the system does not support clock(3), -1 is returned.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.187 Merge Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Merge' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.188 Min Intrinsic

 
Min(A-1, A-2, ..., A-n)

Min: INTEGER or REAL function, the exact type being the result of cross-promoting the types of all the arguments.

A: INTEGER or REAL; at least two such arguments must be provided; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the argument with the smallest value.

See section 8.11.9.179 Max Intrinsic, for the opposite function.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.189 Min0 Intrinsic

 
Min0(A-1, A-2, ..., A-n)

Min0: INTEGER(KIND=1) function.

A: INTEGER(KIND=1); at least two such arguments must be provided; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of MIN() that is specific to one type for A. See section 8.11.9.188 Min Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.190 Min1 Intrinsic

 
Min1(A-1, A-2, ..., A-n)

Min1: INTEGER(KIND=1) function.

A: REAL(KIND=1); at least two such arguments must be provided; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of MIN() that is specific to one type for A and a different return type. See section 8.11.9.188 Min Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.191 MinExponent Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL MinExponent' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.192 MinLoc Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL MinLoc' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.193 MinVal Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL MinVal' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.194 Mod Intrinsic

 
Mod(A, P)

Mod: INTEGER or REAL function, the exact type being the result of cross-promoting the types of all the arguments.

A: INTEGER or REAL; scalar; INTENT(IN).

P: INTEGER or REAL; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns remainder calculated as:

 
A - (INT(A / P) * P)

P must not be zero.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.195 Modulo Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Modulo' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.196 MvBits Intrinsic

 
CALL MvBits(From, FromPos, Len, TO, ToPos)

From: INTEGER; scalar; INTENT(IN).

FromPos: INTEGER; scalar; INTENT(IN).

Len: INTEGER; scalar; INTENT(IN).

TO: INTEGER with same `KIND=' value as for From; scalar; INTENT(INOUT).

ToPos: INTEGER; scalar; INTENT(IN).

Intrinsic groups: mil, f90, vxt.

Description:

Moves Len bits from positions FromPos through `FromPos+Len-1' of From to positions ToPos through `FromPos+Len-1' of TO. The portion of argument TO not affected by the movement of bits is unchanged. Arguments From and TO are permitted to be the same numeric storage unit. The values of `FromPos+Len' and `ToPos+Len' must be less than or equal to `BIT_SIZE(From)'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.197 Nearest Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Nearest' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.198 NInt Intrinsic

 
NInt(A)

NInt: INTEGER(KIND=1) function.

A: REAL; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns A with the fractional portion of its magnitude eliminated by rounding to the nearest whole number and with its sign preserved, converted to type INTEGER(KIND=1).

If A is type COMPLEX, its real part is rounded and converted.

A fractional portion exactly equal to `.5' is rounded to the whole number that is larger in magnitude. (Also called "Fortran round".)

See section 8.11.9.148 Int Intrinsic, for how to convert, truncate to whole number.

See section 8.11.9.21 ANInt Intrinsic, for how to round to nearest whole number without converting.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.199 Not Intrinsic

 
Not(I)

Not: INTEGER function, the `KIND=' value of the type being that of argument I.

I: INTEGER; scalar; INTENT(IN).

Intrinsic groups: mil, f90, vxt.

Description:

Returns value resulting from boolean NOT of each bit in I.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.200 Or Intrinsic

 
Or(I, J)

Or: INTEGER or LOGICAL function, the exact type being the result of cross-promoting the types of all the arguments.

I: INTEGER or LOGICAL; scalar; INTENT(IN).

J: INTEGER or LOGICAL; scalar; INTENT(IN).

Intrinsic groups: f2c.

Description:

Returns value resulting from boolean OR of pair of bits in each of I and J.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.201 Pack Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Pack' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.202 PError Intrinsic

 
CALL PError(String)

String: CHARACTER; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Prints (on the C stderr stream) a newline-terminated error message corresponding to the last system error. This is prefixed by String, a colon and a space. See perror(3).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.203 Precision Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Precision' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.204 Present Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Present' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.205 Product Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Product' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.206 Radix Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Radix' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.207 Rand Intrinsic

 
Rand(Flag)

Rand: REAL(KIND=1) function.

Flag: INTEGER; OPTIONAL; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Returns a uniform quasi-random number between 0 and 1. If Flag is 0, the next number in sequence is returned; if Flag is 1, the generator is restarted by calling `srand(0)'; if Flag has any other value, it is used as a new seed with srand.

See section 8.11.9.236 SRand Intrinsic.

Note: As typically implemented (by the routine of the same name in the C library), this random number generator is a very poor one, though the BSD and GNU libraries provide a much better implementation than the `traditional' one. On a different system you almost certainly want to use something better.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.208 Random_Number Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Random_Number' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.209 Random_Seed Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Random_Seed' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.210 Range Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Range' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.211 Real Intrinsic

 
Real(A)

Real: REAL function. The exact type is `REAL(KIND=1)' when argument A is any type other than COMPLEX, or when it is COMPLEX(KIND=1). When A is any COMPLEX type other than COMPLEX(KIND=1), this intrinsic is valid only when used as the argument to REAL(), as explained below.

A: INTEGER, REAL, or COMPLEX; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Converts A to REAL(KIND=1).

Use of REAL() with a COMPLEX argument (other than COMPLEX(KIND=1)) is restricted to the following case:

 
REAL(REAL(A))

This expression converts the real part of A to REAL(KIND=1).

See section 8.11.9.212 RealPart Intrinsic, for information on a GNU Fortran intrinsic that extracts the real part of an arbitrary COMPLEX value.

See section 8.11.5 REAL() and AIMAG() of Complex, for more information.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.212 RealPart Intrinsic

 
RealPart(Z)

RealPart: REAL function, the `KIND=' value of the type being that of argument Z.

Z: COMPLEX; scalar; INTENT(IN).

Intrinsic groups: gnu.

Description:

The real part of Z is returned, without conversion.

Note: The way to do this in standard Fortran 90 is `REAL(Z)'. However, when, for example, Z is COMPLEX(KIND=2), `REAL(Z)' means something different for some compilers that are not true Fortran 90 compilers but offer some extensions standardized by Fortran 90 (such as the DOUBLE COMPLEX type, also known as COMPLEX(KIND=2)).

The advantage of REALPART() is that, while not necessarily more or less portable than REAL(), it is more likely to cause a compiler that doesn't support it to produce a diagnostic than generate incorrect code.

See section 8.11.5 REAL() and AIMAG() of Complex, for more information.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.213 Rename Intrinsic (subroutine)

 
CALL Rename(Path1, Path2, Status)

Path1: CHARACTER; scalar; INTENT(IN).

Path2: CHARACTER; scalar; INTENT(IN).

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Renames the file Path1 to Path2. A null character (`CHAR(0)') marks the end of the names in Path1 and Path2---otherwise, trailing blanks in Path1 and Path2 are ignored. See rename(2). If the Status argument is supplied, it contains 0 on success or a non-zero error code upon return.

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine, or do not support the (optional) Status argument.

For information on other intrinsics with the same name: See section 10.5.2.126 Rename Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.214 Repeat Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Repeat' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.215 Reshape Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Reshape' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.216 RRSpacing Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL RRSpacing' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.217 RShift Intrinsic

 
RShift(I, Shift)

RShift: INTEGER function, the `KIND=' value of the type being that of argument I.

I: INTEGER; scalar; INTENT(IN).

Shift: INTEGER; scalar; INTENT(IN).

Intrinsic groups: f2c.

Description:

Returns I shifted to the right Shift bits.

Although similar to the expression `I/(2**Shift)', there are important differences. For example, the sign of the result is undefined.

Currently this intrinsic is defined assuming the underlying representation of I is as a two's-complement integer. It is unclear at this point whether that definition will apply when a different representation is involved.

See section 8.11.9.217 RShift Intrinsic, for the inverse of this function.

See section 8.11.9.154 IShft Intrinsic, for information on a more widely available right-shifting intrinsic that is also more precisely defined.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.218 Scale Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Scale' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.219 Scan Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Scan' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.220 Second Intrinsic (function)

 
Second()

Second: REAL(KIND=1) function.

Intrinsic groups: unix.

Description:

Returns the process's runtime in seconds--the same value as the UNIX function etime returns.

On some systems, the underlying timings are represented using types with sufficiently small limits that overflows (wraparounds) are possible, such as 32-bit types. Therefore, the values returned by this intrinsic might be, or become, negative, or numerically less than previous values, during a single run of the compiled program.

For information on other intrinsics with the same name: See section 8.11.9.221 Second Intrinsic (subroutine).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.221 Second Intrinsic (subroutine)

 
CALL Second(Seconds)

Seconds: REAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Returns the process's runtime in seconds in Seconds---the same value as the UNIX function etime returns.

On some systems, the underlying timings are represented using types with sufficiently small limits that overflows (wraparounds) are possible, such as 32-bit types. Therefore, the values returned by this intrinsic might be, or become, negative, or numerically less than previous values, during a single run of the compiled program.

This routine is known from Cray Fortran. See section 8.11.9.49 CPU_Time Intrinsic, for a standard equivalent.

For information on other intrinsics with the same name: See section 8.11.9.220 Second Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.222 Selected_Int_Kind Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Selected_Int_Kind' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.223 Selected_Real_Kind Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Selected_Real_Kind' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.224 Set_Exponent Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Set_Exponent' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.225 Shape Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Shape' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.226 Short Intrinsic

 
Short(A)

Short: INTEGER(KIND=6) function.

A: INTEGER; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Returns A with the fractional portion of its magnitude truncated and its sign preserved, converted to type INTEGER(KIND=6).

If A is type COMPLEX, its real part is truncated and converted, and its imaginary part is disgregarded.

See section 8.11.9.148 Int Intrinsic.

The precise meaning of this intrinsic might change in a future version of the GNU Fortran language, as more is learned about how it is used.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.227 Sign Intrinsic

 
Sign(A, B)

Sign: INTEGER or REAL function, the exact type being the result of cross-promoting the types of all the arguments.

A: INTEGER or REAL; scalar; INTENT(IN).

B: INTEGER or REAL; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns `ABS(A)*s', where s is +1 if `B.GE.0', -1 otherwise.

See section 8.11.9.2 Abs Intrinsic, for the function that returns the magnitude of a value.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.228 Signal Intrinsic (subroutine)

 
CALL Signal(Number, Handler, Status)

Number: INTEGER; scalar; INTENT(IN).

Handler: Signal handler (INTEGER FUNCTION or SUBROUTINE) or dummy/global INTEGER(KIND=1) scalar.

Status: INTEGER(KIND=7); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

If Handler is a an EXTERNAL routine, arranges for it to be invoked with a single integer argument (of system-dependent length) when signal Number occurs. If Handler is an integer, it can be used to turn off handling of signal Number or revert to its default action. See signal(2).

Note that Handler will be called using C conventions, so the value of its argument in Fortran terms Fortran terms is obtained by applying %LOC() (or LOC()) to it.

The value returned by signal(2) is written to Status, if that argument is supplied. Otherwise the return value is ignored.

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine, or do not support the (optional) Status argument.

Warning: Use of the libf2c run-time library function `signal_' directly (such as via `EXTERNAL SIGNAL') requires use of the %VAL() construct to pass an INTEGER value (such as `SIG_IGN' or `SIG_DFL') for the Handler argument.

However, while `CALL SIGNAL(signum, %VAL(SIG_IGN))' works when `SIGNAL' is treated as an external procedure (and resolves, at link time, to libf2c's `signal_' routine), this construct is not valid when `SIGNAL' is recognized as the intrinsic of that name.

Therefore, for maximum portability and reliability, code such references to the `SIGNAL' facility as follows:

 
INTRINSIC SIGNAL
...
CALL SIGNAL(signum, SIG_IGN)

g77 will compile such a call correctly, while other compilers will generally either do so as well or reject the `INTRINSIC SIGNAL' statement via a diagnostic, allowing you to take appropriate action.

For information on other intrinsics with the same name: See section 10.5.2.128 Signal Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.229 Sin Intrinsic

 
Sin(X)

Sin: REAL or COMPLEX function, the exact type being that of argument X.

X: REAL or COMPLEX; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the sine of X, an angle measured in radians.

See section 8.11.9.23 ASin Intrinsic, for the inverse of this function.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.230 SinH Intrinsic

 
SinH(X)

SinH: REAL function, the `KIND=' value of the type being that of argument X.

X: REAL; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the hyperbolic sine of X.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.231 Sleep Intrinsic

 
CALL Sleep(Seconds)

Seconds: INTEGER(KIND=1); scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Causes the process to pause for Seconds seconds. See sleep(2).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.232 Sngl Intrinsic

 
Sngl(A)

Sngl: REAL(KIND=1) function.

A: REAL(KIND=2); scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Archaic form of REAL() that is specific to one type for A. See section 8.11.9.211 Real Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.233 Spacing Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Spacing' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.234 Spread Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Spread' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.235 SqRt Intrinsic

 
SqRt(X)

SqRt: REAL or COMPLEX function, the exact type being that of argument X.

X: REAL or COMPLEX; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the square root of X, which must not be negative.

To calculate and represent the square root of a negative number, complex arithmetic must be used. For example, `SQRT(COMPLEX(X))'.

The inverse of this function is `SQRT(X) * SQRT(X)'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.236 SRand Intrinsic

 
CALL SRand(Seed)

Seed: INTEGER; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Reinitialises the generator with the seed in Seed. See section 8.11.9.152 IRand Intrinsic. See section 8.11.9.207 Rand Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.237 Stat Intrinsic (subroutine)

 
CALL Stat(File, SArray, Status)

File: CHARACTER; scalar; INTENT(IN).

SArray: INTEGER(KIND=1); DIMENSION(13); INTENT(OUT).

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Obtains data about the given file File and places them in the array SArray. A null character (`CHAR(0)') marks the end of the name in File---otherwise, trailing blanks in File are ignored. The values in this array are extracted from the stat structure as returned by fstat(2) q.v., as follows:

  1. Device ID

  2. Inode number

  3. File mode

  4. Number of links

  5. Owner's uid

  6. Owner's gid

  7. ID of device containing directory entry for file (0 if not available)

  8. File size (bytes)

  9. Last access time

  10. Last modification time

  11. Last file status change time

  12. Preferred I/O block size (-1 if not available)

  13. Number of blocks allocated (-1 if not available)

Not all these elements are relevant on all systems. If an element is not relevant, it is returned as 0.

If the Status argument is supplied, it contains 0 on success or a non-zero error code upon return.

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine, or do not support the (optional) Status argument.

For information on other intrinsics with the same name: See section 8.11.9.238 Stat Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.238 Stat Intrinsic (function)

 
Stat(File, SArray)

Stat: INTEGER(KIND=1) function.

File: CHARACTER; scalar; INTENT(IN).

SArray: INTEGER(KIND=1); DIMENSION(13); INTENT(OUT).

Intrinsic groups: unix.

Description:

Obtains data about the given file File and places them in the array SArray. A null character (`CHAR(0)') marks the end of the name in File---otherwise, trailing blanks in File are ignored. The values in this array are extracted from the stat structure as returned by fstat(2) q.v., as follows:

  1. Device ID

  2. Inode number

  3. File mode

  4. Number of links

  5. Owner's uid

  6. Owner's gid

  7. ID of device containing directory entry for file (0 if not available)

  8. File size (bytes)

  9. Last access time

  10. Last modification time

  11. Last file status change time

  12. Preferred I/O block size (-1 if not available)

  13. Number of blocks allocated (-1 if not available)

Not all these elements are relevant on all systems. If an element is not relevant, it is returned as 0.

Returns 0 on success or a non-zero error code.

For information on other intrinsics with the same name: See section 8.11.9.237 Stat Intrinsic (subroutine).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.239 Sum Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Sum' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.240 SymLnk Intrinsic (subroutine)

 
CALL SymLnk(Path1, Path2, Status)

Path1: CHARACTER; scalar; INTENT(IN).

Path2: CHARACTER; scalar; INTENT(IN).

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Makes a symbolic link from file Path1 to Path2. A null character (`CHAR(0)') marks the end of the names in Path1 and Path2---otherwise, trailing blanks in Path1 and Path2 are ignored. If the Status argument is supplied, it contains 0 on success or a non-zero error code upon return (ENOSYS if the system does not provide symlink(2)).

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine, or do not support the (optional) Status argument.

For information on other intrinsics with the same name: See section 10.5.2.131 SymLnk Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.241 System Intrinsic (subroutine)

 
CALL System(Command, Status)

Command: CHARACTER; scalar; INTENT(IN).

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Passes the command Command to a shell (see system(3)). If argument Status is present, it contains the value returned by system(3), presumably 0 if the shell command succeeded. Note that which shell is used to invoke the command is system-dependent and environment-dependent.

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine, or do not support the (optional) Status argument.

For information on other intrinsics with the same name: See section 10.5.2.132 System Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.242 System_Clock Intrinsic

 
CALL System_Clock(Count, Rate, Max)

Count: INTEGER(KIND=1); scalar; INTENT(OUT).

Rate: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Max: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: f90.

Description:

Returns in Count the current value of the system clock; this is the value returned by the UNIX function times(2) in this implementation, but isn't in general. Rate is the number of clock ticks per second and Max is the maximum value this can take, which isn't very useful in this implementation since it's just the maximum C unsigned int value.

On some systems, the underlying timings are represented using types with sufficiently small limits that overflows (wraparounds) are possible, such as 32-bit types. Therefore, the values returned by this intrinsic might be, or become, negative, or numerically less than previous values, during a single run of the compiled program.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.243 Tan Intrinsic

 
Tan(X)

Tan: REAL function, the `KIND=' value of the type being that of argument X.

X: REAL; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the tangent of X, an angle measured in radians.

See section 8.11.9.25 ATan Intrinsic, for the inverse of this function.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.244 TanH Intrinsic

 
TanH(X)

TanH: REAL function, the `KIND=' value of the type being that of argument X.

X: REAL; scalar; INTENT(IN).

Intrinsic groups: (standard FORTRAN 77).

Description:

Returns the hyperbolic tangent of X.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.245 Time Intrinsic (UNIX)

 
Time()

Time: INTEGER(KIND=1) function.

Intrinsic groups: unix.

Description:

Returns the current time encoded as an integer (in the manner of the UNIX function time(3)). This value is suitable for passing to CTIME, GMTIME, and LTIME.

This intrinsic is not fully portable, such as to systems with 32-bit INTEGER types but supporting times wider than 32 bits. Therefore, the values returned by this intrinsic might be, or become, negative, or numerically less than previous values, during a single run of the compiled program.

See section 8.11.9.246 Time8 Intrinsic, for information on a similar intrinsic that might be portable to more GNU Fortran implementations, though to fewer Fortran compilers.

For information on other intrinsics with the same name: See section 10.5.2.134 Time Intrinsic (VXT).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.246 Time8 Intrinsic

 
Time8()

Time8: INTEGER(KIND=2) function.

Intrinsic groups: unix.

Description:

Returns the current time encoded as a long integer (in the manner of the UNIX function time(3)). This value is suitable for passing to CTIME, GMTIME, and LTIME.

Warning: this intrinsic does not increase the range of the timing values over that returned by time(3). On a system with a 32-bit time(3), TIME8 will return a 32-bit value, even though converted to an `INTEGER(KIND=2)' value. That means overflows of the 32-bit value can still occur. Therefore, the values returned by this intrinsic might be, or become, negative, or numerically less than previous values, during a single run of the compiled program.

No Fortran implementations other than GNU Fortran are known to support this intrinsic at the time of this writing. See section 8.11.9.245 Time Intrinsic (UNIX), for information on a similar intrinsic that might be portable to more Fortran compilers, though to fewer GNU Fortran implementations.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.247 Tiny Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Tiny' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.248 Transfer Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Transfer' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.249 Transpose Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Transpose' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.250 Trim Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Trim' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.251 TtyNam Intrinsic (subroutine)

 
CALL TtyNam(Unit, Name)

Unit: INTEGER; scalar; INTENT(IN).

Name: CHARACTER; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Sets Name to the name of the terminal device open on logical unit Unit or to a blank string if Unit is not connected to a terminal.

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine.

For information on other intrinsics with the same name: See section 8.11.9.252 TtyNam Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.252 TtyNam Intrinsic (function)

 
TtyNam(Unit)

TtyNam: CHARACTER*(*) function.

Unit: INTEGER; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Returns the name of the terminal device open on logical unit Unit or a blank string if Unit is not connected to a terminal.

For information on other intrinsics with the same name: See section 8.11.9.251 TtyNam Intrinsic (subroutine).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.253 UBound Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL UBound' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.254 UMask Intrinsic (subroutine)

 
CALL UMask(Mask, Old)

Mask: INTEGER; scalar; INTENT(IN).

Old: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Sets the file creation mask to Mask and returns the old value in argument Old if it is supplied. See umask(2).

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine.

For information on other intrinsics with the same name: See section 10.5.2.135 UMask Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.255 Unlink Intrinsic (subroutine)

 
CALL Unlink(File, Status)

File: CHARACTER; scalar; INTENT(IN).

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Unlink the file File. A null character (`CHAR(0)') marks the end of the name in File---otherwise, trailing blanks in File are ignored. If the Status argument is supplied, it contains 0 on success or a non-zero error code upon return. See unlink(2).

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine, or do not support the (optional) Status argument.

For information on other intrinsics with the same name: See section 10.5.2.136 Unlink Intrinsic (function).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.256 Unpack Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Unpack' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.257 Verify Intrinsic

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic. Use `EXTERNAL Verify' to use this name for an external procedure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.258 XOr Intrinsic

 
XOr(I, J)

XOr: INTEGER or LOGICAL function, the exact type being the result of cross-promoting the types of all the arguments.

I: INTEGER or LOGICAL; scalar; INTENT(IN).

J: INTEGER or LOGICAL; scalar; INTENT(IN).

Intrinsic groups: f2c.

Description:

Returns value resulting from boolean exclusive-OR of pair of bits in each of I and J.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.259 ZAbs Intrinsic

 
ZAbs(A)

ZAbs: REAL(KIND=2) function.

A: COMPLEX(KIND=2); scalar; INTENT(IN).

Intrinsic groups: f2c.

Description:

Archaic form of ABS() that is specific to one type for A. See section 8.11.9.2 Abs Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.260 ZCos Intrinsic

 
ZCos(X)

ZCos: COMPLEX(KIND=2) function.

X: COMPLEX(KIND=2); scalar; INTENT(IN).

Intrinsic groups: f2c.

Description:

Archaic form of COS() that is specific to one type for X. See section 8.11.9.46 Cos Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.261 ZExp Intrinsic

 
ZExp(X)

ZExp: COMPLEX(KIND=2) function.

X: COMPLEX(KIND=2); scalar; INTENT(IN).

Intrinsic groups: f2c.

Description:

Archaic form of EXP() that is specific to one type for X. See section 8.11.9.99 Exp Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.262 ZLog Intrinsic

 
ZLog(X)

ZLog: COMPLEX(KIND=2) function.

X: COMPLEX(KIND=2); scalar; INTENT(IN).

Intrinsic groups: f2c.

Description:

Archaic form of LOG() that is specific to one type for X. See section 8.11.9.170 Log Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.263 ZSin Intrinsic

 
ZSin(X)

ZSin: COMPLEX(KIND=2) function.

X: COMPLEX(KIND=2); scalar; INTENT(IN).

Intrinsic groups: f2c.

Description:

Archaic form of SIN() that is specific to one type for X. See section 8.11.9.229 Sin Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.264 ZSqRt Intrinsic

 
ZSqRt(X)

ZSqRt: COMPLEX(KIND=2) function.

X: COMPLEX(KIND=2); scalar; INTENT(IN).

Intrinsic groups: f2c.

Description:

Archaic form of SQRT() that is specific to one type for X. See section 8.11.9.235 SqRt Intrinsic.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.12 Scope and Classes of Symbolic Names

(The following information augments or overrides the information in Chapter 18 of ANSI X3.9-1978 FORTRAN 77 in specifying the GNU Fortran language. Chapter 18 of that document otherwise serves as the basis for the relevant aspects of GNU Fortran.)

8.12.1 Underscores in Symbol Names  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.12.1 Underscores in Symbol Names

Underscores (`_') are accepted in symbol names after the first character (which must be a letter).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.13 I/O

A dollar sign at the end of an output format specification suppresses the newline at the end of the output.

Edit descriptors in FORMAT statements may contain compile-time INTEGER constant expressions in angle brackets, such as
 
10    FORMAT (I<WIDTH>)

The OPEN specifier NAME= is equivalent to FILE=.

These Fortran 90 features are supported:


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.14 Fortran 90 Features

For convenience this section collects a list (probably incomplete) of the Fortran 90 features supported by the GNU Fortran language, even if they are documented elsewhere. See section `Characters' in and Execution Sequence, for information on additional fixed source form lexical issues. Further, the free source form is supported through the `-ffree-form' option. Other Fortran 90 features can be turned on by the `-ff90' option; see 9.7 Fortran 90. For information on the Fortran 90 intrinsics available, see 8.11.9 Table of Intrinsic Functions.

Automatic arrays in procedures
Character assignments
In character assignments, the variable being assigned may occur on the right hand side of the assignment.
Character strings
Strings may have zero length and substrings of character constants are permitted. Character constants may be enclosed in double quotes (") as well as single quotes. See section 8.7.4 Character Type.
Construct names
(Symbolic tags on blocks.) See section 8.10.3 Construct Names.
CYCLE and EXIT
See section The CYCLE and EXIT Statements.
DOUBLE COMPLEX
See section DOUBLE COMPLEX Statement.
DO WHILE
See section 8.10.1 DO WHILE.
END decoration
See section 8.6.4 Statements.
END DO
See section 8.10.2 END DO.
KIND
IMPLICIT NONE
INCLUDE statements
See section 8.6.7 Including Source Text.
List-directed and namelist I/O on internal files
Binary, octal and hexadecimal constants
These are supported more generally than required by Fortran 90. See section 8.7.3 Integer Type.
`O' and `Z' edit descriptors
NAMELIST
See section 8.9.1 NAMELIST Statement.
OPEN specifiers
STATUS='REPLACE' is supported. The FILE= specifier may be omitted in an OPEN statement if STATUS='SCRATCH' is supplied.
FORMAT edit descriptors
The Z edit descriptor is supported.
Relational operators
The operators <, <=, ==, /=, > and >= may be used instead of .LT., .LE., .EQ., .NE., .GT. and .GE. respectively.
SELECT CASE
Not fully implemented. See section SELECT CASE on CHARACTER Type.
Specification statements
A limited subset of the Fortran 90 syntax and semantics for variable declarations is supported, including KIND. See section 8.7.1.3 Kind Notation. (KIND is of limited usefulness in the absence of the KIND-related intrinsics, since these intrinsics permit writing more widely portable code.) An example of supported KIND usage is:
 
INTEGER (KIND=1) :: FOO=1, BAR=2
CHARACTER (LEN=3) FOO
PARAMETER and DIMENSION attributes aren't supported.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by GCC Administrator on August, 28 2001 using texi2html