2.10.6. Debug printout

Diagnostic print messages are typically controlled by a local verbose parameter, similar to:

if (verbose > 0) then
  write (stdlog,'(....)') &
    'some_t%init: clock,id,..=', wallclock(), self%id, ...
  if (verbose > 1) then
    ...
  end if
end if

As illustrated above, such debug output should be labelled with the data type and procedure name, and with the variable names (w/o spaces to make Python processing easier).

Because many such code blocks can be detrimental to code readability the use of permanent diagnostics should be kept at a minimum, in favor of using debuggers (such as gdb inside VScode), or adding ad hoc statements of the type (fully left-adjusted, to stand out):

WRITE (stderr,*) wallclock(), mpi%rank, omp%thread, 'message', task%id

specifically tracing some action through various pieces of the code, to be removed after filling their function. The lines should be removed in a dedicated commit, so they are recoverable via a simple git revert, w/o introducing other changes.