0% found this document useful (0 votes)
193 views5 pages

Fortan

Fortran is a general-purpose programming language especially suited for numeric computation and scientific computing. Originally developed in the 1950s, it has been used for over six decades for applications like weather prediction, engineering, and high-performance computing. Fortran has evolved over many versions to support new programming paradigms while retaining compatibility.

Uploaded by

shohobi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
193 views5 pages

Fortan

Fortran is a general-purpose programming language especially suited for numeric computation and scientific computing. Originally developed in the 1950s, it has been used for over six decades for applications like weather prediction, engineering, and high-performance computing. Fortran has evolved over many versions to support new programming paradigms while retaining compatibility.

Uploaded by

shohobi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Fortran (/ˈfɔːrtræn/; formerly FORTRAN, derived from Formula Translation[2]) is a general-

purpose, compiled imperative programming language that is especially suited to numeric


computation and scientific computing.
Originally developed by IBM[3] in the 1950s for scientific and engineering applications,
FORTRAN came to subsequently dominate scientific computing. It has been in use for over
six decades in computationally intensive areas such as numerical weather prediction, finite
element analysis, computational fluid dynamics, geophysics, computational
physics, crystallography and computational chemistry. It is a popular language for high-
performance computing[4] and is used for programs that benchmark and rank the
world's fastest supercomputers.[5][6]
Fortran encompasses a lineage of versions, each of which evolved to add extensions to the
language while usually retaining compatibility with prior versions. Successive versions have
added support for structured programming and processing of character-based data
(FORTRAN 77), array programming, modular programming and generic
programming (Fortran 90), high performance Fortran (Fortran 95), object-oriented
programming (Fortran 2003), concurrent programming (Fortran 2008), and native parallel
computing capabilities (Coarray Fortran 2008/2018).
Fortran's design was the basis for many other programming languages. Amongst the better-
known is BASIC, which is based on FORTRAN II with a number of syntax cleanups, notably
better logical structures,[7] and other changes to work more easily in an interactive
environment.[8]

Contents

 1Naming
 2History
o 2.1FORTRAN
 2.1.1Fixed layout and punched cards
o 2.2FORTRAN II
 2.2.1Simple FORTRAN II program
o 2.3FORTRAN III
o 2.4IBM 1401 FORTRAN
o 2.5FORTRAN IV
o 2.6FORTRAN 66
o 2.7FORTRAN 77
 2.7.1Variants: Minnesota FORTRAN
o 2.8Transition to ANSI Standard Fortran
o 2.9Fortran 90
 2.9.1Obsolescence and deletions
 2.9.2"Hello, World!" example
o 2.10Fortran 95
 2.10.1Conditional compilation and varying length strings
o 2.11Fortran 2003
o 2.12Fortran 2008
o 2.13Fortran 2018
 3Science and engineering
 4Language features
 5Portability
 6Variants
o 6.1Fortran 5
o 6.2FORTRAN V
o 6.3Fortran 6
o 6.4Specific variants
 6.4.1FOR TRANSIT for the IBM 650
o 6.5Fortran-based languages
 7Code examples
 8Humor
 9See also
 10References
 11Further reading
 12External links

Naming[edit]
The names of earlier versions of the language through FORTRAN 77 were conventionally
spelled in all-capitals (FORTRAN 77 was the last version in which the use of lowercase
letters in keywords was strictly non-standard).[citation needed] The capitalization has been dropped in
referring to newer versions beginning with Fortran 90. The official language standards now
refer to the language as "Fortran" rather than all-caps "FORTRAN".

History[edit]

An IBM 704 mainframe computer

In late 1953, John W. Backus submitted a proposal to his superiors at IBM to develop a more


practical alternative to assembly language for programming their IBM 704 mainframe
computer.[9]:69 Backus' historic FORTRAN team consisted of programmers Richard Goldberg,
Sheldon F. Best, Harlan Herrick, Peter Sheridan, Roy Nutt, Robert Nelson, Irving Ziller,
Harold Stern, Lois Haibt, and David Sayre.[10] Its concepts included easier entry of equations
into a computer, an idea developed by J. Halcombe Laning and demonstrated in the Laning
and Zierler system of 1952.[11] Some of these programmers were chess players and were
chosen to work at IBM with the thought being that they had logical minds.[12]
A draft specification for The IBM Mathematical Formula Translating System was completed
by November 1954.[9]:71 The first manual for FORTRAN appeared in October 1956,[9]:72 with the
first FORTRAN compiler delivered in April 1957.[9]:75 This was the first optimizing compiler,
because customers were reluctant to use a high-level programming language unless its
compiler could generate code with performance approaching that of hand-coded assembly
language.[13]
While the community was skeptical that this new method could possibly outperform hand-
coding, it reduced the number of programming statements necessary to operate a machine
by a factor of 20, and quickly gained acceptance. John Backus said during a 1979 interview
with Think, the IBM employee magazine, "Much of my work has come from being lazy. I
didn't like writing programs, and so, when I was working on the IBM 701, writing programs for
computing missile trajectories, I started work on a programming system to make it easier to
write programs."[14]
The language was widely adopted by scientists for writing numerically intensive programs,
which encouraged compiler writers to produce compilers that could generate faster and more
efficient code. The inclusion of a complex number data type in the language made Fortran
especially suited to technical applications such as electrical engineering.[citation needed]
By 1960, versions of FORTRAN were available for the IBM 709, 650, 1620,
and 7090 computers. Significantly, the increasing popularity of FORTRAN spurred
competing computer manufacturers to provide FORTRAN compilers for their machines, so
that by 1963 over 40 FORTRAN compilers existed. For these reasons, FORTRAN is
considered to be the first widely used cross-platform programming language.
The development of Fortran paralleled the early evolution of compiler technology, and many
advances in the theory and design of compilers were specifically motivated by the need to
generate efficient code for Fortran programs.
The most comprehensive account of Fortran history in a single document is given by
Lorenzo in the book listed below.

