What is an undefined reference/unresolved external symbol error and how do I fix it in Fortran?

A link-time error like these messages can be for many of the same reasons as for more general uses of the linker, rather than just having compiled a Fortran program. Some of these are covered in the linked question about C++ linking and in another answer here: failing to specify the library, or providing them … Read more

Convert integers to strings to create output filenames at run time

you can write to a unit, but you can also write to a string program foo character(len=1024) :: filename write (filename, “(A5,I2)”) “hello”, 10 print *, trim(filename) end program Please note (this is the second trick I was talking about) that you can also build a format string programmatically. program foo character(len=1024) :: filename character(len=1024) … 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