KHO THƯ VIỆN 🔎

Lập trình Fortran 90 và hướng đối tượng

➤  Gửi thông báo lỗi    ⚠️ Báo cáo tài liệu vi phạm

Loại tài liệu:     PDF
Số trang:         46 Trang
Tài liệu:           ✅  ĐÃ ĐƯỢC PHÊ DUYỆT
 













Nội dung chi tiết: Lập trình Fortran 90 và hướng đối tượng

Lập trình Fortran 90 và hướng đối tượng

Fortran 90 OverviewJ.E. Akin. Copyright 1998This overview of Fortran 90

Lập trình Fortran 90 và hướng đối tượng and abilities of F90. Frequently comparisons are made to similar features in the C—t- and F77 languages and to the Matlab environment.These tables sho

w that F90 has significant improvements over F77 and matches or exceeds newer software capabilities found in C++ and Matlab for dynamic memory managem Lập trình Fortran 90 và hướng đối tượng

ent, user defined data structures, matrix operations, operator definition and overloading, intrinsics for vector and parallel processors and the basic

Lập trình Fortran 90 và hướng đối tượng

requirements for object-oriented programming.They are intended to serve as a condensed quick reference guide for programming in F90 and for understan

Fortran 90 OverviewJ.E. Akin. Copyright 1998This overview of Fortran 90

Lập trình Fortran 90 và hướng đối tượng in Rice Iniwrsitv. MEMS Dept. Houston. IX 77005-1892Keywords object-oriented, encapsulation, inheritance, polymorphism, Fortran 90AbstractThere is a w

idely available object-oriented (OO) programming language that is usually overlooked in die oo Analysis, OO Design, oo Programming literature, it was Lập trình Fortran 90 và hướng đối tượng

designed with most of die features of languages like C++. Eiffel, and Smalltalk. It lias extensive and efficient numerical abilities including concise

Lập trình Fortran 90 và hướng đối tượng

array and matrix handling, like Matlab®. Tn addition, it is readily extended to massively parallel machines and is backed by an international ISO and

Fortran 90 OverviewJ.E. Akin. Copyright 1998This overview of Fortran 90

Lập trình Fortran 90 và hướng đối tượng of them correctly disparaged Fortran 77 (F77) for its lack of object oriented abilities and data structures. However, then and now many authors fail

to realize that the then new Fortran 90 (F90) standard established a well planned object oriented programming language while maintaining a full backwa Lập trình Fortran 90 và hướng đối tượng

rd compatibility with the old F77 standard. F90 offers strong typing, encapsulation, inheritance. multiple inheritance, polymorphism, and other featur

Lập trình Fortran 90 và hướng đối tượng

es important to object oriented programming. This paper will illustrate several of these featmes that are important to engineering computation using O

Fortran 90 OverviewJ.E. Akin. Copyright 1998This overview of Fortran 90

Lập trình Fortran 90 và hướng đối tượng 991: Rumbaugh. 1991). and today there arc more than 100 oo languages. Ihus, it is useful to have an introductory understanding of OOP and some of tire

programming features of 00 languages. You can develop oo software in any high level language, like c or Pascal. However, newer languages such as Ada. Lập trình Fortran 90 và hướng đối tượng

c I I. and F90 have enhanced features that make OOP much more natural, practical, and maintainable. C++ appeared before 190 and currently, is probabl

Lập trình Fortran 90 và hướng đối tượng

y die most popular OOP language, yet 190 was clearly designed to have almost all of lire abilities of Cl I (Adams, 1992: Ballon, 1994). However, rathe

Fortran 90 OverviewJ.E. Akin. Copyright 1998This overview of Fortran 90

Lập trình Fortran 90 và hướng đối tượng will try to overcome that misinformed pomt of view.Copyright © 1999. 2000 J. E. Akin. AJI rights reserved.Page 1 of 23Object Oriented Programming via

Fortran 90Modem 00 languages provide the programmer with three capabilities that improve and simplify the design of such programs: encapsulation, inh Lập trình Fortran 90 và hướng đối tượng

