Fortran Teaching

I have been doing a bit of thinking lately. I know of some young people who were shown and taught some programing examples that included Fortran and Python and I think C. I was not involved directly in this but, they had commented that they “liked” Fortran. There was something about it that made sense to them, as if they intrinsically understood it. These were high school students in advance placement programs.

There is another student I recently encountered who is amazingly interested in science and physics. As a high school student she has set out on a mission to prove “white hole” theory. Now, I do do not know such things, but I am convinced we need to pay attention to these gifted kids.

I have shown her an example of a simple Fortran code and asked “can you figure out what this does?”. She knows Fortran is a programming language, that’s about it at this stage.

So as I thought about this, it occurred to me, why not start teaching younger people now, why wait for the Universities to wake up? Yes there are tools and then, there are excellent tools.

So I would like to collect examples of elegant and simple codes that do fundamental things in Physics and Engineering and use these in some sort of online “seminars” I could put together to expose younger people to what I call “the magic”. This would be in the form of online presentations with Zoom or similar. (Safety is a big deal with younger people I do not take lightly)

Now my time is limited, but I wanted to at east reach out to people here, who care, to start putting this together and start identifying young people who may fit into this. As I proceed with the gfortran MatterMost ( instance I will create a channel there for “learning”. Although I have worked and contributed to gfortran for many years, I do not consider myself an expert. However, if I can understand something, I am pretty sure others can too.

So, I am inviting those of you here to contribute examples here, so that I can start building “teaching” ideas and presentation materials. If you would like to contact me directly, email

[aside: I am not a teacher though one time in high school physics my instructor asked me to teach his class one day because he had a personal issue come up and did not have a substitute. I taught the class about why high voltage transmission lines are high voltage. That trust in me had a very big impact. Likewise, I pursued gfortran contributions because I knew a physicist working on a cancer treatment who needed a computer at home with a Fortran compiler. I built it for him and got a Fortran compiler working for him. These small things with people do matter, we set the example by what we do. ]

Thanks fo your support,



Hi Jerry @JerryD,

great idea, you may be interested by the codes twitted by @Beliavsky in 2022:

The codes are available here:

and here as an organized website:

There are also some code snippets here:

And in the Learn Fortran section:

1 Like

You may also be interested by @Carltoffel 's post:

1 Like

Thanks for this information. Found your message in my spam folder. Hopefully I have that fixed. This is useful.

1 Like

I have a simple code that performs a particle simulation here: 2021_FortranCon/particle_simulation.f90 at main · m3g/2021_FortranCon · GitHub

With periodic boundary conditions. It ends up producing this kind of animation, when visualized with vmd: Simple 2D particle simulation - YouTube

(there is a script in the same repository to visualize the trajectory generated with the Visual Molecular Dynamics (VMD) package).

This kind of animation of particles bouncing usually traps the attention of students. It is easy to adapt the code to perform simulations of planetary motion in a gravitational field (by removing the periodic boundary conditions).