Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

dsecnd command in Fortran 77

Randy_Clark
Beginner
821 Views

I am trying to time a program that I have written, but I need to break it up into different intervals to account for the time I spend inputting data and the time the prorgam actually calculates the information.  On my computer, the program runs very quickly, so getting the time in double precision would be prefered.  I found the dsecnd command in compiler documentation, but it doesn't give much info on how to use.  When I try to compile my program, I have gotten some different errors.  First, it said dsecnd did not have a type and that it must have an explicit type, so I declared dsecnd to be double precision.  Then it said it is an unresolved external symbol.

Searching around the internet, I cannot seem to find any examples of dsecnd being used.  Does anyone have an example, or any suggestions?

0 Kudos
2 Replies
Steven_L_Intel1
Employee
821 Views

Intel Fortran does not provide a DSECND library routine.  It does provide quite a few ways of obtaining time. The one I would recommend most is the Fortran standard intrinsic SYSTEM_CLOCK.  If you wish, you can use the extension SECNDS, which is close to what you seem to want for DSECND.  It takes a single argument that can be single or double precision and it returns the time in seconds since midnight, subtracted by the argument.

If you want to track CPU time rather than "wall clock" time, look at the standard intrinsic CPU_TIME.

0 Kudos
Randy_Clark
Beginner
821 Views

Thanks.  Using the SYSTEM_CLOCK function with 8 bit integers seems to be helping. 

0 Kudos
Reply