Research articles using Fortran

Merci, I did not know that wonderful collection of programming languages resources in many languages:

Then have a look on the sibling project (equally accommodating languages in addition to English) free science books, too. Since Matlab was recently mentioned multiple times in comparison to Fortran, but equally attractive on its own, I speculate Tom O’Haver’s project A Pragmatic Introduction to Signal Processing (filed in the former in section QA/mathematics of the former) may be one of interest for the audience here. Plenty of code ready-to-go (for spreadsheet/Python/Matlab; not [yet] Fortran).

1 Like

The first time I have seen such an extension being used, to each their own I suppose.

Additionally it’s the first I notice a particular nonstandard aspect being employed with a deprecated feature from the standard i.e., the COMMON block:

subroutine sub()
   common, integer :: n
end subroutine 

C:\Temp>gfortran -c sub.f90
sub.f90:2:4:

2 |    common, integer :: n
  |    1

Error: Unclassifiable statement at (1)

Perhaps further preprocessor “magic” might be at work here, I didn’t bother to investigate. But I personally wouldn’t touch that code with the proverbial ten-foot pole even until there is further simplification of the code using standard facilities.

1 Like

A few scientific journals mandate that papers with computational results be reproducible, with the code made available. Journals should also require that accompanying code be standard-conforming, at least for languages such as C, C++, and Fortran with ISO standards. Considering that a research project may span many years, and that compilers implement standards with a lag, flexibility should be allowed regarding which versions of the standard are acceptable. One could mandate that a Fortran-based paper published today be standard F2003, F2008, or F2018.

Journal editors and referees are interested in the scientific content of a paper, not the details of how an underlying program was written. They don’t want to bicker with authors about what features of a programming language can be used. Mandating conformance to a standard outsources the decision of what is acceptable code to a committee that has thought about such things.

Once authors are told that their papers would be published if it weren’t for features such as real*8 declarations sprinkled in their code, they will quickly fix their codes. The results of many papers depend on programming languages without an ISO standard, such as Python or Matlab. I wonder what the guidelines should be for them.

Book publishers should also have rules about language standards, since many authors and book editors are unfamiliar with them.

2 Likes

http://www-personal.umich.edu/~jcaps/code.html

jCODE is a high-performance Fortran-based multiphase/multi-physics flow solver developed and maintained by the Capecelatro Research Group at the University of Michigan. The code is capable of solving the multi-component compressible Navier-Stokes equations on structured curvilinear meshes using a class of high-order energy-stable finite difference operators. It features a range of models and methods including Lagrangian particle tracking, combustion mechanisms, immersed boundaries for complex geometries, shock capturing, and discrete adjoint-based sensitivity.

You will find papers here:
http://www-personal.umich.edu/~jcaps/publications.html

I’d like to add this from an applied stats journal; the editor (Shlomo Sawilowski) is also a Fortran user.

A parallel finite element solver for structural applications from Japan:
https://manual.frontistr.com/en/faq/index.html
Relevant paper can be found here

It is written in Modern Fortran.

Chen, L.; Ouyang, F.
A FORTRAN Program to Model Magnetic Gradient Tensor at High Susceptibility Using Contraction
Integral Equation Method. Minerals, 2021, 11, 1129.

GitHub - Yonfou/3D-MGTM-HS: 3D Magnetic Gradient Tensor Modeling at High Susceptibility is actually a Fortran program (lower case) using free source form and modules

