time: subroutine or function

I’m trying to move a code that sucessfully compiles with g77 to pgf77 but I get a severe compilation error. According to the manual “time” should return an integer. I’m confused here. Again, the same code compiles with g77 and works just fine. What am I missing here? Please help.

Josef

pgf77 6.2-3 32-bit target on x86 Linux
PGFTN-S-0146-Expression must be character type (test.f: 5)
0 inform, 0 warnings, 1 severes, 0 fatal for test
PGFTN/x86 Linux/x86 6.2-3: compilation completed with severe errors


The code is simply this:

PROGRAM test

CHARACTER*24 CFDATE

cfdate = CTIME(time())

print*, cfdate

end

Hi Josef,

You’ll need to declare the 3f functions otherwise implicit declaration is used. Implicitly, time is declared as a REAL since it begins with the letter ‘T’.

Example:

% cat test.f90
       PROGRAM test
       integer*8 time
       external time
       character *24 ctime
       external ctime
       CHARACTER*24 CFDATE

       cfdate = CTIME(time())
       print*, cfdate
       end
% pgf90 test.f90 -tp k8-64
% a.out
 Wed May 16 13:48:29 2007

For 32-bits, change time’s declaration to integer*4.

Hope this helps,
Mat

thanks a lot. that did the trick.
Josef