constants Module

A module which defines a variety of constants, for example, mathematical constants like pi, dimensions of arrays whose sizes are set at compile time, and kind parameters.

This module must not be compiled with a padding option such as -qautodbl=dbl of xlf which makes type conversion of variables even with explicit kind statements.



Contents


Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: run_name_size = 2000

Defines the length of character string used to store all file names that are based on the run_name prefix.

integer, private, parameter :: kind_i1 = int8

Symbolic names for kind type of single and double-precision reals: (with at least 6 and 12 digits of accuracy)

integer, private, parameter :: kind_ih = int16
integer, public, parameter :: kind_is = int32
integer, public, parameter :: kind_id = int64
integer, public, parameter :: kind_rs = real32
integer, public, parameter :: kind_rd = real64
integer, public, parameter :: kind_rq = real128
integer, public, parameter :: sp = real32

Single precision real kind. Needed for gryffin99, a fork of the Hammett, Beer & Dorland code from 1999

integer, public, parameter :: dp = real64

Double precision real kind. Needed for gryffin99, a fork of the Hammett, Beer & Dorland code from 1999

integer, public, parameter :: spc = kind((1.0_sp, 1.0_sp))

Single precision complex kind. Needed for gryffin99, a fork of the Hammett, Beer & Dorland code from 1999

integer, public, parameter :: dpc = kind((1.0_dp, 1.0_dp))

Double precision complex kind. Needed for gryffin99, a fork of the Hammett, Beer & Dorland code from 1999

complex(kind=dp), public, parameter :: ii = (0._dp, 1._dp)

Square root of -1. Needed for gryffin99, a fork of the Hammett, Beer & Dorland code from 1999

complex, public, parameter :: zi = (0.0, 1.0)

Square root of -1.

complex(kind=kind(1.d0)), public, parameter :: dzi = (0.d0, 1.d0)
double precision, public, parameter :: dpi = 3.14159265358979323846264338327950288419716939938

Pi to quad precision, (double if DBLE is unset)

double precision, public, parameter :: dtwopi = 2.*dpi

2*Pi to quad precision, (double if DBLE is unset)

double precision, public, parameter :: dsqrt_pi = sqrt(dpi)

Sqrt(pi) in double or quad precision depending on DBLE

double precision, public, parameter :: dsqrt_twopi = sqrt(dtwopi)

Sqrt(2 * pi) in double or quad precision depending on DBLE

real, public, parameter :: pi = dpi

Pi to double precision, (single if DBLE is unset)

real, public, parameter :: twopi = dtwopi

2*Pi to double precision, (single if DBLE is unset)

real, public, parameter :: sqrt_pi = dsqrt_pi

Sqrt(pi) in single or double precision depending on DBLE

real, public, parameter :: sqrt_twopi = dsqrt_twopi

Sqrt(2 * pi) in single or double precision depending on DBLE


Interfaces

public interface size_of

Returns the number of bytes of storage required by its argument. Equivalent to c_sizeof from iso_c_binding

  • private elemental function size_of_i1(arg)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=kind_i1), intent(in) :: arg

    Return Value integer

  • private elemental function size_of_ih(arg)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=kind_ih), intent(in) :: arg

    Return Value integer

  • private elemental function size_of_is(arg)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=kind_is), intent(in) :: arg

    Return Value integer

  • private elemental function size_of_id(arg)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=kind_id), intent(in) :: arg

    Return Value integer

  • private elemental function size_of_rs(arg)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=kind_rs), intent(in) :: arg

    Return Value integer

  • private elemental function size_of_rd(arg)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=kind_rd), intent(in) :: arg

    Return Value integer

  • private elemental function size_of_cs(arg)

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=kind_rs), intent(in) :: arg

    Return Value integer

  • private elemental function size_of_cd(arg)

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=kind_rd), intent(in) :: arg

    Return Value integer

  • private elemental function size_of_rq(arg)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=kind_rq), intent(in) :: arg

    Return Value integer

  • private elemental function size_of_cq(arg)

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=kind_rq), intent(in) :: arg

    Return Value integer


Functions

private elemental function size_of_i1(arg)

Arguments

Type IntentOptional Attributes Name
integer(kind=kind_i1), intent(in) :: arg

Return Value integer

private elemental function size_of_ih(arg)

Arguments

Type IntentOptional Attributes Name
integer(kind=kind_ih), intent(in) :: arg

Return Value integer

private elemental function size_of_is(arg)

Arguments

Type IntentOptional Attributes Name
integer(kind=kind_is), intent(in) :: arg

Return Value integer

private elemental function size_of_id(arg)

Arguments

Type IntentOptional Attributes Name
integer(kind=kind_id), intent(in) :: arg

Return Value integer

private elemental function size_of_rs(arg)

Arguments

Type IntentOptional Attributes Name
real(kind=kind_rs), intent(in) :: arg

Return Value integer

private elemental function size_of_rd(arg)

Arguments

Type IntentOptional Attributes Name
real(kind=kind_rd), intent(in) :: arg

Return Value integer

private elemental function size_of_rq(arg)

Arguments

Type IntentOptional Attributes Name
real(kind=kind_rq), intent(in) :: arg

Return Value integer

private elemental function size_of_cs(arg)

Arguments

Type IntentOptional Attributes Name
complex(kind=kind_rs), intent(in) :: arg

Return Value integer

private elemental function size_of_cd(arg)

Arguments

Type IntentOptional Attributes Name
complex(kind=kind_rd), intent(in) :: arg

Return Value integer

private elemental function size_of_cq(arg)

Arguments

Type IntentOptional Attributes Name
complex(kind=kind_rq), intent(in) :: arg

Return Value integer