I earlier wrote that journals such require that Fortran (and C and C++) programs be standard-conforming. Before that, journal editors should learn how the language is currently spelled. Looking at code such as that below from model.f90, I think the authors should use parameters in their code instead of repeating magic numbers, and otherwise simplify it, but people don’t get tenure for clean code.

               IF(X(IX)>=550 .AND. X(IX)<=580 .AND. Y(IY)>=350 .AND. Y(IY)<=650 .AND. Z(IZ)>= 50 .AND. Z(IZ)<=150)  THEN
                   Mx(IX,IY,IZ)=Mx0
                END IF
               !--------------------------------------------
               IF(X(IX)>=250 .AND. X(IX)<=550 .AND. Y(IY)>=640 .AND. Y(IY)<=650 .AND. Z(IZ)>= 50 .AND. Z(IZ)<=70)  THEN
                   Mx(IX,IY,IZ)=Mx0
               END IF
               !--------------------------------------------
               IF(X(IX)>=250 .AND. X(IX)<=550 .AND. Y(IY)>=630 .AND. Y(IY)<=640 .AND. Z(IZ)>= 60 .AND. Z(IZ)<=80)  THEN
                   Mx(IX,IY,IZ)=Mx0
               END IF
               !--------------------------------------------
               IF(X(IX)>=250 .AND. X(IX)<=550 .AND. Y(IY)>=620 .AND. Y(IY)<=630 .AND. Z(IZ)>= 70 .AND. Z(IZ)<=90) THEN
                   Mx(IX,IY,IZ)=Mx0
               END IF
               !--------------------------------------------
               IF(X(IX)>=250 .AND. X(IX)<=550 .AND. Y(IY)>=610 .AND. Y(IY)<=620 .AND. Z(IZ)>= 80 .AND. Z(IZ)<=100) THEN
                   Mx(IX,IY,IZ)=Mx0
               END IF
               !--------------------------------------------
               IF(X(IX)>=250 .AND. X(IX)<=550 .AND. Y(IY)>=600 .AND. Y(IY)<=610 .AND. Z(IZ)>= 90 .AND. Z(IZ)<=110) THEN
                   Mx(IX,IY,IZ)=Mx0
               END IF
               !--------------------------------------------
               IF(X(IX)>=250 .AND. X(IX)<=550 .AND. Y(IY)>=590 .AND. Y(IY)<=600 .AND. Z(IZ)>=100 .AND. Z(IZ)<=120) THEN
                   Mx(IX,IY,IZ)=Mx0
               END IF
               !--------------------------------------------
               IF(X(IX)>=250 .AND. X(IX)<=550 .AND. Y(IY)>=580 .AND. Y(IY)<=590 .AND. Z(IZ)>=110 .AND. Z(IZ)<=130) THEN
                   Mx(IX,IY,IZ)=Mx0
               END IF
               !--------------------------------------------
               IF(X(IX)>=250 .AND. X(IX)<=550 .AND. Y(IY)>=570 .AND. Y(IY)<=580 .AND. Z(IZ)>=120 .AND. Z(IZ)<=140) THEN
                   Mx(IX,IY,IZ)=Mx0
               END IF
               !--------------------------------------------
               IF(X(IX)>=250 .AND. X(IX)<=550 .AND. Y(IY)>=560 .AND. Y(IY)<=570 .AND. Z(IZ)>=130 .AND. Z(IZ)<=150) THEN
                   Mx(IX,IY,IZ)=Mx0
               END IF

“Exploring pathways to more accurate machine learning emulation of atmospheric radiative transfer” by Peter Ukkonen

Abstract
Machine learning (ML) parameterizations of subgrid physics is a growing research area. A key question is whether traditional ML methods such as feed-forward neural networks (FNNs) are better suited for representing only specific processes. Radiation schemes are an interesting example, because they compute radiative flows through the atmosphere using well-established physical equations. The sequential aspect of the problem implies that FNNs may not be well-suited for it.

This study explores whether emulating the entire radiation scheme is more difficult than its components without vertical dependencies. FNNs were trained to replace a shortwave radiation scheme, its gas optics component, and its reflectance-transmittance computations. In addition, a novel recurrent NN (RNN) method was developed to structurally incorporate the vertical dependence and sequential nature of radiation computations.

It is found that a bidirectional RNN with an order of magnitude fewer model parameters than FNN is considerably more accurate, while offering a smaller but still significant 4-fold speedup over the original code on CPUs, and a much greater speedup on GPUs. The RNN predicts fluxes with less than 1% error, and heating rates computed from fluxes have a root-mean-square-error of 0.16 K day$^{-1}$ in offline tests using a year of global data. Finally, FNNs emulating gas optics are very accurate while being several times faster. As with RNNs emulating radiative transfer, the smaller dimensionality may be crucial for developing models that are general enough to be used as parameterizations.

