What flags do you set for your GFORTRAN debugger/compiler to catch faulty code?

Bare minimum -Og/-O0 -O0 basically tells the compiler to make no optimisations. Optimiser can remove some local variables, merge some code blocks, etc. and as an outcome it can make debugging unpredictable. The price for -O0 option is very slow code execution, but starting from version 4.8 GCC compilers (including the Fortran one) accept a … 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 90 kind parameter

The KIND of a variable is an integer label which tells the compiler which of its supported kinds it should use. Beware that although it is common for the KIND parameter to be the same as the number of bytes stored in a variable of that KIND, it is not required by the Fortran standard. … Read more

Packaging legacy Fortran in Python. Is it OK to use setuptools and numpy.distutils?

This seems to work but I have questions. Is it generally good practice to mix setuptools and numpy.distribute? Does the order I import them matter? Should I always import setuptools first? Is there an official up-to-date tutorial for packaging extensions to numpy? Perhaps even one with some discussion Fortran extensions? You should not need to … Read more

Purpose of LDA argument in BLAS dgemm?

The LDA parameter in BLAS is effectively the stride of the matrix as it is laid out in linear memory. It is perfectly valid to have an LDA value which is larger than the leading dimension of the matrix which is being operated on. Typical cases where it is either useful or necessary to use … Read more

Best Fortran IDE [closed]

What about these ones: Photran – An Integrated Development Environment and Refactoring Tool for Fortran (this one is everything you need :D) Oracle Solaris Studio Advanced C, C++ and Fortran development platform