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

ISO/IEC 1539-1:2004 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.

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

General Information

Status
Withdrawn
Publication Date
17-Nov-2004
Withdrawal Date
17-Nov-2004
Current Stage
9599 - Withdrawal of International Standard
Start Date
06-Oct-2010
Completion Date
30-Oct-2025
Ref Project

Relations

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

Frequently Asked Questions

ISO/IEC 1539-1:2004 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:2004 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:2004 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:2004 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:2004 has the following relationships with other standards: It is inter standard links to ISO 16890-3:2016, ISO/IEC 1539-1:1997/Cor 1:2001, ISO/IEC 1539-1:1997, ISO/IEC 1539-1:1997/Cor 2:2002, ISO/IEC 1539-1:2010. Understanding these relationships helps ensure you are using the most current and applicable version of the standard.

You can purchase ISO/IEC 1539-1:2004 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
Second edition
2004-11-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 2004
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 2004
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 2004 – All rights reserved

Contents
1 Overview . . 1
1.1 Scope . 1
1.2 Processor. 1
1.3 Inclusions . . 1
1.4 Exclusions . . 1
1.5 Conformance. 2
1.6 Compatibility . 3
1.6.1 Fortran95compatibility . 3
1.6.2 Fortran90compatibility . 3
1.6.3 FORTRAN77compatibility . . 4
1.7 Notation used in this standard . . . . 4
1.7.1 Informativenotes . . 4
1.7.2 Syntaxrules . 4
1.7.3 Constraints . 5
1.7.4 Assumedsyntaxrules. 6
1.7.5 Syntaxconventionsandcharacteristics . . 6
1.7.6 Textconventions . 6
1.8 Deletedandobsolescentfeatures. . 7
1.8.1 Nature of deleted features . 7
1.8.2 Nature of obsolescent features . . . 7
1.9 Normativereferences . 7
2 Fortrantermsandconcepts . 9
2.1 Highlevelsyntax . 9
2.2 Programunitconcepts . 11
2.2.1 Program . 12
2.2.2 Mainprogram . 12
2.2.3 Procedure . 12
2.2.4 Module . 13
2.3 Executionconcepts . 13
2.3.1 Executable/nonexecutable statements . . . . . . 13
2.3.2 Statement order . . . 13
2.3.3 The END statement. 14
2.3.4 Executionsequence . 15
2.4 Data concepts . 15
2.4.1 Type . 15
2.4.2 Data value . . 16
2.4.3 Data entity . . 16
2.4.4 Scalar. 17
2.4.5 Array. 18
2.4.6 Pointer . 18
2.4.7 Storage . 18
2.5 Fundamentalterms . . 18
2.5.1 Name and designator . . . . 19
2.5.2 Keyword . 19
2.5.3 Association. 19
2.5.4 Declaration . 19
© ISO/IEC 2004 – All rights reserved iii

2.5.5 Definition . 19
2.5.6 Reference. 20
2.5.7 Intrinsic . 20
2.5.8 Operator . . . 20
2.5.9 Sequence . . 20
2.5.10 Companionprocessors . . 21
3 Characters,lexicaltokens,andsourceform . . 23
3.1 Processorcharacterset . 23
3.1.1 Letters . 23
3.1.2 Digits. 24
3.1.3 Underscore. . 24
3.1.4 Specialcharacters . 24
3.1.5 Othercharacters. 24
3.2 Low-levelsyntax. 25
3.2.1 Names . 25
3.2.2 Constants . 25
3.2.3 Operators . . 25
3.2.4 Statement labels . . . 26
3.2.5 Delimiters . . 27
3.3 Sourceform . . 27
3.3.1 Freesourceform. . 27
3.3.2 Fixedsourceform . 29
3.4 Includingsourcetext . 30
4 Types . 33
4.1 Theconceptoftype. . 33
4.1.1 Setofvalues . 33
4.1.2 Constants . 33
4.1.3 Operations . . 34
4.2 Typeparameters . . 34
4.3 Relationshipoftypesandvaluestoobjects . 35
4.4 Intrinsictypes . 35
4.4.1 Integertype . 36
4.4.2 Realtype. . 37
4.4.3 Complextype . 39
4.4.4 Charactertype . 40
4.4.5 Logical type . 43
4.5 Derivedtypes . 44
4.5.1 Derived-typedefinition . 45
4.5.2 Derived-typeparameters . . 48
4.5.3 Components . 49
4.5.4 Type-boundprocedures. . 56
4.5.5 Finalsubroutines . . 58
4.5.6 Typeextension . 60
4.5.7 Derived-typevalues . 62
4.5.8 Derived-typespecifier . 62
4.5.9 Constructionofderived-typevalues . 63
4.5.10 Derived-typeoperationsandassignment . 65
4.6 Enumerationsandenumerators . . 66
4.7 Constructionofarrayvalues . 67
5 Data object declarations and specifications . . . 71
5.1 Type declaration statements . 71
iv © ISO/IEC 2004 – All rights reserved

