现代化科学Fortran语言代码库-地球科学堆栈交换江南电子竞技平台江南体育网页版 最近30从www.hoelymoley.com 2023 - 07 - 08 - t20:35:24z //www.hoelymoley.com/feeds/question/20463 https://creativecommons.org/licenses/by-sa/4.0/rdf //www.hoelymoley.com/q/20463 9 现代化科学Fortran语言代码库 Mike76 //www.hoelymoley.com/users/21358 2020 - 11 - 12 - t18:52:41z 2020 - 12 - 01 - t00:37:29z < p >亲爱的江南体育网页版地球科学界,< / p > < p >我寻求一个现代化大型Fortran语言项目,与地理空间NetCDF文件。这种语言的要求包括:< / p > < ul > <李>坚如磐石的NetCDF图书馆(我们不想重新发明轮子)。李李< / > < >的支持向量和矩阵(如通过操作符重载或类似的东西)。李李< / > < >本地性能是必要的(编译或jit编译)。李李< / > < >必须是开源的。李李< / > < >在理想的情况下,简单的绑定和Fortran(不是一个严格的要求)。< /李> < / ul > < p > <代码> Python代码< / > + <代码> numpy > < /代码不是一个真正的可选项,因为定制数据与本机的性能。即使<代码> numpy > < /代码用C实现的,该项目包括自定义操作矩阵的算法,我们不想写这些在Python C .我知道< em > < / em >可以优化通过调用C或Fortran,但我不认为这样的优化与我们的团队将会发生。Therefore, I am seeking a language that is "fast by default". Julia seems to deliver much better on this "fast by default" promise, whereas Python is more like "fast if you have the right optimizations in place".

Matlab is a non-starter because of its proprietary license.

C is a non-starter because it does almost nothing to "modernize" a Fortran codebase.

Go is probably not sufficiently well-established for scientific computing?

Julia could be a promising option because it combines the ease of Python with native performance.

Kotlin might be interesting because it combines the strength of the JVM with the possibility to compile to native code.

Swift would be a great language, but I am not sure whether it is sufficiently mature for my targeted domain.

C++20 and Rust are additional options that might be interesting, but I fear the complexity of those languages (remember that this is for earth scientists, not computer scientists).

Which options would you prefer for a gradual Fortran replacement with NetCDF files?

//www.hoelymoley.com/questions/20463/-/20465 # 20465 1 Mike76回答的现代化科学Fortran语言代码库 Mike76 //www.hoelymoley.com/users/21358 2020 - 11 - 12 - t22:14:15z 2020 - 11 - 12 - t22:14:15z

Right now, I think that Julia makes the cut, because it provides a great tradeoff between "fast scripting" and "high-performance scientific computing". But I am willing to hear other people's opinions, perhaps I have overlooked something.

//www.hoelymoley.com/questions/20463/-/20466 # 20466 7 弗雷德回答的现代化科学Fortran语言代码库 弗雷德 //www.hoelymoley.com/users/2470 2020 - 11 - 12 - t22:51:43z 2020 - 11 - 12 - t22:51:43z < p >作为前Fortran程序员几周前我在网上做了一个小回顾到目前的趋势进行科学规划。< / p > < p >首先,尽管其年龄和有时古老的编程风格,因为它的巨大遗产,Fortran没有被定向到垃圾桶。这将是很长一段时间来使用。< / p > < p >喜欢你,别人一直在寻找另一个开始远离Fortran。< / p > < p >虽然很受欢迎,Python是非常<强>慢< /强>当执行程序。Fortran的速度是它的另一个原因是仍在使用。< / p > < p >对于天文和物理应用程序,我看过很多引用国家偏爱最初教学生Fortran但当他们得到更多的经验在他们的领域暴露他们c++。< / p > < p >这句话从2013年开始,从一个< a href = " https://www.physicsforums.com/threads/best-programming-language-for-physics.719723/ " rel = " noreferrer " > < / >封装了物理论坛一般想法我看到:< / p > < blockquote > < p >老家伙使用fortran和c + +。年轻人使用python、java和c++。< / p > < /引用> < p >与你的答案,我认为如果茱莉亚更广泛使用它可能有潜力取代Fortran和Python科学计算。< / p > //www.hoelymoley.com/questions/20463/-/20469 # 20469 11 由科学家回答语言现代化科学Fortran代码库 科学家 //www.hoelymoley.com/users/21361 2020 - 11 - 14 - t02:50:59z 2020 - 11 - 18 - t04:29:46z < p >现代语言你正在寻找被称为现代Fortran 2018。Fortran 2008年和2018年都一个数值计算项目需要和很多特性,很多其他语言这里提到缺乏(包括极其愉快的数组语法等激发了其他所有语言MATLAB, Python, R,茱莉亚,…,即使是c++数值库)。这是唯一的语言,有本机内置的并行性和是唯一的语言,C,公布的官方标准MPI并行性。它还优秀的供应商支持GPU并行计算我在SC18听到,一些厂商像NVIDIA / PGI已经开始实现本机Fortran通过GPU的并行性特征。< / p > < p >现代Fortran是一个高级语言与MATLAB和Python,然而100 - 500倍(< a href = " https://modelingguru.nasa.gov/docs/doc - 2783”rel = " nofollow noreferrer " > < / > https://modelingguru.nasa.gov/docs/doc - 2783)。使用Coarray Fortran可以无缝地并行化代码运行它以最小的努力从你的笔记本电脑到世界上最大的超级计算机。目前没有其他语言有这样的能力。Fortran语言也是唯一所有级别的并行性,从教学水平矢量化,并发,coarray-distributed并行计算。If such features are not considered "modern", perhaps "post-modern" would be a better description.

Fortran has been a reliable lasting language for almost 3 quarters of a century and has excellent highly-optimized compiler support (Intel, GNU, NAG, IBM, PGI/NVIDIA, ...). If you want to write code that lasts decades, then port your FORTRAN77 code to modern Fortran with minimal effort and save yourself time, energy, money, and computational power.

A good start with modern parallel object-oriented Fortran is "Modern Fortran Explained: Incorporating Fortran 2018" by Metcalf et al.

If you decide to port your code effortlessly to modern Fortran, you can also get help from the official Fortran language website https://fortran-lang.org/ and the community of programmers on Fortran discourse: https://fortran-lang.discourse.group/

Update Nov 17, 2020

Just yesterday NVIDIA released a news post on its GPU implementation of the concurrent features of Fortran 2008 / 2018. Users can now write code in pure modern Fortran and let the compiler automatically offload it to GPUs for thousands-way parallelism.

What is the relevance and importance of this achievement? The same Fortran code that a user writes can now be parallelized via GPUs, distributed CPUs, OpenMP threads, or auto-parallelization features of the Fortran compiler depending on the user's platform and compiler choice. All of that complexity is hidden from the user. No need for preprocessing and conditional compilations anymore. This further enhances the excellent existing portability of Fortran programs across platforms and architectures.

//www.hoelymoley.com/questions/20463/-/20527 # 20527 0 答案由Mozibur Ullah现代化科学Fortran语言的代码库 Mozibur Ullah //www.hoelymoley.com/users/21427 2020 - 12 - 01 - t00:37:29z 2020 - 12 - 01 - t00:37:29z < p >你可以试试Haskell,一个现代的函数式语言。直接使用但也许缺乏熟悉可能有点吓人不知情者。现在有一个广泛的图书馆。< / p >
Baidu
map