* @code{CMPLX}: CMPLX, Complex conversion function
* @code{COMMAND_ARGUMENT_COUNT}: COMMAND_ARGUMENT_COUNT, Get number of command line arguments
* @code{COMPLEX}: COMPLEX, Complex conversion function
+* @code{COMPILER_VERSION}: COMPILER_VERSION, Compiler version string
+* @code{COMPILER_OPTIONS}: COMPILER_OPTIONS, Options passed to the compiler
* @code{CONJG}: CONJG, Complex conjugate function
* @code{COS}: COS, Cosine function
* @code{COSH}: COSH, Hyperbolic cosine function
* @code{GMTIME}: GMTIME, Convert time to GMT info
* @code{HOSTNM}: HOSTNM, Get system host name
* @code{HUGE}: HUGE, Largest number of a kind
-* @code{HYPOT}: HYPOT, Euclidian distance function
+* @code{HYPOT}: HYPOT, Euclidean distance function
* @code{IACHAR}: IACHAR, Code in @acronym{ASCII} collating sequence
* @code{IALL}: IALL, Bitwise AND of array elements
* @code{IAND}: IAND, Bitwise logical and
* @code{IDATE}: IDATE, Current local time (day/month/year)
* @code{IEOR}: IEOR, Bitwise logical exclusive or
* @code{IERRNO}: IERRNO, Function to get the last system error number
-* @code{IMAGE_INDEX}: IMAGE_INDEX, Cosubscript to image index convertion
+* @code{IMAGE_INDEX}: IMAGE_INDEX, Cosubscript to image index conversion
* @code{INDEX}: INDEX intrinsic, Position of a substring within a string
* @code{INT}: INT, Convert to integer type
* @code{INT2}: INT2, Convert to 16-bit integer type
@table @asis
@item @emph{Description}:
@code{ABORT} causes immediate termination of the program. On operating
-systems that support a core dump, @code{ABORT} will produce a core dump even if
-the option @option{-fno-dump-core} is in effect, which is suitable for debugging
-purposes.
-@c TODO: Check if this (with -fno-dump-core) is correct.
+systems that support a core dump, @code{ABORT} will produce a core dump.
@item @emph{Standard}:
GNU extension
Inquiry function
@item @emph{Syntax}:
-@code{RESULT = ALLOCATED(ARRAY)} or @code{RESULT = ALLOCATED(SCALAR)}
+@multitable @columnfractions .80
+@item @code{RESULT = ALLOCATED(ARRAY)}
+@item @code{RESULT = ALLOCATED(SCALAR)}
+@end multitable
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
Elemental function
@item @emph{Syntax}:
-@code{RESULT = ATAN(X)}
-@code{RESULT = ATAN(Y, X)}
+@multitable @columnfractions .80
+@item @code{RESULT = ATAN(X)}
+@item @code{RESULT = ATAN(Y, X)}
+@end multitable
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@item @emph{Description}:
@code{ATAN2(Y, X)} computes the principal value of the argument
function of the complex number @math{X + i Y}. This function can
-be used to transform from carthesian into polar coordinates and
+be used to transform from Cartesian into polar coordinates and
allows to determine the angle in the correct quadrant.
@item @emph{Standard}:
Fortran 2008 and later, negative @var{N} is allowed as GNU extension
@item @emph{Class}:
-Elemental function, except for the tranformational function
+Elemental function, except for the transformational function
@code{BESSEL_JN(N1, N2, X)}
@item @emph{Syntax}:
-@code{RESULT = BESSEL_JN(N, X)}
-@code{RESULT = BESSEL_JN(N1, N2, X)}
+@multitable @columnfractions .80
+@item @code{RESULT = BESSEL_JN(N, X)}
+@item @code{RESULT = BESSEL_JN(N1, N2, X)}
+@end multitable
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
Fortran 2008 and later, negative @var{N} is allowed as GNU extension
@item @emph{Class}:
-Elemental function, except for the tranformational function
+Elemental function, except for the transformational function
@code{BESSEL_YN(N1, N2, X)}
@item @emph{Syntax}:
-@code{RESULT = BESSEL_YN(N, X)}
-@code{RESULT = BESSEL_YN(N1, N2, X)}
+@multitable @columnfractions .80
+@item @code{RESULT = BESSEL_YN(N, X)}
+@item @code{RESULT = BESSEL_YN(N1, N2, X)}
+@end multitable
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
Fortran 2008
@item @emph{Class}:
-Intrinsic function
+Inquiry function of the module @code{ISO_C_BINDING}
@item @emph{Syntax}:
@code{N = C_SIZEOF(X)}
@item @emph{Return value}:
The return value is of type integer and of the system-dependent kind
-@var{C_SIZE_T} (from the @var{ISO_C_BINDING} module). Its value is the
+@code{C_SIZE_T} (from the @code{ISO_C_BINDING} module). Its value is the
number of bytes occupied by the argument. If the argument has the
@code{POINTER} attribute, the number of bytes of the storage area pointed
to is returned. If the argument is of a derived type with @code{POINTER}
@table @asis
@item @emph{Description}:
-@code{COMMAND_ARGUMENT_COUNT()} returns the number of arguments passed on the
+@code{COMMAND_ARGUMENT_COUNT} returns the number of arguments passed on the
command line when the containing program was invoked.
@item @emph{Standard}:
+@node COMPILER_OPTIONS
+@section @code{COMPILER_OPTIONS} --- Options passed to the compiler
+@fnindex COMPILER_OPTIONS
+@cindex flags inquiry function
+@cindex options inquiry function
+@cindex compiler flags inquiry function
+
+@table @asis
+@item @emph{Description}:
+@code{COMPILER_OPTIONS} returns a string with the options used for
+compiling.
+
+@item @emph{Standard}:
+Fortran 2008
+
+@item @emph{Class}:
+Inquiry function of the module @code{ISO_FORTRAN_ENV}
+
+@item @emph{Syntax}:
+@code{STR = COMPILER_OPTIONS()}
+
+@item @emph{Arguments}:
+None.
+
+@item @emph{Return value}:
+The return value is a default-kind string with system-dependent length.
+It contains the compiler flags used to compile the file, which called
+the @code{COMPILER_OPTIONS} intrinsic.
+
+@item @emph{Example}:
+@smallexample
+ use iso_fortran_env
+ print '(4a)', 'This file was compiled by ', &
+ compiler_version(), ' using the options ', &
+ compiler_options()
+ end
+@end smallexample
+
+@item @emph{See also}:
+@ref{COMPILER_VERSION}, @ref{ISO_FORTRAN_ENV}
+@end table
+
+
+
+@node COMPILER_VERSION
+@section @code{COMPILER_VERSION} --- Compiler version string
+@fnindex COMPILER_VERSION
+@cindex compiler, name and version
+@cindex version of the compiler
+
+@table @asis
+@item @emph{Description}:
+@code{COMPILER_VERSION} returns a string with the name and the
+version of the compiler.
+
+@item @emph{Standard}:
+Fortran 2008
+
+@item @emph{Class}:
+Inquiry function of the module @code{ISO_FORTRAN_ENV}
+
+@item @emph{Syntax}:
+@code{STR = COMPILER_VERSION()}
+
+@item @emph{Arguments}:
+None.
+
+@item @emph{Return value}:
+The return value is a default-kind string with system-dependent length.
+It contains the name of the compiler and its version number.
+
+@item @emph{Example}:
+@smallexample
+ use iso_fortran_env
+ print '(4a)', 'This file was compiled by ', &
+ compiler_version(), ' using the options ', &
+ compiler_options()
+ end
+@end smallexample
+
+@item @emph{See also}:
+@ref{COMPILER_OPTIONS}, @ref{ISO_FORTRAN_ENV}
+@end table
+
+
+
@node COMPLEX
@section @code{COMPLEX} --- Complex conversion function
@fnindex COMPLEX
@table @asis
@item @emph{Description}:
@code{CTIME} converts a system time value, such as returned by
-@code{TIME8()}, to a string of the form @samp{Sat Aug 19 18:13:14 1995}.
+@code{TIME8}, to a string. Unless the application has called
+@code{setlocale}, the output will be in the default locale, of length
+24 and of the form @samp{Sat Aug 19 18:13:14 1995}. In other locales,
+a longer string may result.
This intrinsic is provided in both subroutine and function forms; however,
only one form can be used in any given program unit.
@item @emph{Syntax}:
@multitable @columnfractions .80
@item @code{CALL CTIME(TIME, RESULT)}.
-@item @code{RESULT = CTIME(TIME)}, (not recommended).
+@item @code{RESULT = CTIME(TIME)}.
@end multitable
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
-@item @var{TIME} @tab The type shall be of type @code{INTEGER(KIND=8)}.
+@item @var{TIME} @tab The type shall be of type @code{INTEGER}.
@item @var{RESULT} @tab The type shall be of type @code{CHARACTER} and
-of default kind.
+of default kind. It is an @code{INTENT(OUT)} argument. If the length
+of this variable is too short for the time and date string to fit
+completely, it will be blank on procedure return.
@end multitable
@item @emph{Return value}:
-The converted date and time as a string.
+The converted date and time as a string.
@item @emph{Example}:
@smallexample
@end smallexample
@item @emph{See Also}:
-@ref{GMTIME}, @ref{LTIME}, @ref{TIME}, @ref{TIME8}
+@ref{DATE_AND_TIME}, @ref{GMTIME}, @ref{LTIME}, @ref{TIME}, @ref{TIME8}
@end table
asynchronously.
The @code{COMMAND} argument is passed to the shell and executed, using
-the C library's @code{system()} call. (The shell is @code{sh} on Unix
-systems, and @code{cmd.exe} on Windows.) If @code{WAIT} is present and
-has the value false, the execution of the command is asynchronous if the
-system supports it; otherwise, the command is executed synchronously.
+the C library's @code{system} call. (The shell is @code{sh} on Unix
+systems, and @code{cmd.exe} on Windows.) If @code{WAIT} is present
+and has the value false, the execution of the command is asynchronous
+if the system supports it; otherwise, the command is executed
+synchronously.
The three last arguments allow the user to get status information. After
synchronous execution, @code{EXITSTAT} contains the integer exit code of
if the command line was executed (whatever its exit status was).
@code{CMDMSG} is assigned an error message if an error has occurred.
+Note that the @code{system} function need not be thread-safe. It is
+the responsibility of the user to ensure that @code{system} is not
+called concurrently.
@item @emph{Standard}:
Fortran 2008 and later
@item @emph{Note}:
-Because this intrinsic is implemented in terms of the @code{system()}
-function call, its behavior with respect to signalling is processor
+Because this intrinsic is implemented in terms of the @code{system}
+function call, its behavior with respect to signaling is processor
dependent. In particular, on POSIX-compliant systems, the SIGINT and
SIGQUIT signals will be ignored, and the SIGCHLD will be blocked. As
such, if the parent process is terminated, the child process might not be
@fnindex ZEXP
@fnindex CDEXP
@cindex exponential function
-@cindex logarithmic function, inverse
+@cindex logarithm function, inverse
@table @asis
@item @emph{Description}:
This intrinsic is provided in both subroutine and function forms; however,
only one form can be used in any given program unit.
-@var{DATE} is an @code{INTENT(OUT)} @code{CHARACTER} variable of the
-default kind.
-
@item @emph{Standard}:
GNU extension
@item @emph{Syntax}:
@multitable @columnfractions .80
@item @code{CALL FDATE(DATE)}.
-@item @code{DATE = FDATE()}, (not recommended).
+@item @code{DATE = FDATE()}.
@end multitable
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@item @var{DATE}@tab The type shall be of type @code{CHARACTER} of the
-default kind
+default kind. It is an @code{INTENT(OUT)} argument. If the length of
+this variable is too short for the date and time string to fit
+completely, it will be blank on procedure return.
@end multitable
@item @emph{Return value}:
-The current date as a string.
+The current date and time as a string.
@item @emph{Example}:
@smallexample
print *, 'Program ended on ', date
end program test_fdate
@end smallexample
-@end table
+@item @emph{See also}:
+@ref{DATE_AND_TIME}, @ref{CTIME}
+@end table
@node FGET
@table @asis
@item @emph{Description}:
-Frees memory previously allocated by @code{MALLOC()}. The @code{FREE}
+Frees memory previously allocated by @code{MALLOC}. The @code{FREE}
intrinsic is an extension intended to be used with Cray pointers, and is
provided in GNU Fortran to allow user to compile legacy code. For
new code using Fortran 95 pointers, the memory de-allocation intrinsic is
@multitable @columnfractions .15 .70
@item @var{NUMBER} @tab Shall be a scalar of type @code{INTEGER} and of
default kind, @math{@var{NUMBER} \geq 0}
-@item @var{VALUE} @tab Shall be a scalar of type @code{CHARACTER}
+@item @var{VALUE} @tab (Optional) Shall be a scalar of type @code{CHARACTER}
and of default kind.
-@item @var{LENGTH} @tab (Option) Shall be a scalar of type @code{INTEGER}
+@item @var{LENGTH} @tab (Optional) Shall be a scalar of type @code{INTEGER}
and of default kind.
-@item @var{STATUS} @tab (Option) Shall be a scalar of type @code{INTEGER}
+@item @var{STATUS} @tab (Optional) Shall be a scalar of type @code{INTEGER}
and of default kind.
@end multitable
@item @emph{Description}:
Get the @var{VALUE} of the environmental variable @var{NAME}.
-This intrinsic routine is provided for backwards compatibility with
-GNU Fortran 77. In new code, programmers should consider the use of
+This intrinsic routine is provided for backwards compatibility with
+GNU Fortran 77. In new code, programmers should consider the use of
the @ref{GET_ENVIRONMENT_VARIABLE} intrinsic defined by the Fortran
2003 standard.
+Note that @code{GETENV} need not be thread-safe. It is the
+responsibility of the user to ensure that the environment is not being
+updated concurrently with a call to the @code{GETENV} intrinsic.
+
@item @emph{Standard}:
GNU extension
@item @emph{Description}:
Get the @var{VALUE} of the environmental variable @var{NAME}.
+Note that @code{GET_ENVIRONMENT_VARIABLE} need not be thread-safe. It
+is the responsibility of the user to ensure that the environment is
+not being updated concurrently with a call to the
+@code{GET_ENVIRONMENT_VARIABLE} intrinsic.
+
@item @emph{Standard}:
Fortran 2003 and later
@multitable @columnfractions .15 .70
@item @var{NAME} @tab Shall be a scalar of type @code{CHARACTER}
and of default kind.
-@item @var{VALUE} @tab Shall be a scalar of type @code{CHARACTER}
+@item @var{VALUE} @tab (Optional) Shall be a scalar of type @code{CHARACTER}
and of default kind.
-@item @var{LENGTH} @tab Shall be a scalar of type @code{INTEGER}
+@item @var{LENGTH} @tab (Optional) Shall be a scalar of type @code{INTEGER}
and of default kind.
-@item @var{STATUS} @tab Shall be a scalar of type @code{INTEGER}
+@item @var{STATUS} @tab (Optional) Shall be a scalar of type @code{INTEGER}
and of default kind.
-@item @var{TRIM_NAME} @tab Shall be a scalar of type @code{LOGICAL}
+@item @var{TRIM_NAME} @tab (Optional) Shall be a scalar of type @code{LOGICAL}
and of default kind.
@end multitable
@node GETGID
@section @code{GETGID} --- Group ID function
@fnindex GETGID
-@cindex system, group id
+@cindex system, group ID
@table @asis
@item @emph{Description}:
@node GETPID
@section @code{GETPID} --- Process ID function
@fnindex GETPID
-@cindex system, process id
-@cindex process id
+@cindex system, process ID
+@cindex process ID
@table @asis
@item @emph{Description}:
@node GETUID
@section @code{GETUID} --- User ID function
@fnindex GETUID
-@cindex system, user id
+@cindex system, user ID
@cindex user id
@table @asis
@table @asis
@item @emph{Description}:
-Given a system time value @var{TIME} (as provided by the @code{TIME8()}
+Given a system time value @var{TIME} (as provided by the @code{TIME8}
intrinsic), fills @var{VALUES} with values extracted from it appropriate
to the UTC time zone (Universal Coordinated Time, also known in some
countries as GMT, Greenwich Mean Time), using @code{gmtime(3)}.
INTEGER(1) :: a(2)
a(1) = b'00100100'
- a(1) = b'01101010'
+ a(2) = b'01101010'
! prints 00100000
PRINT '(b8.8)', IALL(a)
@node IANY
-@section @code{IANY} --- Bitwise XOR of array elements
+@section @code{IANY} --- Bitwise OR of array elements
@fnindex IANY
@cindex array, OR
@cindex bits, OR of array elements
INTEGER(1) :: a(2)
a(1) = b'00100100'
- a(1) = b'01101010'
+ a(2) = b'01101010'
- ! prints 01111011
+ ! prints 01101110
PRINT '(b8.8)', IANY(a)
END PROGRAM
@end smallexample
@table @asis
@item @emph{Description}:
-@code{IARGC()} returns the number of arguments passed on the
+@code{IARGC} returns the number of arguments passed on the
command line when the containing program was invoked.
This intrinsic routine is provided for backwards compatibility with
the same across different GNU Fortran implementations.
@item @emph{Standard}:
-Fortan 95 and later, with @var{KIND} argument Fortran 2003 and later
+Fortran 95 and later, with @var{KIND} argument Fortran 2003 and later
@item @emph{Class}:
Elemental function
@table @asis
@item @emph{Description}:
-@code{IEOR} returns the bitwise boolean exclusive-OR of @var{I} and
+@code{IEOR} returns the bitwise Boolean exclusive-OR of @var{I} and
@var{J}.
@item @emph{Standard}:
@table @asis
@item @emph{Description}:
-Returns the last system error number, as given by the C @code{errno()}
-function.
+Returns the last system error number, as given by the C @code{errno}
+variable.
@item @emph{Standard}:
GNU extension
@node IMAGE_INDEX
@section @code{IMAGE_INDEX} --- Function that converts a cosubscript to an image index
@fnindex IMAGE_INDEX
-@cindex coarray, IMAGE_INDEX
+@cindex coarray, @code{IMAGE_INDEX}
@cindex images, cosubscript to image index conversion
@table @asis
@table @asis
@item @emph{Description}:
-@code{IOR} returns the bitwise boolean inclusive-OR of @var{I} and
+@code{IOR} returns the bitwise Boolean inclusive-OR of @var{I} and
@var{J}.
@item @emph{Standard}:
INTEGER(1) :: a(2)
a(1) = b'00100100'
- a(1) = b'01101010'
+ a(2) = b'01101010'
- ! prints 10111011
+ ! prints 01001110
PRINT '(b8.8)', IPARITY(a)
END PROGRAM
@end smallexample
@node IS_IOSTAT_END
@section @code{IS_IOSTAT_END} --- Test for end-of-file value
@fnindex IS_IOSTAT_END
-@cindex IOSTAT, end of file
+@cindex @code{IOSTAT}, end of file
@table @asis
@item @emph{Description}:
@item @emph{Return value}:
Returns a @code{LOGICAL} of the default kind, which @code{.TRUE.} if
@var{I} has the value which indicates an end of file condition for
-IOSTAT= specifiers, and is @code{.FALSE.} otherwise.
+@code{IOSTAT=} specifiers, and is @code{.FALSE.} otherwise.
@item @emph{Example}:
@smallexample
@node IS_IOSTAT_EOR
@section @code{IS_IOSTAT_EOR} --- Test for end-of-record value
@fnindex IS_IOSTAT_EOR
-@cindex IOSTAT, end of record
+@cindex @code{IOSTAT}, end of record
@table @asis
@item @emph{Description}:
@item @emph{Return value}:
Returns a @code{LOGICAL} of the default kind, which @code{.TRUE.} if
@var{I} has the value which indicates an end of file condition for
-IOSTAT= specifiers, and is @code{.FALSE.} otherwise.
+@code{IOSTAT=} specifiers, and is @code{.FALSE.} otherwise.
@item @emph{Example}:
@smallexample
@item @emph{Example}:
@smallexample
PROGRAM test_leadz
- WRITE (*,*) LEADZ(1) ! prints 8 if BITSIZE(I) has the value 32
+ WRITE (*,*) BIT_SIZE(1) ! prints 32
+ WRITE (*,*) LEADZ(1) ! prints 31
END PROGRAM
@end smallexample
@node LOG
-@section @code{LOG} --- Logarithm function
+@section @code{LOG} --- Natural logarithm function
@fnindex LOG
@fnindex ALOG
@fnindex DLOG
@fnindex ZLOG
@fnindex CDLOG
@cindex exponential function, inverse
-@cindex logarithmic function
+@cindex logarithm function
+@cindex natural logarithm function
@table @asis
@item @emph{Description}:
-@code{LOG(X)} computes the logarithm of @var{X}.
+@code{LOG(X)} computes the natural logarithm of @var{X}, i.e. the
+logarithm to the base @math{e}.
@item @emph{Standard}:
Fortran 77 and later
@item @emph{Example}:
@smallexample
program test_log
- real(8) :: x = 1.0_8
+ real(8) :: x = 2.7182818284590451_8
complex :: z = (1.0, 2.0)
- x = log(x)
+ x = log(x) ! will yield (approximately) 1
z = log(z)
end program test_log
@end smallexample
@fnindex ALOG10
@fnindex DLOG10
@cindex exponential function, inverse
-@cindex logarithmic function
+@cindex logarithm function with base 10
+@cindex base 10 logarithm function
@table @asis
@item @emph{Description}:
@table @asis
@item @emph{Description}:
-Given a system time value @var{TIME} (as provided by the @code{TIME8()}
+Given a system time value @var{TIME} (as provided by the @code{TIME8}
intrinsic), fills @var{VALUES} with values extracted from it appropriate
to the local time zone using @code{localtime(3)}.
@emph{Warning:} this intrinsic does not increase the range of the timing
values over that returned by @code{clock(3)}. On a system with a 32-bit
-@code{clock(3)}, @code{MCLOCK8()} will return a 32-bit value, even though
+@code{clock(3)}, @code{MCLOCK8} will return a 32-bit value, even though
it is converted to a 64-bit @code{INTEGER(8)} value. That means
overflows of the 32-bit value can still occur. Therefore, the values
returned by this intrinsic might be or become negative or numerically
Fortran 2003 and later
@item @emph{Class}:
-Subroutine
+Pure subroutine
@item @emph{Syntax}:
@code{CALL MOVE_ALLOC(FROM, TO)}
@table @asis
@item @emph{Description}:
-Calculates the Euclidean vector norm (@math{L_2}) norm of
+Calculates the Euclidean vector norm (@math{L_2} norm) of
of @var{ARRAY} along dimension @var{DIM}.
@item @emph{Standard}:
@table @asis
@item @emph{Description}:
-@code{NOT} returns the bitwise boolean inverse of @var{I}.
+@code{NOT} returns the bitwise Boolean inverse of @var{I}.
@item @emph{Standard}:
Fortran 95 and later
@item @emph{Description}:
Returns a disassociated pointer.
-If @var{MOLD} is present, a dissassociated pointer of the same type is
+If @var{MOLD} is present, a disassociated pointer of the same type is
returned, otherwise the type is determined by context.
In Fortran 95, @var{MOLD} is optional. Please note that Fortran 2003
@node NUM_IMAGES
@section @code{NUM_IMAGES} --- Function that returns the number of images
@fnindex NUM_IMAGES
-@cindex coarray, NUM_IMAGES
+@cindex coarray, @code{NUM_IMAGES}
@cindex images, number of
@table @asis
@table @asis
@item @emph{Description}:
-Calculates the partity, i.e. the reduction using @code{.XOR.},
+Calculates the parity, i.e. the reduction using @code{.XOR.},
of @var{MASK} along dimension @var{DIM}.
@item @emph{Standard}:
Determines the shape of an array.
@item @emph{Standard}:
-Fortran 95 and later
+Fortran 95 and later, with @var{KIND} argument Fortran 2003 and later
@item @emph{Class}:
Inquiry function
@item @emph{Syntax}:
-@code{RESULT = SHAPE(SOURCE)}
+@code{RESULT = SHAPE(SOURCE [, KIND])}
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@item @var{SOURCE} @tab Shall be an array or scalar of any type.
If @var{SOURCE} is a pointer it must be associated and allocatable
arrays must be allocated.
+@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+expression indicating the kind parameter of the result.
@end multitable
@item @emph{Return value}:
An @code{INTEGER} array of rank one with as many elements as @var{SOURCE}
has dimensions. The elements of the resulting array correspond to the extend
of @var{SOURCE} along the respective dimensions. If @var{SOURCE} is a scalar,
-the result is the rank one array of size zero.
+the result is the rank one array of size zero. If @var{KIND} is absent, the
+return value has the default integer kind otherwise the specified kind.
@item @emph{Example}:
@smallexample
This intrinsic is provided in both subroutine and function forms;
however, only one form can be used in any given program unit.
+Note that the @code{system} function need not be thread-safe. It is
+the responsibility of the user to ensure that @code{system} is not
+called concurrently.
+
@item @emph{Standard}:
GNU extension
@table @asis
@item @emph{Description}:
-Determines the @var{COUNT} of milliseconds of wall clock time since
-the Epoch (00:00:00 UTC, January 1, 1970) modulo @var{COUNT_MAX},
-@var{COUNT_RATE} determines the number of clock ticks per second.
-@var{COUNT_RATE} and @var{COUNT_MAX} are constant and specific to
-@command{gfortran}.
+Determines the @var{COUNT} of a processor clock since an unspecified
+time in the past modulo @var{COUNT_MAX}, @var{COUNT_RATE} determines
+the number of clock ticks per second. If the platform supports a high
+resolution monotonic clock, that clock is used and can provide up to
+nanosecond resolution. If a high resolution monotonic clock is not
+available, the implementation falls back to a potentially lower
+resolution realtime clock.
+
+@var{COUNT_RATE} and @var{COUNT_MAX} vary depending on the kind of the
+arguments. For @var{kind=8} arguments, @var{COUNT} represents
+nanoseconds, and for @var{kind=4} arguments, @var{COUNT} represents
+milliseconds. Other than the kind dependency, @var{COUNT_RATE} and
+@var{COUNT_MAX} are constant, however the particular values are
+specific to @command{gfortran}.
If there is no clock, @var{COUNT} is set to @code{-HUGE(COUNT)}, and
-@var{COUNT_RATE} and @var{COUNT_MAX} are set to zero
+@var{COUNT_RATE} and @var{COUNT_MAX} are set to zero.
+
+When running on a platform using the GNU C library (glibc), or a
+derivative thereof, the high resolution monotonic clock is available
+only when linking with the @var{rt} library. This can be done
+explicitly by adding the @code{-lrt} flag when linking the
+application, but is also done implicitly when using OpenMP.
@item @emph{Standard}:
Fortran 95 and later
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
-@item @var{COUNT} @tab (Optional) shall be a scalar of type default
+@item @var{COUNT} @tab (Optional) shall be a scalar of type
@code{INTEGER} with @code{INTENT(OUT)}.
-@item @var{COUNT_RATE} @tab (Optional) shall be a scalar of type default
+@item @var{COUNT_RATE} @tab (Optional) shall be a scalar of type
@code{INTEGER} with @code{INTENT(OUT)}.
-@item @var{COUNT_MAX} @tab (Optional) shall be a scalar of type default
+@item @var{COUNT_MAX} @tab (Optional) shall be a scalar of type
@code{INTEGER} with @code{INTENT(OUT)}.
@end multitable
@node THIS_IMAGE
@section @code{THIS_IMAGE} --- Function that returns the cosubscript index of this image
@fnindex THIS_IMAGE
-@cindex coarray, THIS_IMAGE
+@cindex coarray, @code{THIS_IMAGE}
@cindex images, index of this image
@table @asis
@item @emph{Description}:
Returns the current time encoded as an integer (in the manner of the
UNIX function @code{time(3)}). This value is suitable for passing to
-@code{CTIME()}, @code{GMTIME()}, and @code{LTIME()}.
+@code{CTIME}, @code{GMTIME}, and @code{LTIME}.
This intrinsic is not fully portable, such as to systems with 32-bit
@code{INTEGER} types but supporting times wider than 32 bits. Therefore,
@item @emph{Description}:
Returns the current time encoded as an integer (in the manner of the
UNIX function @code{time(3)}). This value is suitable for passing to
-@code{CTIME()}, @code{GMTIME()}, and @code{LTIME()}.
+@code{CTIME}, @code{GMTIME}, and @code{LTIME}.
@emph{Warning:} this intrinsic does not increase the range of the timing
values over that returned by @code{time(3)}. On a system with a 32-bit
-@code{time(3)}, @code{TIME8()} will return a 32-bit value, even though
+@code{time(3)}, @code{TIME8} will return a 32-bit value, even though
it is converted to a 64-bit @code{INTEGER(8)} value. That means
overflows of the 32-bit value can still occur. Therefore, the values
returned by this intrinsic might be or become negative or numerically
@node VERIFY
-@section @code{VERIFY} --- Scan a string for the absence of a set of characters
+@section @code{VERIFY} --- Scan a string for characters not a given set
@fnindex VERIFY
@cindex string, find missing set
@table @asis
@item @emph{Description}:
-Verifies that all the characters in a @var{SET} are present in a @var{STRING}.
+Verifies that all the characters in @var{STRING} belong to the set of
+characters in @var{SET}.
If @var{BACK} is either absent or equals @code{FALSE}, this function
returns the position of the leftmost character of @var{STRING} that is
-not in @var{SET}. If @var{BACK} equals @code{TRUE}, the rightmost position
-is returned. If all characters of @var{SET} are found in @var{STRING}, the
-result is zero.
+not in @var{SET}. If @var{BACK} equals @code{TRUE}, the rightmost
+position is returned. If all characters of @var{STRING} are found in
+@var{SET}, the result is zero.
@item @emph{Standard}:
Fortran 95 and later, with @var{KIND} argument Fortran 2003 and later
Default-kind integer constant to be used as kind parameter when defining
logical variables used in atomic operations. (Fortran 2008 or later.)
+@item @code{CHARACTER_KINDS}:
+Default-kind integer constant array of rank one containing the supported kind
+parameters of the @code{CHARACTER} type. (Fortran 2008 or later.)
+
@item @code{CHARACTER_STORAGE_SIZE}:
Size in bits of the character storage unit.
size of 16, 32, and 64 bits. It is negative if a target platform
does not support the particular kind. (Fortran 2008 or later.)
+@item @code{INTEGER_KINDS}:
+Default-kind integer constant array of rank one containing the supported kind
+parameters of the @code{INTEGER} type. (Fortran 2008 or later.)
+
@item @code{IOSTAT_END}:
-The value assigned to the variable passed to the IOSTAT= specifier of
+The value assigned to the variable passed to the @code{IOSTAT=} specifier of
an input/output statement if an end-of-file condition occurred.
@item @code{IOSTAT_EOR}:
-The value assigned to the variable passed to the IOSTAT= specifier of
+The value assigned to the variable passed to the @code{IOSTAT=} specifier of
an input/output statement if an end-of-record condition occurred.
@item @code{IOSTAT_INQUIRE_INTERNAL_UNIT}:
Scalar default-integer constant, used by @code{INQUIRE} for the
-IOSTAT= specifier to denote an that a unit number identifies an
+@code{IOSTAT=} specifier to denote an that a unit number identifies an
internal unit. (Fortran 2008 or later.)
@item @code{NUMERIC_STORAGE_SIZE}:
The size in bits of the numeric storage unit.
+@item @code{LOGICAL_KINDS}:
+Default-kind integer constant array of rank one containing the supported kind
+parameters of the @code{LOGICAL} type. (Fortran 2008 or later.)
+
@item @code{OUTPUT_UNIT}:
Identifies the preconnected unit identified by the asterisk
(@code{*}) in @code{WRITE} statement.
size of 32, 64, and 128 bits. It is negative if a target platform
does not support the particular kind. (Fortran 2008 or later.)
+@item @code{REAL_KINDS}:
+Default-kind integer constant array of rank one containing the supported kind
+parameters of the @code{REAL} type. (Fortran 2008 or later.)
+
@item @code{STAT_LOCKED}:
Scalar default-integer constant used as STAT= return value by @code{LOCK} to
denote that the lock variable is locked by the executing image. (Fortran 2008
denote that the lock variable is unlocked. (Fortran 2008 or later.)
@end table
+The module also provides the following intrinsic procedures:
+@ref{COMPILER_OPTIONS} and @ref{COMPILER_VERSION}.
+
@node ISO_C_BINDING
@item @code{C_F_PROCPOINTER}
@item @code{C_FUNLOC}
@item @code{C_LOC}
+@item @code{C_SIZEOF}
@end table
@c TODO: Vertical spacing between C_FUNLOC and C_LOC wrong in PDF,
@c don't really know why.
@code{OMP_LIB_KINDS}, and in a form of a Fortran @code{include} file named
@file{omp_lib.h}. The procedures provided by @code{OMP_LIB} can be found
in the @ref{Top,,Introduction,libgomp,GNU OpenMP runtime library} manual,
-the named constants defined in the @code{OMP_LIB_KINDS} module are listed
+the named constants defined in the modules are listed
below.
For details refer to the actual
@item @code{omp_nest_lock_kind}
@item @code{omp_sched_kind}
@end table
+
+@code{OMP_LIB} provides the scalar default-integer
+named constant @code{openmp_version} with a value of the form
+@var{yyyymm}, where @code{yyyy} is the year and @var{mm} the month
+of the OpenMP version; for OpenMP v3.0 the value is @code{200805}.
+
+And the following scalar integer named constants of the
+kind @code{omp_sched_kind}:
+
+@table @asis
+@item @code{omp_sched_static}
+@item @code{omp_sched_dynamic}
+@item @code{omp_sched_guided}
+@item @code{omp_sched_auto}
+@end table