This is an old revision of the document!
USE-statement should have an
ONLY:-clause, which lists the imported symbols [-Wuse-without-only].
OMP PARALLEL-region should declare
There are two measure of defense against spaghetti code:
PRIVATEand only few public symbols.
For many common operation there exist wrappers in CP2K to prevent usage errors and to allow for central redirections.
cp_files.Finstead of calling
fm-package instead of calling BLAS or Scalapack directly.
message_passing.Finstead of calling MPI directly.
machine.Fto access architecture depended things like e.g. the working directory.
iw=cp_logger_get_default_unit_nr();and write only if you actually received a unit:
IF(iw>0) WRITE (UNIT=iw, ,,,).
Every line of code has to be compiled and maintained. Hence, unused variables and code poses an unnecessary burden and should be removed. However, sometimes it is beneficial to keep debugging code around. Such code should be put into a
IF(debug_this_module)-block, with a parameter set to
.FALSE.. This way the code will stay up-to-date and easily callable.
.Ffile should contain either a
PROGRAMor a single
MODULE, whose name matches the filename.
INSTALL-file and added to the cp2k_flags function (cp2k_info.F).
make -j pretty.
SUBROUTINEshould be preceded by a valid doxygen block.
\param(for each parameter),
make doxifyto format your doxygen comments, or generate templates where none exist