Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 18 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
18
Dung lượng
769,13 KB
Nội dung
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)-#/ $" [...]... programs like NET -Legacy FORTRAN code can be difficult to read and refactor due to age Older FORTRAN programs may not have obeyed any recognizable methodology Also, GOTO statements Modern Uses - A majority of supercomputers run programs written in FORTRAN -Monster.com lists about fifty jobs that require FORTRAN experience Twenty of those fifty also require security clearance -FORTRAN is still the fastest... modeling, etc Parting Thoughts -FORTRAN isn't unique Everything FORTRAN does can also be done by more powerful languages, starting with C - FORTRAN is fast with mathematics, but Moore's Law is faster -FORTRAN was an important step in programming languages, but it now only caters to the niche market of High Performance Computing Sources http://www.ibiblio.org/pub/languages /fortran/ ch1-8.html http://www.lahey.com/lookat90.htm... Strong Type Checking - FORTRAN uses static (compile time) type checking -At run time all variables in memory are bit strings without data type information -No type checking is done at run time, variables are just accessed by the starting address of variable Portability -FORTRAN revisions are almost completely backwards-compatible and have only removed obsolete instructions -FORTRAN 90 introduced KIND... data type issues -An example of the KIND type: real (kind=kind(0.0)) r -kind(0.0) defaults to the processor's built in size for a real, or the programmer can specify the number of digits FORTRAN Exception Handling - In FORTRAN, pointers cannot overlap in memory - This is done to allow optimization for greater speed in numerical calculations - All arrays passed to subroutines are guaranteed not to be aliased,... http://www.ibiblio.org/pub/languages /fortran/ ch1-8.html http://www.lahey.com/lookat90.htm http://chronicle.com/blogs/wiredcampus/supercomputers-often-run-outdated-software/8184 http://en.wikipedia.org/wiki/Row-major_order http:/ /fortran. com/ . FORTRAN – Convenon is caps up to FORTRAN7 7 – Title caps for Fortran 90 forward Background • Brainchild of John Backus as a more friendly and useable alternave to assembly language • Fortran s compiler,. 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. 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