5.1.1 Declarationtypespecifiers . 75
5.1.2 Attributes . 76
5.2 Attribute specification statements . . 85
5.2.1 Accessibility statements . . 86
5.2.2 ALLOCATABLE statement . . . . 86
5.2.3 ASYNCHRONOUSstatement . 86
5.2.4 BIND statement . . . 87
5.2.5 DATA statement . . 87
5.2.6 DIMENSION statement . . 90
5.2.7 INTENTstatement . 90
5.2.8 OPTIONAL statement . . . 90
5.2.9 PARAMETER statement . . 90
5.2.10 POINTER statement . . . . 91
5.2.11 PROTECTEDstatement. . 91
5.2.12 SAVEstatement. 91
5.2.13 TARGET statement . . . . 92
5.2.14 VALUE statement . . 92
5.2.15 VOLATILE statement . . . 92
5.3 IMPLICITstatement . 92
5.4 NAMELISTstatement . 95
5.5 Storageassociationofdataobjects . 95
5.5.1 EQUIVALENCE statement . . . . 95
5.5.2 COMMONstatement . 98
6 Useofdataobjects . . 103
6.1 Scalars . 104
6.1.1 Substrings . . 104
6.1.2 Structurecomponents. 104
6.1.3 Typeparameterinquiry . . 106
6.2 Arrays . 106
6.2.1 Wholearrays . 107
6.2.2 Arrayelementsandarraysections . 107
6.3 Dynamicassociation . 110
6.3.1 ALLOCATE statement . . . 110
6.3.2 NULLIFY statement . . . . 113
6.3.3 DEALLOCATE statement . 114
7 Expressionsandassignment . 117
7.1 Expressions . 117
7.1.1 Formofanexpression. 117
7.1.2 Intrinsicoperations . 121
7.1.3 Definedoperations . 122
7.1.4 Type,typeparameters,andshapeofanexpression . . 123
7.1.5 Conformabilityrulesforelementaloperations . 125
7.1.6 Specificationexpression. 125
7.1.7 Initializationexpression. 126
7.1.8 Evaluationofoperations . 128
7.2 Interpretation of operations . 132
7.2.1 Numericintrinsicoperations . 133
7.2.2 Characterintrinsicoperation. 133
7.2.3 Relationalintrinsicoperations . . 134
7.2.4 Logical intrinsic operations. 135
7.3 Precedence of operators . . . . 136
7.4 Assignment . . 138
© ISO/IEC 2004 – All rights reserved v

