My Modern Fortran book is now published

Thank you @milancurcic to share those numbers. It is quite difficult to find such information. Interesting for people who could become authors.
Of course, in the scientific edition we don’t expect to become rich, and most author’s primary objective is probably not earning money, but it’s a reward for a huge time working on the book.
I have not yet commanded my copy, but sure I will :bookmark: ! I probably need to relearn Fortran one more time… (It could be a post: “How many times have your learned Fortran in your life?” :wink:)

2 Likes

If you start this topic, I will write my response there for sure. Some may find it interesting :slight_smile:

2 Likes

An electronic version of the Modern Fortran book, along with 12 other books, is now available for $12 (!) until about Feb 15 in the Humble Book Bundle: Math for Programmers by Manning Publications . Humble Bundle regularly offers collections of ebooks, from publishers such as O’Reilly, Manning, Apress, and Packt. I have bought from them before – they are legitimate.

4 Likes

Unfortunately I had a total unacceptable experience with Manning when I ‘bought’ this book (‘bought’ as in paid for, but got nothing in return). Will never deal with Manning again.

Having read about the book here on Fortran Discourse, I paid for an electronic version from Manning on 22 January this year. I was very much looking forward to it as I still actively develop in Fortran but have never been successful at getting parallel execution working in my programs (at least not without taking longer to run than the existing single threaded programs!).

But I have never received the (e)book. And now I discover it can be bought as part of a bundle at a fraction of the price I paid (US$38.39)!

At the time I paid for the book, I attempted to download the PDF version from the webpage that came up after the purchase. The attempted download was via Free Download Manager (FDM), as that is set up as default in my browser (Chrome). However, FDM reported an error and the download failed. I never got anything, not even a single byte of the DL. When FDM came up with the error message I pressed ‘Cancel’ and a standard browser save dialogue came up with some random .html link, which I again pressed ‘Cancel’.

I then went to the email confirmation and attempted to DL the PDF from the link in the email. All I got this time was a message saying I had already downloaded that version of the book and that I should choose one of the other options. Which is absurd - first because what on earth would it matter if I did download two pdf copies, and secondly I don’t own a Kindle (and have no intention of getting one), have no idea what EPUB is, and are not in the slightest interested in using this reference book in a browser link every time I need to look up something. The only version I have any interest in is the PDF copy and having paid for it I expect to get it.

I immediately reported the issue to support@manning.com (within about 30 mins of the purchase and attempted DL) but to date have received zero response from them. A couple of later attempts at the DL since then (including today) again brought up the 'You have already downloaded that format of your ebook" message. Not only no reply, but nothing done to fix the issue.

So now NZ$54.38 out of pocket (yes, the payment went through immediately) with nothing to show for it. Living in a foreign country seems little I can do about it. They have taken my money and delivered nothing. The only means of contact seems to be via their support email address, which they have simply not responded to. Totally unacceptable.

To add salt to the wound, over the next week they sent two advertising emails that I had not signed up to!

3 Likes

@DSNZ welcome to the Fortran Forum! Your experience is absolutely unacceptable and I am hoping Manning can quickly resolve it. @cc @milancurcic

Hi @DSNZ,
It looks like your experience is very unfortunate and unacceptable, and I guess it can happen in this kind of electronic transactions… Because I also bought the book some time ago, I’ve checked the e-mail from Manning, and it seems there are two options for downloading the PDF. The first option is to use one-time download links shown at the bottom of the e-mail from Manning, which looks like:

Modern Fortran (eBook: pdf + ePub + kindle + liveBook)
Access liveBook
Download PDF Kindle EPUB

I tried the above PDF link today, and it shows the following message (i.e., it is only available one-time and I cannot use it twice).

Sorry, but it appears that you have already downloaded that format of your eBook.

The token for the eBook you are downloading is either invalid or already used.
Each format of the eBook is downloadable one time through the Product Delivery email. You can still download your eBook as often as needed by signing into your account.

As suggested above, the second option (for downloading) seems to create an account on the Manning site. If you go to Login - Single Sign On | Manning Publications, you can enter your e-mail address + password, or “register a new account” (the link below the box). I think you need to use your e-mail address that was used when purchasing the book, and after log-in, you can reach a personal account page. Then the Dashboard section has the e-book download links (at the right-most corner of each book that you bought). I think this may work also for you, so maybe try creating an account…?

If the personal account does not work either, this support page may be useful:

