User Tools

Site Tools


conv

This is an old revision of the document!


Coding Convention Messages

c001

⚠️ Found ${statement} with unchecked STAT in “${proc}”

c002

⚠️ Module “${mod}” USEd without ONLY clause or not PRIVATE

c003

⚠️ Symbol “${var}” in procedure “${proc}” is IMPLICIT-SAVE

✅ Please either move the variable initialization to the routine body or add an explicit SAVE attribute.

In Fortran, assigning a variable at declaration implicitly adds the SAVE attribute. As an unexpected consequence the variable gets persevered across subroutine invocations. In the C programming language these are called static variables.

c004

⚠️ Symbol “${var}” in procedure “${proc}” is IMPLICIT-TYPE

c005

⚠️ Symbol “${var}” in procedure “${proc}” is THREADPRIVATE

c006

⚠️ OMP PARALLEL without DEFAULT(NONE) found in “${proc}”

c007

⚠️ Found CALL with NULL() as argument in procedure “${proc}”

c012

⚠️ Found WRITE statement with hardcoded unit in “${proc}”

c013

⚠️ Found DEALLOCATE with STAT argument in “${proc}”

c014

⚠️ Found FLOAT in “${proc}”

c015

⚠️ Found lossy conversion ${m.group(1)} without KIND argument in “${proc}”

c016

⚠️ Found type ${derived_type} without initializer

✅ Please add default initialization to every derived type, for example like this:

TYPE foo_type
   INTEGER                             :: my_int     = -1
   REAL(dp)                            :: my_real    = 0.0_dp
   LOGICAL                             :: my_logical = .FALSE.
   CHARACTER(LEN=42)                   :: my_string  = ""
   TYPE(bar_type)                      :: my_nested  = bar_type()
   REAL(dp), DIMENSION(3,3)            :: my_array   = 0.0_dp
   REAL(dp), DIMENSION(:), POINTER     :: my_pointer => NULL()
   REAL(dp), DIMENSION(:), ALLOCATABLE :: my_alloc  ! Automatically initialized
END TYPE foo_type
 
TYPE bar_type
   INTEGER                             :: my_int     = -1
END TYPE bar_type

c101

⚠️ Found CALL cp_fm_gemm in procedure “${proc}”

✅ Please don't call cp_fm_gemm directly, but instead use parallel_gemm from src/parallel_gemm_api.F. It allows for switching between different implementation - in particular ScaLAPACK and COSMA.

c102

⚠️ Found CALL m_abort in procedure “${proc}”

✅ Please don't call m_abort directly, but instead use the error handling macro CPABORT(“message”).

c103

⚠️ Found CALL mp_abort in procedure “${proc}”

✅ Please don't call mp_abort directly, but instead use the error handling macro CPABORT(“message”).

c104

⚠️ Found CALL RANDOM_NUMBER in procedure “${proc}”

✅ Please don't call RANDOM_NUMBER, but instead use src/common/parallel_rng_types.F.

c105

⚠️ Found CALL RANDOM_SEED in procedure “${proc}”

✅ Please don't call RANDOM_SEED, but instead use src/common/parallel_rng_types.F.

c201

⚠️ Found GOTO statement in procedure “${proc}”

✅ Please don't use the GOTO statement because it's harmful and dangerous.

c202

⚠️ Found FORALL statement in procedure “${proc}”

✅ Please don't use the FORALL statement because it's deprecated since Fortran 2018.

c203

⚠️ Found OPEN statement in procedure “${proc}”

✅ Please don't call OPEN directly, but instead use the wrappers from src/common/cp_files.F.

c204

⚠️ Found CLOSE statement in procedure “${proc}”

✅ Please don't call CLOSE directly, but instead use the wrappers from src/common/cp_files.F.

c205

⚠️ Found STOP statement in procedure “${proc}”

✅ Please don't call STOP directly, but instead use the error handling macro CPABORT(“message”).

conv.1677261905.txt.gz · Last modified: 2023/02/24 18:05 by oschuett