This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [gfortran,patch] Add ITIME and IDATE intrinsics
- From: Daniel Franke <franke dot daniel at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Date: Mon, 3 Jul 2006 22:55:44 +0200
- Subject: Re: [gfortran,patch] Add ITIME and IDATE intrinsics
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:message-id; b=AH793uOG4rqJmLUiJ7fbb2cTrHEPkAaJavfRzcBffK01FAzHcHE/3tIWezZX1tkVWdgjIxhWqBeN6y3pDQFaZhEBWdSGhESBzq2zCKExXIFebjFOlHO1viUaE3fNIA2J2NEMGA73UJ9BGxzcFi5bLVa+HkHNRwfrh5D60E3n4Xw=
- References: <44A96CC0.1080505@gmail.com> <200607032150.42422.franke.daniel@gmail.com> <44A981A4.30406@gmail.com>
> > If not yet done, I could update intrinsic.texi?
> That would be a most welcome contribution!
Done and attached (mostly stripped from g77 manuals).
> Just a simple check: do you have a copyright assignement with the FSF?
Nope. That's first contribution besides problem reports.
Regards
Daniel
Index: intrinsic.texi
===================================================================
--- intrinsic.texi (revision 115149)
+++ intrinsic.texi (working copy)
@@ -100,7 +100,9 @@
* @code{HUGE}: HUGE, Largest number of a kind
* @code{IACHAR}: IACHAR, Code in @acronym{ASCII} collating sequence
* @code{ICHAR}: ICHAR, Character-to-integer conversion function
+* @code{IDATE}: IDATE, Current local time (day/month/year)
* @code{IRAND}: IRAND, Integer pseudo-random number
+* @code{ITIME}: ITIME, Current local time (hour/minutes/seconds)
* @code{KIND}: KIND, Kind of an entity
* @code{LOC}: LOC, Returns the address of a variable
* @code{LOG}: LOG, Logarithm function
@@ -3294,8 +3296,48 @@
@end smallexample
@end table
+@node IDATE
+@section @code{IDATE} --- Get current local time subroutine (day/month/year)
+@findex @code{IDATE} intrinsic
+@table @asis
+@item @emph{Description}:
+@code{IDATE(TARRAY)} Fills @code{TARRAY} with the numerical values at the
+current local time. The day (in the range 1-31), month (in the range 1-12),
+and year appear in elements 1, 2, and 3 of @code{TARRAY}, respectively.
+The year has four significant digits.
+@item @emph{Option}:
+gnu
+
+@item @emph{Class}:
+subroutine
+
+@item @emph{Syntax}:
+@code{CALL IDATE(TARRAY)}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .80
+@item @var{TARRAY} @tab The type shall be @code{REAL, DIMENSION(3)}.
+@end multitable
+
+@item @emph{Return value}:
+The day, month and year of the current local time.
+
+
+@item @emph{Example}:
+@smallexample
+program test_idate
+ integer, dimension(3) :: tarray
+ call idate(tarray)
+ print *, tarray(1)
+ print *, tarray(2)
+ print *, tarray(3)
+end program test_idate
+@end smallexample
+@end table
+
+
@node IRAND
@section @code{IRAND} --- Integer pseudo-random number
@findex @code{IRAND} intrinsic
@@ -3340,8 +3382,48 @@
@end table
+@node ITIME
+@section @code{ITIME} --- Get current local time subroutine (hour/minutes/seconds)
+@findex @code{ITIME} intrinsic
+@table @asis
+@item @emph{Description}:
+@code{IDATE(TARRAY)} Fills @code{TARRAY} with the numerical values at the
+current local time. The hour (in the range 1-24), minute (in the range 1-60),
+and seconds (in the range 1-60) appear in elements 1, 2, and 3 of @code{TARRAY},
+respectively.
+@item @emph{Option}:
+gnu
+
+@item @emph{Class}:
+subroutine
+
+@item @emph{Syntax}:
+@code{CALL ITIME(TARRAY)}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .80
+@item @var{TARRAY} @tab The type shall be @code{REAL, DIMENSION(3)}.
+@end multitable
+
+@item @emph{Return value}:
+The hour, minutes and seconds of the current local time.
+
+
+@item @emph{Example}:
+@smallexample
+program test_itime
+ integer, dimension(3) :: tarray
+ call itime(tarray)
+ print *, tarray(1)
+ print *, tarray(2)
+ print *, tarray(3)
+end program test_itime
+@end smallexample
+@end table
+
+
@node KIND
@section @code{KIND} --- Kind of an entity
@findex @code{KIND} intrinsic