Fortran is missing in The Algorithms


Actually there is book named:
“Algorithms and data structures in F and Fortran”
by Robin.A.Vowels.
It has
Linked Lists and Trees
Directed graphs
Text processing

All written in Fortran 90/95.

What is F?

According to the book:

F is a subset of Fortran that supports the modern features of Fortran 90/95, but which omits the old, error prone features of the earlier versions. Thus the programs in this book will run with an F compiler (from Imagine1), as well as compiler supporting the entire Fortran 90/95 language.

1 Like

I found this page about F: F in Fortran Wiki

Is F still evolving following the recent standards of Fortran? I find the idea of F very interesting, but g95 seems to be the only compiler that supports it with an option of std=F, and g95 is not maintained anymore.

1 Like

I don’t think it caught on.

The idea itself I think is a good one, however I think it has to be implemented in a modern compiler that understands all of Fortran (both modern and legacy), but in addition it can optionally restrict your code to a subset with errors or warnings. That way if you happen to not use a subset, you can still compile your code. I assume that was the idea even with F, if it was part of the g95 compiler. For LFortran, we are planning to have such a mode: Create pedantic/strict mode (#450) · Issues · lfortran / lfortran · GitLab

1 Like

No. The primary person behind F, Walt Brainerd (author, standards committee member, and creator of passed away. Some people, including me, did use F and ELF90 to transition from FORTRAN to (what was then) modern Fortran. There were some discussions in comp.lang.fortran of why the Fortran subsets did not catch on. The problem is that while everyone would agree that Fortran 95 or Fortran 2018 is bigger than it would be if it were designed today, you cannot get a consensus of what should be allowed. For example, although I liked the idea of F, I think you had to use the DIMENSION statement and provide all specifier names, so that what I prefer,

real :: x(n1), y(n1,n2)
write (*,*) x

must be written in F as

real, dimension(n1) :: x
real, dimension(n1,n2) :: y
write (unit=*,fmt=*) x

There has been discussion here of creating a subset through FPM defaults.