7.4.1 Assignment statement . . . 138
7.4.2 Pointerassignment . 142
7.4.3 Maskedarrayassignment–WHERE . 145
7.4.4 FORALL . . . 148
8 Executioncontrol. . 155
8.1 Executableconstructscontainingblocks . 155
8.1.1 Rulesgoverningblocks . . 155
8.1.2 IFconstruct . 156
8.1.3 CASEconstruct . 158
8.1.4 ASSOCIATEconstruct . . 160
8.1.5 SELECTTYPEconstruct . 162
8.1.6 DOconstruct . 164
8.2 Branching . 169
8.2.1 GO TO statement . . 169
8.2.2 Computed GO TO statement . . . 170
8.2.3 Arithmetic IF statement . . 170
8.3 CONTINUE statement . . . . 170
8.4 STOPstatement . . 170
9 Input/output statements . . . 171
9.1 Records. 171
9.1.1 Formatted record . . 171
9.1.2 Unformatted record . 172
9.1.3 Endfilerecord . 172
9.2 Externalfiles. . 172
9.2.1 Fileexistence . 173
9.2.2 Fileaccess . . 173
9.2.3 Fileposition . 175
9.2.4 Filestorageunits . . 177
9.3 Internalfiles . . 177
9.4 Fileconnection . 178
9.4.1 Connectionmodes. 179
9.4.2 Unitexistence . 179
9.4.3 Connectionofafiletoaunit. 179
9.4.4 Preconnection . 180
9.4.5 The OPEN statement . . . . 180
9.4.6 The CLOSE statement . . . 184
9.5 Data transfer statements . . . 186
9.5.1 Controlinformationlist. 186
9.5.2 Data transfer input/output list . . 191
9.5.3 Execution of a data transfer input/output statement . 193
9.5.4 Termination of data transfer statements . . . . 205
9.6 Waitingonpendingdatatransfer . 205
9.6.1 WAITstatement . 205
9.6.2 Waitoperation . 206
9.7 Filepositioningstatements . 207
9.7.1 BACKSPACEstatement . . 207
9.7.2 ENDFILE statement . . . . 208
9.7.3 REWIND statement . . . . 208
9.8 FLUSH statement . . . 208
9.9 Fileinquiry . 209
9.9.1 Inquiryspecifiers . . 210
9.9.2 Restrictionsoninquiryspecifiers. . 216
vi © ISO/IEC 2004 – All rights reserved

9.9.3 Inquirebyoutputlist . 216
9.10 Error,end-of-record,andend-of-fileconditions . . 216
9.10.1 ErrorconditionsandtheERR=specifier . 217
9.10.2 End-of-fileconditionandtheEND=specifier. 217
9.10.3 End-of-recordconditionandtheEOR=specifier. 217
9.10.4 IOSTAT=specifier . 218
9.10.5 IOMSG=specifier. . 218
9.11 Restrictions on input/output statements . . . . . 219
10 Input/output editing . 221
10.1 Explicitformatspecificationmethods . 221
10.1.1 FORMAT statement . . . . 221
10.1.2 Characterformatspecification . 221
10.2 Formofaformatitemlist . . 222
10.2.1 Editdescriptors . . 222
10.2.2 Fields. 224
10.3 Interaction between input/output list and format . . . . 224
10.4 Positioningbyformatcontrol . 225
10.5 Decimalsymbol . 226
10.6 Data edit descriptors . 226
10.6.1 Numericediting . . 226
10.6.2 Logical editing . . . . 232
10.6.3 Characterediting . . 232
10.6.4 Generalizedediting . 233
10.6.5 User-definedderived-typeediting . 235
10.7 Controleditdescriptors. 235
10.7.1 Positionediting . 235
10.7.2 Slashediting . 236
10.7.3 Colonediting . 236
10.7.4 SS,SP,andSediting . 237
10.7.5 Pediting . . 237
10.7.6 BNandBZediting . 237
10.7.7 RU,RD,RZ,RN,RC,andRPediting . . 238
10.7.8 DCandDPediting . 238
10.8 Characterstringeditdescriptors. . 238
10.9 List-directed formatting . . . 238
10.9.1 List-directedinput . 239
10.9.2 List-directedoutput. 241
10.10 Namelist formatting . . 242
10.10.1 Namelistinput. 243
10.10.2 Namelistoutput . . 246
11 Programunits . 249
11.1 Mainprogram . 249
11.2 Modules . 250
11.2.1 The USE statement and use association . . . . . 251
11.3 Blockdataprogramunits. . 253
12 Procedures . 255
12.1 Procedureclassifications . . 255
12.1.1 Procedureclassificationbyreference. 255
12.1.2 Procedureclassificationbymeansofdefinition . 255
12.2 Characteristicsofprocedures. 256
12.2.1 Characteristicsofdummyarguments . . 256
© ISO/IEC 2004 – All rights reserved vii

