FORTRAN 0 1954 First High Level Language FORTRAN I 1957 First Compiled Language FORTRAN II 1958 1958 Independent Subroutines FORTRAN IV 1960 1960 Most Used Version FORTRAN 66 196667 First Standard ID: 728419
Download Presentation The PPT/PDF document "Fortran Matthew Carson History of FORTRA..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Fortran
Matthew CarsonSlide2
History of FORTRAN
FORTRAN 0
1954; First High Level Language
FORTRAN I
1957;
First
Compiled Language
FORTRAN II 1958
1958; Independent Subroutines
FORTRAN IV 1960
1960; Most Used Version
FORTRAN 66
1966-67; First Standard
FORTRAN 77
1977-78; IMPLICIT and Block Control
Fortran 90
1991-92; Free-form code
Fortran 95
1997; FORALL and ALLOCATABLESlide3
Fortran Compiler Support for Fortran 2003/2008
http
://
fortranwiki.org/fortran/show/Fortran+2003+status
http://
fortranwiki.org/fortran/show/Fortran+2008+statusSlide4
Fortran Overview
Variable names up to 31 characters
Case-insensitive
Strong typed
Static bindingSlide5
Data Types
INTEGER
REAL
COMPLEX
LOGICAL
CHARACTER
DERIVED TYPES
REAL (KIND=2) :: x = 10.25
REAL (KIND=8) :: x = 10.25
CHARACTER :: char = ‘a’
CHARACTER (LEN=5) :: string = “Hello”Slide6
Arrays
INTEGER, DIMENSION(10, 10)
::
array
INTEGER, DIMENSION(:, :) :: array
CHARACTER, DIMENSION(10) ::
array_of_characters
CHARACTER(LEN=5), DIMENSION(10)
::
array_of_stringsSlide7
Derived Types
F
ortran 90/95
TYPE car
REAL :: weight
REAL :: length
INTEGER ::
id_number
END TYPE car
Fortran 2003
TYPE circle
REAL :: radius
CONTAINS
PROCEDURE :: area
END TYPE circleSlide8
Operators and Expressions
Operator precedence
Exponentiation (**)
Multiplication/Division
Addition/Subtraction
( <, <=, >, >=, ==, /= )
.NOT.
.AND.
.OR.
.XOR. , .EQV. , .NEQV.
REAL :: w, x, y, z
w = 5
x = 2
y = -w**x ! Outputs: -25
z = (-w)**x ! Outputs: 25Slide9
Control Structures
IF-ELSE IF-ELSE-END IF
SELECT CASE (<parameter>)
DO <variable> = INITIAL_VAL, END_VAL, STEP
DO WHILE (<logical expression>)
FORALL
FORALL (I=1:100, J=1:100) A(I,J)=I*(I+J)Slide10
Subprograms
function
FUNCTION cube(x) result(y)
INTEGER, INTENT(IN) :: x
INTEGER :: y
y = x**3
END FUNCTION cube
PROGRAM test
IMPLICIT NONE
INTEGER :: cube
print *, cube(4)
END PROGRAM
subroutine
SUBROUTINE
half_cube
(x, y, z)
INTEGER, INTENT(IN) :: x
INTEGER, INTENT(OUT) :: y, z
y = x/2
z = x**3
END SUBROUTINE
half_cube
PROGRAM test
…
CALL
half_cube
(x, y, z)
END PROGRAMSlide11
Readability
Easy to read
Free form source code
Procedural language base
Use of END program statementsSlide12
Writability
FORmula
TRANslator
Inclusion of complex data types
Fewer control structures and librariesSlide13
Reliability
Strong typing and Static Binding
Simple to read and write = easy to maintain
“I don’t know what the language of the year 2000 will look like, but I know it will be called Fortran.” Tony Hoare, Turing award winner 1980Slide14
Cost
Easy to learn
Free compiler
Backward compatibility