evolution of fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/evolutionfortran.pdfmore important...

21
Evolution of Fortran Presented by: Tauqeer Ahmad Seminar on Languages for Scientific Computing

Upload: others

Post on 05-May-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

Evolution of Fortran

Presented by:

Tauqeer Ahmad

Seminar on Languages for Scientific Computing

Page 2: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

Outline (1)

Evolution of FORTRAN 2/21 Tauqeer Ahmad

History of Fortran

Versions

FORTRAN I

FORTRAN II

FORTRAN III

FORTRAN IV

FORTRAN 66

FORTRAN 77

Page 3: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

Outline (2)

Tauqeer Ahmad Evolution of FORTRAN 3/21

Fortran 90

Fortran 95

Fortran 2003

Fortran 2008

Simple Fortran Program

Lifecycle of Fortran Program

Page 4: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

History of Fortran

Stands for IBM Mathematical FORmula

TRANslation System but abbreviated to

FORmula TRANslation

FORTRAN 0 was developed by a IBM

research team headed by John Backus in

1954.

“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.”

Was the first high-level programming

language.

John Backus 1924-1988

Evolution of FORTRAN 4/21 Tauqeer Ahmad

Page 5: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

More History

The design of FORTRAN made it

easier to translate mathematical

formulas into code.

FORTRAN originally began as a

digital code interpreter for the IBM

701

At that time it was called Speed

coding

The point of FORTRAN was to

make programming easier.

FORTRAN is an

Imperative(Procedural) Language

like C, Ada and Pascal etc.

IBM 701

Evolution of FORTRAN 5/21 Tauqeer Ahmad

Page 6: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

FORTRAN I

Was the first compiler

Was developed from scratch in 1954-1957

Cut development time.

2 weeks to 2 hours

Evolution of FORTRAN 6/21 Tauqeer Ahmad

Page 7: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

FORTRAN II

It allowed to add user-written procedures and subroutines.

COMMON statement.

Fix the bugs.

Evolution of FORTRAN 7/21 Tauqeer Ahmad

Page 8: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

FORTRAN III

Was developed, but never widely distributed

It made possible to use assembly code right in middle of FORTRAN code.

Such “inlined” code can be more efficient but advantages of High Level Language are lost.

Evolution of FORTRAN 8/21 Tauqeer Ahmad

Page 9: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

FORTRAN IV

Removed the machine dependent features of

FORTRAN II e.g. READ INPUT TAPE.

Also added some new features.

Logical IF statement

Logical data type

Logical Boolean expressions

Released in 1962.

Evolution of FORTRAN 9/21 Tauqeer Ahmad

Page 10: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

FORTRAN 66

First high level language standard in the world.

It included:

Types: integer, real, double precision, complex, logical

Arrays: up to 3 subscripts

Procedures: user-written and intrinsic

Permissive of extensions

Do loops

READ, WRITE statement for sequesntial I/O

Evolution of FORTRAN 10/21 Tauqeer Ahmad

Page 11: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

FORTRAN 77 (1)

FORTRAN 77 replaced FORTRAN IV as the new

standard.

It retained most of the features of IV

It added

Character string handling

Logical loop control statements

And a If with a optional else statement

Recursion

Evolution of FORTRAN 11/21 Tauqeer Ahmad

Page 12: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

FORTRAN 77 (2)

IMPLICIT statement

Character data type

Direct-access file I/O

Became out of date.

Evolution of FORTRAN 12/21 Tauqeer Ahmad

Page 13: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

Fortran 90 (1)

Major revision:

Free source format input

Modern control structures

Precision specification

Whole array processing

Dynamic arrays

User defined types

Modules

Evolution of FORTRAN 13/21 Tauqeer Ahmad

Page 14: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

Fortran 90 (2)

SELECT . . . CASE construct for multi-way selection

New and enhanced intrinsic procedures

Identifiers upto 31 character length

Inline comments

User written interface for generic procedures

Backward-compatible with FORTRAN 77.

Tauqeer Ahmad Evolution of FORTRAN 14/21

Page 15: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

Fortran 95

Minor revision with these new features: FORALL, WHERE.

Clearly defined that ALLOCATABLE arrays are automatically deallocated when they go out of scope.

Pointer initialization.

Automatic component initialization.

Few small fixes. ASSIGN and assigned GOTO statement.

DO statements using REAL and DOUBLE PRECISION variables

Evolution of FORTRAN 15/21 Tauqeer Ahmad

Page 16: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

Fortran 2003 (1)

Major revision with these new features:

Exception handling

Allocatable components and dummy

Arguments

Interoperability with C

Object-orientation: procedure pointers and structure

components, structure finalization.

Evolution of FORTRAN 16/21 Tauqeer Ahmad

Page 17: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

Fortran 2003 (2)

Type extension and inheritance,

Polymorphism

Many minor enhancements

Tauqeer Ahmad Evolution of FORTRAN 17/21

Page 18: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

Fortran 2008

Intended as a minor revision, but not as minor as for Fortran 95.

More important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability of Fortran with C.

Evolution of FORTRAN 18/21 Tauqeer Ahmad

Page 19: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

Simple Fortran Program

PROGRAM AddTwoNumbers

IMPLICIT NONE

REAL x, y, z

PRINT *, 'Enter two numbers to add:'

READ *, x, y

z = x + y

PRINT *, 'Result =', z

END PROGRAM AddTwoNumbers

Tauqeer Ahmad Evolution of FORTRAN 19/21

Page 20: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

Lifecycle of Fortran Program

Tauqeer Ahmad Evolution of FORTRAN 20/21

FORTRAN

Program

FORTRAN

Compiler

Libraries

Link with

Libraries

Source Code Object Code Executable

Code

Execute

Program Test & Debug

Program

Make Changes

in Source Code

Page 21: Evolution of Fortran - umu.sehpac.cs.umu.se/teaching/sem-lsc-12/EvolutionFortran.pdfMore important supplement of Fortran 2008 is ISO Technical Specification 29113 On further Interoperability

Bibliography

History of FORTRAN

http://en.wikipedia.org/wiki/Fortran

Handouts on FORTRAN Basics

http://www-solar.mcs.st-and.ac.uk/~steveb/course/notes/set2.pdf

ibiblio.org. A Brief History of FORTRAN.

http://www.ibiblio.org/pub/languages/fortran/ch1-1.html

Introduction and Basic FORTRAN

http://www.cs.mtu.edu/~shene/COURSES/cs201/NOTES/intro.html

Evolution of FORTRAN 21/21 Tauqeer Ahmad