Intrinsic Procedures
********************

This portion of the document is incomplete and undergoing massive expansion and editing.  All contributions and corrections are strongly encouraged.

Introduction to intrinsic procedures
====================================

Gfortran provides a rich set of intrinsic procedures that includes all the intrinsic procedures required by the Fortran 95 standard, a set of intrinsic procedures for backwards compatibility with Gnu Fortran 77 (i.e., g77), and a small selection of intrinsic procedures from the Fortran 2003 standard.  Any description here, which conflicts with a description in either the Fortran 95 standard or the Fortran 2003 standard, is unintentional and the standard(s) should be considered authoritative.

The enumeration of the KIND type parameter is processor defined in the Fortran 95 standard.  Gfortran defines the default integer type and default real type by INTEGER(KIND=4) and REAL(KIND=4), respectively.  The standard mandates that both data types shall have another kind, which have more precision.  On typical target architectures supports by gfortran, this kind type parameter is KIND=8. Hence, REAL(KIND=8) and DOUBLE PRECISION are equivalent. In the description of generic intrinsic procedures, the kind type parameter will be specified by KIND=*, and in the description of specific names for an intrinsic procedure the kind type parameter will be explicitly given (e.g., REAL(KIND=4) or REAL(KIND=8)).  Finally, for brevity the optional KIND= syntax will be omitted.

Many of the intrinsics procedures take one or more optional arguments. This document follows the convention used in the Fortran 95 standard, and denotes such arguments by square brackets.

Gfortran offers the -std=f95 and -std=gnu options, which can be used to restrict the set of intrinsic procedures to a given standard.  By default, gfortran sets the -std=gnu option, and so all intrinsic procedures describe here are accepted.  There is one caveat.  For a select group of intrinsic procedures, g77 implemented both a function and a subroutine.  Both classes have been implemented in gfortran for backwards compatibility with g77.  It is noted here that these functions and subroutines cannot be intermixed in a given subprogram.  In the descriptions that follow, the applicable option(s) is noted.

ABORT --- Abort the program
===========================

Description:
     ABORT causes immediate termination of the program.  On operating systems that support a core dump, ABORT will produce a core dump, which is suitable for debugging purposes.

Option:
     gnu

Type:
     non-elemental subroutine

Syntax:
     CALL ABORT

Return value:
     Does not return.

Example:

          program test_abort
            integer :: i = 1, j = 2
            if (i /= j) call abort
          end program test_abort

ABS --- Absolute value
======================

Description:
     ABS(X) computes the absolute value of X.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     X = ABS(X)

Arguments:

     X   The type of the argument shall be an INTEGER(*),
     REAL(*), or COMPLEX(*).

Return value:
     The return value is of the same type and kind as the argument except the return value is REAL(*) for a COMPLEX(*) argument.

Example:

          program test_abs
            integer :: i = -1
            real :: x = -1.e0
            complex :: z = (-1.e0,0.e0)
            i = abs(i)
            x = abs(x)
            x = abs(z)
          end program test_abs

Specific names:

     Name              Argument              Return type         Option
     CABS(Z)    COMPLEX(4) Z   REAL(4)      f95, gnu
     DABS(X)    REAL(8)    X   REAL(8)      f95, gnu
     IABS(I)    INTEGER(4) I   INTEGER(4)   f95, gnu
     ZABS(Z)    COMPLEX(8) Z   COMPLEX(8)   gnu
     CDABS(Z)   COMPLEX(8) Z   COMPLEX(8)   gnu

ACHAR --- Character in ASCII collating sequence
===============================================

Description:
     ACHAR(I) returns the character located at position I in the ASCII collating sequence.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     C = ACHAR(I)

Arguments:

     I   The type shall be an INTEGER(*).

Return value:
     The return value is of type CHARACTER with a length of one.  The kind type parameter is the same as  KIND('A').

Example:

          program test_achar
            character c
            c = achar(32)
          end program test_achar

ACOS --- Arccosine function
===========================

Description:
     ACOS(X) computes the arccosine of its X.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     X = ACOS(X)

Arguments:

     X   The type shall be an REAL(*), and a magnitude that is
     less than one.

Return value:
     The return value is of type REAL(*) and it lies in the range  0 \leq \arccos (x) \leq \pi.  The kind type parameter is the same as X.

