Information technology - Programming languages - Fortran - Part 1: Base language

ISO/IEC 1539-1:2010 specifies the form and establishes the interpretation of programs expressed in the base Fortran language. Its purpose is to promote portability, reliability, maintainability, and efficient execution of Fortran programs for use on a variety of computing systems. ISO/IEC 1539-1:2010 specifies the forms that a program written in the Fortran language may take, the rules for interpreting the meaning of a program and its data, the form of the input data to be processed by such a program, and the form of the output data resulting from the use of such a program. Except where stated otherwise, requirements and prohibitions specified by ISO/IEC 1539-1:2010 apply to programs rather than processors.

Technologies de l'information — Langages de programmation — Fortran — Partie 1: Langage de base

General Information

Status
Withdrawn
Publication Date
05-Oct-2010
Withdrawal Date
05-Oct-2010
Current Stage
9599 - Withdrawal of International Standard
Start Date
28-Nov-2018
Completion Date
30-Oct-2025
Ref Project

Relations

Standard
ISO/IEC 1539-1:2010 - Information technology -- Programming languages -- Fortran
English language
603 pages
sale 15% off
Preview
sale 15% off
Preview
Standard
ISO/IEC 1539-1:2010 - Information technology -- Programming languages -- Fortran
English language
603 pages
sale 15% off
Preview
sale 15% off
Preview

Frequently Asked Questions

ISO/IEC 1539-1:2010 is a standard published by the International Organization for Standardization (ISO). Its full title is "Information technology - Programming languages - Fortran - Part 1: Base language". This standard covers: ISO/IEC 1539-1:2010 specifies the form and establishes the interpretation of programs expressed in the base Fortran language. Its purpose is to promote portability, reliability, maintainability, and efficient execution of Fortran programs for use on a variety of computing systems. ISO/IEC 1539-1:2010 specifies the forms that a program written in the Fortran language may take, the rules for interpreting the meaning of a program and its data, the form of the input data to be processed by such a program, and the form of the output data resulting from the use of such a program. Except where stated otherwise, requirements and prohibitions specified by ISO/IEC 1539-1:2010 apply to programs rather than processors.

ISO/IEC 1539-1:2010 specifies the form and establishes the interpretation of programs expressed in the base Fortran language. Its purpose is to promote portability, reliability, maintainability, and efficient execution of Fortran programs for use on a variety of computing systems. ISO/IEC 1539-1:2010 specifies the forms that a program written in the Fortran language may take, the rules for interpreting the meaning of a program and its data, the form of the input data to be processed by such a program, and the form of the output data resulting from the use of such a program. Except where stated otherwise, requirements and prohibitions specified by ISO/IEC 1539-1:2010 apply to programs rather than processors.

ISO/IEC 1539-1:2010 is classified under the following ICS (International Classification for Standards) categories: 35.060 - Languages used in information technology. The ICS classification helps identify the subject area and facilitates finding related standards.

ISO/IEC 1539-1:2010 has the following relationships with other standards: It is inter standard links to ISO/IEC 1539-1:2010/Cor 1:2012, ISO/IEC 1539-1:2018, ISO/IEC TR 19767:2005, ISO/IEC 1539-1:2004. Understanding these relationships helps ensure you are using the most current and applicable version of the standard.

You can purchase ISO/IEC 1539-1:2010 directly from iTeh Standards. The document is available in PDF format and is delivered instantly after payment. Add the standard to your cart and complete the secure checkout process. iTeh Standards is an authorized distributor of ISO standards.

Standards Content (Sample)


INTERNATIONAL ISO/IEC
STANDARD 1539-1
Third edition
2010-10-15
Information technology — Programming
languages — Fortran —
Part 1:
Base language
Technologies de l'information — Langages de programmation —
Fortran —
Partie 1: Langage de base
Reference number
©
ISO/IEC 2010
PDF disclaimer
This PDF file may contain embedded typefaces. In accordance with Adobe's licensing policy, this file may be printed or viewed but
shall not be edited unless the typefaces which are embedded are licensed to and installed on the computer performing the editing. In
downloading this file, parties accept therein the responsibility of not infringing Adobe's licensing policy. The ISO Central Secretariat
accepts no liability in this area.
Adobe is a trademark of Adobe Systems Incorporated.
Details of the software products used to create this PDF file can be found in the General Info relative to the file; the PDF-creation
parameters were optimized for printing. Every care has been taken to ensure that the file is suitable for use by ISO member bodies. In
the unlikely event that a problem relating to it is found, please inform the Central Secretariat at the address given below.

