subroutine findtime(first,what) USE Numeric_Kinds_Module use CommonInfo_Module implicit none ! Put 'initcount' into a module ! what = what is being timed: limited to 20 characters ! time = in seconds logical first character(len=*) what integer count,count_rate,count_max real(kind=dp) timesec,timemin,timehr call system_clock(count,count_rate,count_max) if (first) then initcount=count end if if (.not.first) then If (count.lt.initcount_global) Then timesec=(Real(count_max-initcount)/count_rate)+(Real(count)/count_rate) Else timesec=Real(count-initcount)/count_rate EndIf !timesec=Real(count-initcount)/count_rate timemin=timesec/60.d0 timehr=timemin/60.d0 !write(Out_Unit,*) ' ' !write(Out_Unit,*) 'Timing for : ',what !write(Out_Unit,*) 'Time in sec = ',timesec !write(Out_Unit,*) 'Time in min = ',timemin !write(Out_Unit,*) 'Time in hr = ',timehr print*,' ' print*,'Timing for : ',what print*,'timesec = ',timesec print*,'timemin = ',timemin print*,'timehr = ',timehr end if end subroutine findtime