L15_FORTRAN+Essentials

L15_FORTRAN+Essentials - FORTRAN Essentials CS1372...

Info iconThis preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon
FORTRAN Essentials CS1372 Auxiliary Material
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background FORTRAN: FORmula TRANslation Fortran I written 1954-1957 First successful HLL Team at IBM lead by John Backus Changed everything Fortran II released 1958 Fortran III never released Fortran IV released 1962 Version G in common use in the mid 60's Version H highly optimizing. Written in Fortran IV Ver G! Fortran 66 Standard released in 1966 (ANSI) First HLL standard in the world
Background image of page 2
Background FORTRAN 77 (1978) Fixed a number of shortcomings in Fortran 66 FORTRAN 90 (1991) Took too long and allowed C and C++ major inroads FORTRAN 95 Minor revision plus High Performance Fortran FORTRAN 2003 Latest version. ..major revision 2007: John Backus - Leader of Fortran Project dies at 82
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
References http://www.kcl.ac.uk/kis/support/cit/fortran/ provides more information than you could possibly make use of. http://www.star.le.ac.uk/~cgp/prof77.html#tth_ is a web version of one of the original text books. Good text book: “Introduction to Programming with FORTRAN”: Chivers and Sleightholme; Springer Press
Background image of page 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background FORTRAN was designed when punched cards were the source code input medium for computers Each card was one line of code. Large programs were contained in file cabinets full of cards
Background image of page 6
Fixed Column Assignments Column 1: C indicates a comment line Columns 2-5: numeric value – a label Column 6: non-blank means continue the previous line Columns 7-71: source code Columns 72-80: comments (usually used for a sequence number)
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Restricted Character Set Only numbers, upper case letters, .,+-*/ So what about: ‘THIS IS TEXT’ -> 12HTHIS IS TEXT Yes, you had to count the letters in the string Later versions added the quote character but retained the logical operator syntax
Background image of page 8
Design Goals FORTRAN is designed for speed – more so even than C – and many of its irritating language features derive from this goal. It is case insensitive, unlike almost all modern languages. Earlier versions did not permit recursion
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Program Modules The main program is a PROGRAM and appears first in the source file SUBROUTINES are CALLED by the main program or other SUBROUTINES, and return nothing. They can, however, “send values back” via parameters.
Background image of page 10
Program Modules (cont) FUNCTIONS can both return values and return data via parameters. The data return feature is really only useful if you want to use the result directly in an expression or as a function parameter. Parameters are always passed by reference In later versions, you express the INTENT of a parameter to be IN, OUT, or INOUT.
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Swap (PBR) SUBROUTINE SWAP(INT I, INT J) INT T; T = I I = J J = T RETURN END
Background image of page 12
Implicit Variable Typing In the original language, variables did not need to be predefined for type. If the variable name started with I .
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 48

L15_FORTRAN+Essentials - FORTRAN Essentials CS1372...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online