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 77=== [[File:Ftn-elim-1240x1709.jpg|thumb|upright|FORTRAN-77 program with compiler output, written on a [[Control Data Corporation|CDC]] [[CDC Cyber|175]] at [[RWTH Aachen University]], Germany, in 1987]] [[File:4.3 BSD UWisc VAX Emulation f77 Manual.png|thumb|[[4.3BSD|4.3 BSD]] for the [[Digital Equipment Corporation]] (DEC) [[VAX]], displaying the [[man page|manual]] for FORTRAN 77 (f77) compiler]] After the release of the FORTRAN 66 standard, compiler vendors introduced several extensions to ''Standard Fortran'', prompting ANSI committee X3J3 in 1969 to begin work on revising the 1966 standard, under sponsorship of [[CBEMA]], the Computer Business Equipment Manufacturers Association (formerly BEMA). Final drafts of this revised standard circulated in 1977, leading to formal approval of the new FORTRAN standard in April 1978. The new standard, called ''FORTRAN 77'' and officially denoted X3.9-1978, added a number of significant features to address many of the shortcomings of FORTRAN 66: * Block {{code|IF}} and {{code|END IF}} statements, with optional {{code|ELSE IF}} and {{code|ELSE}} clauses, to provide improved language support for [[structured programming]] * {{code|DO}} loop extensions, including parameter expressions, negative increments, and zero trip counts * {{code|OPEN}}, {{code|CLOSE}}, and {{code|INQUIRE}} statements for improved I/O capability * Direct-access file I/O * {{code|CHARACTER}} data type, replacing Hollerith strings with vastly expanded facilities for character input and output and processing of character-based data * {{code|PARAMETER}} statement for specifying constants * {{code|SAVE}} statement for persistent local variables * Generic names for intrinsic functions (e.g. {{code|SQRT}} also accepts arguments of other types, such as {{code|COMPLEX}} or {{code|REAL*16}}). * A set of intrinsics ({{code|LGE}}, {{code|LGT}}, {{code|LLE}}, {{code|LLT}}) for ''lexical'' comparison of strings, based upon the [[ASCII]] [[collating sequence]]. (These ASCII functions were demanded by the [[United States Department of Defense|U.S. Department of Defense]], in their conditional approval vote.{{Citation needed|date=October 2011}}) * A maximum of seven dimensions in arrays, rather than three. Allowed subscript expressions were also generalized. In this revision of the standard, a number of features were removed or altered in a manner that might invalidate formerly standard-conforming programs. (Removal was the only allowable alternative to X3J3 at that time, since the concept of "[[deprecation]]" was not yet available for ANSI standards.) While most of the 24 items in the conflict list (see Appendix A2 of X3.9-1978) addressed loopholes or pathological cases permitted by the prior standard but rarely used, a small number of specific capabilities were deliberately removed, such as: * [[Hollerith constant]]s and [[Herman Hollerith|Hollerith]] data, such as <syntaxhighlight lang="fortran" inline> GREET = 12HHELLO THERE!</syntaxhighlight> * Reading into an H edit (Hollerith field) descriptor in a FORMAT specification * Overindexing of array bounds by subscripts <syntaxhighlight lang="fortranfixed"> DIMENSION A(10,5) Y = A(11,1) </syntaxhighlight> * Transfer of control out of and back into the range of a DO loop (also known as "Extended Range") A Fortran 77 version of the Heron program requires no modifications to the Fortran 66 version. However this example demonstrates additional cleanup of the I/O statements, including using list-directed I/O, and replacing the Hollerith edit descriptors in the {{code|FORMAT}} statements with quoted strings. It also uses structured {{code|IF}} and {{code|END IF}} statements, rather than {{code|GOTO}}/{{code|CONTINUE}}. <syntaxhighlight lang="fortranfixed"> PROGRAM HERON C AREA OF A TRIANGLE WITH A STANDARD SQUARE ROOT FUNCTION C INPUT - DEFAULT STANDARD INPUT UNIT, INTEGER INPUT C OUTPUT - DEFAULT STANDARD OUTPUT UNIT, REAL OUTPUT C INPUT ERROR DISPLAY ERROR OUTPUT CODE 1 IN JOB CONTROL LISTING READ (*, *) IA, IB, IC 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 .LE. 0 .OR. IB .LE. 0 .OR. IC .LE. 0) THEN WRITE (*, *) 'IA, IB, and IC must be greater than zero.' STOP 1 END IF C IF (IA+IB-IC .LE. 0 + .OR. IA+IC-IB .LE. 0 + .OR. IB+IC-IA .LE. 0) THEN WRITE (*, *) 'Sum of two sides must be greater than third side.' STOP 1 END IF 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 (*, 601) IA, IB, IC, AREA 601 FORMAT ('A= ', I5, ' B= ', I5, ' C= ', I5, ' AREA= ', F10.2, + ' 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