Utilisation g95
Tobias Burnus
burnus@net-b.de
Mon Jun 4 09:43:00 GMT 2007
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
More information about the Fortran
mailing list