Skip to content

Commit c656b4a

Browse files
author
jvdelisle
committed
2005-07-01 Jerry DeLisle <[email protected]>
* intrinsic.texi: Add documentaion for eoshift, epsilon, etime, and exit. Fixed alignment of text for dtime syntax. Fixed a few line lengths. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101530 138bc75d-0d04-0410-961f-82ee72b054a4
1 parent 8fb619a commit c656b4a

File tree

2 files changed

+242
-16
lines changed

2 files changed

+242
-16
lines changed

gcc/fortran/ChangeLog

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2005-07-01 Jerry DeLisle <[email protected]>
2+
3+
* gfortran.texi: Fix typos and grammar.
4+
* invoke.texi: Fix typos and grammar.
5+
* intrinsic.texi: Add documentaion for eoshift, epsilon, etime, and exit.
6+
Fixed alignment of text for dtime syntax. Fixed a few line lengths.
7+
18
2005-06-25 Jakub Jelinek <[email protected]>
29

310
* trans-stmt.c (gfc_trans_forall_1): Prefer to use smaller logical

gcc/fortran/intrinsic.texi

+235-16
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,12 @@ and editing. All contributions and corrections are strongly encouraged.
7777
* @code{DPROD}: DPROD, Double product function
7878
* @code{DREAL}: DREAL, Double real part function
7979
* @code{DTIME}: DTIME, Execution time subroutine (or function)
80+
* @code{EOSHIFT}: EOSHIFT, End-off shift function
81+
* @code{EPSILON}: EPSILON, Epsilon function
8082
* @code{ERF}: ERF, Error function
8183
* @code{ERFC}: ERFC, Complementary error function
84+
* @code{ETIME}: ETIME, Execution time subroutine (or function)
85+
* @code{EXIT}: EXIT, Exit the program with status.
8286
* @code{EXP}: EXP, Cosine function
8387
* @code{LOG}: LOG, Logarithm function
8488
* @code{LOG10}: LOG10, Base 10 logarithm function
@@ -665,8 +669,8 @@ end program test_anint
665669

666670
@table @asis
667671
@item @emph{Description}:
668-
@code{ANY(MASK [, DIM])} determines if any of the values in the logical array @var{MASK}
669-
along dimension @var{DIM} are @code{.TRUE.}.
672+
@code{ANY(MASK [, DIM])} determines if any of the values in the logical array
673+
@var{MASK} along dimension @var{DIM} are @code{.TRUE.}.
670674

671675
@item @emph{Option}:
672676
f95, gnu
@@ -1225,7 +1229,8 @@ end program test_besyn
12251229

12261230
@table @asis
12271231
@item @emph{Description}:
1228-
@code{BIT_SIZE(I)} returns the number of bits (integer precision plus sign bit) represented by the type of @var{I}.
1232+
@code{BIT_SIZE(I)} returns the number of bits (integer precision plus sign bit)
1233+
represented by the type of @var{I}.
12291234

12301235
@item @emph{Option}:
12311236
f95, gnu
@@ -1264,7 +1269,8 @@ end program test_bit_size
12641269

12651270
@table @asis
12661271
@item @emph{Description}:
1267-
@code{BTEST(I,POS)} returns logical .TRUE. if the bit at @var{POS} in @var{I} is set.
1272+
@code{BTEST(I,POS)} returns logical @code{.TRUE.} if the bit at @var{POS}
1273+
in @var{I} is set.
12681274

12691275
@item @emph{Option}:
12701276
f95, gnu
@@ -1964,7 +1970,6 @@ program test_digits
19641970
integer :: i = 12345
19651971
real :: x = 3.143
19661972
real(8) :: y = 2.33
1967-
complex :: z = (23.0,45.6)
19681973
print *, digits(i)
19691974
print *, digits(x)
19701975
print *, digits(y)
@@ -2166,9 +2171,11 @@ end program test_dreal
21662171
@code{DTIME(TARRAY, RESULT)} initially returns the number of seconds of runtime
21672172
since the start of the process's execution in @var{RESULT}. @var{TARRAY}
21682173
returns the user and system components of this time in @code{TARRAY(1)} and
2169-
@code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) + TARRAY(2)}.
2174+
@code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) +
2175+
TARRAY(2)}.
21702176

2171-
Subsequent invocations of @code{DTIME} return values accumulated since the previous invocation.
2177+
Subsequent invocations of @code{DTIME} return values accumulated since the
2178+
previous invocation.
21722179

21732180
On some systems, the underlying timings are represented using types with
21742181
sufficiently small limits that overflows (wraparounds) are possible, such as
@@ -2194,8 +2201,10 @@ gnu
21942201
subroutine
21952202

21962203
@item @emph{Syntax}:
2197-
@code{CALL DTIME(TARRAY, RESULT)}
2198-
@code{RESULT = DTIME(TARRAY)}, (not recommended)
2204+
@multitable @columnfractions .80
2205+
@item @code{CALL DTIME(TARRAY, RESULT)}.
2206+
@item @code{RESULT = DTIME(TARRAY)}, (not recommended).
2207+
@end multitable
21992208

