fortran66のブログ

fortran について書きます。

【メモ帳】中国武漢コロナ&グレタちゃん

日本 2月24日

政治政策として。 f:id:fortran66:20200316003604p:plain www3.nhk.or.jp

www.mhlw.go.jp

f:id:fortran66:20200316004156j:plain www.nikkei.com

英 3月12日

f:id:fortran66:20200316004531p:plain

www.bbc.com

www.bbc.com

グレタちゃん 3月11日

https://livedoor.blogimg.jp/dqnplus/imgs/0/c/0cbec733-s.jpg

blog.livedoor.jp

【メモ帳】N Wirth

N. Wirth, The Essence of Programming Languages

link.springer.com

4 Language Semantics


While disregarding details and further unresolved difficulties, we emphasize that
the language’s definition must be stated in terms of mathematical formulae and be
free of references to any mechanism for execution. A language must be understandable
by its static rules alone, without knowledge about any possible implementation.
We explain this strong requirement by three familiar examples:

1. Numbers: Operations on numbers (integers) are defined by the axioms of mathematics.
Hence there is no need to specify how numbers are represented as sequences
of bits. In fact, representation must not be specified, as this would narrow the freedoms
of implementers. Such an over-specification would break the notion of the
abstraction; it would reveal to the reader properties of their (possible) representation
instead of the numbers themselves.

2. Data Structures: Each element of an array is selected by a unique index, and an
element of a matrix by a tuple of indices. Hence, there is no need for a programmer to
know how an array is allocated within a computer store (whether row- or columnwise
or anything else). In fact, this knowledge would allow the programmer to perform
operations not specified by the proper abstraction alone.

3. Iterative Statements: Repetitions are typically explained in terms of their implementation
with jumps. But there is no need for a programmer to know about jumps, in
fact he must avoid the notion of structure-breaking jumps. Instead, the properties of
an iterative statement S must be defined in terms of the effect of the iterated statement
Q alone.

整数や配列の番地の展開は実装の詳細に依らぬのがいいと言っていて、その通りだと思いますが Fortran を学ぶ上では避けては通れない知識だとも思います。ここが表面的な文法を学んだだけでは苦しい所である気がします。

それは、現在の計算機ではメモリー上のデータの移動が律速段階になっていて、明示的代入を通じてメモリー移動を巧妙に制御しないと計算機資源を有効に活用できない所に遠因していると考えます。

なお三番目のループ(ジャンプ)については Hoare の記述に依っているようです。

N. Wirth, The Development of Procedural Programming Languages Personal Contributions and Perspectives

ALGOL, PASCAL, Module-2, Oberon の系譜について回顧

link.springer.com

アルゴリズムとデータ構造

アルゴリズムとデータ構造

PASCAL (情報処理シリーズ)

PASCAL (情報処理シリーズ)

Oberon-2 Programming with Windows

Oberon-2 Programming with Windows

Object-Oriented Programming in Oberon-2

Object-Oriented Programming in Oberon-2

Programming in Oberon: Steps Beyond Pascal and Modula (ACM Press)

Programming in Oberon: Steps Beyond Pascal and Modula (ACM Press)

【寝言】禿詐欺師まがいの次のターゲット

太陽光で間抜けの菅直人を騙してぼろもうけしたクズがまた汚いことをやろうとしている。

medical.nikkeibp.co.jp

www.moeruasia.net

SBIファーマ株式会社(医療機器の研究開発、製造、販売) 取締役 上昌広 ttp://www.sbipharma.co.jp/company/

SBIバイオテック株式会社 取締役(社外) 上昌広 http://www.sbibiotech.jp/corporate/profile.html

togetter.com

水虫の医者に国会で武漢コロナの発言をさせる馬鹿旧民主党

【寝言】

ベニスに死す

www.afpbb.com youtu.be

f:id:fortran66:20200309235225p:plain

イラン・イタリア・朝鮮 土葬国はダメだな。

21世紀のコンピュートピア!

f:id:fortran66:20200309235216j:plain

日本円 独り立つ

f:id:fortran66:20200310003124p:plain

www.kitco.com

数値計算のためのFortran90/95プログラミング入門(第2版)

数値計算のためのFortran90/95プログラミング入門(第2版)

  • 作者:牛島 省
  • 発売日: 2020/01/28
  • メディア: 単行本(ソフトカバー)

【メモ帳】数理科学 FORTRAN(特集) 昭和43年 (1968)6巻2号 

目次

数理科学も昔はダイヤモンド社刊だったのですね。

dl.ndl.go.jp

