110 likes | 413 Views
Introduction to Fortran. Fortran Evolution Drawbacks of FORTRAN 77 Fortran 90 New features Advantages of Additions. Introduction to Fortran. Fortran Evolution History: FORmula TRANslation. first compiler: 1957. first official standard 1972: `FORTRAN 66'.
E N D
Introduction to Fortran Fortran Evolution Drawbacks of FORTRAN 77 Fortran 90 New features Advantages of Additions
Introduction to Fortran • Fortran Evolution • History: • FORmula TRANslation. • first compiler: 1957. • first official standard 1972: `FORTRAN 66'. • updated in 1980 to FORTRAN 77. • updated further in 1991 to Fortran 90. • next upgrade due in 1996 - remove obsolescent features, correct mistakes and add limited basket of new facilities such as ELEMENTAL and PURE user-defined procedures and the FORALL statement. • Fortran is now an ISO/IEC and ANSI standard.
Introduction to Fortran • Drawbacks of FORTRAN 77 • FORTRAN 77 was limited in the following areas, • awkward `punched card' or `fixed form' source format; • inability to represent intrinsically parallel operations; • lack of dynamic storage; • non-portability; • no user-defined data types; • lack of explicit recursion; • reliance on unsafe storage and sequence association features.
Introduction to Fortran • Fortran 90 New features • Fortran 90 supports, • free source form; • array syntax and many more (array) intrinsics; • dynamic storage and pointers; • portable data types (KIND s); • derived data types and operators; • recursion; • MODULE s • procedure interfaces; • enhanced control structures; • user defined generic procedures; • enhanced I/O.
Introduction to Fortran • Advantages of Additions • Fortran 90 is: • more natural; • greater flexibility; • enhanced safety; • parallel execution; • separate compilation; • greater portability; • but is • larger; • more complex;
Language Obsolescence • Language Obsolescence • Obsolescent Features • Undesirable Features
Language Obsolescence • Language Obsolescence • Fortran 90 has a number of features marked as obsolescent, this means, • they are already redundant in FORTRAN 77; • better methods of programming already existed in the FORTRAN 77 standard; • programmers should stop using them; • the standards committee's intention is that many of these features will be removed from the next revision of the language, Fortran 95;
Language Obsolescence • Obsolescent Features • The following features are labelled as obsolescent and will be removed from the next revision of Fortran, Fortran 95, • the arithmetic IF statement; • ASSIGN statement; • ASSIGN ed GOTO statements; • ASSIGN ed FORMAT statements; • Hollerith format strings; • the PAUSE statement; • REAL and DOUBLE PRECISION DO-loop control expressions and index variables; • shared DO-loop termination; • alternate RETURN; • branching to an ENDIF from outside the IF block;
Language Obsolescence • Undesirable Features • fixed source form layout - use free form; • implicit declaration of variables - use IMPLICIT NONE; • COMMON blocks - use MODULE; • assumed size arrays - use assumed shape; • EQUIVALENCE statements; • ENTRY statements; • the computed GOTO statement - use IF statement;
Object Oriented Programming • Object Oriented Facilities • Fortran 90 has some Object Oriented facilities such as: • data abstraction -- user-defined types; • data hiding -- PRIVATE and PUBLIC attributes; • encapsulation -- Modules and data hiding facilities; • inheritance and extensibility -- super-types, operator overloading and generic procedures; • polymorphism -- user can program his / her own polymorphism by generic overloading; • reusability -- Modules;