1 / 28

FORTRAN 77

FORTRAN 77. Presented by: Destry Diefenbach. The Free Online Dictionary of Computing ( http://foldoc.doc.ic.ac.uk/ ) Fortrash

efrem
Download Presentation

FORTRAN 77

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. FORTRAN 77 Presented by: Destry Diefenbach

  2. The Free Online Dictionary of Computing (http://foldoc.doc.ic.ac.uk/) Fortrash <abuse, language> /for'trash/ Hackerism for the Fortran language, referring to its primitive design, gross and irregular syntax, limited control constructs, and slippery, exception-filled semantics. [Jargon File] (1994-10-26)

  3. “Algol is FORTRAN done right.” -Bruce Knobe, 1973 • “Pascal is FORTRAN done right.” -Raymond Langsford, 1980 • “FORTRAN 77 is FORTRAN done right.” -James Ball, 1983

  4. 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. • Was the first high-level programming language John Backus 1924-1988

  5. 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 Speedcoding • The point of FORTRAN was to make programming easier. IBM 701

  6. FORTRAN I 1957 • Was the first compiler • By 1958 over 50% of software was in FORTRAN • Cut development time. • 2 weeks to 2 hours

  7. FORTRAN II - IV • FORTRAN II • Independent compilation • Fix the bugs • FORTRAN III • Was developed, but it was never widely distrbuted • FORTRAN IV • Explicit type declarations • Logical selection (IF) statement • Subprogram names could be parameters • ANSI standard in 1966

  8. FORTRAN 77 • 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

  9. Data Types FORTRAN 77 explicitly permits data types of integer, real, double precision, complex, logical, and characters.

  10. Real Data Types • Represent decimal numbers • It uses scientific notation • 3E5 300000 • .123E-3 .000123

  11. Double Precision Data Types • Instead of E it used D • 1D2 100

  12. Complex Data Types • Built in complex number data type • Which occupies 2 bytes • The first byte in the pair represents the real part of the complex data type. • The second byte represents the imaginary part of the complex item. represented as follows Numeric Value (4.61,-6.81) 4.61 – 6.81i (-10,5) -10+5i

  13. Program Structure • A FORTRAN program is a collection of subprogram definitions. • Subprograms may be a FUNCTION that returns values, a SUBROUTINE that doesn’t return a value, and one must be the “main program”

  14. Main Program • The main program receives control of the processor when an executable program is loaded for execution. • There can be only one main program in an executable program. • That main program is identified by the fact that it does not have a FUNCTION, SUBROUTINE, or BLOCK DATA statement as its initial statement.

  15. Intrinsic Functions • FORTRAN 77 has many intrinsic functions • Examples • SQRT( ) square root • FLOAT( ),INT ( ) type conversions • COS( ),SIN( ), TAN( ) trig functions

  16. Statement Functions • Statement functions are one line defined functions that is internal to the program unit in which it is defined • Example of a statement function • ROOT(A,B,C) = (-B+SQRT(B**2-4.0*A*C))/(2.0*A)

  17. Subprograms • The main abstraction devices in FORTRAN 77 are the subroutines and functions. • The subroutine definition • SUBROUTINE SWAP (I,J) M = I I = J J = M RETURN END Functions are structurally similar to subroutines.

  18. Control Structures • GOTO statements • IF statements • DO statement • CONTINUE statement • STOP and PAUSE statements • END statement

  19. GOTO Statements • The GOTO statement is used to direct program control to indicated by the statement number specified in the respective GOTO statement • Three types of GOTO statements • Unconditional GOTO 100 • Computed GOTO(1,2,3)I • Assigned GOTO I,(1,2,3)

  20. IF Statements • Contains IF, ELSE IF, ELSE, END IF • Example • IF(Q) THEN A=B C=D ELSE IF (R) THEN E=F G=H ELSE X=Y Z=W END IF

  21. DO Statement • The DO statement is used to establish a controlled loop • Example DO • DO 10 I = 1,10,1

  22. CONTINUE,STOP PAUSE, and END STATEMENT • The CONTINUE statement serves as a point of reference in a program • No operational function is performed • It is frequently used in DO loops to provide a terminal statement • The STOP and PAUSE statements do a similar task • The STOP terminates execution • The PAUSE terminates execution, but leaves the program in a resumable state • The END statement marks the physical end of a program

  23. EVALUATION • Readability • Writability • Reliability • Cost

  24. Readability • FORTRAN 77 is not to hard to read on a small scale, but when many GOTO statements are involved it gets very difficult • Identifiers can only be six characters long

  25. Writability • Depends on what you are using it for. • Is a pretty simply language

  26. Reliability • Is not very reliable • Only static type checking • Lack of exception handling

  27. Cost • Cheap • Lots of free resources/compilers • A fairly easy language to learn

  28. Bibliography • Marshall, A C. A Brief History of FORTRAN 77. 8 Sept. 1997 http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode29.html • ibiblio.org. A Brief History of FORTRAN. No date http://www.ibiblio.org/pub/languages/fortran/ch1-1.html • American National Standards Institute, Inc. American National Standard Programming Language FORTRAN. April 3, 1978. http://www.fortran.com/F77_std/rjcnf-0.html • Chivers, Ian D. Sleightholme, Jane. Interactive FORTRAN 77: A Hands on Approach 2nd ed. 1984. http://www.kcl.ac.uk/kis/support/cit//fortran/f77book.pdf • William, Waite. FORTRAN 77 Semantic Analysis. No date. http://eli-project.sourceforge.net/fortran_html/Semantics.html#s1 • Bellis, Mary. Inventors of the Modern Computer. No date. http://inventors.about.com/library/weekly/aa072198.htm • Page, Rex. Didday, Rich. Alpert, Elizabeth. FORTRAN 77 for Humans, 3rd ed. 1986 West Publishing Company • Katzan, Harry Jr. FORTRAN 77, Computer Science Series. 1978 Van Nostrand Reinhold Company

More Related