・  FORTRAN(特集)/1~27,33~82
・ FORTRANの世界(座談会) / 小野 勝章/18~27
・ 大型FORTRANの特徴 / 小林 達/45~53
・ JIS FORTRANの特徴 / 菅 忠義/33~38
・ ぼくたちの失敗 / 江沢 洋/60~62
・ 数理工学雑記帳-12-不等式の条件 / 森口 繁一/28~32
・ アンケート--FōRTRAN一覧 / 数理科学編集部/63~79
・ 特集:FōRTRAN / 東大大型計算機センター 研究開発部員 プログラム指導員/3~82
・ 多次元の処理と政治的関心の研究例 / 穐山 貞登/39~44
・ 市場調査とコンピュータ / 磯野 達雄/54~59
・ ことばのページ / 戸田 英雄/80~82
・ Burroughs E6000 VRCS / 町田裕叙/86~87
・ コンピュータ・ニュース / 編集部/88,90
・ 電子計算機学校紹介 //83~83
・ 日本科学技術研修所・計算センター //84~84
・ 富士通電算機専門学校 //85~85
・ 初心者へのアドバイス--FōRTRANキイ・ポイント / 東大大型計算機センター 研究開発部員 プログラム指導員/3~12
・ ちいさなFōRTRAN //12~17
・ 数理科学次号予告 //53~53
・ 数理科学既刊1月号内容 //59~59

標準言語FORTRAN (電子計算機基礎講座 3)

標準言語FORTRAN (電子計算機基礎講座 3)

  • 作者:菅忠義
  • 発売日: 1972/05/01
  • メディア: 単行本

【ニュース】FORTRAN 堂々の二位!

今後スキルを磨きたい言語、スキルを磨かなくてよい言語

active.nikkeibp.co.jp

今後、スキルを磨かなくてもよいと思う言語

f:id:fortran66:20200305003955j:plain

今後、スキルを磨きたいと思う言語

f:id:fortran66:20200305004354j:plain

このグラフから、世間一般ではこれ以上学ぶことが無いほど FORTRAN のスキルがすでに非常に高いと結論されます。

FORTRAN 大人気!愛され言語!w

IT 革命で(トイレット)ペーパーレス社会

今日は街にトイレットペーパーが溢れていましたw

togetter.com

共産党のテロでしたかw 松川事件下山事件三鷹事件・・・

【メモ帳】Intel fortran v19.1 の派生型オブジェクトの代入

派生型オブジェクトの代入時の再割り付けに関する理解しがたい振る舞い

intel fortran 19.0/19.1

終了処理を伴う派生型変数を静的なスカラー変数に対して代入するとき、静的変数が reallocate されている感じ。[追記:loc関数で番地を見ると変化していないので reallocate ではなかったです。] gfortran ではそうならない。

なお unallocated な allocatble 変数に代入する時は final 処理はされない。

ソース・プログラム

module m_test
    implicit none
    type :: t_base
        integer :: i = 0
    contains
        final :: fin_base
    end type t_base
    
    contains
    
    subroutine fin_base(this)
        type(t_base), intent(in out) :: this
        print *, 'final'
    end subroutine fin_base
end module m_test
    
program test
    use m_test
    implicit none
    type(t_base) :: a
    a = a
end program test

実行結果

a=a の所で final subroutine が呼ばれている。 a=t_base() でも同様。

 final

参考

ソース・プログラム

module m_test
    implicit none
    type :: t_base
        integer :: i = 0
    contains
        final :: fin_base
    end type t_base
    
    contains
    
    subroutine fin_base(this)
        type(t_base), intent(in out) :: this
        print *, 'final'
    end subroutine fin_base
end module m_test
    
program test
    use m_test
    implicit none
    type(t_base) :: a
    type(t_base), allocatable :: b
    class(t_base), allocatable :: c
    print *, 'start'
    a = t_base()
    print *, 'end: a'
    b = a
    print *, 'end: b'
    c = a
    print *, 'end: c'
end program test

実行結果

 start
 final
 end: a
 end: b
 end: c

追記

配列の時や部分配列の時は finalization は行われませんが、配列の要素の時は finalization が行われます。スカラーの時だけ異常な振る舞いがなされるようです。

ソース・プログラム

module m_test
    implicit none
    type :: t_base
        integer :: i = 0
    contains
        final :: fin_base
    end type t_base
    
    contains
    
    subroutine fin_base(this)
        type(t_base), intent(in out) :: this
        print *, 'final'
    end subroutine fin_base
end module m_test
    
program test
    use m_test
    implicit none
    type(t_base) :: a, b(10)
    print *, 'loc a', loc(a)
    a = a
    print *, 'loc a', loc(a)
    print *, 'loc b', loc(b)
    b = b
    print *, 'loc b', loc(b)
    b(1:1) = b(1:1)
    print *, 'loc b', loc(b)
    b(1) = b(1)
    print *, 'loc b', loc(b)
    
end program test

実行結果

loc a    14000912
final
loc a    14000912
loc b    14000872
loc b    14000872
loc b    14000872
final
loc b    14000872

Fortran 2018 with Parallel Programming

Fortran 2018 with Parallel Programming

  • 作者:Ray, Subrata
  • 発売日: 2019/08/27
  • メディア: ハードカバー

Fortran ハンドブック

Fortran ハンドブック

数値計算のためのFortran90/95プログラミング入門(第2版)

数値計算のためのFortran90/95プログラミング入門(第2版)

  • 作者:牛島 省
  • 発売日: 2020/01/28
  • メディア: 単行本(ソフトカバー)