Coding standards

In all contributions to the code, please follow the spirit of these guidelines as much as possible, and try to rectify violations you come across. If you think there is a good reason to have an exception to these rules in some specific part of the code, please discuss it with the other developers first.

Guidelines for Committing

Special Octopus infrastructure

When you add new input variables, be sure to write a variable description.

General form:


    !%Variable NAME
    !%Type TYPE
    !%Default VALUE
    !%Section SECTION[::SUBSECTION]
    !%Description
    !% DESCRIPTION TEXT
    !%Option OPTION_NAME [OPTION_VALUE]
    !% OPTION_DESCRIPTION
    !%Option OPTION_NAME2 [OPTION_VALUE2]
    !% OPTION_DESCRIPTION2
    !%End

Example, with following call to parser:


    !%Variable ExcessCharge
    !%Type float
    !%Default 0.0
    !%Section States
    !%Description
    !% The net charge of the system. A negative value means that we are adding
    !% electrons, while a positive value means we are taking electrons
    !% from the system.
    !%End
    call parse_variable('ExcessCharge', M_ZERO, excess_charge)

‘‘Unless otherwise specified, the rules below apply to Fortran source. Some can be applied to C source as well.’’

Required Elements

Program Structure

Names

Data Structures

Declarations

Modules

Data types

Output

Comments

Required Macros and Routines

Forbidden

Portability

Performance

Scripts

C code

C++ code

Makefiles

Other

Editor Configuration

To configure your editor to use our indentation convention:

References