- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I want to use the function MCLOCK to know the timing of my program.
Here is the peace of code :
integer time_I, time_First, time_Final
time_I = MCLOCK()
On compilation it gives me the error :
"Error: This name does not have a type, and must have an explicit type"
Do you know why?
Anybody knows what to do ?
Thanks
Samba.
I want to use the function MCLOCK to know the timing of my program.
Here is the peace of code :
integer time_I, time_First, time_Final
time_I = MCLOCK()
On compilation it gives me the error :
"Error: This name does not have a type, and must have an explicit type"
Do you know why?
Anybody knows what to do ?
Thanks
Samba.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just forget to say that I am a new Fortran user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you have set
IMPLICIT NONE
(which is good practice) you will need to declare MCLOCK explicitly, either with an old-fashioned
INTEGER MCLOCK
or with an interface block.
If you did not set IMPLICIT NONE, you are probably being caught by the empty argument, which should have been accepted with the interface block. You could add an argument, and simply not use it.
IMO, the interface block ought to be provided if you
USE IFPORT
As that doesn't appear to be the case, I think a problem report on premier.intel.com would be in order. ifort ought to be set up to make your case "just work" when you follow the documentation.
IMPLICIT NONE
(which is good practice) you will need to declare MCLOCK explicitly, either with an old-fashioned
INTEGER MCLOCK
or with an interface block.
If you did not set IMPLICIT NONE, you are probably being caught by the empty argument, which should have been accepted with the interface block. You could add an argument, and simply not use it.
IMO, the interface block ought to be provided if you
USE IFPORT
As that doesn't appear to be the case, I think a problem report on premier.intel.com would be in order. ifort ought to be set up to make your case "just work" when you follow the documentation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tim,
THank for your quick reply.
Actually I set IMPLICIT NONE at the beginning of the program.
I am using Intel Fortran 9.1.
I just saw the report of Steve Lionel about explicit interface.
I try to use the following explicit interface declaration :
INTERFACE
FUNCTION MCLOCK ()
INTEGER ::MCLOCK
END FUNCTION
END INTERFACE
But it does not seem to work.
Any suggestion on the way to declare the interface and where in the program ir should be declared?
Thanks,
Samba.
THank for your quick reply.
Actually I set IMPLICIT NONE at the beginning of the program.
I am using Intel Fortran 9.1.
I just saw the report of Steve Lionel about explicit interface.
I try to use the following explicit interface declaration :
INTERFACE
FUNCTION MCLOCK ()
INTEGER ::MCLOCK
END FUNCTION
END INTERFACE
But it does not seem to work.
Any suggestion on the way to declare the interface and where in the program ir should be declared?
Thanks,
Samba.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a compiler bug. You should not have to declare MCLOCK which is an intrinsic function. Oddly, even adding an INTEGER declaration doesn't help. Using an INTERFACE would be wrong as that means it is an external routine.
I'll report this to the developers. I suggest using the standard intrinsic SYSTEM_CLOCK or perhaps CPU_TIME as an alternative.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Steve.
I'll try to find an alternative
I'll try to find an alternative

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page