Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Fortran
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===FORTRAN 66=== Perhaps the most significant development in the early history of FORTRAN was the decision by the ''American Standards Association'' (now [[American National Standards Institute]] (ANSI)) to form a committee sponsored by the [[Business Equipment Manufacturers Association]] (BEMA) to develop an ''American Standard Fortran''. The resulting two standards, approved in March 1966, defined two languages, ''FORTRAN'' (based on FORTRAN IV, which had served as a de facto standard), and ''Basic FORTRAN'' (based on FORTRAN II, but stripped of its machine-dependent features). The FORTRAN defined by the first standard, officially denoted X3.9-1966, became known as ''FORTRAN 66'' (although many continued to term it FORTRAN IV, the language on which the standard was largely based). FORTRAN 66 effectively became the first industry-standard version of FORTRAN. FORTRAN 66 included: * Main program, {{code|SUBROUTINE}}, {{code|FUNCTION}}, and {{code|BLOCK DATA}} program units * {{code|INTEGER}}, {{code|REAL}}, {{code|DOUBLE PRECISION}}, {{code|COMPLEX}}, and {{code|LOGICAL}} [[data type]]s * {{code|COMMON}}, {{code|DIMENSION}}, and {{code|EQUIVALENCE}} statements * {{code|DATA}} statement for specifying initial values * [[Intrinsic function|Intrinsic]] and {{code|EXTERNAL}} (e.g., library) functions * Assignment statement * {{code|GO TO}}, computed {{code|GO TO}}, assigned {{code|GO TO}}, and {{code|ASSIGN}} statements * Logical {{code|IF}} and arithmetic (three-way) {{code|IF}} statements * {{code|DO}} loop statement * {{code|READ}}, {{code|WRITE}}, {{code|BACKSPACE}}, {{code|REWIND}}, and {{code|ENDFILE}} statements for sequential I/O * {{code|FORMAT}} statement and assigned format * {{code|CALL}}, {{code|RETURN}}, {{code|PAUSE}}, and {{code|STOP}} statements * [[Hollerith constant]]s in {{code|DATA}} and {{code|FORMAT}} statements, and as arguments to procedures * Identifiers of up to six characters in length * Comment lines * {{code|END}} line The above Fortran II version of the Heron program needs several modifications to compile as a Fortran 66 program. Modifications include using the more machine independent versions of the {{code|READ}} and {{code|WRITE}} statements, and removal of the unneeded {{code|FLOATF}} type conversion functions. Though not required, the arithmetic {{code|IF}} statements can be re-written to use logical {{code|IF}} statements and expressions in a more structured fashion. <syntaxhighlight lang="fortranfixed"> C AREA OF A TRIANGLE WITH A STANDARD SQUARE ROOT FUNCTION C INPUT - TAPE READER UNIT 5, INTEGER INPUT C OUTPUT - LINE PRINTER UNIT 6, REAL OUTPUT C INPUT ERROR DISPLAY ERROR OUTPUT CODE 1 IN JOB CONTROL LISTING READ (5, 501) IA, IB, IC 501 FORMAT (3I5) C C IA, IB, AND IC MAY NOT BE NEGATIVE OR ZERO C FURTHERMORE, THE SUM OF TWO SIDES OF A TRIANGLE C MUST BE GREATER THAN THE THIRD SIDE, SO WE CHECK FOR THAT, TOO IF (IA .GT. 0 .AND. IB .GT. 0 .AND. IC .GT. 0) GOTO 10 WRITE (6, 602) 602 FORMAT (42H IA, IB, AND IC MUST BE GREATER THAN ZERO.) STOP 1 10 CONTINUE C IF (IA+IB-IC .GT. 0 + .AND. IA+IC-IB .GT. 0 + .AND. IB+IC-IA .GT. 0) GOTO 20 WRITE (6, 603) 603 FORMAT (50H SUM OF TWO SIDES MUST BE GREATER THAN THIRD SIDE.) STOP 1 20 CONTINUE C C USING HERON'S FORMULA WE CALCULATE THE C AREA OF THE TRIANGLE S = (IA + IB + IC) / 2.0 AREA = SQRT ( S * (S - IA) * (S - IB) * (S - IC)) WRITE (6, 601) IA, IB, IC, AREA 601 FORMAT (4H A= ,I5,5H B= ,I5,5H C= ,I5,8H AREA= ,F10.2, + 13H SQUARE UNITS) STOP END </syntaxhighlight>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Fortran
(section)
Add topic