Changes between Version 1 and Version 2 of doc/tec/developerrules/palmstandard


Ignore:
Timestamp:
Oct 15, 2018 6:02:57 PM (6 years ago)
Author:
kanani
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • doc/tec/developerrules/palmstandard

    v1 v2  
    44'''Why to follow some standards?''' - Because everyone has her/his own programming style, sort of a dialect. And as it is, no one can understand all the possible dialects. So what do we do? We learn and apply the coding standard to make PALM more easily readable for all current and future developers. Let's all work on that - together.
    55
    6 == Formatting ==
     6== Indenting ==
     7'''General module structure'''
     8* 1 blank before MODULE, CONTAINS, SUBROUTINE (= first indention level)
     9* +3 blanks for all following indention levels \\('''only exception:''' ONLY list in USE statements +4 blanks)
     10* 1 blank between individual strings
     11* 1 blank after ","
     12* 1 blank before "::"
     13* 2 blanks after ":"
     14{{{
     15 MODULE new_module_mod
    716
     17    USE arrays_3d,                                                        &
     18        ONLY:  tend, u, v, w, zu, zw
     19
     20    IMPLICIT NONE
     21
     22    CHARACTER ::  global_string_a
     23
     24    SAVE
     25
     26    PRIVATE
     27
     28    PUBLIC global_string_a
     29
     30    INTERFACE newmod_3d_data_averaging
     31       MODULE PROCEDURE newmod_3d_data_averaging
     32    END INTERFACE newmod_3d_data_averaging
     33
     34 CONTAINS
     35
     36 SUBROUTINE newmod_3d_data_averaging( mode, variable )
     37
     38    USE control_parameters
     39
     40 END SUBROUTINE newmod_3d_data_averaging
     41
     42 END MODULE new_module_mod
     43}}}
     44
     45== Sorting ==
     46except for CALLs to modules/subroutines
     47
     48== Commenting ==
    849
    950== Naming conventions ==
     
    1152
    1253== New modules ==
    13 === File header ====
    14 Files always start with a doxygen-readable comment line including the FORTRAN file name.\\
    15 This is followed by the license section. If your code originates from another model, please clarify the license and permissions for this code to enter the PALM model system. It might be necessary in that case to add some more information to this header.\\
    16 The revisions section will later include short notes of the changes applied to a specific svn revision of this file. The {{{$Id$}}} string is required so that svn knows to generate the respective time stamp for a revision (see existing SOURCE files).\\
    17 Finally, involved authors are included, followed by a description of the purpose and functions of the module. If necessary, TODOs, notes and known bugs can be added. The "!>" indicate doxygen-readable comment lines, the "@" marks doxygen variables.
     54'''File header'''
     55* Files always start with a doxygen-readable comment line including the FORTRAN file name.
     56* This is followed by the license section. If your code originates from another model, please clarify the license and permissions for this code to enter the PALM model system. It might be necessary in that case to add some more information to this header.
     57* The revisions section will later include short notes of the changes applied to a specific svn revision of this file. The {{{$Id$}}} string is required so that svn knows to generate the respective time stamp for a revision (see existing SOURCE files).
     58* Finally, involved authors are included, followed by a description of the purpose and functions of the module. If necessary, TODOs, notes and known bugs can be added. The "!>" indicate doxygen-readable comment lines, the "@" marks doxygen variables.
    1859{{{
    1960!> @file new_module_mod.f90