©  ISO/IEC 2010
All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by any means,
electronic or mechanical, including photocopying and microfilm, without permission in writing from either ISO at the address below or
ISO's member body in the country of the requester.
ISO copyright office
Case postale 56 • CH-1211 Geneva 20
Tel. + 41 22 749 01 11
Fax + 41 22 749 09 47
E-mail copyright@iso.org
Web www.iso.org
Published in Switzerland
ii © ISO/IEC 2010 – All rights reserved

Contents
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Normative references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Terms and de nitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Notation, symbols and abbreviated terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.4.1 Syntax rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.4.2 Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.4.3 Assumed syntax rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.4.4 Syntax conventions and characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.4.5 Text conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.5 Conformance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.6 Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.6.1 New intrinsic procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.6.2 Fortran 2003 compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.6.3 Fortran 95 compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.6.4 Fortran 90 compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.6.5 FORTRAN 77 compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.7 Deleted and obsolescent features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.7.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.7.2 Nature of deleted features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.7.3 Nature of obsolescent features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2 Fortran concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.1 High level syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.2 Program unit concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.2.1 Program units and scoping units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.2.2 Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.2.3 Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.2.4 Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.2.5 Submodule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.3 Execution concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.3.1 Statement classi cation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.3.2 Statement order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.3.3 The END statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.3.4 Program execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.3.5 Execution sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.4 Data concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.4.1 Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.4.2 Data value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.4.3 Data entity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.4.4 De nition of objects and pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.4.5 Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.4.6 Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.4.7 Coarray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
c
ISO/IEC 2010 { All rights reserved iii

2.4.8 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.4.9 Allocatable variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.4.10 Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.5 Fundamental concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.5.1 Names and designators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.5.2 Statement keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.5.3 Other keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.5.4 Association . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.5.5 Intrinsic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.5.6 Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.5.7 Companion processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3 Lexical tokens and source form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.1 Processor character set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.1.1 Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.1.2 Letters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.1.3 Digits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.1.4 Underscore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.1.5 Special characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.1.6 Other characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.2 Low-level syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.2.1 Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.2.2 Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.2.3 Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.2.4 Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.2.5 Statement labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.2.6 Delimiters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.3 Source form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.3.1 Program units, statements, and lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.3.2 Free source form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.3.3 Fixed source form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.4 Including source text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.1 The concept of type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.1.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.1.2 Set of values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.1.3 Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.1.4 Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.2 Type parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.3 Relationship of types and values to objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.3.1 Type speci ers and type compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.4 Intrinsic types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.4.1 Classi cation and speci cation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.4.2 Numeric intrinsic types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.4.3 Character type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4.4.4 Logical type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4.5 Derived types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4.5.1 Derived type concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4.5.2 Derived-type de nition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4.5.3 Derived-type parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
4.5.4 Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
4.5.5 Type-bound procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
4.5.6 Final subroutines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
4.5.7 Type extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
4.5.8 Derived-type values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
c
iv
ISO/IEC 2010 { All rights reserved

4.5.9 Derived-type speci er . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
4.5.10 Construction of derived-type values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
4.5.11 Derived-type operations and assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
4.6 Enumerations and enumerators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
4.7 Binary, octal, and hexadecimal literal constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
4.8 Construction of array values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
5 Attribute declarations and speci cations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.2 Type declaration statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.2.1 Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.2.2 Automatic data objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
5.2.3 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.2.4 Examples of type declaration statements . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.3 Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.3.1 Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.3.2 Accessibility attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.3.3 ALLOCATABLE attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
5.3.4 ASYNCHRONOUS attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
5.3.5 BIND attribute for data entities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
5.3.6 CODIMENSION attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.3.7 CONTIGUOUS attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.3.8 DIMENSION attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.3.9 EXTERNAL attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
5.3.10 INTENT attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
5.3.11 INTRINSIC attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
5.3.12 OPTIONAL attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
5.3.13 PARAMETER attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
5.3.14 POINTER attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
5.3.15 PROTECTED attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
5.3.16 SAVE attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
5.3.17 TARGET attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
5.3.18 VALUE attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
5.3.19 VOLATILE attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
5.4 Attribute speci cation statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
5.4.1 Accessibility statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
5.4.2 ALLOCATABLE statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5.4.3 ASYNCHRONOUS statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5.4.4 BIND statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5.4.5 CODIMENSION statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5.4.6 CONTIGUOUS statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
5.4.7 DATA statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
5.4.8 DIMENSION statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
5.4.9 INTENT statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
5.4.10 OPTIONAL statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
5.4.11 PARAMETER statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
5.4.12 POINTER statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
5.4.13 PROTECTED statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
5.4.14 SAVE statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
5.4.15 TARGET statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
5.4.16 VALUE statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
5.4.17 VOLATILE statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
5.5 IMPLICIT statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
5.6 NAMELIST statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
5.7 Storage association of data objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
5.7.1 EQUIVALENCE statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
c
ISO/IEC 2010 { All rights reserved v

5.7.2 COMMON statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
5.7.3 Restrictions on common and equivalence . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
6 Use of data objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
6.1 Designator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
6.2 Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
6.3 Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
6.4 Scalars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
6.4.1 Substrings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
6.4.2 Structure components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
6.4.3 Coindexed named objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
6.4.4 Complex parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
6.4.5 Type parameter inquiry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
6.5 Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
6.5.1 Order of reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
6.5.2 Whole arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
6.5.3 Array elements and array sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
6.5.4 Simply contiguous array designators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
6.6 Image selectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
6.7 Dynamic association . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
6.7.1 ALLOCATE statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
6.7.2 NULLIFY statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
6.7.3 DEALLOCATE statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
6.7.4 STAT= speci er . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
6.7.5 ERRMSG= speci er . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
7 Expressions and assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
7.1 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
7.1.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
7.1.2 Form of an expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
7.1.3 Precedence of operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
7.1.4 Evaluation of operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
7.1.5 Intrinsic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
7.1.6 De ned operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
7.1.7 Evaluation of operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
7.1.8 Integrity of parentheses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
7.1.9 Type, type parameters, and shape of an expression . . . . . . . . . . . . . . . . . . . . . 148
7.1.10 Conformability rules for elemental operations . . . . . . . . . . . . . . . . . . . . . . . . 149
7.1.11 Speci cation expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
7.1.12 Constant expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
7.2 Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
7.2.1 Assignment statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
7.2.2 Pointer assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
7.2.3 Masked array assignment { WHERE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
7.2.4 FORALL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
8 Execution control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
8.1 Executable constructs containing blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
8.1.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
8.1.2 Rules governing blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
8.1.3 ASSOCIATE construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
8.1.4 BLOCK construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
8.1.5 CRITICAL construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
8.1.6 DO construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
8.1.7 IF construct and statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
8.1.8 SELECT CASE construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
c
vi
ISO/IEC 2010 { All rights reserved

8.1.9 SELECT TYPE construct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
8.1.10 EXIT statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
8.2 Branching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
8.2.1 Branch concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
8.2.2 GO TO statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
8.2.3 Computed GO TO statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
8.2.4 Arithmetic IF statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
8.3 CONTINUE statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
8.4 STOP and ERROR STOP statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
8.5 Image execution control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
8.5.1 Image control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
8.5.2 Segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
8.5.3 SYNC ALL statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
8.5.4 SYNC IMAGES statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
8.5.5 SYNC MEMORY statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
8.5.6 LOCK and UNLOCK statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
8.5.7 STAT= and ERRMSG= speci ers in image control statements . . . . . . . . . . . . . . . 195
9 Input/output statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
9.1 Input/output concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
9.2 Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
9.2.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
9.2.2 Formatted record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
9.2.3 Unformatted record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
9.2.4 End le record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
9.3 External les . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
9.3.1 Basic concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
9.3.2 File existence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
9.3.3 File access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
9.3.4 File position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
9.3.5 File storage units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
9.4 Internal les . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
9.5 File connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
9.5.1 Referring to a le . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
9.5.2 Connection modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
9.5.3 Unit existence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
9.5.4 Connection of a le to a unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
9.5.5 Preconnection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
9.5.6 OPEN statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
9.5.7 CLOSE statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
9.6 Data transfer statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
9.6.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
9.6.2 Control information list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
9.6.3 Data transfer input/output list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
9.6.4 Execution of a data transfer input/output statement . . . . . . . . . . . . . . . . . . . . 219
9.6.5 Termination of data transfer statements . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
9.7 Waiting on pending data transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
9.7.1 Wait operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
9.7.2 WAIT statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
9.8 File positioning statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
9.8.1 Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
9.8.2 BACKSPACE statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
9.8.3 ENDFILE statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
9.8.4 REWIND statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
9.9 FLUSH statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
9.10 File inquiry statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
c
ISO/IEC 2010 { All rights reserved vii

9.10.1 Forms of the INQUIRE statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
9.10.2 Inquiry speci ers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
9.10.3 Inquire by output list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
9.11 Error, end-of-record, and end-of- le conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
9.11.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
9.11.2 Error conditions and the ERR= speci er . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
9.11.3 End-of- le condition and the END= speci er . . . . . . . . . . . . . . . . . . . . . . . . . 241
9.11.4 End-of-record condition and the EOR= speci er . . . . . . . . . . . . . . . . . . . . . . . 241
9.11.5 IOSTAT= speci er . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
9.11.6 IOMSG= speci er . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
9.12 Restrictions on input/output statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
10 Input/output editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
10.1 Format speci cations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
10.2 Explicit format speci cation methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
10.2.1 FORMAT statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
10.2.2 Character format speci cation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
10.3 Form of a format item list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
10.3.1 Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
10.3.2 Edit descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
10.3.3 Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
10.4 Interaction between input/output list and format . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
10.5 Positioning by format control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
10.6 Decimal symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
10.7 Data edit descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
10.7.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
10.7.2 Numeric editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
10.7.3 Logical editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
10.7.4 Character editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
10.7.5 Generalized editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
10.7.6 User-de ned derived-type editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
10.8 Control edit descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
10.8.1 Position editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
10.8.2 Slash editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
10.8.3 Colon editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
10.8.4 SS, SP, and S editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
10.8.5 P editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
10.8.6 BN and BZ editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
10.8.7 RU, RD, RZ, RN, RC, and RP editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
10.8.8 DC and DP editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
10.9 Character string edit descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
10.10 List-directed formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
10.10.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
10.10.2 Values and value separators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
10.10.3 List-directed input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
10.10.4 List-directed output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
10.11 Namelist formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
10.11.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
10.11.2 Name-value subsequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
10.11.3 Namelist input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
10.11.4 Namelist output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
11 Program units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
11.1 Main program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
11.2 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
11.2.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
c
viii
ISO/IEC 2010 { All rights reserved

11.2.2 The USE statement and use association . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
11.2.3 Submodules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
11.3 Block data program units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
12 Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
12.1 Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
12.2 Procedure classi cations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
12.2.1 Procedure classi cation by reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
12.2.2 Procedure classi cation by means of de nition . . . . . . . . . . . . . . . . . . . . . . . . 277
12.3 Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
12.3.1 Characteristics of procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
12.3.2 Characteristics of dummy arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
12.3.3 Characteristics of function results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
12.4 Procedure interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
12.4.1 Interface and abstract interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
12.4.2 Implicit and explicit interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
12.4.3 Speci cation of the procedure interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
12.5 Procedure reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
12.5.1 Syntax of a procedure reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
12.5.2 Actual arguments, dummy arguments, and argument association . . . . . . . . . . . . . . 291
12.5.3 Function reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
12.5.4 Subroutine reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
12.5.5 Resolving named procedure references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
12.5.6 Resolving type-bound procedure references . . . . . . . . . . . . . . . . . . . . . . . . . . 305
12.6 Procedure de nition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
12.6.1 Intrinsic procedure de nition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
12.6.2 Procedures de ned by subprograms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
12.6.3 De nition and invocation of procedures by means other than Fortran . . . . . . . . . . . 311
12.6.4 Statement function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
12.7 Pure procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
12.8 Elemental procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
12.8.1 Elemental procedure declaration and interface . . . . . . . . . . . . . . . . . . . . . . . . 313
12.8.2 Elemental function actual arguments and results . . . . . . . . . . . . . . . . . . . . . . . 314
12.8.3 Elemental subroutine actual arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
13 Intrinsic procedures and modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
13.1 Classes of intrinsic procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
13.2 Arguments to intrinsic procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
13.2.1 General rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
13.2.2 The shape of array arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
13.2.3 Mask arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
13.2.4 DIM arguments and reduction functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
13.3 Bit model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
13.3.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
13.3.2 Bit sequence comparisons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
13.3.3 Bit sequences as arguments to INT and REAL . . . . . . . . . . . . . . . . . . . . . . . . 317
13.4 Numeric models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
13.5 Standard generic intrinsic procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
13.6 Speci c names for standard intrinsic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
13.7 Speci cations of the standard intrinsic procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
13.7.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
13.8 Standard modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
13.8.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
13.8.2 The ISO FORTRAN ENV intrinsic module . . . . . . . . . . . . . . . . . . . . . . . . . 397
14 Exceptions and IEEE arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
c
ISO/IEC 2010 { All rights reserved ix

14.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
14.2 Derived types and constants de ned in the modules . . . . . . . . . . . . . . . . . . . . . . . . . . 402
14.3 The exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
14.4 The rounding modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
14.5 Under
ow mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
14.6 Halting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
14.7 The
oating-point status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
14.8 Exceptional values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
14.9 IEEE arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
14.10 Summary of the procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
14.11 Speci cations of the procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
14.11.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
14.12 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
15 Interoperability with C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
15.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
15.2 The ISO C BINDING intrinsic module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
15.2.1 Summary of contents . . . . . . . . . . . . . . . . . .
...


INTERNATIONAL ISO/IEC
STANDARD 1539-1
Third edition
2010-10-15
Information technology — Programming
languages — Fortran —
Part 1:
Base language
Technologies de l'information — Langages de programmation —
Fortran —
Partie 1: Langage de base
Reference number
©
ISO/IEC 2010
PDF disclaimer
PDF files may contain embedded typefaces. In accordance with Adobe's licensing policy, such files may be printed or viewed but shall
not be edited unless the typefaces which are embedded are licensed to and installed on the computer performing the editing. In
downloading a PDF file, parties accept therein the responsibility of not infringing Adobe's licensing policy. The ISO Central Secretariat
accepts no liability in this area.
Adobe is a trademark of Adobe Systems Incorporated.
Details of the software products used to create the PDF file(s) constituting this document can be found in the General Info relative to
the file(s); the PDF-creation parameters were optimized for printing. Every care has been taken to ensure that the files are suitable for
use by ISO member bodies. In the unlikely event that a problem relating to them is found, please inform the Central Secretariat at the
address given below.
This CD-ROM contains the publication ISO/IEC 1539-1:2010 in portable document format (PDF), which can
be viewed using Adobe® Acrobat® Reader.
Adobe and Acrobat are trademarks of Adobe Systems Incorporated.

This third edition cancels and replaces the second edition (ISO/IEC 1539-1:2004), which has been
technically revised. It also incorporates the Technical Corrigenda ISO/IEC 1539-1:2004/Cor.1:2006,
ISO/IEC 1539-1:2004/Cor.2:2007, ISO/IEC 1539-1:2004/Cor.3:2008 and ISO/IEC 1539-1:2004/Cor.4:2009,
and the Technical Report ISO/IEC TR 19767:2005.
©  ISO/IEC 2010
All rights reserved. Unless required for installation or otherwise specified, no part of this CD-ROM may be reproduced, stored in a retrieval
system or transmitted in any form or by any means without prior permission from IS
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.

Loading comments...