22002209
@item @emph{Arguments}:
22012210
@multitable @columnfractions .15 .80
@@ -2229,6 +2238,110 @@ end program test_dtime
22292238

22302239

22312240

2241+
@node EOSHIFT
2242+
@section @code{EOSHIFT} --- End-off shift function
2243+
@findex @code{EOSHIFT} intrinsic
2244+
@cindex eoshift intrinsic
2245+
2246+
@table @asis
2247+
@item @emph{Description}:
2248+
@code{EOSHIFT(ARRAY, SHIFT[,BOUNDARY, DIM])} performs an end-off shift on
2249+
elements of @var{ARRAY} along the dimension of @var{DIM}. If @var{DIM} is
2250+
omitted it is taken to be @code{1}. @var{DIM} is a scaler of type
2251+
@code{INTEGER} in the range of @math{1 /leq DIM /leq n)} where @math{n} is the
2252+
rank of @var{ARRAY}. If the rank of @var{ARRAY} is one, then all elements of
2253+
@var{ARRAY} are shifted by @var{SHIFT} places. If rank is greater than one,
2254+
then all complete rank one sections of @var{ARRAY} along the given dimension are
2255+
shifted. Elements shifted out one end of each rank one section are dropped. If
2256+
@var{BOUNDARY} is present then the cooresponding value of from @var{BOUNDARY}
2257+
is copied back in the other end. If @var{BOUNDARY} is not present then the
2258+
following are copied in depending on the type of @var{ARRAY}.
2259+
2260+
@multitable @columnfractions .15 .80
2261+
@item @emph{Array Type} @tab @emph{Boundary Value}
2262+
@item Numeric @tab 0 of the type and kind of @var{ARRAY}.
2263+
@item Logical @tab @code{.FALSE.}.
2264+
@item Character(@var{len}) @tab @var{len} blanks.
2265+
@end multitable
2266+
2267+
@item @emph{Option}:
2268+
f95, gnu
2269+
2270+
@item @emph{Class}:
2271+
transformational function
2272+
2273+
@item @emph{Syntax}:
2274+
@code{A = EOSHIFT(A, SHIFT[,BOUNDARY, DIM])}
2275+
2276+
@item @emph{Arguments}:
2277+
@multitable @columnfractions .15 .80
2278+
@item @var{ARRAY} @tab May be any type, not scaler.
2279+
@item @var{SHIFT} @tab The type shall be @code{INTEGER}.
2280+
@item @var{BOUNDARY} @tab Same type as @var{ARRAY}.
2281+
@item @var{DIM} @tab The type shall be @code{INTEGER}.
2282+
@end multitable
2283+
2284+
@item @emph{Return value}:
2285+
Returns an array of same type and rank as the @var{ARRAY} argument.
2286+
2287+
@item @emph{Example}:
2288+
@smallexample
2289+
program test_eoshift
2290+
integer, dimension(3,3) :: a
2291+
a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
2292+
print '(3i3)', a(1,:)
2293+
print '(3i3)', a(2,:)
2294+
print '(3i3)', a(3,:)
2295+
a = EOSHIFT(a, SHIFT=(/1, 2, 1/), BOUNDARY=-5, DIM=2)
2296+
print *
2297+
print '(3i3)', a(1,:)
2298+
print '(3i3)', a(2,:)
2299+
print '(3i3)', a(3,:)
2300+
end program test_eoshift
2301+
@end smallexample
2302+
@end table
2303+
2304+
2305+
2306+
@node EPSILON
2307+
@section @code{EPSILON} --- Epsilon function
2308+
@findex @code{EPSILON} intrinsic
2309+
@cindex epsilon, significant
2310+
2311+
@table @asis
2312+
@item @emph{Description}:
2313+
@code{EPSILON(X)} returns a nearly negligible number relative to @code{1}.
2314+
2315+
@item @emph{Option}:
2316+
f95, gnu
2317+
2318+
@item @emph{Class}:
2319+
inquiry function
2320+
2321+
@item @emph{Syntax}:
2322+
@code{C = EPSILON(X)}
2323+
2324+
@item @emph{Arguments}:
2325+
@multitable @columnfractions .15 .80
2326+
@item @var{X} @tab The type shall be @code{REAL(*)}.
2327+
@end multitable
2328+
2329+
@item @emph{Return value}:
2330+
The return value is of same type as the argument.
2331+
2332+
@item @emph{Example}:
2333+
@smallexample
2334+
program test_epsilon
2335+
real :: x = 3.143
2336+
real(8) :: y = 2.33
2337+
print *, EPSILON(x)
2338+
print *, EPSILON(y)
2339+
end program test_epsilon
2340+
@end smallexample
2341+
@end table
2342+
2343+
2344+
22322345
@node ERF
22332346
@section @code{ERF} --- Error function
22342347
@findex @code{ERF} intrinsic
@@ -2317,6 +2430,119 @@ end program test_erfc
23172430

