FortranTip's Avatar

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

20 Followers  |  4 Following  |  23 Posts  |  Joined: 24.02.2025  |  1.4286

Latest posts by fortrantip.bsky.social on Bluesky

Preview
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

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...

27.05.2025 12:14 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Preview
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), ...

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...

25.05.2025 19:38 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

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.

11.05.2025 15:49 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
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/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.

04.05.2025 14:52 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
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/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.

27.04.2025 11:02 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
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...

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...

26.04.2025 15:21 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Webinar -  Fortran on CPU and GPU
YouTube video by LAPP CNRS Webinar - Fortran on CPU and GPU

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.

21.04.2025 19:23 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

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.

18.04.2025 17:34 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
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

Compiler engineer Peter Klausler gives advice on writing portable Fortran and examples of non-portable code. github.com/klausler/for...

07.04.2025 18:39 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
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 ...

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...

29.03.2025 14:45 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
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...

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...

28.03.2025 13:40 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Intel Fortran compiler 2025.1 released Intel(R) Fortran Compiler 2025.1.0 was released today. There are a few minor features from Fortran 2023, OpenMP 6.0. These features were part of a total of 168 edits over the 2025.0 release and incl...

fortran-lang.discourse.group/t/intel-fort... Intel Fortran compiler 2025.1 released

26.03.2025 19:03 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
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 &

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...

20.03.2025 17:14 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
get_file – Fortran-lang/stdlib A community driven standard library for (modern) Fortran

Federico Perini suggest using stdlib.fortran-lang.org/interface/ge... for this. "An elegant way
@fortran-lang stdlib does this is to use the `inquire(…size=nbytes)` and then read it all at once. This allows both faster I/O and overall operation (lines can then be split in memory)."

17.03.2025 11:44 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
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/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.

17.03.2025 11:43 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
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/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.

16.03.2025 13:17 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
LLVM Fortran Levels Up: Goodbye flang-new, Hello flang! LLVM has included a Fortran compiler β€œFlang” since LLVM 11 in late 2020. However, until recently the Flang binary was not flang (like clang) but instead flang-new. LLVM 20 ends the era of flang-new.

#Flang #LLVM #Fortran blog.llvm.org/posts/2025-0...

12.03.2025 01:13 β€” πŸ‘ 4    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Preview
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/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

09.03.2025 20:48 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
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/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.

07.03.2025 12:23 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
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/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.

06.03.2025 11:42 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
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/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.

01.03.2025 12:53 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
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/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...

26.02.2025 14:10 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
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/t-kalinowski... Quickr transpiles numerical R functions with declarations to Fortran, with a 100x typical speed-up.

25.02.2025 15:46 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Putting Fortran’s object-related features to practical use β€” Fortran Programming Language Fortran : High-performance parallel programming language

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.

24.02.2025 21:33 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@fortrantip is following 4 prominent accounts