eritance, and polymorphism (or generic functionality). Related topics involve objects, classes, and data hiding. All object combines various classical

Lập trình Fortran 90 và hướng đối tượng

data types into a set that defines a new variable type, or structure. A class unifies the new entity types and supporting data that represents its st

Fortran 90 OverviewJ.E. Akin. Copyright 1998This overview of Fortran 90

Lập trình Fortran 90 và hướng đối tượng data, is called an instance of the class. In older languages like c and F77, the data and functions at e separate entities. .An 00 language provides a

way to couple or encapsulate the data and its functions into a unified entity. This is a more natural way to model real-world entities which have bot Lập trình Fortran 90 và hướng đối tượng

h data and functionality. The encapsulation is done with a "module” block in F90. and with a "class" block in C++. This encapsulation also includes a

Lập trình Fortran 90 và hướng đối tượng

mechanism whereby some or all of the data and supporting subprograms can be hidden from the user. The accessibility of the specifications and subprogr

Fortran 90 OverviewJ.E. Akin. Copyright 1998This overview of Fortran 90

Lập trình Fortran 90 và hướng đối tượng t of a progr am from access, and especially from being changed in other parts of the progr am. In C++ the default IS that data and functions are "priv

ate" unless declared "public." while F90 makes the opposite choice for its default protection mode, hl a F90 "module" it is the "contains" statement t Lập trình Fortran 90 và hướng đối tượng

hat, among other things, couples the data, specifications, and operators befoie it to the functions and subroutines that follow it.Class hierarchies c

Lập trình Fortran 90 và hướng đối tượng

an be visualized when we realize tliat we can employ one or more previously defined classes (of data and functionality) to organize additional classes

Fortran 90 OverviewJ.E. Akin. Copyright 1998This overview of Fortran 90

Lập trình Fortran 90 và hướng đối tượng e. For example, if we have defined an Employee_class. then a Managerclass would inherit all of the data and functionality of an employee We would then

only be required to add only the totally new data and functions needed for a manager. We may also need a mechanism to re-define specific Employee_cla Lập trình Fortran 90 và hướng đối tượng

ss fimctions that differ for a Manager_class. By using the concept of a class hierarchy, less programming effort is required to create the final enhan

Lập trình Fortran 90 và hướng đối tượng

ced program. In F90 the earlier class is brought into rhe later class hierarchy by the use statement followed by the name of the "module" statement bl

Fortran 90 OverviewJ.E. Akin. Copyright 1998This overview of Fortran 90

Lập trình Fortran 90 và hướng đối tượng that common functionality. In other words, subprograms having the same generic name aie interpreted differently depending on the class of the objects

presented as arguments to the subprogr ams This is usefill in class hierarchies where a small number of meaningful function names can be used to mani Lập trình Fortran 90 và hướng đối tượng

pulate different, but related object classes. The above concepts are those essential to object oriented design and OOP In the later sections we will d

Lập trình Fortran 90 và hướng đối tượng

emonstrate by example F90 implementations of these concepts.Copyright © '999. 2000 J. E. Akin. Ail rights reserved.Page 2 of 23Object Oriented Program

Fortran 90 OverviewJ.E. Akin. Copyright 1998This overview of Fortran 90

Lập trình Fortran 90 và hướng đối tượng t class type Rectanglereal :: base, height ; end type Rectanglecontains 1 Computation of area for rectangles.function rectanglearea ( r ) result ( are

a )type ( Rectangle ), intent(in) :: r real: areaarea ■ r%base * r%height ; end function rectanglearea end module classRectanglemodule class_Circle ! Lập trình Fortran 90 và hướng đối tượng

define the second object class real : : pi - 3.1415926535897931d0 ! a circle constant type Circlereal :: radius ; end type Circlecontains :Computation

Lập trình Fortran 90 và hướng đối tượng

of area for circles,

Fortran 90 OverviewJ.E. Akin. Copyright 1998This overview of Fortran 90

Fortran 90 OverviewJ.E. Akin. Copyright 1998This overview of Fortran 90

Gọi ngay
Chat zalo
Facebook