Description
It would be a really big time-saver for someone encountering these codes for the first time if every code is written as a test that reports success or failure so that a newcomer doesn't have to digest the entire algorithm and then read verbose output to determine whether a particular run succeeded or failed. End each program with something along the lines of
block
logical, parameter :: testing=.true.
if (testing) call verify(calculation_result) ! error terminate if the calculation failed
print *, "Poisson test passed."
end block
where making testing
a compile-time constant allows an optimizing compiler to completely eliminate the verification code during a dead-code removal phase when you want to do runs to measure performance. You could use a preprocessor macro to switch the value to false when so desired.
Even better would be to adopt a unit-testing framework that automates the execution of all the tests. I recommend Vegetables.