Fortran
Jordan Marn
Steven Devine
Background
•
Developed by IBM in the 1950s
•
Designed for use in scien"c and engineering "elds
•
Originally wri%en as FORTRAN
–
Convenon is caps up to FORTRAN77
–
Title caps for Fortran 90 forward
Background
•
Brainchild of John Backus as a more friendly and useable alternave to assembly
language
•
Fortran’s compiler, released in 1957, was the "rst opmizing compiler.
Hello World
program hello
print *, "Hello World!"
end program hello
Current Usage
•
Scien"c Community
•
Engineers
•
Super Compung
Readability
•
Pros
–
Formulas and funcons are easily recognizable
–
Strongly typed.
–
Looping and control statements work in familiar ways in later versions of Fortran, using do
as the primary key word.
Readability
•
Cons
–
Case Insensive
–
Whitespace insensive
–
Many built-in funcons and types, lacks high orthogonality
–
GOTO
–
Column major order for 2D arrays
Writeability
•
Pros
–
Case insensive
–
Whitespace insensive
–
Powerful funcons and algebraic evaluaon
Writeability
•
Cons
–
GOTO is the basis for control structure in older versions
–
Names restricted to 6 characters
–
Variables are in scope only for subrounes
Reliability
! "
#$ $ #%&%'%(%)
$*$+ &%'%(%)
,#$ %./0$10
#2&-#/3'-#/3(-#/3)-#/
$"
4$
-
5%
65
-
776%
7
#$ $#
$+8-&99/
:::::::::::::::::::::::::::
# #: $:&/:":-#:+$:&99/:":8-#/: :9/;$
,#$ %./00
$"#
46
-/6
-
557
-
6%5<
55
5
-
5675
5
-
=9>#"%7
5575
%5
>#"1
-626-9:9//
-
6-9:9/05?%
5
$;
#%
7?
55%
55
-@.%@.%@.%/
A
B
-29BCB33/
A
@2D.'39EB
@2D.'3&EB
D.'39E2D9E.3D&E.B
D.'3&E2D'E.3D(E.B
F
F
Cost
-
5G:
H
6:$
-
+5I:
5?5
:% :
!J
<7
-
!:5<5G:
7G:
-
7
%7%
%@%:
Parng Thoughts
-
0G:$5
57%7
7%5!0+7
-
7%
576;:
4
1KK777:55:K5KKK&L:
1KK777::K6=9:
1KK:K5K7K7KL&L)
1KK:76:K76K7<M
1KK:K