How many times have you learned Fortran in your life?

It’s interesting to see that all generations are present in our community. It’s a great richness for sharing knowledge.

5 Likes

When I was studying at the Faculty of Chemistry, UNAM, I discovered Fortran 77, but I didn’t like it, I felt that it was very old, but in a book I discovered Fortran 90, and there I fell in love with the language and decided to learn it. I started with Chapman’s Fortran 90/95 book (Fortran 90/95 for Scientists and Engineers) and a Visual Studio 6.0, using Array Visualizer. It was great. Then I had to learn FORTRAN 77 for a job for a research institute. When I learned Java and C ++, I wanted to see the potentialities of Fortran with respect to OOP, I read "Object-oriented Programming via Fortran 90/95 "From Ed Akin. Then I got really excited about the capabilities of Fortran 2003 and started studying it, also with Chapman’s book, but the third edition. For now I have not studied Fortran 2008 and Fortran 2018, I hope have a time in the future. For now they go 3 times.

.

6 Likes

My first Fortran encounter was a course taken in 1977 or 1978 when I started my university education. So it must have been still F66. The final project was realized on a mainframe computer taking up whole story of a building. With punched cards as the source input. So I knew exactly what did the “fixed form” mean :wink: Some time around 1990 I started to teach F77 to the students of the very same department (astronomy) and have been doing so ever since (also C), gradually upgrading to F90/95 and further. The new standards I learned (well, still learning) by myself in a sort of continuous self-education.

Surely I do appreciate the modern Fortran features but I also value the F77 simplicity which made this language an ideal choice for teaching “programming” to people who had never programmed before (which was and still is the great majority of students starting the first year of the university). One could easily learn F77 in one semester (60 hours). With the modern versions this is hardly possible. And still, the vast library of astronomical software still in use is mostly F77.

1 Like

I wonder if Fortran 77 was so simple. You need to know for example about leading and physical dimensions of arrays when passing them to subroutines, and passing x(1) to a subroutine could mean either passing a scalar or effectively passing a pointer to an array. Fortran 90+ assumed shape arrays are simpler to teach and use.

Languages such as Matlab were created partly because many undergraduates were unproductive in FORTRAN IV or 77. A Fortran 95 subset such as F or ELF90 could probably be learned in the same time as F77. A book I liked was Essential Fortran 90 & 95 (1997) by Loren Meissner.

1 Like

Two times. First time was in high school, back in … it must have been 1988 or 1989, last year of high school. I liked they way the teacher taught us how to deal with vectors and matrices, but spent way too much time on formatted input and output without ever mentioning free format which was a deterrence for me and I started coding in C instead, soon to switch to C++.

But, in spite of my fluency with C/C++, upon joining Delft University of Technology in 1997, I was forced to go back to FORTRAN 77 because the lab head of the time wanted to understand every piece of code written in his lab and he only knew FORTRAN 77. In spite of frustration and disappointment, I had to do it if I wanted to keep the job. But I can’t say I learned FORTRAN for the second time, I simply started to code in it and that was it. I was more focused on MPI and parallelization because I was coding for a Cray T3E.

After completing my PhD in 2001, I left Delft, left FORTRAN too, changed a couple of jobs and was using C++ for most the projects I was involved in. And that’s how it was for almost two decades, until 2018 when a young Russian lad joined my lab in Switzerland (where I still work) because he was using the code I developed in Delft for his research, and thought I would help him to implement certain physical models. But then something unexpected happened. When we opened the old sources, when I saw the code I was writing almost two decades back, I became very emotional, it was like travelling back in time, nice memories from the Netherlands came rushing back, memories of my young wife (we divorced since) and my two baby daughters … it all came back and the old code became my obsession. I was helping the young Russian lad as much as I could, but was at the same time refactoring the code using the best of my capabilities, relying heavily on the book: “Object-Oriented Programming via Fortran 90/95” from Ed Akim. That was the second time I learned Fortran, and boy did I love it. On one hand I was modernizing something which I created almost two decades ago, but I also loved to see how Fortran developed, and my mind felt liberated from all the intricate complexities of C++. Fortran now had objects (which were still pseudo-objects in Akin’s book but I could see where it was going), but I didn’t have to think which headers to include, shall I make an STL class or not, shall I pass arguments by value or by reference (all is reference in Fortran but is hidden from you - great), shall I define member function as const or not, shall I use pointer (*) or reference (&), and yeah … never forget that although you have N entities in your container, they start from 0 and the last one is N-1. (I know there are workarounds, but it’s undeniable they require extra effort and add complexity).

I would be very cocky to claim that I know enough, the second step of learning Fortran is a continuous process to this day, and I hope for many years to come :slight_smile:

6 Likes

Nice story!

Concerning that point, you can find some interesting discussions here:
https://fortran-lang.discourse.group/t/some-basic-questions-on-fortran/825

Note also that the interoperability with C introduced the value statement to pass an argument by value. But it is not limited to calling C functions and can be used in other cases.
See for example: IBM Documentation

2 Likes

Thanks for this additional info. My point was, however, that I am actually happier with fewer options in a computing language, at least in this stage of my life and career. If I have constantly have to make choices in my brain: “by reference or by value?”, “pointer or reference”, “can this member function be declared const or not?”, “do I need to include mathc or stdlibc?” my mind is constantly being distracted and eventually need more time to solve a problem at hand. Put on top constant e-mail notifications, meeting reminders, messages you receive on your phone, I don’t need additional “clutter” from the programming language.

6 Likes