Izmaylova, G.R., Yusupova, L.F.
Numerical implementation of the mathematical model of combined effect on the formation using FORTRAN programming language
(2021) Journal of Physics: Conference Series, 2032 (1), art. no. 012042, .
DOI: 10.1088/1742-6596/2032/1/012042
https://iopscience.iop.org/article/10.1088/1742-6596/2032/1/012042

A paper about oil production.
FORTRAN in uppercase. They use Compaq Visual Fortran (Fortran<=95) and the screenshot shows it’s fixed form.

2 Likes

Actually they call it “FORTAN” (in the caption of the figure with the source code).

Another interesting point is that comments in the source code are in Russian which means that Compaq Visual Fortran could manage either ISO 8859-5 (Cyrillic) or UTF. Probably the former as CVF dates from the early 2000’s, and UTF was spread slowly although born in 1991.

2 Likes

Anton Kasprzhitskii et al., «XMHFL: Software for calculating excited and ionized states of molecules by X-ray» in SoftwareX 13, 2021, 100647 (https://doi.org/10.1016/j.softx.2020.100647., open access). GitHub repository of the Fortran 2003 program.

Abstract:
«XMHFL is a computer program that implements the Single Center Expansion (SCE) method to describe ground, excited and ionized states of a molecular system with one or more vacancies. The simulation mechanism is based on a combination of the three-point difference Numerov scheme and Thomas algorithm. The modular architecture of the XMHFL solvers allows using the generated code as the basis for the development of new methods and algorithms, as well as increasing the possibilities of molecular characterization calculation for X-ray molecular spectroscopy research and training as an educational platform.»

We published several papers on software research in Fortran - see the last section in SimCon - Software Research . Should they be referenced here?

1 Like

Maybe you can reference a few newest ones. There is obviously tons of Fortran articles in the past 50 years, but maybe we can use this thread to highlight recent work.

@Beliavsky In June, you mentioned your compilation of Fortran code maintained on GitHub. Covering multiple fields and managed in sections, e.g., about file I/O, physics, or economics, it offers a showcase what Fortran can do (a bit like the demo pages of e.g., gnuplot) without aiming to be a package repository like CTAN.

Would it be acceptable for you if

  • your compilation would contain links of the programs mentioned in this thread (possibly some already are), and
  • there were an early and prominent link towards your compilation, added to section «other resources/on the web» on fortran-lang’s page dedicated to learning Fortran like there is e.g., about the examples by Scivision?
1 Like

The article can be downloaded. Another article from Nature, also in the area of biology and using CUDA Fortran, is also listed below.

Computer Physics Communications

Volume 273, April 2022, 108248

FSEI-GPU: GPU accelerated simulations of the fluid–structure–electrophysiology interaction in the left heart

Authors:
FrancescoViola

Vamsi Spandan

Valentina Meschini

Joshua Romero

Massimiliano Fatica

Marco D. de Tullio

Roberto Verzicco

Abstract

The reliability of cardiovascular computational models depends on the accurate solution of the hemodynamics, the realistic characterization of the hyperelastic and electric properties of the tissues along with the correct description of their interaction. The resulting fluid–structure–electrophysiology interaction (FSEI) thus requires an immense computational power, usually available in large supercomputing centers, and requires long time to obtain results even if multi–CPU processors are used (MPI acceleration). In recent years, graphics processing units (GPUs) have emerged as a convenient platform for high performance computing, as they allow for considerable reductions of the time–to–solution.

This approach is particularly appealing if the tool has to support medical decisions that require solutions within reduced times and possibly obtained by local computational resources. Accordingly, our multi–physics solver [1] has been ported to GPU architectures using CUDA Fortran to tackle fast and accurate hemodynamics simulations of the human heart without resorting to large–scale supercomputers. This work describes the use of CUDA to accelerate the FSEI on heterogeneous clusters, where both the CPUs and GPUs are used in synergistically with minor modifications of the original source code. The resulting GPU accelerated code solves a single heartbeat within a few hours (from three to ten depending on the grid resolution) running on premises computing facility made of few GPU cards, which can be easily installed in a medical laboratory or in a hospital, thus opening towards a systematic computational fluid dynamics (CFD) aided diagnostic.

Keywords:

Fluid dynamics, Cardiovascular flows, Hemodynamics, Fluid-structure-interaction, Multiphysics model, Computational engineering


2nd paper: GitHub: Euplectella_HPC

Extreme flow simulations reveal skeletal adaptations of deep-sea sponges

Nature volume 595 , pages537–541 (2021)

  • 6097 Accesses
  • 2 Citations
  • 202 Altmetric

Abstract

Since its discovery1,2, the deep-sea glass sponge Euplectella aspergillum has attracted interest in its mechanical properties and beauty. Its skeletal system is composed of amorphous hydrated silica and is arranged in a highly regular and hierarchical cylindrical lattice that begets exceptional flexibility and resilience to damage3,4,5,6. Structural analyses dominate the literature, but hydrodynamic fields that surround and penetrate the sponge have remained largely unexplored. Here we address an unanswered question: whether, besides improving its mechanical properties, the skeletal motifs of E. aspergillum underlie the optimization of the flow physics within and beyond its body cavity. We use extreme flow simulations based on the ‘lattice Boltzmann’ method7, featuring over fifty billion grid points and spanning four spatial decades. These in silico experiments reproduce the hydrodynamic conditions on the deep-sea floor where E. aspergillum lives8,9,10. Our results indicate that the skeletal motifs reduce the overall hydrodynamic stress and support coherent internal recirculation patterns at low flow velocity. These patterns are arguably beneficial to the organism for selective filter feeding and sexual reproduction11,12. The present study reveals mechanisms of extraordinary adaptation to live in the abyss, paving the way towards further studies of this type at the intersection between fluid mechanics, organism biology and functional ecology.

Saransh Singh, Farangis Ram and Marc De Graef

EMsoft: open source software for electron diffraction/image simulations

EMsoft is an open source package for the simulation of electron diffraction patterns and images for both
SEM and TEM modalities. The package has been under development since the late 1990’s and is
currently available as version 3.1 from a GitHub repository. The main component of the package is a
source code library of functions and subroutines that cover crystallography, symmetry, electron
scattering factors, geometry, rotation representations, basic image filters, defect displacement fields,
reciprocal space sampling schemes, and so on. The code is mostly written in fortran-90, with oc-
casional routines making use of the C-bindings that are available in fortran-2003. A second library
covers routines used to read and write files in the open source HDF5 (Hierarchical Data Format) file
format [2], which is the default format for all computational results. At the time of writing of this
abstract, more than 200, 000 lines of source code have been written, about half of which are available
via the source code repository

1 Like

[Submitted to arXiv on 23 Dec 2021]

A fast computational model for the electrophysiology of the whole human heart

Giulio Del Corso, Roberto Verzicco, Francesco Viola

In this study we present a novel computational model for unprecedented simulations of the whole cardiac electrophysiology. According to the heterogeneous electrophysiologic properties of the heart, the whole cardiac geometry is decomposed into a set of coupled conductive media having different topology and electrical conductivities: (i) a network of slender bundles comprising a fast conduction atrial network, the AV-node and the ventricular bundles; (ii) the Purkinje network; and (iii) the atrial and ventricular myocardium. The propagation of the action potential in these conductive media is governed by the bidomain/monodomain equations, which are discretized in space using an in-house finite volume method and coupled to three different cellular models, the Courtemanche model [1] for the atrial myocytes, the Stewart model [2] for the Purkinje Network and the ten Tusscher-Panfilov model [3] for the ventricular myocytes. The developed numerical model correctly reproduces the cardiac electrophysiology of the whole human heart in healthy and pathologic conditions and it can be tailored to study and optimize resynchronization therapies or invasive surgical procedures. Importantly, the whole solver is GPU-accelerated using CUDA Fortran providing an unprecedented speedup, thus opening the way for systematic parametric studies and uncertainty quantification analyses.

Subjects: Medical Physics (physics.med-ph)