Chapters 2, 3, and 4 of Modern Fortran are now free

Manning has published chapters 2, 3, and 4 of my Modern Fortran book as a free 92-page ebook:

Check it out to find out if you’d like my book before purchasing it. It covers the basics: Writing simple Fortran programs, procedures, and modules, and putting them together.

6 Likes

Thank you for that book. It seems very clear, progressive and pleasant to read. I like the figures and the way code is presented. At first look, I am sure it is interesting both for beginners and senior programmers: everyone should learn something by reading it.

If I have understood, the full book is not yet published ? (https://www.manning.com/books/modern-fortran)

1 Like

Thank you, Vincent, I’m happy that you find it clear!

The book is finished and has entered production in February. Last time I looked the print was scheduled for July, but now I see that’s pushed back to Fall. However it’s available for purchase now and you’d get the ebook version immediately and the print version once it’s out.

1 Like

Milan, congratulations on the book. I just finished it and found it pleasant to read and very clear, while also not burying the reader in needless details. I learned a bunch as well, as I’m not very experienced in parallel applications.

Cheers!

2 Likes

Thank you so much, Melissa! I’m really happy that you enjoyed it. :blush:

1 Like

Milan, I like your writing style from these chapters. I’m looking forward to the book’s publication. I did see a technical error, though. In the section introducing integers, you write:

Exceeding the permissible range of a variable results in an overflow. In that event, the value of the variable is set to infinity of either sign, -Inf or +Inf.

Unless gfortran has a feature I am not aware of (and a cursory web search says it doesn’t), integers don’t have infinities - typically if you overflow an integer, you get the low-order bits of the result, unless the compiler supports integer overflow checking and that is enabled, in which case you get a run-time error.

This statement would generally be true of reals, assuming IEEE floating point (not universal). One must take care not to conflate features of a specific implementation or platform with that of the language.

4 Likes

Steve, thanks a lot for catching and reporting this. I will fix it and clarify.

I bet there are quite a few more errors like this. If you happen to notice them, please report back. The book is in production but I still have the opportunity to correct errors. This forum is a good place to report them–it’s helpful for other readers to be aware of them as well.

Once the book is out in print in the Fall, I’ll start an Errata repository at https://github.com/modern-fortran to keep track of errors to be fixed in the 2nd edition.

1 Like

I am new to Fortran and recently read some chapters in this book. I found it extremely helpful. The writing style is very clear. The explanation is very pleasant too. Looking forward to buying this book.

1 Like

I think the discussion regarding compilation order and dependencies is very good. In otherwords, compile modules using, for example, ‘gfotran -c’ first and then linking. I think it would be vety helpful to expand on this further regarding situations where large numbers of modules are involved. It is possible to place module fies in separate directories, similar to a library. Unfortuenately it is not well standardized where *.mod files should be placed or maintained. It would be good if the community could elaborate to beginners what would be considered best practices in organizing .mod files.

1 Like

Thank you, both, and welcome @Shahid. I appreciate everybody’s feedback and it definitely made the book better. It’s off to the print so I won’t be making any further changes, but please keep the feedback coming–especially what’s confusing, poorly explained, or just wrong–and I will be incorporating it for the 2nd edition.

1 Like