I am glad to join the Fortran community. I work on large-scale exact diagonalization calling the libraries like BLAS, LAPACK, (P)ARPACK and do parallel computing.
I want to modify a code written in Fortran 90 by writing in newer versions of the Fortran language.
The supercomputer in my current institute has the following packages: GCC-11.3.0, GSL-2.7, OpenMPI-4.1.4, OpenBLAS-0.3.20, ScaLAPACK-2.2.0, ARPACK-NG-3.8.0
So I wonder if I can write a new code in Fortran 2018, or even with the newest version Fortran 2023?
The support of gfortran for various standards is described at Standards (The GNU Fortran Compiler) and Major changes in GCC Gfortran by version | Scientific Computing and for Fortran 2018 at Fortran2018Status - GCC Wiki. The latest gfortran is gfortran 14, which will implement more features than your current GCC-11.3.0. You are probably safe using features through Fortran 2008, but the best answer will be obtained from trial and error. You can install more than one version of gfortran on your PC, and if a later version supports a feature you want to use, you could ask the system administrators to install a later version of gcc on the supercomputer.
Using a standard later than Fortran 90 will not stop you from using GSL and the other packages you listed, and in fact the C interoperability features of Fortran 2003, implemented in gfortran, enable you to call GSL in a standard-conforming way: FGSL 1.6.0 released
Dear Beliavsky,
Thank you for your helpful advice.
I will try to add new Fortran features to the code, and ask the administrator to install newer version of GCC.
I recommended elsewhere yesterday using as many different compilers as you can. That’s good for hunting bugs in one’s own programs and in compilers. (I use gfortran, g95, ifort, ifx, lfortran and AOCC flang myself. They all cost me $0.00. I don’t know why several different compilers are called flang. The AOCC one was easiest to install on my Linux machine.)
I am trying to understand what changes you would be able to make.
First you would need to identify what new features of F18 and F23 could assist you in the type of Fortran you are using. It would be interesting to others what new features you are identifying.
However there may be limitations on utilising these features, if they are not incorporated into “the libraries like BLAS, LAPACK, (P)ARPACK and do parallel computing”
@Harper raises an interesting point regarding other compilers, as most of them would not have fully implemented the new features in F18 and F23, so testing of these could be a challenge.
If your “do parallel” includes OpenMP, there is also the support for recent versions of this specification and how it relates to your supercomputer environment.
Please update us on what new features you find helpful.