Example:

          program test_acos
            real(8) :: x = 0.866_8
            x = achar(x)
          end program test_acos

Specific names:

     Name              Argument            Return type         Option
     DACOS(X)   REAL(8) X    REAL(8)      f95, gnu

ADJUSTL --- Left adjust a string
================================

Description:
     ADJUSTL(STR) will left adjust a string by removing leading spaces. Spaces are inserted at the end of the string as needed.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     STR = ADJUSTL(STR)

Arguments:

     STR   The type shall be CHARACTER.

Return value:
     The return value is of type CHARACTER where leading spaces are removed and the same number of spaces are inserted on the end of STR.

Example:

          program test_adjustl
            character(len=20) :: str = '   gfortran'
            str = adjustl(str)
            print *, str
          end program test_adjustl

ADJUSTR --- Right adjust a string
=================================

Description:
     ADJUSTR(STR) will right adjust a string by removing trailing spaces. Spaces are inserted at the start of the string as needed.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     STR = ADJUSTR(STR)

Arguments:

     STR   The type shall be CHARACTER.

Return value:
     The return value is of type CHARACTER where trailing spaces are removed and the same number of spaces are inserted at the start of STR.

Example:

          program test_adjustr
            character(len=20) :: str = 'gfortran'
            str = adjustr(str)
            print *, str
          end program test_adjustr

AIMAG --- Imaginary part of complex number
==========================================

Description:
     AIMAG(Z) yields the imaginary part of complex argument Z.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     X = AIMAG(Z)

Arguments:

     Z   The type of the argument shall be COMPLEX(*).

Return value:
     The return value is of type real with the kind type parameter of the argument.

Example:

          program test_aimag
            complex(4) z4
            complex(8) z8
            z4 = cmplx(1.e0_4, 0.e0_4)
            z8 = cmplx(0.e0_8, 1.e0_8)
            print *, aimag(z4), dimag(z8)
          end program test_aimag

Specific names:

     Name              Argument              Return type         Option
     DIMAG(Z)   COMPLEX(8) Z   REAL(8)      f95, gnu

AINT --- Imaginary part of complex number
=========================================

Description:
     AINT(X [, KIND]) truncates its argument to a whole number.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     X = AINT(X)

     X = AINT(X, KIND)

Arguments:

     X      The type of the argument shall be REAL(*).
     KIND   (Optional) KIND shall be a scalar integer
     initialization expression.

Return value:
     The return value is of type real with the kind type parameter of the argument if the optional KIND is absence; otherwise, the kind type parameter will be given by KIND.  If the magnitude of X is less than one, then AINT(X) returns zero.  If the magnitude is equal to or greater than one, then it returns the largest whole number that does not exceed its magnitude.  The sign is the same as the sign of X.

Example:

          program test_aint
            real(4) x4
            real(8) x8
            x4 = 1.234E0_4
            x8 = 4.321_8
            print *, aint(x4), dint(x8)
            x8 = aint(x4,8)
          end program test_aint

Specific names:

     Name             Argument           Return type        Option
     DINT(X)   REAL(8) X   REAL(8)     f95, gnu

ALL --- All values in MASK along DIM are true
=============================================

Description:
     ALL(MASK [, DIM]) determines if all the values are true in MASK in the array along dimension DIM.

Option:
     f95, gnu

Type:
     transformational function

Syntax:
     L = ALL(MASK)

     L = ALL(MASK, DIM)

Arguments:

     MASK   The type of the argument shall be LOGICAL(*) and
     it shall not be scalar.
     DIM    (Optional) DIM shall be a scalar integer
     with a value that lies between one and the rank of MASK.

Return value:
     ALL(MASK) returns a scalar value of type LOGICAL(*) where the kind type parameter is the same as the kind type parameter of MASK.  If DIM is present, then ALL(MASK, DIM) returns an array with the rank of MASK minus 1.  The shape is determined from the shape of MASK where the DIM dimension is elided.

     (A)
          ALL(MASK) is true if all elements of MASK are true. It also is true if MASK has zero size; otherwise, it is false.

     (B)
          If the rank of MASK is one, then ALL(MASK,DIM) is equivalent to ALL(MASK).  If the rank is greater than one, then ALL(MASK,DIM) is determined by applying ALL to the array sections.

