10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-18 12:03:57 +01:00
quantum_package/src
2016-06-17 12:42:59 +02:00
..
AO_Basis Merge pull request #38 from scemama/master 2016-03-07 20:33:50 +01:00
Bitmask Distributed PT2 2016-02-19 00:20:28 +01:00
Determinants Merge branch 'master' into develop 2016-06-16 00:14:14 +02:00
Electrons Added target_pt2_qmc 2015-10-19 17:28:08 +02:00
Ezfio_files Downgraded ZeroMQ to 4.0.7 2015-12-04 20:02:35 +01:00
Integrals_Bielec mmap seems OK 2016-06-16 12:47:08 +02:00
Integrals_Monoelec Accelerated pot_mo_ints.irp.f 2016-06-17 12:42:59 +02:00
MO_Basis Added swap_mos program 2016-04-04 12:43:50 +02:00
MOGuess added the mulliken and hyperfine coupling constants analysis 2016-02-16 18:32:53 +01:00
Nuclei Added target_pt2_qmc 2015-10-19 17:28:08 +02:00
Pseudo Some modif for the interface with qmcpack 2016-01-14 15:18:31 +01:00
Utils Forgot files 2016-06-16 12:52:39 +02:00
ZMQ Upgraded ZeroMQ 2016-06-06 10:56:28 +02:00
.gitignore Beter error handler 2015-07-16 12:15:07 +02:00
README.rst QPACKAGE_ROOT => QP_ROOT =D 2015-06-08 14:49:10 +02:00

======================
Programming guidelines
======================

Each module (directory) contains the following:

* A ``README.rst`` file to document the current module.
* An ``ASSUMPTIONS.rst`` file. This file should document all the implicit
  assumptions used in the module. For example, if the atomic orbitals are
  assumed to be normalized, this should be mentioned in the
  ``AOs/ASSUMPTIONS.rst`` file.
* A ``NEEDED_MODULES`` file which contains the list of modules on which the
  current module depends
* A set of ``.irp.f`` files containing provider, subroutines and functions
* A ``Makefile`` that should compile
* Optionally some ``*.ezfio_config`` configuration files for the EZFIO
  library

A new module may be created by invoking the ``create_module.sh`` script.

Every subroutine, function or provider should be documented using the
BEGIN_DOC ... END_DOC block. The documentation should be written in
ReStructured Text format to enable the automatic generation of the Sphinx
documentation.

When the current module depends on other modules, the list of modules should
be added in the ``NEEDED_MODULES`` file.


Creating a new module
=====================

Every new module should be created using the interactive ``create_module.sh``
script located in the ``${QP_ROOT}/scripts`` directory. This will create
all the required files with correct templates.


Makefiles
=========

Use the structure of Makefiles provided by the ``create_module.sh`` script. If
you need to re-create the Makefile, you can use the ``create_Makefile.sh``
script in the current module directory.

If you need to add some Fortran or C files that should not be tracked by IRPF90,
you have to add them manually to the Makefile in the ``SRC`` variable.
You also need to add the corresponding ``*.o`` file prefixed by ``IRPF90_temp/``.
For example

.. code-block:: Makefile

  SRC=map_module.f90
  OBJ=IRPF90_temp/map_module.o



Input data
==========

Every program is supposed to use an EZFIO database containing all the
persistent data. This database can be modified in using the generated Fortran
functions or the generated Python module.

The definition of the data needed by the module should be put in the
``*.ezfio_config`` file.

Input data can also be read from the standard input to enable the use of
a program with a pipe, but the read statements should be present **only** in
the main program.


Output data
===========

Print to stdout statements should only appear in programs, not in providers,
subroutines or functions. This enables the possibility easily use the programs
with pipes.

To print, you should write in an output file provided by the ``Output``
module. Every module has its own output file. Before printing something,
a timestamp should be put in the output with the ``write_time`` function.
This allows an external script to read all the pieces of the output files
and put them in a sequential order. The format of the output should be
in ReStructured Text for easy transformation of the output data to pdf,
HTML, man, etc.


Creating a shell script
=======================

Shell scripts should be located in the ``${QP_ROOT}/scripts`` directory.
Relative paths should be avoided as much as possible, and the result of commands
should be always checked. For example, when creating a directory the existence
of the directory has to be checked.


Documentation
=============

.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.



Needed Modules
==============

.. Do not edit this section. It was auto-generated from the
.. NEEDED_MODULES file.

* `Utils <http://github.com/LCPQ/quantum_package/tree/master/src/Utils>`_