FORTRAN[edit]
The initial release of FORTRAN for the IBM 704 contained 32 statements, including:

 DIMENSION  and  EQUIVALENCE  statements


 Assignment statements
 Three-way  arithmetic IF  statement, which passed control to one of three locations in
the program depending on whether the result of the arithmetic statement was negative,
zero, or positive
 IF  statements for checking exceptions ( ACCUMULATOR OVERFLOW ,  QUOTIENT
OVERFLOW , and  DIVIDE CHECK ); and  IF  statements for manipulating sense switches
and sense lights
 GO TO , computed  GO TO ,  ASSIGN , and assigned  GO TO
 DO  loops
 Formatted I/O:  FORMAT ,  READ ,  READ INPUT TAPE ,  WRITE ,  WRITE OUTPUT
TAPE ,  PRINT , and  PUNCH
 Unformatted I/O:  READ TAPE ,  READ DRUM ,  WRITE TAPE , and  WRITE DRUM
 Other I/O:  END FILE ,  REWIND , and  BACKSPACE
 PAUSE ,  STOP , and  CONTINUE
 FREQUENCY  statement (for providing optimization hints to the compiler).
The arithmetic  IF  statement was reminiscent of (but not readily implementable by) a three-
way comparison instruction (CAS—Compare Accumulator with Storage) available on the
704. The statement provided the only way to compare numbers—by testing their difference,
with an attendant risk of overflow. This deficiency was later overcome by "logical" facilities
introduced in FORTRAN IV.
The  FREQUENCY  statement was used originally (and optionally) to give branch probabilities
for the three branch cases of the arithmetic IF statement. The first FORTRAN compiler used
this weighting to perform at compile time a Monte Carlo simulation of the generated code,
the results of which were used to optimize the placement of basic blocks in memory—a very
sophisticated optimization for its time. The Monte Carlo technique is documented in Backus
et al.'s paper on this original implementation, The FORTRAN Automatic Coding System:
The fundamental unit of program is the basic block; a basic block is a stretch of program
which has one entry point and one exit point. The purpose of section 4 is to prepare for
section 5 a table of predecessors (PRED table) which enumerates the basic blocks and lists
for every basic block each of the basic blocks which can be its immediate predecessor in
flow, together with the absolute frequency of each such basic block link. This table is
obtained by running the program once in Monte-Carlo fashion, in which the outcome of
conditional transfers arising out of IF-type statements and computed GO TO's is determined
by a random number generator suitably weighted according to whatever FREQUENCY
statements have been provided.[10]
Many years later, the  FREQUENCY  statement had no effect on the code, and was treated as
a comment statement, since the compilers no longer did this kind of compile-time simulation.
A similar fate has befallen compiler hints in several other programming languages, e.g.
the  register  keyword in C.[citation needed]
The first FORTRAN compiler reported diagnostic information by halting the program when an
error was found and outputting an error code on its console. That code could be looked up
by the programmer in an error messages table in the operator's manual, providing them with
a brief description of the problem.[15][16] Later, an error-handling subroutine to handle user
errors such as division by zero, developed by NASA,[17] was incorporated, informing users of
which line of code contained the error.
Fixed layout and punched cards[edit]

FORTRAN code on a punched card, showing the specialized uses of columns 1–5, 6 and 73–80

Further information: Computer programming in the punched card era


Before the development of disk files, text editors and terminals, programs were most often
entered on a keypunch keyboard onto 80-column punched cards, one line to a card. The
resulting deck of cards would be fed into a card reader to be compiled. Punched card codes
included no lower-case letters or many special characters, and special versions of the IBM
026 keypunch were offered that would correctly print the re-purposed special characters
used in FORTRAN.
Reflecting punched card input practice, Fortran programs were originally written in a fixed-
column format, with the first 72 columns read into twelve 36-bit words.
A letter "C" in column 1 caused the entire card to be treated as a comment and ignored by
the compiler. Otherwise, the columns of the card were divided into four fields:

 1 to 5 were the label field: a sequence of digits here was taken as a label for use in
DO or control statements such as GO TO and IF, or to identify a FORMAT statement
referred to in a WRITE or READ statement. Leading zeros are ignored and 0 is not a
valid label number.
 6 was a continuation field: a character other than a blank or a zero here caused the
card to be taken as a continuation of the statement on the prior card. The continuation
cards were usually numbered 1, 2, etc. and the starting card might therefore have zero in
its continuation column—which is not a continuation of its preceding card.
 7 to 72 served as the statement field.
 73 to 80 were ignored (the IBM 704's card reader only used 72 columns).[18]
Columns 73 to 80 could therefore be used for identification information, such as punching a

You might also like