12.2.2 Characteristicsoffunctionresults . 257
12.3 Procedureinterface . . 257
12.3.1 Implicitandexplicitinterfaces . 257
12.3.2 Specificationoftheprocedureinterface . . 258
12.4 Procedurereference . . 266
12.4.1 Actualarguments,dummyarguments,andargumentassociation. 268
12.4.2 Functionreference. 276
12.4.3 Subroutinereference . 276
12.4.4 Resolvingnamedprocedurereferences. 276
12.4.5 Resolvingtype-boundprocedurereferences . . 278
12.5 Proceduredefinition. . 279
12.5.1 Intrinsicproceduredefinition. 279
12.5.2 Proceduresdefinedbysubprograms . 279
12.5.3 Definition and invocation of procedures by means other than Fortran . . . . . . 285
12.5.4 Statement function . 285
12.6 Pureprocedures . 286
12.7 Elementalprocedures . 287
12.7.1 Elementalproceduredeclarationandinterface . 287
12.7.2 Elementalfunctionactualargumentsandresults. 288
12.7.3 Elementalsubroutineactualarguments . . 289
13 Intrinsicproceduresandmodules . 291
13.1 Classesofintrinsicprocedures . 291
13.2 Argumentstointrinsicprocedures . . 291
13.2.1 Theshapeofarrayarguments . 292
13.2.2 Maskarguments. 292
13.3 Bitmodel . . 292
13.4 Numericmodels . 293
13.5 Standardgenericintrinsicprocedures . 294
13.5.1 Numericfunctions. . 294
13.5.2 Mathematicalfunctions. . 294
13.5.3 Characterfunctions . 295
13.5.4 Kindfunctions. 295
13.5.5 Miscellaneoustypeconversionfunctions. . 295
13.5.6 Numericinquiryfunctions . 295
13.5.7 Arrayinquiryfunctions . 296
13.5.8 Otherinquiryfunctions. 296
13.5.9 Bitmanipulationprocedures . 296
13.5.10 Floating-point manipulation functions . . . . . . 296
13.5.11 Vectorandmatrixmultiplyfunctions . . 297
13.5.12 Arrayreductionfunctions . 297
13.5.13 Arrayconstructionfunctions . 297
13.5.14 Arraylocationfunctions . . 297
13.5.15 Nullfunction. 297
13.5.16 Allocationtransferprocedure . . 297
13.5.17 Randomnumbersubroutines. 297
13.5.18 Systemenvironmentprocedures . . 298
13.6 Specificnamesforstandardintrinsicfunctions . 298
13.7 Specificationsofthestandardintrinsicprocedures . 300
13.8 Standardintrinsicmodules . 359
13.8.1 TheIEEEmodules . 359
13.8.2 The ISO FORTRANENVintrinsicmodule . 359
13.8.3 The ISO C BINDING module . . . 360
viii © ISO/IEC 2004 – All rights reserved

