This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Utilisation g95


duc.pham@insa-strasbourg.fr wrote:
> When I work with g95, one probleme occurs. It's the function "timef()".
I have a couple of remarks:

First, note that this mailing list is for the GNU Fortran compiler
"gfortran" which is since 4.0 part of the GCC. The g95 compiler is a
different project which is also based on the the GCC backend, but not
part of GCC. See also:
http://gcc.gnu.org/wiki/TheOtherGCCBasedFortranCompiler

More on gfortran: http://gcc.gnu.org/wiki/GFortran
More on g95: http://www.g95.org/


Secondly, timef() is not part of the Fortran standard but a vendor
extension, which is also not that widely supported. On my system only
the Intel Fortran compiler (ifort) supports it, but none of g77,
gfortran, g95 or sunf95 [or NAG f95].

In general one should try to omit vendor extensions and use standard
Fortran intrinsic procedures, i.e. instead of:
real(8) :: t
t = timef()
....
t = timef()
print *, 'Elapsed time: ', t

For instance the following:

integer :: t1, t2, rate
call system_clock(t1, rate)
....
call system_clock(t2)
print *, 'Elapsed time: ', real(t2-t1)/rate


Thirdly, I filled an enhancement bug for timef() in gfortran:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32203

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]