From: Tobias Burnus on
On 12/14/2009 12:04 PM, Vivek Astvansh wrote:
> When I compile my .f file with gcc440, I get the following error:
> Error: Missing actual argument 'time' in call to 'dtime' at (1)
>
> Note that the file compiles fine with gcc412.

Are you sure that you call with "gcc412" also dtime and not (some
external) fdtime? I am asking because my GCC/gfortran 4.1.2 prints the
same error message as your gcc440 or my GCC 4.5.0.

> #if MD_LINUX || linux
> call fdtime(timeee)
> #else
> call dtime(timeee)
> #endif

The error message also makes perfectly sense if one looks at the
documentation of "dtime" at
http://gcc.gnu.org/onlinedocs/gfortran/DTIME.html

(Even g77 has the same syntax:
http://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/DTime-Intrinsic-_0028subroutine_0029.html
)

Reading the documentation, one finds out that "dtime" exists in
g77/gfortran both as function and as subroutine. The subroutine version
takes two arguments - and not just one.

I quickly checked some other compilers and those seem only to support
the function version - with the same syntax as gfortran. Thus I wonder
with which compiler "call dtime(timeee)" actually worked.

If you look at the gfortran documentation [first link], you will see
that at the bottom there is a reference to CPU_TIME. Unless you need to
support quite old compilers, you should consider to switch to CPU_TIME
as this intrinsic is well defined (part of the Fortran 95/2003[/2008
draft] standard [but not in Fortran 77 or 90]) - and thus works with all
Fortran 95 compilers, which are widely used.

Tobias