Writing to Customer Support is usually the best way to reach us about a problem. However, from time to time customer emails fail to reach us. If you have contacted our support team and have not received a response within 1-2 business days, please send a message via one of our social media channels, or write to business@manning.com.

So, it looks like there can occur some problem for e-mails… (I guess this might possibly correspond to your case).

1 Like

Hi @DSNZ, I’m sorry that you’re having this issue. It’s unacceptable.

You should be able to download the book (any number of times and in all e-formats) through the Manning dashboard following the instructions by @septc.

If you still have issues downloading it, please email me at milancurcic@hey.com and I will connect you with people at Manning to resolve this quickly.

2 Likes

Many thanks for the replies and advice @certik, @septc, and @milancurcic. I at last have my copy via the dashboard after registering (appears I was registered when I bought the book but I had no record of that so had to reset the password etc). So far only a quick flip through the first half - looks very well setout. Well done Milan.

Still unhappy with Manning though - no response to my email to support, even after a month and a half, and secondly the restriction to a single download without logging in. I still see no reason why that restriction should apply if linking in via the email that was sent out.

I admit I missed the last sentence in the rejection message saying I could download again by logging in to my ‘account’. Perhaps because I did not realise I had an account with them. I do not recall ticking anything to set up an account and I have no record of a password for an account with them (normally reasonably meticulous at recording passwords when I do set up an account). But as far as possible I avoid setting up accounts for one-off or infrequent purchases (to avoid being overwhelmed by one-off accounts, etc). I certainly did not envisage regular purchases from them. To be honest, I had never heard of them previously (obviously new to Fortran Discourse, despite programming in Fortran for well over fifty years!)

2 Likes

I’m happy that you got your download and hope you enjoy the book.

Thank you, I will pass your feedback to the staff and ask them to improve. I agree that no response to support email is not good service.

I suspect that the single-download restriction is to prevent multiple people from downloading the book, in case the email gets forwarded around or posted publicly. Nevertheless, your experience shows that their delivery flow can greatly improve.

Please feel free to post any feedback or critique on the book itself in this thread.

1 Like

The book is being used as a reference – the author even holds it up at 1:02 – for a free video course Fortran: Crash Course on Modern Fortran.

The author starts by writing a function that I think should be a subroutine (it returns nothing and has non-error output), so perhaps he should have read Modern Fortran more carefully and heeded its advice on using functions vs. subroutines. But this is a quibble.

Statement for Q4 2020 (Oct 1 - Dec 31) just came. Here are the units sold in Q4 and to date, by channel:

Channel Q4 To date total
Domestic retail 356 356
International retail 260 260
Web (print+ebook) 68 468
Ebook 47 739
Total 731 1823

It warms my heart to see how many people bougth the book. :slight_smile: Thank you all!

11 Likes

Book review:
This book is a must have. If you are a beginner, you will be happy to be taken by the hand. You will learn not only modern Fortran basics, but also the physical modelling basics. If you have more than two Fortran decades behind you, you will be happy to learn the new features of the latest standards, and new good practices.
The book is written in a simple style but always precise, very well illustrated which is rare with programming books, with a very progressive difficulty. And contrarily to most programming books, it is always based on practical cases. The structure is quite audacious, as the introduction chapter rapidly introduces parallel programming with code examples using MPI and co-arrays, then you go back to an “hello world!” example in chapter 2! But as tsunami physics is introduced, you understand that you will never get bored with that book, the author alternating parts about Fortran, numerical methods, physics or mathematics. And even in the sections you master, it is always interesting to consider the pedagogical methods of the author.
The only reason to avoid that book would be that you already know every feature of modern Fortran (co-arrays, OOP…), and you are an expert in tsunami physics. But the probability you are Milan Curcic would be non-negligible :wink:.

Note also that if you buy the printed version, you can afterward download freely the PDF version on the editor website, using some codes hidden in the pages.

7 Likes

@milancurcic , reading the chapter 6, I have one question about use iso_fortran_env, only: input_unit, output_unit, error_unit, which I am discovering. Pages 148-149, you say that:

In the context of Fortran, standard streams matter when you want to read and write data in a portable manner. Using read * and print * is likely to access standard input and output but isn’t guaranteed by the Fortran standard.

But in the Fortran 2018 draft, I read:

16.10.2.22 OUTPUT_UNIT
1 The value of the default integer scalar constant OUTPUT_UNIT identifies the same processor-dependent external unit preconnected for sequential formatted output as the one identified by an asterisk in a WRITE statement (12.6.4.3). The value shall not be −1.

