Confusing double precision real in Fortran

Personally I now write use, intrinsic :: iso_fortran_env which includes parameters such as int32,real64 which have the obvious meanings, and can be used like this: real(real64) :: a_64_bit_real_scalar Note that kind=8 is not guaranteed, by the standard, to deliver an 8-byte kind. The values that kind parameters take are not standardised and do vary from … Read more

Fortran SAVE statement

In principal when a module goes out-of-scope, the variables of that module become undefined — unless they are declared with the SAVE attribute, or a SAVE statement is used. “Undefined” means that you are not allowed to rely on the variable having the previous value if you again use the module — it might have … Read more

Fortran intent(inout) versus omitting intent

According to The Fortran 2003 Handbook by Adams, et al., there is one difference between an intent(inout) argument and argument without specified intent. The actual argument (i.e., in the caller) in the intent(inout) case must always be definable. If the intent is not specified, the argument must be definable if execution of the subroutine attempts … Read more