14 ExceptionsandIEEEarithmetic . . 361
14.1 Derivedtypesandconstantsdefinedinthemodules . 362
14.2 Theexceptions . 363
14.3 Theroundingmodes . 365
14.4 Underflowmode . 365
14.5 Halting . 366
14.6 The floating point status . . . 366
14.7 Exceptionalvalues. 366
14.8 IEEEarithmetic. 366
14.9 Tablesoftheprocedures . 367
14.9.1 Inquiryfunctions . . 367
14.9.2 Elementalfunctions . 368
14.9.3 Kindfunction . 368
14.9.4 Elementalsubroutines . . 368
14.9.5 Nonelementalsubroutines . 368
14.10 Specificationsoftheprocedures . 369
14.11 Examples. 384
15 InteroperabilitywithC. 389
15.1 The ISO C BINDING intrinsic module . . . . . . 389
15.1.1 Namedconstantsandderivedtypesinthemodule. 389
15.1.2 Proceduresinthemodule . 390
15.2 InteroperabilitybetweenFortranandCentities . 393
15.2.1 Interoperabilityofintrinsictypes . 394
15.2.2 InteroperabilitywithCpointertypes . 395
15.2.3 InteroperabilityofderivedtypesandCstructtypes . 396
15.2.4 Interoperabilityofscalarvariables . 397
15.2.5 Interoperabilityofarrayvariables . 397
15.2.6 Interoperabilityofproceduresandprocedureinterfaces . 398
15.3 InteroperationwithCglobalvariables. 400
15.3.1 Bindinglabelsforcommonblocksandvariables . 401
15.4 InteroperationwithCfunctions . 401
15.4.1 Bindinglabelsforprocedures . . 401
15.4.2 ExceptionsandIEEEarithmeticprocedures . 402
16 Scope,association,anddefinition . 403
16.1 Scopeofglobalidentifiers. 403
16.2 Scopeoflocalidentifiers . . 404
16.2.1 Localidentifiersthatarethesameascommonblocknames. 405
16.2.2 Functionresults . 405
16.2.3 Restrictionsongenericdeclarations . 405
16.2.4 Components,typeparameters,andbindings . 406
16.2.5 Argumentkeywords . 407
16.3 Statement and construct entities . . . 407
16.4 Association. 408
16.4.1 Nameassociation . 408
16.4.2 Pointerassociation . 412
16.4.3 Storageassociation . 413
16.4.4 Inheritanceassociation . 416
16.4.5 Establishingassociations . . 416
16.5 Definitionandundefinitionofvariables . . 417
16.5.1 Definitionofobjectsandsubobjects. 417
16.5.2 Variablesthatarealwaysdefined . 417
16.5.3 Variablesthatareinitiallydefined. 417
© ISO/IEC 2004 – All rights reserved ix

16.5.4 Variablesthatareinitiallyundefined . 418
16.5.5 Eventsthatcausevariablestobecomedefined . 418
16.5.6 Eventsthatcausevariablestobecomeundefined. 419
16.5.7 Variabledefinitioncontext . 421
AnnexA (informative)Glossaryoftechnicalterms . 423
AnnexB (informative)Decrementalfeatures. 435
B.1 Deletedfeatures . 435
B.2 Obsolescentfeatures. . 436
B.2.1 Alternatereturn. 436
B.2.2 Computed GO TO statement . . . 436
B.2.3 Statement functions. 436
B.2.4 DATA statements among executables . . . . . . 437
B.2.5 Assumedcharacterlengthfunctions. 437
B.2.6 Fixedformsource . 437
B.2.7 CHARACTER* form of CHARACTER declaration . . 437
AnnexC (informative)Extendednotes . 439
C.1 Section 4notes . 439
C.1.1 Intrinsic and derived types (4.4, 4.5) . 439
C.1.2 Selection of the approximation methods (4.4.2) . 440
C.1.3 Type extension and component accessibility (4.5.1.1, 4.5.3) . 440
C.1.4 Abstracttypes. 441
C.1.5 Pointers (4.5.1) . . 442
C.1.6 Structureconstructorsandgenericnames. 443
C.1.7 Generictype-boundprocedures . 445
C.1.8 Final subroutines (4.5.5, 4.5.5.1, 4.5.5.2, 4.5.5.3) . . 446
C.2 Section 5notes . 448
C.2.1 The POINTER attribute (5.1.2.11) . 448
C.2.2 The TARGET attribute (5.1.2.14). 449
C.2.3 The VOLATILE attribute (5.1.2.16). 449
C.3 Section 6notes . 450
C.3.1 Structure components (6.1.2). . 450
C.3.2 Allocation with dynamic type (6.3.1) . 451
C.3.3 Pointerallocationandassociation . 452
C.4 Section 7notes . 453
C.4.1 Characterassignment . 453
C.4.2 Evaluationoffunctionreferences . 453
C.4.3 Pointersinexpressions . 453
C.4.4 Pointersontheleftsideofanassignment. 453
C.4.5 An example of a FORALL construct containing a WHERE construct . . . . . . 454
C.4.6 Examples of FORALL statements . 455
C.5 Section 8notes . 456
C.5.1 Loopcontrol . 456
C.5.2 TheCASEconstruct . 456
C.5.3 ExamplesofDOconstructs. 456
C.5.4 ExamplesofinvalidDOconstructs . 458
C.6 Section 9notes . 459
C.6.1 External files (9.2) . . 459
C.6.2 Nonadvancing input/output (9.2.3.1) . 461
C.6.3 Asynchronousinput/output . 462
C.6.4 OPEN statement (9.4.5) . . 463
C.6.5 Connection properties (9.4.3) . . 464
x © ISO/IEC 2004 – All rights reserved

