From 1dcb80753c47b0ce9bc00dcee7e5fda4042891a0 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 22 Oct 2009 09:14:17 +0000 Subject: [PATCH] tidying up code and reversing order in debug timing output --- code/debug.f90 | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/code/debug.f90 b/code/debug.f90 index 21b5bffb0..159e76200 100644 --- a/code/debug.f90 +++ b/code/debug.f90 @@ -22,6 +22,10 @@ CONTAINS + +!******************************************************************** +! initialize the debugging capabilities +!******************************************************************** subroutine debug_init() use prec, only: pInt @@ -59,11 +63,11 @@ subroutine debug_reset() debug_CrystalliteLoopDistribution = 0_pInt debug_MaterialpointStateLoopDistribution = 0_pInt debug_MaterialpointLoopDistribution = 0_pInt - debug_cumLpTicks = 0_pInt - debug_cumDotStateTicks = 0_pInt + debug_cumLpTicks = 0_pInt + debug_cumDotStateTicks = 0_pInt debug_cumDotTemperatureTicks = 0_pInt - debug_cumLpCalls = 0_pInt - debug_cumDotStateCalls = 0_pInt + debug_cumLpCalls = 0_pInt + debug_cumDotStateCalls = 0_pInt debug_cumDotTemperatureCalls = 0_pInt endsubroutine @@ -81,34 +85,33 @@ endsubroutine nHomog implicit none - integer(pInt) i,integral - integer(pLongInt) tickrate + integer(pInt) i,integral + integer(pLongInt) tickrate + call system_clock(count_rate=tickrate) write(6,*) write(6,*) 'DEBUG Info' write(6,*) - write(6,'(a33,x,i12)') 'total calls to LpAndItsTangent :',debug_cumLpCalls + write(6,'(a33,x,i12)') 'total calls to LpAndItsTangent :',debug_cumLpCalls if (debug_cumLpCalls > 0_pInt) then - call system_clock(count_rate=tickrate) - write(6,'(a33,x,f12.6)') 'avg CPU time/microsecs per call :',dble(debug_cumLpTicks)/tickrate/1.0e-6_pReal/debug_cumLpCalls - write(6,'(a33,x,f12.3)') 'total CPU time/s :',dble(debug_cumLpTicks)/tickrate + write(6,'(a33,x,f12.3)') 'total CPU time/s :',dble(debug_cumLpTicks)/tickrate + write(6,'(a33,x,f12.6)') 'avg CPU time/microsecs per call :',& + dble(debug_cumLpTicks)*1.0e6_pReal/tickrate/debug_cumLpCalls endif write(6,*) - write(6,'(a33,x,i12)') 'total calls to dotState :',debug_cumDotStateCalls + write(6,'(a33,x,i12)') 'total calls to dotState :',debug_cumDotStateCalls if (debug_cumdotStateCalls > 0_pInt) then - call system_clock(count_rate=tickrate) - write(6,'(a33,x,f12.6)') 'avg CPU time/microsecs per call :',& - dble(debug_cumDotStateTicks)/tickrate/1.0e-6_pReal/debug_cumDotStateCalls - write(6,'(a33,x,f12.3)') 'total CPU time/s :',dble(debug_cumDotStateTicks)/tickrate + write(6,'(a33,x,f12.3)') 'total CPU time/s :',dble(debug_cumDotStateTicks)/tickrate + write(6,'(a33,x,f12.6)') 'avg CPU time/microsecs per call :',& + dble(debug_cumDotStateTicks)*1.0e6_pReal/tickrate/debug_cumDotStateCalls endif write(6,*) - write(6,'(a33,x,i12)') 'total calls to dotTemperature :',debug_cumDotTemperatureCalls + write(6,'(a33,x,i12)') 'total calls to dotTemperature :',debug_cumDotTemperatureCalls if (debug_cumdotTemperatureCalls > 0_pInt) then - call system_clock(count_rate=tickrate) - write(6,'(a33,x,f12.6)') 'avg CPU time/microsecs per call :',& - dble(debug_cumDotTemperatureTicks)/tickrate/1.0e-6_pReal/debug_cumDotTemperatureCalls - write(6,'(a33,x,f12.3)') 'total CPU time/s :',dble(debug_cumDotTemperatureTicks)/tickrate + write(6,'(a33,x,f12.3)') 'total CPU time/s :', dble(debug_cumDotTemperatureTicks)/tickrate + write(6,'(a33,x,f12.6)') 'avg CPU time/microsecs per call :',& + dble(debug_cumDotTemperatureTicks)*1.0e6_pReal/tickrate/debug_cumDotTemperatureCalls endif integral = 0_pInt