Example:

          program test_all
            logical l
            l = all((/.true., .true., .true./))
            print *, l
            call section
            contains
              subroutine section
                integer a(2,3), b(2,3)
                a = 1
                b = 1
                b(2,2) = 2
                print *, all(a .eq. b, 1)
                print *, all(a .eq. b, 2)
              end subroutine section
          end program test_all

ALLOCATED --- Status of an allocatable entity
=============================================

Description:
     ALLOCATED(X) checks the status of wether X is allocated.

Option:
     f95, gnu

Type:
     inquiry function

Syntax:
     L = ALLOCATED(X)

Arguments:

     X      The argument shall be an ALLOCATABLE array.

Return value:
     The return value is a scalar LOGICAL with the default logical kind type parameter.  If X is allocated, ALLOCATED(X) is .TRUE.; otherwise, it returns the .TRUE.

Example:

          program test_allocated
            integer :: i = 4
            real(4), allocatable :: x(:)
            if (allocated(x) .eqv. .false.) allocate(x(i)
          end program test_allocated

ANINT --- Imaginary part of complex number
==========================================

Description:
     ANINT(X [, KIND]) rounds its argument to the nearest whole number.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     X = ANINT(X)

     X = ANINT(X, KIND)

Arguments:

     X      The type of the argument shall be REAL(*).
     KIND   (Optional) KIND shall be a scalar integer
     initialization expression.

Return value:
     The return value is of type real with the kind type parameter of the argument if the optional KIND is absence; otherwise, the kind type parameter will be given by KIND.  If X is greater than zero, then ANINT(X) returns AINT(X+0.5).  If X is less than or equal to zero, then return AINT(X-0.5).

Example:

          program test_anint
            real(4) x4
            real(8) x8
            x4 = 1.234E0_4
            x8 = 4.321_8
            print *, anint(x4), dnint(x8)
            x8 = anint(x4,8)
          end program test_anint

Specific names:

     Name              Argument           Return type        Option
     DNINT(X)   REAL(8) X   REAL(8)     f95, gnu

ANY --- Any value in MASK along DIM is true
===========================================

Description:
     ANY(MASK [, DIM]) determines if any of the values is true in MASK in the array along dimension DIM.

Option:
     f95, gnu

Type:
     transformational function

Syntax:
     L = ANY(MASK)

     L = ANY(MASK, DIM)

Arguments:

     MASK   The type of the argument shall be LOGICAL(*) and
     it shall not be scalar.
     DIM    (Optional) DIM shall be a scalar integer
     with a value that lies between one and the rank of MASK.

Return value:
     ANY(MASK) returns a scalar value of type LOGICAL(*) where the kind type parameter is the same as the kind type parameter of MASK.  If DIM is present, then ANY(MASK, DIM) returns an array with the rank of MASK minus 1.  The shape is determined from the shape of MASK where the DIM dimension is elided.

     (A)
          ANY(MASK) is true if any element of MASK is true; otherwise, it is false.  It also is false if MASK has zero size.

     (B)
          If the rank of MASK is one, then ANY(MASK,DIM) is equivalent to ANY(MASK).  If the rank is greater than one, then ANY(MASK,DIM) is determined by applying ANY to the array sections.

Example:

          program test_any
            logical l
            l = any((/.true., .true., .true./))
            print *, l
            call section
            contains
              subroutine section
                integer a(2,3), b(2,3)
                a = 1
                b = 1
                b(2,2) = 2
                print *, any(a .eq. b, 1)
                print *, any(a .eq. b, 2)
              end subroutine section
          end program test_any

ASIN --- Arcsine function
=========================

Description:
     ASIN(X) computes the arcsine of its X.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     X = ASIN(X)

Arguments:

     X   The type shall be an REAL(*), and a magnitude that is
     less than one.

Return value:
     The return value is of type REAL(*) and it lies in the range  \pi / 2 \leq \arccos (x) \leq \pi / 2.  The kind type parameter is the same as X.

Example:

          program test_asin
            real(8) :: x = 0.866_8
            x = asin(x)
          end program test_asin

Specific names:

     Name              Argument            Return type         Option
     DASIN(X)   REAL(8) X    REAL(8)      f95, gnu

ATAN --- Arctangent function
============================

Description:
     ATAN(X) computes the arctangent of X.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     X = ATAN(X)

Arguments:

     X   The type shall be an REAL(*).

Return value:
     The return value is of type REAL(*) and it lies in the range  - \pi / 2 \leq \arcsin (x) \leq \pi / 2.

Example:

          program test_atan
            real(8) :: x = 2.866_8
            x = atan(x)
          end program test_atan

Specific names:

     Name              Argument            Return type         Option
     DATAN(X)   REAL(8) X    REAL(8)      f95, gnu

BESJ0 --- Bessel function of the first kind of order 0
======================================================

Description:
     BESJ0(X) computes the Bessel function of the first kind of order 0 of X.

Option:
     gnu

Type:
     elemental function

Syntax:
     X = BESJ0(X)

Arguments:

     X   The type shall be an REAL(*).

Return value:
     The return value is of type REAL(*) and it lies in the range  - 0.4027... \leq Bessel (0,x) \leq 1.

Example:

          program test_besj0
            real(8) :: x = 0.0_8
            x = besj0(x)
          end program test_besj0

Specific names:

     Name              Argument            Return type         Option
     DBESJ0(X)   REAL(8) X    REAL(8)      gnu

BESJ1 --- Bessel function of the first kind of order 1
======================================================

Description:
     BESJ1(X) computes the Bessel function of the first kind of order 1 of X.

Option:
     gnu

Type:
     elemental function

Syntax:
     X = BESJ1(X)

Arguments:

     X   The type shall be an REAL(*).

Return value:
     The return value is of type REAL(*) and it lies in the range  - 0.5818... \leq Bessel (0,x) \leq 0.5818 .

Example:

          program test_besj1
            real(8) :: x = 1.0_8
            x = besj1(x)
          end program test_besj1

Specific names:

     Name              Argument            Return type         Option
     DBESJ1(X)  REAL(8) X    REAL(8)      gnu

BESJN --- Bessel function of the first kind
===========================================

Description:
     BESJN(N, X) computes the Bessel function of the first kind of order N of X.

Option:
     gnu

Type:
     elemental function

Syntax:
     Y = BESJN(N, X)

Arguments:

     N   The type shall be an INTEGER(*).
     X   The type shall be an REAL(*).

Return value:
     The return value is of type REAL(*).

Example:

          program test_besjn
            real(8) :: x = 1.0_8
            x = besjn(5,x)
          end program test_besjn

Specific names:

     Name              Argument            Return type         Option
     DBESJN(X)  REAL(8) X    REAL(8)      gnu

BESY0 --- Bessel function of the second kind of order 0
=======================================================

Description:
     BESY0(X) computes the Bessel function of the second kind of order 0 of X.

Option:
     gnu

Type:
     elemental function

Syntax:
     X = BESY0(X)

Arguments:

     X   The type shall be an REAL(*).

Return value:
     The return value is of type REAL(*).

Example:

          program test_besy0
            real(8) :: x = 0.0_8
            x = besy0(x)
          end program test_besy0

Specific names:

     Name              Argument            Return type         Option
     DBESY0(X)  REAL(8) X    REAL(8)      gnu

BESY1 --- Bessel function of the second kind of order 1
=======================================================

Description:
     BESY1(X) computes the Bessel function of the second kind of order 1 of X.

Option:
     gnu

Type:
     elemental function

Syntax:
     X = BESY1(X)

Arguments:

     X   The type shall be an REAL(*).

Return value:
     The return value is of type REAL(*).

Example:

          program test_besy1
            real(8) :: x = 1.0_8
            x = besy1(x)
          end program test_besy1

Specific names:

     Name              Argument            Return type         Option
     DBESY1(X)  REAL(8) X    REAL(8)      gnu

BESYN --- Bessel function of the second kind
============================================

Description:
     BESYN(N, X) computes the Bessel function of the second kind of order N of X.

Option:
     gnu

Type:
     elemental function

Syntax:
     Y = BESYN(N, X)

Arguments:

     N   The type shall be an INTEGER(*).
     X   The type shall be an REAL(*).

Return value:
     The return value is of type REAL(*).

Example:

          program test_besyn
            real(8) :: x = 1.0_8
            x = besyn(5,x)
          end program test_besyn

Specific names:

     Name              Argument            Return type         Option
     DBESYN(X)  REAL(8) X    REAL(8)      gnu

COS --- Cosine function
=======================

Description:
     COS(X) computes the cosine of X.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     X = COS(X)

Arguments:

     X   The type shall be an REAL(*) or
     COMPLEX(*).

Return value:
     The return value has same type and kind than X.

Example:

          program test_cos
            real :: x = 0.0
            x = cos(x)
          end program test_cos

Specific names:

     Name              Argument            Return type         Option
     DCOS(X)    REAL(8) X    REAL(8)      f95, gnu
     CCOS(X)    COMPLEX(4) X    COMPLEX(4)      f95, gnu
     ZCOS(X)    COMPLEX(8) X    COMPLEX(8)      f95, gnu
     CDCOS(X)   COMPLEX(8) X    COMPLEX(8)      f95, gnu

COSH --- Hyperbolic cosine function
===================================

Description:
     COSH(X) computes the hyperbolic cosine of X.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     X = COSH(X)

Arguments:

     X   The type shall be an REAL(*).

Return value:
     The return value is of type REAL(*) and it is positive ( \cosh (x) \geq 0 .

Example:

          program test_cosh
            real(8) :: x = 1.0_8
            x = cosh(x)
          end program test_cosh

Specific names:

     Name              Argument            Return type         Option
     DCOSH(X)   REAL(8) X    REAL(8)      f95, gnu

ERF --- Error function
======================

Description:
     ERF(X) computes the error function of X.

Option:
     gnu

Type:
     elemental function

Syntax:
     X = ERF(X)

Arguments:

     X   The type shall be an REAL(*).

Return value:
     The return value is of type REAL(*) and it is positive ( - 1 \leq erf (x) \leq 1 .

Example:

          program test_erf
            real(8) :: x = 0.17_8
            x = erf(x)
          end program test_erf

Specific names:

     Name              Argument            Return type         Option
     DERF(X)    REAL(8) X    REAL(8)      gnu

ERFC --- Error function
=======================

Description:
     ERFC(X) computes the complementary error function of X.

Option:
     gnu

Type:
     elemental function

Syntax:
     X = ERFC(X)

Arguments:

     X   The type shall be an REAL(*).

Return value:
     The return value is of type REAL(*) and it is positive ( 0 \leq erfc (x) \leq 2 .

Example:

          program test_erfc
            real(8) :: x = 0.17_8
            x = erfc(x)
          end program test_erfc

Specific names:

     Name              Argument            Return type         Option
     DERFC(X)   REAL(8) X    REAL(8)      gnu

EXP --- Exponential function
============================

Description:
     EXP(X) computes the base e exponential of X.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     X = EXP(X)

Arguments:

     X   The type shall be an REAL(*) or
     COMPLEX(*).

Return value:
     The return value has same type and kind than X.

Example:

          program test_exp
            real :: x = 1.0
            x = exp(x)
          end program test_exp

Specific names:

     Name              Argument            Return type         Option
     DEXP(X)    REAL(8) X    REAL(8)      f95, gnu
     CEXP(X)    COMPLEX(4) X    COMPLEX(4)      f95, gnu
     ZEXP(X)    COMPLEX(8) X    COMPLEX(8)      f95, gnu
     CDEXP(X)   COMPLEX(8) X    COMPLEX(8)      f95, gnu

LOG --- Logarithm function
==========================

Description:
     LOG(X) computes the logarithm of X.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     X = LOG(X)

Arguments:

     X   The type shall be an REAL(*) or
     COMPLEX(*).

Return value:
     The return value is of type REAL(*) or COMPLEX(*). The kind type parameter is the same as X.

Example:

          program test_log
            real(8) :: x = 1.0_8
            complex :: z = (1.0, 2.0)
            x = log(x)
            z = log(z)
          end program test_log

Specific names:

     Name              Argument            Return type         Option
     ALOG(X)    REAL(4) X    REAL(4)      f95, gnu
     DLOG(X)    REAL(8) X    REAL(8)      f95, gnu
     CLOG(X)    COMPLEX(4) X    COMPLEX(4)      f95, gnu
     ZLOG(X)    COMPLEX(8) X    COMPLEX(8)      f95, gnu
     CDLOG(X)   COMPLEX(8) X    COMPLEX(8)      f95, gnu

LOG10 --- Base 10 logarithm function
====================================

Description:
     LOG10(X) computes the base 10 logarithm of X.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     X = LOG10(X)

Arguments:

     X   The type shall be an REAL(*) or
     COMPLEX(*).

Return value:
     The return value is of type REAL(*) or COMPLEX(*). The kind type parameter is the same as X.

Example:

          program test_log10
            real(8) :: x = 10.0_8
            x = log10(x)
          end program test_log10

Specific names:

     Name              Argument            Return type         Option
     ALOG10(X)    REAL(4) X    REAL(4)      f95, gnu
     DLOG10(X)    REAL(8) X    REAL(8)      f95, gnu

SIN --- Sine function
=====================

Description:
     SIN(X) computes the sine of X.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     X = SIN(X)

Arguments:

     X   The type shall be an REAL(*) or
     COMPLEX(*).

Return value:
     The return value has same type and king than X.

Example:

          program test_sin
            real :: x = 0.0
            x = sin(x)
          end program test_sin

Specific names:

     Name              Argument            Return type         Option
     DSIN(X)    REAL(8) X    REAL(8)      f95, gnu
     CSIN(X)    COMPLEX(4) X    COMPLEX(4)      f95, gnu
     ZSIN(X)    COMPLEX(8) X    COMPLEX(8)      f95, gnu
     CDSIN(X)   COMPLEX(8) X    COMPLEX(8)      f95, gnu

SINH --- Hyperbolic sine function
=================================

Description:
     SINH(X) computes the hyperbolic sine of X.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     X = SINH(X)

Arguments:

     X   The type shall be an REAL(*).

Return value:
     The return value is of type REAL(*).

Example:

          program test_sinh
            real(8) :: x = - 1.0_8
            x = sinh(x)
          end program test_sinh

Specific names:

     Name              Argument            Return type         Option
     DSINH(X)   REAL(8) X    REAL(8)      f95, gnu

SQRT --- Square-root function
=============================

Description:
     SQRT(X) computes the square root of X.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     X = SQRT(X)

Arguments:

     X   The type shall be an REAL(*) or
     COMPLEX(*).

Return value:
     The return value is of type REAL(*) or COMPLEX(*). The kind type parameter is the same as X.

Example:

          program test_sqrt
            real(8) :: x = 2.0_8
            complex :: z = (1.0, 2.0)
            x = sqrt(x)
            z = sqrt(z)
          end program test_sqrt

Specific names:

     Name              Argument            Return type         Option
     DSQRT(X)    REAL(8) X    REAL(8)      f95, gnu
     CSQRT(X)    COMPLEX(4) X    COMPLEX(4)      f95, gnu
     ZSQRT(X)    COMPLEX(8) X    COMPLEX(8)      f95, gnu
     CDSQRT(X)   COMPLEX(8) X    COMPLEX(8)      f95, gnu

TAN --- Tangent function
========================

Description:
     TAN(X) computes the tangent of X.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     X = TAN(X)

Arguments:

     X   The type shall be an REAL(*).

Return value:
     The return value is of type REAL(*).  The kind type parameter is the same as X.

Example:

          program test_tan
            real(8) :: x = 0.165_8
            x = tan(x)
          end program test_tan

Specific names:

     Name              Argument            Return type         Option
     DTAN(X)    REAL(8) X    REAL(8)      f95, gnu

TANH --- Hyperbolic tangent function
====================================

Description:
     TANH(X) computes the hyperbolic tangent of X.

Option:
     f95, gnu

Type:
     elemental function

Syntax:
     X = TANH(X)

Arguments:

     X   The type shall be an REAL(*).

Return value:
     The return value is of type REAL(*) and lies in the range - 1 \leq tanh(x) \leq 1 .

Example:

          program test_tanh
            real(8) :: x = 2.1_8
            x = tanh(x)
          end program test_tanh

Specific names:

     Name              Argument            Return type         Option
     DTANH(X)   REAL(8) X    REAL(8)      f95, gnu