fortran66のブログ

fortran について書きます。

【悲報】Lahey 廃業 

Lahey Systems 2022年12月末日をもって廃業

Lahey Computer Systems will permanently close on December 31, 2022

DOS の頃から Fortran compiler を出していた Lahey systems が廃業となったようです。Absoft に続きまたひとつ独立系ベンダーの廃業となりました。合掌。

Fortran 95 以降は独自のコンパイラ開発をやめて、Fujitsu FortranOEM や gfortran に開発環境を付加するなど試みていました。Intel Fortran 無償化が重荷の上の藁一本になったのではないかと思います。

www.lahey.com

かつては Lahey Essential Fortran という Fortran90 の過去互換性を捨てたクリーンな教育用 Fortran コンパイラも出していて、私も Fortran 90 をそれで学んだので悲しいニュースです。ELF90 第3版は紙マニュアルも付いており、それで文法を学ぶことで Fortran 90 の要点に触れられた気がします。その後の第4版では Fortran 95 文法を一部取り入れておりました。しかしマニュアルが PDF に変わったので学習用にはイマイチの気がしました。

【寝言】大晦日の寝言

今年良かった音楽

YouTube のお勧めに出て来て気に入りました。


www.youtube.com


www.youtube.com

今年良かった本 Joscelyn Godwin "the Golden Thread"

たまたま紙版が 400円を切る値段になっていたので買ってみました。予想以上に良い本で、定価で買っても良かったと思いました。西洋密教の連綿たる伝燈を、学識あふれる Joscelyn Godwin が一歩引いて俯瞰的に記述していて、武内義雄支那の儒仏道三教交渉史などを思わせる面白さでした。著者がニューエイジな神智学系の人なので、こんな本を読んでいてはこちらの品性が疑われると思って買わないでいましたが ("a low-grade spiritual supermarket" 的な意味で)、もっと早く買って読んでおけばよかったと思いました。

【メモ帳】intel fortran 2023.0 出る!

冬至

先の 22 日に冬至を迎えましたが、至点を通る太陽に感動を新たにし、そしてまた日々新たに。

Intel Fortran 2023

その冬至の日に intel fortranllvm 版の ifx が、旧 intel fortran ifort に並ぶこととなりました。

community.intel.com

公約の roadmap 通りにスケジュールを守ってきたようです。とりあえず ifx も文法的には Fortran 2018 まで対応し、2023年は実行速度の ifort に負けぬ最適化に取り組むようです。

www.intel.com

release note

www.intel.com

ifx version 2023.0.0

  • Intel Fortran Compiler, based on modern LLVM technology, now has up to Fortran 2018 full language standards support, including Coarrays eliminating the need for external APIs such as MPI or OpenMP.

  • To easily express offload parallelism the compiler adds DO CONCURRENT GPU offload support. Intel® Fortran Compiler adds support for 4th Gen Intel® Xeon® Scalable Processor (formerly Sapphire Rapids), and Intel® Data Center GPU MAX Series (formerly Ponte Vecchio).

  • Intel Fortran Compiler enhances OpenMP 5.0, 5.1 compliance, focusing much of that on offloading, and improved performance.

  • Developers are now able to source-level debug optimized code.

  • Intel® Fortran Compiler has feature parity with Intel® Fortran Compiler Classic.

  • Corrections to reported problems

  • Read this supplemental article for more information about the implementation of Fortran 2003, Fortran 2008, Fortran 2018, OpenMP 4.5, OpenMP 5.0/5.1 and some OpenMP 6.0 features.

ifort version 2021.8.0

  • The Intel® Fortran Compiler Classic has been updated to include recent versions of 3rd party components, which include functional and security updates.

  • Corrections to reported problems

【メモ帳】Fortran の value 属性

call by value !?

Fortran の副プログラムの引数は、call by reference がデフォルトですが、Fortran 2003 で引数に value 属性が加わり、call by value 型の扱いも出来るようになりました。特に副プログラムに bind(c) の属性もつけてやることで、C 言語との互換もとれるようになりました。

ここで bind(c) を付けなかった場合に、value 属性の引数がどうなるのか気になる所です。Dr. Fortran こと Steve Lionel のコラムによると、intel fortran では呼び出し側でコピーを取って、そのコピーを call by referecnce で渡すそうです。これは FORTRAN 77 時代のテクニックで式を実引数にすると、その結果をテンポラリにコピーしてそれを call by reference で渡すのと同じになっています。次のようなものがその例になります。

call sub((3))

stevelionel.com

stevelionel.com

ところが、compiler explorer を見ると gfortran では value 属性の引数は bind(c) したときと同じように値を送っているように見えます。

もう少し詳しく調べてみたいところですが、とりあえず色々あるんだなとメモっておくことにします。

godbolt.org

    module test_m
        implicit none
    contains
        subroutine sub1(x)
            real, intent(in) :: x
            print *, loc(x) ! non-standard
        end subroutine sub1

        subroutine sub2(x)
            real, value :: x
            print *, loc(x) ! non-standard
        end subroutine sub2

        subroutine sub3(x) bind(c)
            real, value :: x
            print *, loc(x) ! non-standard
        end subroutine sub3
    
    end module test_m
    
    
    
    program test01
        use test_m
        implicit none
            real :: stack
            
            stack = 1.0
            call sub1(stack)
            call sub1((stack))

            call sub2(stack)
            call sub3(stack)
    end program test01

【メモ帳】intel fortran 2023 年の予定

Webinar : Intel oneAPI 2023 Release: Preview the Tools

上記表題のウェビナーがありました。まだアーカイブには載っていないようですが、そのうち出る事でしょう。

www.intel.com

Fortran の話はそれほど出ませんでしたが、一応以前のロードマップ通りに事を進めていて、文法の実装状況は llvmコンパイラ ifx が 旧来の ifort に並んだので、来年はユーザーからのフィードバックももらって、実アプリにおける性能向上を目指すとのことでした。また質疑の所では、DEC Fortran 以来の FORTRAN IV/66 文法も引き続きサポートして後方互換性を保つと言っておりました。

fortran66.hatenablog.com

【メモ帳】スエーデンの Fortran 動画講座

Fortran youtube 講座 全3日

追記:二日目以降の講義も上がっていました。標準 Fortran の入門を離れ、より発展的な話題になっています。

一日目は、OOPC/C++ 連携についての講座のようです。動画見てませんw スライドなどが GitHub に上がっています。


www.youtube.com


www.youtube.com

二日目は、次期規格以降で導入される Generics 等を扱っています。LFortran を利用してサンプルを示しています。


www.youtube.com


www.youtube.com


www.youtube.com

三日目は、Array について掘り下げているようです。


www.youtube.com


www.youtube.com

ABBA 1976 年

FORTRAN77 の頃。


www.youtube.com

@terryc.3390 2 年前 Fun Fact-This is LITERALLY the moment when ABBA revealed Dancing Queen to the world...ie. performed it for the first time EVER...at the wedding of the future queen of Sweden. Yes, it's a lip sync.