fortranプログラミング入門object oriented programming, ieee arithmetic support, volatile...

16
Fortranプログラミング入門 -Fortranとは?- Introduction to Fortran Programming -What is Fortran?-

Upload: others

Post on 29-May-2020

12 views

Category:

Documents


0 download

TRANSCRIPT

Fortranプログラミング入門-Fortranとは?-

Introduction to Fortran Programming-What is Fortran?-

Fortranとは…What is Fortran?

世界で最初の高級言語!!

1950年代中頃IBM社John.W.Backusらのチームが開発

Q.この時代のコンピュータは何に使われていたか?

The first high-level language in the world!!

A team of IBM's John.W. Backus et al developed in the mid 1950's

Q. What was the computer in this era used for?当時はまだインターネットがない

At that time,no Internet yet.

Fortranとは…What is Fortran?

Q.この時代のコンピュータは何に使われていたか?

A.科学技術計算をするため!!

Q.では、どのようにしてプラグラミングを書いていたか?

Q. What was the computer in this era used for?

A. Science and technology calculations !!

Q. How did you write programming?

ENIAC(エニアック、Electronic Numerical Integrator and Computer

出典: UNITED STATES ARMY RESEARCH LABOLATORYhttp://ftp.arl.mil/mike/comphist/eniac-story.htmlPhoto is Wikipediahttps://ja.wikipedia.org/wiki/ENIAC

ENIAC(エニアック、Electronic Numerical Integrator and Computer

出典:Webで学ぶ情報処理概論http://www.infonet.co.jp/ueyama/ip/history/eniac.html

Fortranとは…What is Fortran?

"FORTRAN"とは、FORmula TRANslationの略です。

"FORTRAN" stands for FORmula TRANslation.

Fortranとは…What is Fortran?

Q.では、どのようにしてプラグラミングを書いていたか?

A. 機械語(0と1)あるいはアセンブリ言語(機械語と1:1対応)を使っていた。

Q. How did you write programming?

A. Machine language (0 and 1) or Assembly language (1 : 1 correspondence with machine language).

URL: https://www.sqa.org.uk/e-learning/CompArch03CD/page_05.htm

Fortranとは…What is Fortran?

世界で最初の高級言語!!1950年代中頃IBM社John.W.Backusらのチームが開発

そこで、科学技術計算用コンピュータのためにアセンブリ言語の代わりとしてFORTRANを開発!!Fortranは今でも科学技術計算向けのプログラミング言語として使われている!!The first high-level language in the world!!A team of IBM's John.W. Backus et al developed in the mid 1950'sSo, they developed “FORTRAN”as an alternative to assembly language for computer for scientific computing!!!Fortran is still used as a programming languagefor scientific computing!

アセンブリは難しい!?

Assembling is difficult !?

Fortranの歴史What is Fortran?

IBM社John.W.Backusらのチームが開発後…

各社がFORTRAN言語を開発→規格が違うため汎用性がない…

After the team of IBM Developed ...

Several companies developed the FORTRAN language →There is no portability due to different standards ...

Fortranの歴史What is Fortran?

IBM社John.W.Backusらのチームが開発後…

各社がFORTRAN言語を開発→規格が違うため汎用性がない…

標準規格を作ろう!! →1966年 ASA(現ANSI)がFORTRANを規格化(FORTRAN66)

After the team of IBM Developed ...

Several companies developed the FORTRAN language →There is no portability due to different standards ...

Let's make standards! →1966 ASA (now ANSI) standardized FORTRAN (FORTRAN 66).

Fortranの歴史What is Fortran?

しかし時代は進み、他言語が生み出される…

1972年 C言語ポインタ,構造体,再帰呼び出しがある

1983年 C++ オブジェクト指向のプログラミング(クラス) 1990年以降 Python, Java, Ruby etc…

However, the times advance, other languages are developed ...

1972 C language (are pointers, structures, recursive calls). 1983 C++ Object oriented programming. (are Class)

Since 1990 Python, Java, Ruby etc…もう時代遅れなのか!?

Obsolete already?

Fortranの歴史

Fortranも時代に合わせて進化!!

・1978年 FORTRAN77として制定 (ANSI X3.9-1978) 文字列の扱いが可能.

・1991年 Fortran90として制定 (ISO/IEC 1539:1991) ポインタ,構造体,モジュール(C++でいうクラス)を追加

・1997年 Fortran95を制定 (ISO/IEC 1539-1:1997) Fortran90のバグを修正,新たな関数の追加

・2004年 Fortran2003を制定 (ISO/IEC 1539-1:2004) オブジェクト指向のプログラミング,IEEE算術のサポート,VOLATILE属性,ALLOCATABLE属性の拡張

What is Fortran?

Fortran also evolved to the times!

・1978 FORTRAN77 established(ANSI X3.9-1978)

FORTRAN77 can handle character strings.

・1991 Fortran90 established(ISO/IEC 1539:1991)

Add pointer, structure, module.

・1997 Fortran95 established(ISO/IEC 1539-1:1997)

Bug fix in Fortran90, added a new function.

・2004 Fortran2003 established(ISO/IEC 1539-1:2004)

Object oriented programming, IEEE arithmetic support, VOLATILE attribute, extension of ALLOCATABLE attribute

IEEE arithmetic — Intrinsic module providing IEEE arithmetic facilities

FortranコンパイラFortran compiler

Fortranも時代に合わせて進化!!

・2010年 Fortran2008を制定 (ISO/IEC 1539-1:2010) Fortran95/2003の並列化を目指した言語 Co-array Fortranを標準規格化

・2018年 Fortran20152018を制定! (2018年11月現在)

Fortran also evolved to the times!

・2010 Fortran2008 established(ISO/IEC 1539-1:2010) Language aiming for parallelization of Fortran 95/2003. Standardization of Co-array Fortran.

・2018 Fortran20152018 established! (As of November 2018)

FortranコンパイラFortran compiler

Open source: GNU Compiler Collection

G77 ⇒ G95

gfortran

本講義で採用!!

Adopt it in this lecture!!

Pay:

IntelFortran

NAG Fortran (Numerical Algorithms Group)

etc…

FortranコンパイラFortran compiler

Let's check the functions available in(If you are interested)

https://gcc.gnu.org/wiki/GFortran