# Doctor Fortran in "It Takes All KINDs" - Doctor Fortran

submited by
Style Pass
2022-07-02 08:00:10

So this is retirement? As I noted earlier, I may no longer be working for Intel, but I do intend to stay active in the Fortran and Intel development communities. While I am back in the forum answering questions, it is liberating knowing that I am not responsible for making sure every question (and bug report) gets answered. I recently learned a wonderfully appropriate Polish saying “Nie mój cyrk, nie moje małpy”, which translates literally to “Not my circus, not my monkey”, or more colloquially, “not my problem”. I plan to apply this a lot.

As has often been the case in Doctor Fortran posts, I get the ideas for these by seeing what sorts of problems and questions often arise about Fortran. Recently there was an extended thread in the comp.lang.fortran newsgroup about Fortran KIND values, started by someone learning Fortran who had a basic misunderstanding of how they worked. Most of the advice in the thread was good, but there were some folk who, while very knowledgeable and whose expertise I admire, offered a suggestion I thought flat-out wrong. Thus begat this post. But first, some history is needed.

In the beginning, there was FORTRAN – FORmula TRANslator for the IBM 704. The original FORTRAN, as well as its successor FORTRAN II, was almost entirely lacking in the ability to specify what kind of numbers you were calculating with. The 704 had “fixed point” registers, which we know as integers, and “floating point” registers (reals). Just one size of each. The early FORTRAN language didn’t even have a way to explicitly declare whether a variable (or in the case of FORTRAN II, a function) was real or integer – that was indicated by the choice of first letter of the variable’s name. Yes, this is where the implicit typing rule for “letters I through N being integer, everything else being real” came from. (FORTRAN II also applied a meaning to the last letter of a name being F (made it a function) or the first letter being X (made the function be integer).)