Fortran: Grammar/markup fixes in intrinsics documentation

Continuing a series of patches to tidy the Fortran manual, this
installment fixes problems with inappropriate use of future tense and
adds some missing markup I noticed in passing.

gcc/fortran/ChangeLog
	* intrinsic.texi: Grammar and markup fixes throughout
	the file.
This commit is contained in:
Sandra Loosemore 2024-12-27 20:45:14 +00:00
parent 26226ace87
commit 2c5761025a

View file

@ -348,10 +348,10 @@ another kind, which have more precision. On typical target architectures
supported by @command{gfortran}, this kind type parameter is @code{KIND=8}.
Hence, @code{REAL(KIND=8)} and @code{DOUBLE PRECISION} are equivalent.
In the description of generic intrinsic procedures, the kind type parameter
will be specified by @code{KIND=*}, and in the description of specific
names for an intrinsic procedure the kind type parameter will be explicitly
is specified by @code{KIND=*}, and in the description of specific
names for an intrinsic procedure the kind type parameter is explicitly
given (e.g., @code{REAL(KIND=4)} or @code{REAL(KIND=8)}). Finally, for
brevity the optional @code{KIND=} syntax will be omitted.
brevity the optional @code{KIND=} syntax is omitted.
Many of the intrinsic procedures take one or more optional arguments.
This document follows the convention used in the Fortran 95 standard,
@ -380,8 +380,8 @@ the applicable standard for each intrinsic procedure is noted.
@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.
It will also print a backtrace, unless @code{-fno-backtrace} is given.
systems that support a core dump, @code{ABORT} produces a core dump.
It also prints a backtrace, unless @code{-fno-backtrace} is given.
@item @emph{Standard}:
GNU extension
@ -759,7 +759,7 @@ Inverse function: @*
@table @asis
@item @emph{Description}:
@code{ADJUSTL(STRING)} will left adjust a string by removing leading spaces.
@code{ADJUSTL(STRING)} left adjusts a string by removing leading spaces.
Spaces are inserted at the end of the string as needed.
@item @emph{Standard}:
@ -805,7 +805,7 @@ end program test_adjustl
@table @asis
@item @emph{Description}:
@code{ADJUSTR(STRING)} will right adjust a string by removing trailing spaces.
@code{ADJUSTR(STRING)} right adjusts a string by removing trailing spaces.
Spaces are inserted at the start of the string as needed.
@item @emph{Standard}:
@ -929,7 +929,7 @@ expression indicating the kind parameter of the result.
@item @emph{Return value}:
The return value is of type @code{REAL} with the kind type parameter of the
argument if the optional @var{KIND} is absent; otherwise, the kind
type parameter will be given by @var{KIND}. If the magnitude of
type parameter is given by @var{KIND}. If the magnitude of
@var{X} is less than one, @code{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
@ -967,7 +967,7 @@ end program test_aint
@code{ALARM(SECONDS, HANDLER [, STATUS])} causes external subroutine @var{HANDLER}
to be executed after a delay of @var{SECONDS} by using @code{alarm(2)} to
set up a signal and @code{signal(2)} to catch it. If @var{STATUS} is
supplied, it will be returned with the number of seconds remaining until
supplied, it is returned with the number of seconds remaining until
any previously scheduled alarm was due to be delivered, or zero if there
was no previously scheduled alarm.
@ -1002,7 +1002,7 @@ program test_alarm
call sleep(10)
end program test_alarm
@end smallexample
This will cause the external routine @var{handler_print} to be called
This causes the external routine @var{handler_print} to be called
after 3 seconds.
@end table
@ -1211,7 +1211,7 @@ expression indicating the kind parameter of the result.
@item @emph{Return value}:
The return value is of type real with the kind type parameter of the
argument if the optional @var{KIND} is absent; otherwise, the kind
type parameter will be given by @var{KIND}. If @var{A} is greater than
type parameter is given by @var{KIND}. If @var{A} is greater than
zero, @code{ANINT(A)} returns @code{AINT(X+0.5)}. If @var{A} is
less than or equal to zero then it returns @code{AINT(X-0.5)}.
@ -1577,7 +1577,7 @@ if @var{Y} is present, @var{X} shall be REAL.
@item @emph{Return value}:
The return value is of the same type and kind as @var{X}.
If @var{Y} is present, the result is identical to @code{ATAN2(Y,X)}.
Otherwise, it the arcus tangent of @var{X}, where the real part of
Otherwise, it the arctangent of @var{X}, where the real part of
the result is in radians and lies in the range
@math{-\pi/2 \leq \Re \atan(x) \leq \pi/2}.
@ -3379,7 +3379,7 @@ the sizes of the data pointed to by these components.
print *, (c_sizeof(s)/c_sizeof(r) == 5)
end
@end smallexample
The example will print @code{T} unless you are using a platform
The example prints @code{T} unless you are using a platform
where default @code{REAL} variables are unusually padded.
@item @emph{See also}:
@ -4577,13 +4577,13 @@ Returns a @code{REAL} value representing the elapsed CPU time in
seconds. This is useful for testing segments of code to determine
execution time.
If a time source is available, time will be reported with microsecond
If a time source is available, time is reported with microsecond
resolution. If no time source is available, @var{TIME} is set to
@code{-1.0}.
Note that @var{TIME} may contain a, system dependent, arbitrary offset
Note that @var{TIME} may contain a system-dependent arbitrary offset
and may not start with @code{0.0}. For @code{CPU_TIME}, the absolute
value is meaningless, only differences between subsequent calls to
value is meaningless; only differences between subsequent calls to
this subroutine, as shown in the example below, should be used.
@ -4691,7 +4691,7 @@ end program test_cshift
@table @asis
@item @emph{Description}:
@code{CTIME} converts a system time value, such as returned by
@ref{TIME8}, to a string. The output will be of the form @samp{Sat
@ref{TIME8}, to a string. The output is of the form @samp{Sat
Aug 19 18:13:14 1995}.
This intrinsic is provided in both subroutine and function forms; however,
@ -4715,7 +4715,7 @@ Subroutine, function
@item @var{RESULT} @tab The type shall be of type @code{CHARACTER} and
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.
completely, it is blank on procedure return.
@end multitable
@item @emph{Return value}:
@ -5285,7 +5285,7 @@ become, negative, or numerically less than previous values, during a single
run of the compiled program.
Please note, that this implementation is thread safe if used within OpenMP
directives, i.e., its state will be consistent while called from multiple
directives, i.e., its state is consistent while called from multiple
threads. However, if @code{DTIME} is called from multiple threads, the result
is still the time since the last invocation. This may not give the intended
results. If possible, use @code{CPU_TIME} instead.
@ -5669,10 +5669,10 @@ end program test_etime
@table @asis
@item @emph{Description}:
@code{EVENT_QUERY} assignes the number of events to @var{COUNT} which have been
@code{EVENT_QUERY} assigns the number of events to @var{COUNT} that have been
posted to the @var{EVENT} variable and not yet been removed by calling
@code{EVENT WAIT}. When @var{STAT} is present and the invocation was successful,
it is assigned the value 0. If it is present and the invocation has failed,
@code{EVENT WAIT}. When @var{STAT} is present and the invocation is successful,
it is assigned the value 0. If it is present and the invocation fails,
it is assigned a positive value and @var{COUNT} is assigned the value @math{-1}.
@item @emph{Standard}:
@ -5785,8 +5785,8 @@ end program test_exec
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
dependent. In particular, on POSIX-compliant systems, the @code{SIGINT} and
@code{SIGQUIT} signals are ignored, and @code{SIGCHLD} is blocked. As
such, if the parent process is terminated, the child process might not be
terminated alongside.
@ -6007,7 +6007,7 @@ Subroutine, function
@item @var{DATE}@tab The type shall be of type @code{CHARACTER} of the
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.
completely, it is blank on procedure return.
@end multitable
@item @emph{Return value}:
@ -6917,7 +6917,7 @@ After @code{GETARG} returns, the @var{VALUE} argument holds the
@var{POS}th command line argument. If @var{VALUE} cannot hold the
argument, it is truncated to fit the length of @var{VALUE}. If there are
less than @var{POS} arguments specified at the command line, @var{VALUE}
will be filled with blanks. If @math{@var{POS} = 0}, @var{VALUE} is set
is filled with blanks. If @math{@var{POS} = 0}, @var{VALUE} is set
to the name of the program (on systems that support this feature).
@item @emph{Example}:
@ -7032,7 +7032,7 @@ and of default kind.
After @code{GET_COMMAND_ARGUMENT} returns, the @var{VALUE} argument holds the
@var{NUMBER}-th command line argument. If @var{VALUE} cannot hold the argument, it is
truncated to fit the length of @var{VALUE}. If there are less than @var{NUMBER}
arguments specified at the command line, @var{VALUE} will be filled with blanks.
arguments specified at the command line, @var{VALUE} is filled with blanks.
If @math{@var{NUMBER} = 0}, @var{VALUE} is set to the name of the program (on
systems that support this feature). The @var{LENGTH} argument contains the
length of the @var{NUMBER}-th command line argument. If the argument retrieval
@ -7146,7 +7146,7 @@ Subroutine
@item @emph{Return value}:
Stores the value of @var{NAME} in @var{VALUE}. If @var{VALUE} is
not large enough to hold the data, it is truncated. If @var{NAME}
is not set, @var{VALUE} will be filled with blanks.
is not set, @var{VALUE} is filled with blanks.
@item @emph{Example}:
@smallexample
@ -7203,7 +7203,7 @@ and of default kind.
@item @emph{Return value}:
Stores the value of @var{NAME} in @var{VALUE}. If @var{VALUE} is
not large enough to hold the data, it is truncated. If @var{NAME}
is not set, @var{VALUE} will be filled with blanks. Argument @var{LENGTH}
is not set, @var{VALUE} is filled with blanks. Argument @var{LENGTH}
contains the length needed for storing the environment variable @var{NAME}
or zero if it is not present. @var{STATUS} is -1 if @var{VALUE} is present
but too short for the environment variable; it is 1 if the environment
@ -7285,8 +7285,8 @@ Subroutine
@item @emph{Return value}:
Stores the current user name in @var{C}. (On systems where POSIX
functions @code{geteuid} and @code{getpwuid} are not available, and
the @code{getlogin} function is not implemented either, this will
return a blank string.)
the @code{getlogin} function is not implemented either, this
returns a blank string.)
@item @emph{Example}:
@smallexample
@ -9733,7 +9733,7 @@ If @var{X} is @code{COMPLEX}, the imaginary part @math{\omega} is in the range
program test_log
real(8) :: x = 2.7182818284590451_8
complex :: z = (1.0, 2.0)
x = log(x) ! will yield (approximately) 1
x = log(x) ! yields (approximately) 1
z = log(z)
end program test_log
@end smallexample
@ -9947,8 +9947,8 @@ The return value is of type @code{INTEGER} and of the same kind as
@table @asis
@item @emph{Description}:
@code{LSTAT} is identical to @ref{STAT}, except that if path is a
symbolic link, then the link itself is statted, not the file that it
refers to.
symbolic link, then the operation is performed on the link itself,
not the file that it refers to.
The elements in @code{VALUES} are the same as described by @ref{STAT}.
@ -10505,7 +10505,7 @@ on the function @code{clock(3)} in the C standard library.
@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} returns 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
@ -10984,7 +10984,7 @@ end program
@table @asis
@item @emph{Description}:
@code{MOVE_ALLOC(FROM, TO)} moves the allocation from @var{FROM} to
@var{TO}. @var{FROM} will become deallocated in the process.
@var{TO}. @var{FROM} becomes deallocated in the process.
@item @emph{Standard}:
Fortran 2003 and later
@ -12082,7 +12082,7 @@ and when using multiple threads up to @math{2^{128}} threads can each
generate @math{2^{128}} random numbers before any aliasing occurs.
Note that in a multi-threaded program (e.g. using OpenMP directives),
each thread will have its own random number state. For details of the
each thread has its own random number state. For details of the
seeding procedure, see the documentation for the @code{RANDOM_SEED}
intrinsic.
@ -13655,7 +13655,7 @@ storage or an array element multiplied by the size of the array.
print *, (sizeof(s)/sizeof(r) == 5)
end
@end smallexample
The example will print @code{.TRUE.} unless you are using a platform
The example prints @code{.TRUE.} unless you are using a platform
where default @code{REAL} variables are unusually padded.
@item @emph{See also}:
@ -14195,8 +14195,8 @@ larger integer kinds), @var{COUNT} typically represents micro- or
nanoseconds depending on resolution of the underlying platform clock.
@var{COUNT_MAX} usually equals @code{HUGE(COUNT_MAX)}. Note that the
millisecond resolution of the @var{kind=4} version implies that the
@var{COUNT} will wrap around in roughly 25 days. In order to avoid issues
with the wrap around and for more precise timing, please use the
@var{COUNT} wraps around in roughly 25 days. In order to avoid issues
with the wrap-around and for more precise timing, please use the
@var{kind=8} version.
If there is no clock, or querying the clock fails, @var{COUNT} is set
@ -14538,7 +14538,7 @@ suitable for passing to @ref{CTIME}, @ref{GMTIME}, and @ref{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} returns 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
@ -15346,27 +15346,27 @@ 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
Scalar default-integer constant used as @code{STAT=} return value by @code{LOCK} to
denote that the lock variable is locked by the executing image. (Fortran 2008
or later.)
@item @code{STAT_LOCKED_OTHER_IMAGE}:
Scalar default-integer constant used as STAT= return value by @code{UNLOCK} to
Scalar default-integer constant used as @code{STAT=} return value by @code{UNLOCK} to
denote that the lock variable is locked by another image. (Fortran 2008 or
later.)
@item @code{STAT_STOPPED_IMAGE}:
Positive, scalar default-integer constant used as STAT= return value if the
argument in the statement requires synchronisation with an image, which has
initiated the termination of the execution. (Fortran 2008 or later.)
Positive, scalar default-integer constant used as @code{STAT=} return value if the
argument in the statement requires synchronization with an image that has
initiated termination. (Fortran 2008 or later.)
@item @code{STAT_FAILED_IMAGE}:
Positive, scalar default-integer constant used as STAT= return value if the
argument in the statement requires communication with an image, which has
is in the failed state. (TS 18508 or later.)
Positive, scalar default-integer constant used as @code{STAT=} return value if the
argument in the statement requires communication with an image that is
in the failed state. (TS 18508 or later.)
@item @code{STAT_UNLOCKED}:
Scalar default-integer constant used as STAT= return value by @code{UNLOCK} to
Scalar default-integer constant used as @code{STAT=} return value by @code{UNLOCK} to
denote that the lock variable is unlocked. (Fortran 2008 or later.)
@end table