Skip to content

FLUE_constants ​

Module FLUE_constants Numerical constants and precision definitions for the FLUE codebase.

Purpose: This module provides a centralised and portable definition of working precisions and commonly used mathematical constants using ISO_C_BINDING.

Design:

  • WP defines the working real precision (double precision).
  • WC defines the corresponding complex precision.
  • SP provides single precision support where needed.

Mathematical constants:

  • PI is defined via acos(-1) for portability.
  • TWO_PI is provided to avoid repeated computation and magic numbers.

Example:

 use FLUE_constants, only: WP, PI
 real(kind=WP) :: theta
 theta = 2.0_WP * PI

Source: src/constants.f90

Dependencies

Variables ​

NameTypeAttributesDescription
WPintegerparameterWorking precision for real-valued computations [double precision]
WCintegerparameterWorking precision for complex-valued computations [double precision complex].
PIreal(kind=WP)parameterCircular constant π ~ 3.14.....
TWO_PIreal(kind=WP)parameter2π.
SPintegerparameterSingle precision kind