C.6.6 CLOSE statement (9.4.6). . 465
C.7 Section 10notes. 465
C.7.1 Number of records (10.3, 10.4, 10.7.2). . 465
C.7.2 List-directed input (10.9.1). 466
C.8 Section 11notes. 466
C.8.1 Main program and block data program unit (11.1, 11.3) . . 466
C.8.2 Dependent compilation (11.2) . . 467
C.8.3 Examplesoftheuseofmodules . 469
C.9 Section 12notes. 475
C.9.1 Portability problems with external procedures (12.3.2.2) . 475
C.9.2 Procedures defined by means other than Fortran (12.5.3) . 476
C.9.3 Procedure interfaces (12.3) . . 476
C.9.4 Abstract interfaces (12.3) and procedure pointer components (4.5). 476
C.9.5 Argument association and evaluation (12.4.1.2) . 478
C.9.6 Pointers and targets as arguments (12.4.1.2) . . 479
C.9.7 Polymorphic Argument Association (12.4.1.3) . . 480
C.10 Section 15notes. 482
C.10.1 Runtimeenvironments . . 482
C.10.2 ExamplesofInteroperationbetweenFortranandCFunctions . 482
C.11 Section 16notes. 487
C.11.1 Examples of host association (16.4.1.3) . 487
C.11.2 Rules ensuring unambiguous generics (16.2.3) . . 488
C.12 Arrayfeaturenotes . . 493
C.12.1 Summaryoffeatures . 493
C.12.2 Examples. . 495
C.12.3 FORmula TRANslation and array processing . 499
C.12.4 Sumofsquaredresiduals . 500
C.12.5 Vectornorms: infinity-normandone-norm . . 500
C.12.6 Matrixnorms: infinity-normandone-norm . . 500
C.12.7 Logical queries . . . . 500
C.12.8 Parallel computations . . . . 501
C.12.9 Exampleofelement-by-elementcomputation . . 501
C.12.10 Bitmanipulationandinquiryprocedures . 502
AnnexD (informative)Syntaxrules. 503
D.1 Extractofallsyntaxrules . . 503
D.2 Syntaxrulecross-reference . . 541
AnnexE (informative)Index. 553
© ISO/IEC 2004 – All rights reserved xi

List of Tables
2.1 Requirements on statement ordering . 14
2.2 Statements allowed in scoping units . 14
3.1 Special characters . 24
6.1 Subscript order value . 108
7.1 Type of operands and results for intrinsic operators . 121
7.2 Interpretation of the numeric intrinsic operators . 133
7.3 Interpretation of the character intrinsic operator // . 134
7.4 Interpretation of the relational intrinsic operators . 134
7.5 Interpretation of the logical intrinsic operators . 135
7.6 The values of operations involving logical intrinsic operators. 135
7.7 Categories of operations and relative precedence . 136
7.8 Type conformance for the intrinsic assignment statement. 138
7.9 Numeric conversion and the assignment statement . 141
13.1 Characteristics of the result of NULL ( ) . 341
15.1 Names of C characters with special semantics . 390
15.2 Interoperability between Fortran and C types . 394
xii © ISO/IEC 2004 – All rights reserved

