Neko
0.8.1
A portable framework for high-order spectral element flow simulations
|
Fortran code should conform to the Fortran 2008 standard and should use an indentation level of 2, except for the extra indentation within do
if
, select
or where
statements and for each level inside a structure e.g. type
, interface
, where the indentation level is 3, and a 0 indentation is used for module
or contains
(except for contains
inside a derived type, where a single indentation level is used).
These are the default rules in Emacs' Fortran mode, an example is given below,
Please note that the maximum line length in Neko should not exceed 80 columns.
Additionally the findent tool can be used to enforce these rules by assigning the following options. The documentation of findent
provide details for emacs, vim and gedit. For VSCode, the Modern Fortran extension provide an integration.
For portability reasons, it is essential to only use data type kinds defined in num_types.f90 and avoid legacy constructs like real*8
or integer(kind=8)
Floating-point numbers should be declared using real
with the kind rp
, which is the configured working precision for Neko (defaults to double). If single, double or quad precision is explicitly needed, use the kinds sp
, dp
or qp
, respectively. For 16, 32, or 64-bit integers, Neko has defined the kinds i2
, i4
or i8
, respectively; however, for standard integers, it is perfectly fine to use a plain integer
.