It’s my first time programming with Fortran and I’m still finding my feet.
I’m following along with the tutorials , but I’m wondering if the community here has any suggestions for beginner projects?
And I’ve noticed Tutorials outside Fortran-lang seem scarce, are there any other free resources folks would suggest/that I may not have heard about?
Well, it depends from what do you want to do with fortran and what is your main line of work/research. I would suggest to start with something you know about and that you have already coded in other languages. In this way you can compare the results and check step by step. Careful though, Fortran lacks a real library, so try to start from a problem you can implement completely.
For me, this go-to problem is the FEM procedure for the Poisson equation on the square, because multiple classes I attended used that example, and I have a good understanding of the (mathematical) problem. I coded it in Matlab when I had to learn Matlab, and in python when I needed to learn python, always double checking with the fortran implementation on the same dataset.
Try describing to us why you’re learning fortran, what brought you here and what you would like to achieve in Fortran. We might be able to give you better suggestions
Got it. I’m learning it for a job that involves a lot of HPC but I’m not overly familiar with the language. I have used Python in the past but this was specified instead. I was asking about modelling/numerical projects that are good for beginners. We used to do small problems back when I was a student, pendulum sim etc, but if there’s no real library, would working on something like that be too complex from scratch?
I don’t know what @kimala meant by “there’s no real library”, but if they meant “standard library”, then …
Fortran HAS a standard library, of course, but it’s provided through statements and intrinsic procedures (i.e., you don’t have to worry about which header has what). And there are also a bunch of intrinsic modules, one for compiler-specific stuff (ISO_FORTRAN_ENV) and the other for alignment with other standads (ISO_C_BINDING and IEEE_*).
But Fortran (like most ISO-guided languages) is agnostic operating systems, so for those specific cases you’re better off using either a compiler extension, or (preferred) invoking the C function that does what you need —using the bind(C) attribute/suffix and the ISO_C_BINDING module mentioned above.
If you want to get acquainted with stdlib, a quick way would be to play around at the Compiler Explorer platform and load stdlib as a library Stdlib in Compiler Explorer then you can copy-paste examples from the documentation to understand by doing. stdlib contains many nice API’s such a high level wrappers for BLAS/LAPACK à la Numpy linalg – Fortran-lang/stdlib, hash tables, quadrature rules and many more.