Foreword
ISO (the International Organization for Standardization) and IEC (the International Electrotechnical
Commission) form the specialized system for worldwide standardization. National bodies that are members of
ISO or IEC participate in the development of International Standards through technical committees established
by the respective organization to deal with particular fields of technical activity. ISO and IEC technical
committees collaborate in fields of mutual interest. Other international organizations, governmental and non-
governmental, in liaison with ISO and IEC, also take part in the work. In the field of information technology,
ISO and IEC have established a joint technical committee, ISO/IEC JTC 1.
International Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 2.
The main task of the joint technical committee is to prepare International Standards. Draft International
Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as
an International Standard requires approval by at least 75 % of the national bodies casting a vote.
Attention is drawn to the possibility that some of the elements of this document may be the subject of patent
rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights.
Subcommittee SC 22, Programming languages, their environments and system software interfaces.
This second edition cancels and replaces the first edition (ISO/IEC 1539-1:1997), which has been technically
revised. It also incorporates the Technical Corrigenda ISO/IEC 1539-1:1997/Cor. 1:2001 and
ISO/IEC 1539-1:1997/Cor. 2:2002.
ISO/IEC 1539 consists of the following parts, under the general title Information technology — Programming
languages — Fortran:
 Part 1: Base language
 Part 2: Varying length character strings
 Part 3: Conditional compilation
© ISO/IEC 2004 – All rights reserved xiii

Introduction
International Standard programming language Fortran
This part of the International Standard comprises the specification of the base Fortran language, infor-
mally known as Fortran 2003. With the limitations noted in 1.6.2, the syntax and semantics of Fortran
95 are contained entirely within Fortran 2003. Therefore, any standard-conforming Fortran 95 program
not affected by such limitations is a standard conforming Fortran 2003 program. New features of Fortran
2003 can be compatibly incorporated into such Fortran 95 programs, with any exceptions indicated in
the text of this part of the standard.
Fortran 2003 contains several extensions to Fortran 95; among them are:
(1) Derived-type enhancements: parameterized derived types (allows the kind, length, or shape
of a derived type’s components to be chosen when the derived type is used), mixed compo-
nent accessibility (allows different components to have different accessibility), public entities
of private type, improved structure constructors, and finalizers.
(2) Object oriented programming support: enhanced data abstraction (allows one type to ex-
tend the definition of another type), polymorphism (allows the type of a variable to vary
at runtime), dynamic type allocation, SELECT TYPE construct (allows a choice of execu-
tion flow depending upon the type a polymorphic object currently has), and type-bound
procedures.
(3) The ASSOCIATE construct (allows a complex expression or object to be denoted by a
simple symbol).
(4) Data manipulation enhancements: allocatable components, deferred type parameters, VOL-
ATILE attribute, explicit type specification in array constructors, INTENT specification of
pointer arguments, specified lower bounds of pointer assignment and pointer rank remap-
ping, extended initialization expressions, MAX and MIN intrinsics for character type, and
enhanced complex constants.
(5) Input/output enhancements: asynchronous transfer operations (allows a program to con-
tinue to process data while an input/output transfer occurs), stream access (allows access to
a file without reference to any record structure), user specified transfer operations for derived
types, user specified control of rounding during format conversions, the FLUSH statement,
named constants for preconnected units, regularization of input/output keywords, and ac-
cess to input/output error messages.
(6) Procedure pointers.
(7) Scoping enhancements: the ability to rename defined operators (supports greater data ab-
straction) and control of host association into interface bodies.
(8) Support for IEC 60559 (IEEE 754) exceptions and arithmetic (to the extent a processor’s
arithmetic supports the IEC International Standard).
(9) Interoperability with the C programming language (allows portable access to many libraries
and the low-level facilities provided by C and allows the portable use of Fortran libraries by
programs written in C).
(10) Support for international usage: (ISO 10646) and choice of decimal or comma in numeric
formatted input/output.
(11) Enhanced integration with the host operating system: access to command line arguments,
environment variables, and the processor’s error messages.
xiv © ISO/IEC 2004 – All rights reserved

Organization of this part of ISO/IEC 1539
This part of ISO/IEC 1539 is organized in 16 sections, dealing with 8 conceptual areas. These 8 areas,
and the sections in which they are treated, are:
High/low level concepts Sections 1, 2, 3
Data concepts Sections 4, 5, 6
Computations Sections 7, 13, 14
Execution control Section 8
Input/output Sections 9, 10
Program units Sections 11, 12
Interoperability with C Section 15
Scoping and association rules Section 16
It also contains the following nonnormative material:
Glossary A
Decremental features B
Extended notes C
Syntax rules D
Index E
© ISO/IEC 2004 – All rights reserved xv

