REVIEW AND COMMENT ON BSR - K3.9 DRAFT PROPOSED ANS FORTRAN
Document Type:
Collection:
Document Number (FOIA) /ESDN (CREST):
CIA-RDP83T00573R000600200023-2
Release Decision:
RIFPUB
Original Classification:
K
Document Page Count:
8
Document Creation Date:
December 12, 2016
Document Release Date:
April 24, 2002
Sequence Number:
23
Case Number:
Publication Date:
August 30, 1976
Content Type:
MF
File:
Attachment | Size |
---|---|
![]() | 365.14 KB |
Body:
Approved For Ri ease
1976 August 30
Un VIN1399MM IFIB0=11I 012 OF COMMERCE
National Bureau of Standards
Washington, D.C. 20234
MEMORANDUM FOR FIPS Points of Contact
FIPSCAC
From: Harry S. White, Jr
Associate Director for ADP Stad~dards
Subject: Review and Comment on BSR - X3.9 Draft Proposed ANS FORTRAN
My memorandum of 1976 July 30 provided for your review and comment
the draft proposed American National Standard FORTRAN (BSR - X3.9).
I have just received the attached press release from ANSI concerning
the review process on the draft proposal and recent changes made by
the responsible technical standards committee (X3J3).
This additional material is for your information and use in preparing
appropriate comments to the X3J3 Committee Secretary, Mr. Lloyd Campbell,
BRL-CSD, Building 328, Aberdeen Proving Ground, Maryland 21005.
7-93
N BAS Approved For Release 2002/05/17: CIA-RDP83T00573R000600200023-2
1901-1976
v m
7??6.1916
Approved For F Lease 2002/05/17: CIA-RDP83T00573000600200023-2
Tfl
COMMITTEE CORRESPONDENCE
amerian national standards committees: Doc. No.: X3/76-70
X3-Computers & Information Processing
Xd-Office Machines & Supplies
operating under the procedures of the American National Standards Institute
secretariat: CBEMA, 1828 L St NW (suite 1200), Washington DC 20036 202/46S-2299
PRESS RELEASE
Data : 76-07-30
Project : 76
Milestone : 15
(GA
RY to: X3J3 Secretary
"FORTRAN Standards Committee Adopts IF-THEN-ELSE"
The FORTRAN Standards Committee met in Idaho Falls, Idaho during July 12-15
to begin reviewing public comments received on the draft proposed revised FORTRAN
standard. The committee, also known as X3J3, is a technical committee of the
American National Standards Institute (ANSI).
At the meeting, X3J3 approved the addition of four new statements that
together provide the capability to conditionally execute groups of statements.
They are called block IF, ELSE IF, ELSE and END IF statements. The need for
this capability was strongly presented in many of the public comments. It was
also a lively topic of discussion at two public presentations on the draft
standard that took place in Los Angeles in February and Washington, D.C. in
.March.
X3J3 published its draft proposal in the March issue of SIGPLAN Notices, a
publication of the Special Interest Group on Programming Languages of the
Association for Computing Machinery. More than eight thousand copies have been
distributed to interested individuals, and technical, business and governmental
organizations around the world.
The widespread interest in the proposal for a revised FORTRAN standard is
indicated by the substantial volume of comments received. As of the beginning
of the meeting, 200 letters had been received totaling 810 pages. The over-
whelming majority of comments are favorable and contain many constructive
suggestions. According to ANSI procedures, each suggestion will be evaluated to
determine whether a change should be made to the draft standard. Following
completion of the X3J3 review process, each public review letter will be answered
indicating the action taken.
X3J3 will continue its review of public comments at its next meeting in
September. The public review and comment period closes September 28, 1976.
Approved For Release 2002/05/17: CIA-RDPS3FPU2SK666t3-2by
X3J3 on 15 July 1976)
Approved For Release 2002/05/17 : CIA-RDP83T00573R000600200023-2
Bel Laboratories
??a-t F, I RTRAN Standai-Llo Conunt.t! 1,fvt t-:5 au? it, ly 22, 19'16
IF-THEN-ELSE
IF-THEN-ELSE was adopted at the July meeting of X3J3. The
attached press release and IF-THEN-ELSE text is being sent
to you as information relating to the processing of dpANS
FORTRAN.
Press Release
Attached is a press release announcing the adoption of
IF-THEN-ELSE by X3J3. IF-THEN-ELSE was adopted for the
FORTRAN full language and the subset language.
IF-THEN-ELSE Text
The principal change to the dpANS FORTRAN is to Section 11,
CONTROL STATEMENTS. Section 11 of Document X3J3/76.3
FORTRAN Full Language is attached. The text of the subset
is not attached since the IF-THEN-ELSE subset text is
identical to that of the full language.
Document X3J3/76 remains the basis document for dpANS FORTRAN.
Document X3J3/76.3 is a working document of X3J3 and is
subject to further changes.
Comments on dpANS FORTRAN or the new IF-THEN-ELSE text may
be sent to:
Lloyd W. Campbell
X3J3 Secretary
BRL-CSD Bldg. 328
Aberdeen Proving Ground
MD 21005 USA
J. C. Noll
Att.
Press Release
X3J3/76.3 Section 11,
CONTROL STATEMENTS
There are sixteen control statements:
(1) Unconditional GO TO
(2) Computed GO TO 10
(3) Assigned GO TO 12
(4) Arithmetic IF 14
(5) Logical IF 16
(6) Block IF 18
(7) ELSE IF 20 I
(8) ELSE 22 I
(9) END IF 24 I
(10) DO 26 I
(11) CONTINUE 28 I
(12) STOP 30 I
(13) PAUSE 32
(14) END 34
(15) CALL 36 I
(16) RETURN 38 I
CALL and RETURN statements are described in Section 15. 40
11.1 Unconditional GO TO Statement 43
The form of an unconditional GO TO statement is: 45
GO TO 1 47
where i is the statement label of an executable statement 49
that appears in the some program unit as the unconditional 50
GO TO statement. 51
Execution of an unconditional GO TO statement causes a 53
transfer of control so that the statement identified by the 54
statement label is executed next. 55
Approved For Release 2002/05/17 : CIA-RDP83T00573R000600200023-2
Approved For Release 2002/05/17 : CIA-RDP83T00573R000600200023-2
11.2 Computed GO TO Statement 61
The form of a computed GO TO statement is: 63
GO. TO (g I.I)... ) [,] &
where: ]L is an integer, real, or double precision 67
expression 1 68
1 is the statement label of an executable statement 70
that appears in the some program unit as the 71
computed GO TO statement. The same statement 72
.o a, ma-/ appear co a than unca 11, Zhu 7eme 73
computed GO TO statement.` 74
Execution of a computed GO TO statement causes evaluation of 76
the expression INT(g). Let the value of INT(g) be i. The 77
evaluation of INT(g) is followed by a transfer of control so 78
that the statement identified by the ith statement label in 79
the list of statement labels is executed next, provided that 80
1 S i i a, where n is the number of statement labels in the 81
list of statement labels. If jr, the execution 82
sequence continues as. though a CONTINUE statement were 83
executed. 84
11.3 Assigned GO TO Statement 87
The form of an assigned GO TO statement is: 89
GO TO i [[,] ( ;i [,I]... )] 91
where: i is an integer variable name 93
]z is the statement label of an executable statement 95
that appears in the same program unit as the 96
assigned GO TO statement. The some statement 97
label may appear more than once in the same 98
assigned GO TO statement. 99
At the time of execution of an assigned GO TO statement, the 101
current value of i must have been assigned by the prior 102
execution of an ASSIGN statement (10.3) to the statement 103
label of an executable statement. The execution of the 104
assigned GO TO statement causes a transfer of control so 105
that the statement identified by that statement label is 106
executed next. The lost definition of the variable in an 107
assigned GO TO statement must have occurred in the some 108
program unit as the assigned GO TO statement. 109
If the parenthesized list is present, the statement label 111
assigned to i must be one (if the statement labels in the 112
list. 113
11.4 Arithmetic IF Statement 121
The form of an arithmetic IF statement is: 123
IF ( j)1, , i. ,Ss 1Z5
where: I is an integer, real, or double precision 127
expression 128
.L,, ga, and j are each the statement label of an 130
executable statement that appears in the some 131
the - ?h.w IC statement. The 157
some statement ~ label may appear more then once in 133
the same arithmetic IF statement. 134
Execution of an arithmetic IF statement causes evaluation of 136
the expression g followed by a transfer of control. The 137
statement identified by 5.? 12, or .17 is executed next as 138
the value of g is less than zero, equal to zero, or greater 139
than zero, respectively. 140
11.5 Logical IF Statement 143
The form of a logical IF statement is: 145
IF (I)3.I 147
where: ;, is a logical expression 149
]u is any executable statement except a DO, 151
block IF, ELSE IF, ELSE, END IF, END, or another 152
logical IF statement. 153
Execution of a logical IF statement causes evaluation of the 155
expression A. If the value of t is true, statement 3S is 156
executed. If the value of A is false, statement j, is not 157
executed and the execution sequence continues as though a 158
CONTINUE statement were executed. 159
Note that the execution of a function reference in the 161
expression II of a logical IF statement is permitted to 162
effect entities in the statement j. 163
11.6 Block IF Statement 166
The block IF statement is used with the END IF statement 168
and, optionally, the ELSE IF and ELSE statements to control 169
the execution sequence. 170
The form of a block IF statement is: 172
IF (g) THEN 174
where g is a logical expression. 176
Approved For Release 2002/05/17 : CIA-RDP83T00573R000600200023-2
Approved For Release 2002/05/17 : CIA-RDP83T00573R000600200023-2
11.6.1 IF-level 181 I
The IF-level of a stateme"t I is 183
P, - nx 185 j
where n, is the number of block IF statements from the 187
beginning of the program unit up to and including g, and n= 188
is the number o4 END IF statements in the program unit up to 189
but not including g. 190
The IF-level of every statement must be zero or positive. 192
The IF-level of each block IF, ELSE IF, ELSE, and END IF 193
statement must be positive. The IF-level of the END 194
statement of each program unit must be zero. 195
11.6.2 IF-Block 197
An IF-block consists of all of the executable statements 199
after the block IF statement up to, but not including, the 200
next ELSE IF, ELSE, or END IF statement that has the same 201
IF-level as the block IF statement. An IF-block may be 202
empty. 203
11.6.3 Execution of a Block IF Statement 205
Execution of a block IF statement causes evaluation of the 207
expression g. If the value of g is true, normal execution 208
sequence continues with the first statement of the IF-block. 209
If the IF-block is empty, control is transferred to the next 210
END IF statement that has the same IF-level as the block IF 211
statement. If the value of g is false, control is 212
transferred to the next ELSE IF, ELSE, or END IF statement 213
that has the same IF-level as the block IF statement. 214
Transfer into an IF-block is permitted. 216
If the execution of the last statement in the IF-block does 218
not result in a transfer of control, control is transferred 219
to the next END IF statement that has the same IF-level as 220
the block IF statement that precedes the IF-block. 221
11.7 ELSE IF Statement 224 I
The form of an ELSE IF statement is: 226
I
ELSE IF (1) THEN 228 I
where g is a logical expression. 230 I
11.7.1 ELSE IF-Block 232
An ELSE IF-block consists of all of the executable 234
statements after the ELSE IF statement up to, but not 235
including, the next ELSE IF, ELSE, or END IF statement that 236
has the some IF-level as the ELSE IF statement. An ELSE IF- 241
block may be empty. 242
11.7.2 Execution of an ELSE IF Statement 244 I
Execution of an ELSE IF statement causes evaluation of the 246
expression g. If the value of g is true, normal execution 247
sequence continues with the first statement of the ELSE IF- 248
block. If the ELSE IF-block is empty, control is 249
transferred to the next END IF statement that has the some 250
IF-level as the ELSE IF statement. If the value of g is 251
false, control is transferred to the next ELSE IF, ELSE, or 252
END IF statement that has the same IF-level as the ELSE IF 253
statement. 254
Transfer into an ELSE IF-block is permitted. 256
If execution of the last statement in the ELSE IF-block does 258
not result in a transfer of control, control is transferred 259
to the next END IF statement that has the same IF-level as 260
the ELSE IF statement that precedes the ELSE IF-block. 261
11.8 ELSE Statement 264
The form of an ELSE statement is: 266
ELSE 268
11.8.1 ELSE-Block 270
An ELSE-block consists of all of the executable statements 272
after the ELSE statement up to, but not including, the next 273
END IF statement that has the same IF-level as the ELSE 274
statement. An ELSE-block may be empty. 275
An END IF statement of the some IF-level as the ELSE 277
statement must appear before the appearance of an ELSE IF or 278
ELSE statement of the some IF-level. 279
11.8.2 Execution of an ELSE Statement 281 I
Execution of an ELSE statement has no effect. Normal 283
execution sequence continues. 284
Transfer into an ELSE-block is permitted. 286 I
11.9 END IF Statement 289 I
The form of en END IF statement is: 291 I
END IF 293 I
Execution of an END IF statement has no effect. Normal 295
execution sequence continues. Z96
Approved For Release 2002/05/17 : CIA-RDP83T00573R000600200023-2
Approved For Release 2002/05/17 : CIA-RDP83T00573R000600200023-2
For each block IF statement, there must be a corresponding 301
END IF statement in the some program unit. A corresponding 302
E,LF statement is the next. END IF statement that has the 303
some IF-level as the block IF statement. 304
11.10 DO Statement 307
A DO statement is used to specify a loop, called a DO-loon 309
The form of a DO statement ist 311
DO 3. [,] i =&,, ?, [,g,] 313
where: s is the ermreemn.t Icbe! of en executable 3i5
t
T
s
atement.
he statement identified by 3,, celled 316
the terminal statement of the DO-loop, must 317
physically follow and appear in the some program 318
unit as the DO statement. 319
is the name of an integer, real, or double 321
Precision variable, called the D0-variable 322
&a. and g, are each an integer, real, or double 324
precision expression. 325
The terminal statement of a DO-loop must not be an 327
unconditional GO TO, assigned GO TO. arithmetic IF, 328
block IF, ELSE IF, ELSE, END IF, RETURN, STOP, END, or DO 329
statement. If the terminal statement of a DO-loop is a 330
logical IF, it may contain any executable statement except a 331
DO, block IF, ELSE IF, ELSE, END IF, END, or another logical 332 I
IF statement. 333
11.10.1 Range of a DO-Loop 335
The range Qf g DO-loop consists of the executable statements 337
from and including the first executable statement following 338
the DO statement that specifies the DO-loop, to and 339
including the terminal statement of the DO-loop. 340
If a DO statement appears within the range of a DO-loop, the 342
range of the DO-loop specified by that DO statement must be 343
within the range of the outer DO-loop. More than one DO- 344
loop may have the same terminal statement. 345
If a DO statement appears within an IF-block, ELSE IF-block, 347
or ELSE-block, the range of that DO-loop must be contained 348
entirely within that !F-block, ELSE IF-block, or ELSE-block, 349
respectively. 350
If a block IF statement appears within the range of a D0- 352
loop, the corresponding END IF statement must also appear 353
within the range of that DO-loop. 354
A DO-loop Is either active or inactive. Initially inactive, 363
a DO-loop becomes active only when its DO statement is 364
executed. 365
Once active, the DO-loop becomes inactive only when: 367
(1) its iteration count is zero, 369
(2) its DO-variable becomes undefined or is redefined by 371
means other than the incrementation described in 372
373 I
(3) a RETURN, STOP, or END statement is executed in its 375
(5) it is in the range of another DO-loop whose DO 381
statement is executed. 382
Note that transfer of control out of the range of a DO-loop 384
does not inactivate the DO-loop. However, the DO-loop 385
becomes inactive if the DO-variable becomes undefined or is 386
redefined outside the range. 387
When a DO-loop becomes inactive, the DO-variable of the DO- 389
loop retains its last defined value unless it has become 390
undefined. 391
11.10.3 Executing a DO Statement 393
The effect of executing a DO statement is to perform the 395
following steps in sequence: 396
(1) The initial parameter _q? the terminal parameter tq:, 398
and the incrementation parameter j, are established 399
by evaluating i. g? and g,, respectively, 400
including, if necessary, conversion to the type of 401
the DO-variable according to the rules for arithmetic 402
conversion (Table 4). If All does not appear, ffl, has 403
a value of one. jt, must not have a value of zero. 404
(2) The DO-variable becomes defined with the value of the 406
initial parameter it,. 407
(3) The iteration count is established and is the value
of the expression
MAX( INT( (,g, - T, r P0/13), 0)
Note that the iteration count is zero whenever:
409
410
412
414
Approved For Release 2002/05/17 : CIA-RDP83T00573R000600200023-2
Approved For Release 2002/05/17 : CIA-RDP83T00573R000600200023-2
_,, > T~ and m, > 0, or 421
.q, < Ig, and IC] < 0. 423
At the completion of execution of the DO statement, loop 425
control processing begins. 426
11.10.4 Loop Control Processing 428 I
Loop control processing determines if further execution of 430
the range of the DO-loop is required. The iteration count is 431
tested. If it is not zero, execution of the first statement 432
in the range of the DO-loop begins. If the iteration count 433
is zero, the DO-loop becomes inactive. If, as a result, all 434
of the DO-loops sharing the terminal statement of this DO- 435
loop are inactive, normal execution continues with execution 436
of the next executable statement following the terminal 437
statement. However, if some of the DO-loops sharing the 438
terminal statement are active, execution continues with 439
incrementation processing, as described below. 440
11.10.5 Execution of the Range 442 I
Statements in the range of a DO-loop are executed until the 444
terminal statement is reached. Except by the incrementation 445
described in 11.10.7, the DO-variable of the DO-loop may 446 I
neither be redefined nor become undefined during execution 447
of the range of the DO-loop. 448
11.10.6 Terminal Statement Execution 450
Execution of the terminal statement occurs as a result of 452
the normal execution sequence or as a result of transfer of 453
control, subject to the restrictions in 11.10.8. Unless 454
execution of the terminal statement results in a transfer of 455
control, execution then continues with incrementation 456
processing, as described below. 457
11.10.7 Incrementation Processing 459
N=0
DO 100 1=1,10
J=1
DO 100 K=1,5
L=K
100 N=N+1
101 CONTINUE
481
483
484
485
486
487
488
489
Incrementation processing has the effect of the following 461
steps performed in sequence: 462
Cl) The DO-variable, and the incrementation parameter of 464
the active DO-loop whose DO statement was most 465
recently executed, are selected for processing. 466
(2) The value of the DO-variable is incremented by the 468
value of the incrementation parameter gs. 469
(3) The iteration count is decremented by one. 471
(4) Execution conrinues with 'oop control processing 473
(11.10 4 of the same DO-loop whose iteration count 474
was decremented. 475
After execution of the above statements and at the execution 491
of the CONTINUE statement, I=11, J=10, K=6, L=5, and N=50. 492
N=0
DO 200 1=1,10
J=I
00 200 K=5,1
L=K
200 N=N+1
201 CONTINUE
496
497
498
499
500
501
502
After execution of the above statements and at the execution 504
of the CONTINUE statement, 1=11. J=10, K=5, and N=O. L is 505
not defined by the above statements. 506
11.10.8 Transfer into the Range of a DO-Loot) 508
Transfer of control into the range of an inactive DO-loop is 510
not permitted. Transfer of control to any executable 511
statement in the range of an active DO-loop is permitted 512
unless the statement is also in the range of an inactive DO- 513
loop. 514
11.11 CONTINUE Statement 517
The form of a CONTINUE statement is: 519
CONTINUE 521
Execution of a CONTINUE statement has no effect. 523
If the CONTINUE statement is not the terminal statement of a 525
DO-loop, normal execution sequence continues. If the 526
CONTINUE statement is the terminal statement of a DO-loop, 5Z7
the next statement executed depends on the result of the DO- 528
loop incrementation processing (11.10.7). 529
11.12 STOP Statement 532
The form of a STOP statement is: 534
STOP Irk] 536
Approved For Release 2002/05/17 : CIA-RDP83T00573R000600200023-2
Approved For Release 2002/05/17 : CIA-RDP83T00573R000600200023-2
where q is a string of not more then five digits, or is a 541
character constant. 542
Execution of a STOP statement. causes termination of 544
execution of the executable program. At the time of 545
termination, the digit string or character constant is 546
accessible. 547
11.13 PAUSE Statement 550
The form of a PAUSE statement is: 552
PAUSE (q] 554
where q is a string of not more then five digits, or is a 556
character constant. 557
Execution of a PAUSE statement causes a cessation of 559
execution of the executable program. Execution must be 560
resumable. At the time of cessation of execution, the digit 561
string or character constant is accessible. Resumption of 562
execution is not under control of the program. If execution 563
is resumed, the normal execution sequence is continued. 564
11.14 END Statement 567
The END statement indicates the end of the sequence of 569
statements and comment lines of a program unit (3.5).. If 570
executed in a subprogram, it has the effect of a RETURN 571
statement (15.8). If executed in a main program, it 572
terminates the execution of the executable program. 573
The form of an END statement is: 575
END 577
An END statement is written only in columns 7 through 72 of 579
an initial line. An END statement must not be continued. 580
No other statement in a program unit may have an initial' 581
line that appears to be an END statement. 582
The last line of every program unit must be an END 584
statement. 585
Approved For Release 2002/05/17 : CIA-RDP83T00573R000600200023-2