23182431

23192432

2433+
@node ETIME
2434+
@section @code{ETIME} --- Execution time subroutine (or function)
2435+
@findex @code{ETIME} intrinsic
2436+
@cindex ETIME subroutine
2437+
2438+
@table @asis
2439+
@item @emph{Description}:
2440+
@code{ETIME(TARRAY, RESULT)} returns the number of seconds of runtime
2441+
since the start of the process's execution in @var{RESULT}. @var{TARRAY}
2442+
returns the user and system components of this time in @code{TARRAY(1)} and
2443+
@code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) + TARRAY(2)}.
2444+
2445+
On some systems, the underlying timings are represented using types with
2446+
sufficiently small limits that overflows (wraparounds) are possible, such as
2447+
32-bit types. Therefore, the values returned by this intrinsic might be, or
2448+
become, negative, or numerically less than previous values, during a single
2449+
run of the compiled program.
2450+
2451+
If @code{ETIME} is invoked as a function, it can not be invoked as a
2452+
subroutine, and vice versa.
2453+
2454+
@var{TARRAY} and @var{RESULT} are @code{INTENT(OUT)} and provide the following:
2455+
2456+
@multitable @columnfractions .15 .30 .60
2457+
@item @tab @code{TARRAY(1)}: @tab User time in seconds.
2458+
@item @tab @code{TARRAY(2)}: @tab System time in seconds.
2459+
@item @tab @code{RESULT}: @tab Run time since start in seconds.
2460+
@end multitable
2461+
2462+
@item @emph{Option}:
2463+
gnu
2464+
2465+
@item @emph{Class}:
2466+
subroutine
2467+
2468+
@item @emph{Syntax}:
2469+
@multitable @columnfractions .8
2470+
@item @code{CALL ETIME(TARRAY, RESULT)}.
2471+
@item @code{RESULT = ETIME(TARRAY)}, (not recommended).
2472+
@end multitable
2473+
2474+
@item @emph{Arguments}:
2475+
@multitable @columnfractions .15 .80
2476+
@item @var{TARRAY}@tab The type shall be @code{REAL, DIMENSION(2)}.
2477+
@item @var{RESULT}@tab The type shall be @code{REAL}.
2478+
@end multitable
2479+
2480+
@item @emph{Return value}:
2481+
Elapsed time in seconds since the start of program execution.
2482+
2483+
@item @emph{Example}:
2484+
@smallexample
2485+
program test_etime
2486+
integer(8) :: i, j
2487+
real, dimension(2) :: tarray
2488+
real :: result
2489+
call ETIME(tarray, result)
2490+
print *, result
2491+
print *, tarray(1)
2492+
print *, tarray(2)
2493+
do i=1,100000000 ! Just a delay
2494+
j = i * i - i
2495+
end do
2496+
call ETIME(tarray, result)
2497+
print *, result
2498+
print *, tarray(1)
2499+
print *, tarray(2)
2500+
end program test_etime
2501+
@end smallexample
2502+
@end table
2503+
2504+
2505+
2506+
@node EXIT
2507+
@section @code{EXIT} --- Exit the program with status.
2508+
@findex @code{EXIT}
2509+
@cindex exit
2510+
2511+
@table @asis
2512+
@item @emph{Description}:
2513+
@code{EXIT} causes immediate termination of the program with status. If status
2514+
is omitted it returns the connonical @emph{success} for the system. All Fortran
2515+
I/O units are closed.
2516+
2517+
@item @emph{Option}:
2518+
gnu
2519+
2520+
@item @emph{Class}:
2521+
non-elemental subroutine
2522+
2523+
@item @emph{Syntax}:
2524+
@code{CALL EXIT([STATUS])}
2525+
2526+
@item @emph{Arguments}:
2527+
@multitable @columnfractions .15 .80
2528+
@item @var{STATUS} @tab The type of the argument shall be @code{INTEGER(*)}.
2529+
@end multitable
2530+
2531+
@item @emph{Return value}:
2532+
@code{STATUS} is passed to the parent process on exit.
2533+
2534+
@item @emph{Example}:
2535+
@smallexample
2536+
program test_exit
2537+
integer :: STATUS = 0
2538+
print *, 'This program is going to exit.'
2539+
call EXIT(STATUS)
2540+
end program test_exit
2541+
@end smallexample
2542+
@end table
2543+
2544+
2545+
23202546
@node EXP
23212547
@section @code{EXP} --- Exponential function
23222548
@findex @code{EXP} intrinsic
@@ -2709,13 +2935,6 @@ end program test_tanh
27092935

27102936

27112937

2712-
@comment gen eoshift
2713-
@comment
2714-
@comment gen epsilon
2715-
@comment
2716-
@comment gen etime
2717-
@comment sub etime
2718-
@comment
27192938
@comment sub exit
27202939
@comment
27212940
@comment gen exponent

0 commit comments

Comments
 (0)