INTERNATIONAL STANDARD                 ISO/IEC 1539-1:2004(E)

Information technology — Programming languages —
Fortran —
Part 1:
Base Language
Section 1: Overview
1.1 Scope
ISO/IEC 1539 is a multipart International Standard; the parts are published separately. This publi-
cation, ISO/IEC 1539-1, which is the first part, specifies the form and establishes the interpretation
of programs expressed in the base Fortran language. The purpose of this part of ISO/IEC 1539 is to
promote portability, reliability, maintainability, and efficient execution of Fortran programs for use on
a variety of computing systems. The second part, ISO/IEC 1539-2, defines additional facilities for the
manipulation of character strings of variable length. The third part, ISO/IEC 1539-3, defines a stan-
dard conditional compilation facility for Fortran. A processor conforming to part 1 need not conform to
ISO/IEC 1539-2 or ISO/IEC 1539-3; however, conformance to either assumes conformance to this part.
Throughout this publication, the term “this standard” refers to ISO/IEC 1539-1.
1.2 Processor
The combination of a computing system and the mechanism by which programs are transformed for use
on that computing system is called a processor in this standard.
1.3 Inclusions
This standard specifies
(1) The forms that a program written in the Fortran language may take,
(2) The rules for interpreting the meaning of a program and its data,
(3) The form of the input data to be processed by such a program, and
(4) The form of the output data resulting from the use of such a program.
1.4 Exclusions
This standard does not specify
(1) The mechanism by which programs are transformed for use on computing systems,
(2) The operations required for setup and control of the use of programs on computing systems,
(3) The method of transcription of programs or their input or output data to or from a storage
medium,
(4) The program and processor behavior when this standard fails to establish an interpretation
except for the processor detection and reporting requirements in items (2) through (8)of
1.5,
�c ISO/IEC 2004 – All rights reserved 1

(5) The size or complexity of a program and its data that will exceed the capacity of any
particular computing system or the capability of a particular processor,
(6) The physical properties of the representation of quantities and the method of rounding,
approximating, or computing numeric values on a particular processor,
(7) The physical properties of input/output records, files, and units, or
(8) The physical properties and implementation of storage.
1.5 Conformance
A program (2.2.1)isa standard-conforming program if it uses only those forms and relationships
described herein and if the program has an interpretation according to this standard. A program unit
(2.2) conforms to this standard if it can be included in a program in a manner that allows the program
to be standard conforming.
A processor conforms to this standard if
(1) It executes any standard-conforming program in a manner that fulfills the interpretations
herein, subject to any limits that the processor may impose on the size and complexity of
the program;
(2) It contains the capability to detect and report the use within a submitted program unit of
a form designated herein as obsolescent, insofar as such use can be detected by reference to
the numbered syntax rules and constraints;
(3) It contains the capability to detect and report the use within a submitted program unit of
an additional form or relationship that is not permitted by the numbered syntax rules or
constraints, including the deleted features described in Annex B;
(4) It contains the capability to detect and report the use within a submitted program unit of
an intrinsic type with a kind type parameter value not supported by the processor (4.4);
(5) It contains the capability to detect and report the use within a submitted program unit of
source form or characters not permitted by Section 3;
(6) It contains the capability to detect and report the use within a submitted program of name
usage not consistent with the scope rules for names, labels, operators, and assignment
symbols in Section 16;
(7) It contains the capability to detect and report the use within a submitted program unit of
intrinsic procedures whose names are not defined in Section 13;and
(8) It contains the capability to detect and report the reason for rejecting a submitted program.
However, in a format specification that is not part of a FORMAT statement (10.1.1), a processor need not
detect or report the use of deleted or obsolescent features, or the use of additional forms or relationships.
A standard-conforming processor may allow additional forms and relationships provided that such ad-
ditions do not con
...

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...