- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
I'm trying to evalute the model performance using ifort, however the print out did not show up properly.
Here is my code. Please show me how to complish this task.
real*4 telapse
character*8 ctime(2)
* Time the run
call time(ctime(1))
:
:
* End of the simulation call time(ctime(2))
call print_runtime(telapse, ctime)
:
:
************************************************************************
subroutine print_runtime(telapse, ctime)
************************************************************************
implicit none
real*4 telapse
character*8 ctime(2)
integer*2 RunDays,
> RunHours,
> RunMins,
> RunSecs
character*40 msgstr, rtfname
parameter (msgstr = ' *** Total run time (wallclock) was ')
parameter (rtfname = 'runtime.txt')
open (unit=99, file=rtfname, status='unknown')
write (99,*) telapse, ' ', ctime(1), ' ', ctime(2)
close (99)
* Now convert telapse from seconds to DD HH:MM:SS
RunDays = INT (telapse / 86400.0)
telapse = telapse - (RunDays * 86400.0)
RunHours = INT (telapse / 3600.0)
telapse = telapse - (RunHours * 3600.0)
RunMins = INT (telapse / 60.0)
RunSecs = NINT (telapse - (RunMins * 60.0))
if (RunDays .GT. 0) then
write (*,1) msgstr, RunDays, RunHours, RunMins, RunSecs
1 format (A36, I2, 'days, ', I2.2, ':', I2.2, ':', I2.2, ' hh:mm:ss ***')
else if (RunHours .GT. 0) then
write (*,2) msgstr, RunHours, RunMins, RunSecs
2 format (A36, I2, ':', I2.2, ':', I2.2, ' hh:mm:ss ***')
else if (RunMins .GT. 0) then
write (*,3) msgstr, RunMins, RunSecs
3 format (A36, I2, ':', I2.2, ' mm:ss ***')
else ! less than 60 seconds
write (*,4) msgstr, telapse
4 format (A36, F7.4, ' seconds ***')
endif
return
end
Currently, my print out shows "*** Total run time (wallclock) was 0.0000seconds ***"
How to show up a proper total run time (wallclock) here?
Theruntime.txt shows 0.0000000E+00 16:57:32 16:57:44
Thanks.
Michael
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Perhaps its in code you don't show, but where is telapse ever set? I suggest that you use the standard Fortran intrinsic SYSTEM_CLOCK for this purpose.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Perhaps its in code you don't show, but where is telapse ever set? I suggest that you use the standard Fortran intrinsic SYSTEM_CLOCK for this purpose.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI Steve,
Agree.
I usesystem_clock andcpu_time instead of time or dtime.
Thanks.
Michael

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