FortranTip
fortrantip.bsky.social
FortranTip
@fortrantip.bsky.social
Tips about Fortran. I also post on X/Twitter and at Fortran Discourse. Past tips are at https://github.com/Beliavsky/FortranTip
DO CONCURRENT communicates that an operation should be independent of order, but when there is no parallelization method the compiler must pick some order to follow. Marshall Ward ran some tests and suggests outer to inner loops. github.com/marshallward...
GitHub - marshallward/do-conc-order: Comparison of non-parallel do concurrent(i,j) vs do concurrent(j,i)
Comparison of non-parallel do concurrent(i,j) vs do concurrent(j,i) - marshallward/do-conc-order
github.com
May 27, 2025 at 12:14 PM
OpenMP directives can be faster than DO CONCURRENT, since compiler writers have put more effort in implementing the former. fortran-lang.discourse.group/t/do-concurr...
Do concurrent: not seeing any speedup
I am trying three different poisson solvers: Do loops: program poisson_solver implicit none integer, parameter :: nx=512, ny=512, max_iter=10000 real, parameter :: tol=1.0e-6, dx=1.0/(nx-1), ...
fortran-lang.discourse.group
May 25, 2025 at 7:38 PM
www.sovereign.tech/tech/gfortran The Sovereign Tech Fund is funding gfortran €360,000 to improve parallel computing support and make other improvements. It is used in climate modeling, aerospace, weather forecasting, computational chemistry, artificial intelligence, and other fields.
www.sovereign.tech
May 11, 2025 at 3:49 PM
github.com/fortran-lang... Fprettify, written in Python, is probably the most used auto-formatter for modern Fortran code. It imposes strict whitespace formatting and integrates with editors such as Vim.
GitHub - fortran-lang/fprettify: auto-formatter for modern fortran source code
auto-formatter for modern fortran source code. Contribute to fortran-lang/fprettify development by creating an account on GitHub.
github.com
May 4, 2025 at 2:52 PM
fortran-lang.discourse.group/t/gnu-fortra... Gfortran 15.1 is released. Fortran 2018 and 2023 locality specifiers to DO CONCURRENT are now supported, there is experimental support for unsigned types, and a -Wexternal-interface-mismatch option has been added, among other things.
GNU Fortran 15.1 has been released
Greetings, the GCC developers announced the release of GCC 15.1. The change log mentions the following updates to GNU Fortran: Fortran 2018 and 2023 locality specifiers to do concurrent are now sup...
fortran-lang.discourse.group
April 27, 2025 at 11:02 AM
There are efforts to translate Fortran to C++ with LLMs, but
Damian Rouson notes that Fortran concepts such as pure functions and SPMD parallelism with a PGAS that both work in distributed memory have no precise counterparts in C++. fortran-lang.discourse.group/t/scientists...
Scientists are using artificial intelligence and large language models to rewrite old code in modern languages
I see several issues with translating Fortran to C++. The most fundamental is that Fortran has concepts and capabilities that C++ lacks (of course, the reverse is true too). A significant example is...
fortran-lang.discourse.group
April 26, 2025 at 3:21 PM
Vincent Lafage discusses the evolution of Fortran and how to evolve legacy Fortran codes in a video at youtube.com/watch?v=iXod..., starting at 8:47.
Webinar - Fortran on CPU and GPU
YouTube video by LAPP CNRS
youtube.com
April 21, 2025 at 7:23 PM
github.com/Beliavsky/Ge... I wrote Python scripts that prompt LLMs to generate Fortran code and send them compiler error messages until the code compiles. On Groq Cloud, Facebook's llama-3.3-70b-versatile is a good coding model.
github.com
April 18, 2025 at 5:34 PM
Compiler engineer Peter Klausler gives advice on writing portable Fortran and examples of non-portable code. github.com/klausler/for...
GitHub - klausler/fortran-wringer-tests: A collection of non-portable Fortran usage, standard-conformant or otherwise
A collection of non-portable Fortran usage, standard-conformant or otherwise - klausler/fortran-wringer-tests
github.com
April 7, 2025 at 6:39 PM
If x is an allocatable array,

x = y

causes the compiler to check if x must be resized before y is copied to it. You can write

x(:) = y