So I don’t understand what input_unit, output_unit, error_unit really brings in terms of portability.

2 Likes

I will need to buy this book! From the preview in the Manning website, it seems quite well written, simple, pedagogical, but also rigorous.

About the (very nice) MPI vs coarrays example, I wonder:

  • The mpi_barrier seems superfluous?
  • The non-blocking send/receive can be replaced by a blocking equivalent, skipping the mpi_wait and produce the same results?

I think that such differences would not change the message that coarrays are simpler than the equivalent minimal MPI implementation.

1 Like

Indeed, I don’t recall reading the relevant part of the standard, and I also don’t remember why and how I thought it was portable or guaranteed to be connected to standard streams. It does look like my statement about portability of these input and output units is a mistake.

Please point out all mistakes like this that you find. I’m collecting them to be addressed in a (hopefully) 2nd edition. And thank you for the wonderful review!

1 Like

It could be useful if we want something clearer than an asterisk, although that asterisk is so common in Fortran coding that I am not sure it is so useful.

But the error_unit brings something (at least I am personally not aware of any other way to achieve such writing).

Minor: I also personally do not like to wrap allocate or provide the stat argument, and I prefer to just let the compiler generate an error message at runtime by default. I don’t have a copy right now to check if it was left in the final version or not.

Major: The main conceptual issue I have is that I do not like to use the OOP for numerical codes, I very much prefer the Fortran 95 “pure” procedural style. I do not like overriding operators either. I do like some of the additions in Fortran 2003 (such as newunit and [] for arrays and intent(out), allocatable) and 2008 and 2018, such as do concurrent (although I haven’t actually used it yet too much in production).

Summary: I like using Fortran features directly, not create custom wrappers.

This works very well for smaller codes, or structured grid codes, electronic structure codes, etc. It gets tough for arbitrary mesh multiphysics codes, and I have plenty of experience with those too. I think Milan was creating a “proxy” for such codes. Still, my approach is to only introduce OOP features as needed, when the alternative is more complex in practice. I always start with procedural style.

I don’t have time right now, but I have been toying with the idea to create examples / tutorials on exactly this topic, and compare OOP style versus direct style side by side and discuss pros and cons of each, from my perspective. The basic tutorial that I helped write here: Fortran Best Practices — Fortran90 1.0 documentation does not go into this particular topic too much. I have seen the same issues with C++ codes, people often tend to over-complicate things with abstractions, when many times using simple “pure procedure” style is much simpler in practice. This is best discussed on particular examples, I have several that I encountered in practice. I will like to get to it eventually and write it up, perhaps as blog posts, then we can discuss it, and if people agree, we can create official tutorials, showing both OOP and procedural style approach on examples with pros and cons of each.

10 Likes

I program in Fortran 95 style too, but there are cases where operator overloading is useful. I have derived types for (month,year), (day,month,year), (hour,minute,second) etc. You often want to compare dates and times, and overloading > and other operators makes it easier to write and understand such code. I have Fortran data frame types, with matrices attached to column and row labels, similar but more restricted than the data frame of R or Python pandas. Defining arithmetic operators for such data frames makes it possible to use them as matrices, as is done in R and Python.

2 Likes

You may be right about the barrier, I’ll look later why that is there. It’s possible that it only serves to order the before and after printouts. Regarding the non-blocking send/receive, the coarray operations are non-blocking in general so I thought it’d be a fair comparison to use the non-blocking MPI calls.

1 Like

Thanks @certik. From my understanding of your post, this is a style preference, not an actual issue with the book, correct?

Regarding style, I agree. You know that I’m all about pure functions. But it’s impossible to cover broader topics and have all chapters in the book fit everybody’s style. If I wrote a book that fit only my or your narrow style, it wouldn’t be useful for many people. So it’s a balance between presenting a coherent view and style and capturing the broadest audience possible.

A key point of the book is to show how to write parallel solvers that a) look like math, and b) have exactly the same code in parallel and serial forms. To illustrate:

du = u * diff(u) / diff(x) * dt

where operators are parallel and the assignment does the appropriate syncing and halo exchange. You can’t do this with procedural style.

You got it, exactly right. :slight_smile:

Yes, this is still in, but I put several “warnings” about abstractions that you asked for.

Can you post this review on Amazon? I think it would help people decide whether the book is for them or not.