to bypass the compiler check and perhaps boost speed, but this should be tested.
fortran-lang.discourse.group/t/optimizing...
Optimizing vectorized array operations
There are lots of really good answers here! So I won’t add to those. Let me just add a final note which makes array-syntax sub-optimal, and in this suggestion, it can kill performance. When you do ...
fortran-lang.discourse.group
March 29, 2025 at 2:45 PM
Gfortran has a DEPRECATED attribute and ifx has a MESSAGE directive to warn about procedures that should not be called in new code but must be preserved for backwards compatibility.
fortran-lang.discourse.group/t/what-are-t...
What are the versioning/dev rules of stdlib?
GCC offers a deprecated attribute: module a contains subroutine foo !GCC$ ATTRIBUTES DEPRECATED :: FOO print *, "Don't call me." end subroutine end module use a, only: foo call foo end that shows a...
fortran-lang.discourse.group
March 28, 2025 at 1:40 PM
Slides and video for the talk "Fortran 2023 for you: Features and tools" by Katherine Rasmussen are at hpc.fau.de/2025/03/03/n...
NHR PerfLab Seminar: Fortran 2023 for you: Features and tools (March 10, online)
Speaker: Katherine Rasmussen (Lawrence Berkeley National Laboratory) Date and time: Monday, March 10, 2025, 4:00 p.m. CET [3:00 p.m. GMT, 8:00 a.m. PDT] (online) – note the change of date &
hpc.fau.de
March 20, 2025 at 5:14 PM
github.com/guntherwille... "When reading a file, line by line, and using a character array with fixed length (len attribute) to store it, trailing spaces will be added to fill the character string." To avoid this, in the READ statement use advance="no", set the size, and reallocate.
GitHub - guntherwillems/fortran-file-read: Fortran, read a text file without losing trailing spaces
Fortran, read a text file without losing trailing spaces - guntherwillems/fortran-file-read
github.com
March 17, 2025 at 11:43 AM
fortran-lang.discourse.group/t/first-time... Jean-Christophe Loiseau gives a set of numerical algorithms to code to learn a scientific programming language such as Fortran. His book loiseaujc.github.io/Scientific_C... uses NumPy and SciPy.
First time fortran-lang programmer : advice for a newbie?
An excellent resource for beginners is the book Modern Fortran: Building efficient parallel applications by @milancurcic, particularly if you’re interested in using Fortran for scientific computing ap...
fortran-lang.discourse.group
March 16, 2025 at 1:17 PM
hpc.fau.de/2025/03/03/n... Katherine Rasmussen will give an online talk "Fortran 2023 for you: Features and tools" on Monday March 10 4:00 p.m. CET. One topic will be the Julienne unit testing framework
NHR PerfLab Seminar: Fortran 2023 for you: Features and tools (March 10, online)
Speaker: Katherine Rasmussen (Lawrence Berkeley National Laboratory) Date and time: Monday, March 10, 2025, 4:00 p.m. CET [3:00 p.m. GMT, 8:00 a.m. PDT] (online) – note the change of date &
hpc.fau.de
March 9, 2025 at 8:48 PM
github.com/fortuno-repo... Fortuno is a flexible & extensible object-oriented Fortran unit testing framework for serial, MPI-parallel and coarray-parallel projects that minimizes boilerplate code when writing tests while prioritizing modularity and extensibility.
GitHub - fortuno-repos/fortuno: Flexible & extensible object oriented Fortran unit testing framework for serial, MPI-parallel and coarray-parallel projects
Flexible & extensible object oriented Fortran unit testing framework for serial, MPI-parallel and coarray-parallel projects - fortuno-repos/fortuno
github.com
March 7, 2025 at 12:23 PM
beliavsky.github.io/Fortran-pack... Here are 400 projects that work with the Fortran Package Manager, listed by topic. FPM lets you build a program/library, run the executables/tests, and distribute it as a dependency to other projects.
Projects that can be built with the Fortran Package Manager. Also see fortran-lang package index. Please suggest changes here.
List of projects that can be built with the Fortran Package Manager
beliavsky.github.io
March 6, 2025 at 11:42 AM
github.com/Beliavsky/Fo... Many books with Fortran code have been published in the fields of numerical analysis, mathematical optimization, CFD, finite elements, physics, chemistry, and statistics. They are listed by subject at the repo.
GitHub - Beliavsky/Fortran-related-books: Books with Fortran code, other than textbooks, listed by subject
Books with Fortran code, other than textbooks, listed by subject - Beliavsky/Fortran-related-books
github.com
March 1, 2025 at 12:53 PM
github.com/zoush99/f-ikos F-IKOS is a static analyzer for Fortran programs by Sheng Zou et al. that can find run-time errors such as division by zero. It is based on the IKOS analyzer for C and C++. Paper: ceur-ws.org/Vol-3864/qua...
GitHub - zoush99/f-ikos: This is a static analyzer for Fortran programs, named F-IKOS. It is based on IKOS, and we have made some modifications to make it more powerful.
This is a static analyzer for Fortran programs, named F-IKOS. It is based on IKOS, and we have made some modifications to make it more powerful. - zoush99/f-ikos
github.com
February 26, 2025 at 2:10 PM
github.com/t-kalinowski... Quickr transpiles numerical R functions with declarations to Fortran, with a 100x typical speed-up.
GitHub - t-kalinowski/quickr: R to Fortran Transpiler
R to Fortran Transpiler. Contribute to t-kalinowski/quickr development by creating an account on GitHub.
github.com
February 25, 2025 at 3:46 PM
fortran-lang.org/learn/oop_fe...
Fortran-lang just added an article "Putting Fortran’s object-related features to practical use" by Reinhold Bader, revised by nbehrnd, covering object-based and object-oriented programming techniques and performance and ease of use.
Putting Fortran’s object-related features to practical use — Fortran Programming Language
Fortran : High-performance parallel programming language
fortran-lang.org
February 24, 2025 at 9:33 PM