2008-01-11 00:23:57 +05:30
|
|
|
|
|
|
|
|
|
!##############################################################
|
|
|
|
|
MODULE debug
|
|
|
|
|
!##############################################################
|
2008-02-19 18:28:46 +05:30
|
|
|
|
use prec
|
2008-01-11 00:23:57 +05:30
|
|
|
|
|
2008-02-19 18:28:46 +05:30
|
|
|
|
|
|
|
|
|
implicit none
|
2009-03-04 17:18:54 +05:30
|
|
|
|
integer(pInt), dimension(nCutback+1) :: debug_cutbackDistribution = 0_pInt
|
|
|
|
|
integer(pInt), dimension(nInner) :: debug_InnerLoopDistribution = 0_pInt
|
|
|
|
|
integer(pInt), dimension(nOuter) :: debug_OuterLoopDistribution = 0_pInt
|
2009-03-20 20:49:58 +05:30
|
|
|
|
integer(8) :: debug_cumLpTicks = 0_pInt
|
|
|
|
|
integer(8) :: debug_cumDotStateTicks = 0_pInt
|
2009-03-16 23:08:33 +05:30
|
|
|
|
integer(pInt) :: debug_cumLpCalls = 0_pInt
|
2009-03-20 20:04:24 +05:30
|
|
|
|
integer(pInt) :: debug_cumDotStateCalls = 0_pInt
|
2008-02-19 18:28:46 +05:30
|
|
|
|
logical :: debugger = .false.
|
2009-03-04 17:18:54 +05:30
|
|
|
|
logical :: distribution_init = .false.
|
2008-02-19 18:28:46 +05:30
|
|
|
|
|
|
|
|
|
CONTAINS
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!********************************************************************
|
|
|
|
|
! write debug statements to standard out
|
|
|
|
|
!********************************************************************
|
|
|
|
|
SUBROUTINE debug_info()
|
|
|
|
|
|
|
|
|
|
use prec
|
2008-01-11 00:23:57 +05:30
|
|
|
|
implicit none
|
2008-02-19 18:28:46 +05:30
|
|
|
|
|
2009-03-16 23:08:33 +05:30
|
|
|
|
integer(pInt) i,integral
|
2009-03-30 20:24:05 +05:30
|
|
|
|
integer(8) tickrate
|
2008-02-19 18:28:46 +05:30
|
|
|
|
|
2009-03-16 23:08:33 +05:30
|
|
|
|
write(6,*)
|
2008-02-19 18:28:46 +05:30
|
|
|
|
write(6,*) 'DEBUG Info'
|
2009-03-16 23:08:33 +05:30
|
|
|
|
write(6,*)
|
2009-03-20 20:04:24 +05:30
|
|
|
|
write(6,'(a33,x,i12)') 'total calls to LpAndItsTangent :',debug_cumLpCalls
|
2009-03-16 23:08:33 +05:30
|
|
|
|
if (debug_cumLpCalls > 0_pInt) then
|
|
|
|
|
call system_clock(count_rate=tickrate)
|
2009-03-20 20:04:24 +05:30
|
|
|
|
write(6,'(a33,x,f12.6)') 'avg CPU time/microsecs per call :',dble(debug_cumLpTicks)/tickrate/1.0e-6_pReal/debug_cumLpCalls
|
2009-03-16 23:08:33 +05:30
|
|
|
|
write(6,'(a33,x,i12)') 'total CPU ticks :',debug_cumLpTicks
|
|
|
|
|
endif
|
|
|
|
|
write(6,*)
|
2009-03-20 20:04:24 +05:30
|
|
|
|
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,i12)') 'total CPU ticks :',debug_cumDotStateTicks
|
|
|
|
|
endif
|
|
|
|
|
write(6,*)
|
2008-02-19 18:28:46 +05:30
|
|
|
|
write(6,*) 'distribution_cutback :'
|
|
|
|
|
do i=0,nCutback
|
|
|
|
|
if (debug_cutbackDistribution(i+1) /= 0) write(6,*) i,debug_cutbackDistribution(i+1)
|
|
|
|
|
enddo
|
|
|
|
|
write(6,*) 'total',sum(debug_cutbackDistribution)
|
|
|
|
|
write(6,*)
|
|
|
|
|
|
2009-03-16 23:08:33 +05:30
|
|
|
|
integral = 0_pInt
|
2009-03-30 20:24:05 +05:30
|
|
|
|
write(6,*) 'distribution_InnerLoop :'
|
2008-02-19 18:28:46 +05:30
|
|
|
|
do i=1,nInner
|
2009-03-16 23:08:33 +05:30
|
|
|
|
if (debug_InnerLoopDistribution(i) /= 0) then
|
|
|
|
|
integral = integral + i*debug_InnerLoopDistribution(i)
|
|
|
|
|
write(6,*) i,debug_InnerLoopDistribution(i)
|
|
|
|
|
endif
|
2008-02-19 18:28:46 +05:30
|
|
|
|
enddo
|
2009-03-16 23:08:33 +05:30
|
|
|
|
write(6,*) 'total',sum(debug_InnerLoopDistribution),integral
|
2008-02-19 18:28:46 +05:30
|
|
|
|
write(6,*)
|
|
|
|
|
|
2009-03-16 23:08:33 +05:30
|
|
|
|
integral = 0_pInt
|
2008-02-19 18:28:46 +05:30
|
|
|
|
write(6,*) 'distribution_OuterLoop :'
|
|
|
|
|
do i=1,nOuter
|
2009-03-16 23:08:33 +05:30
|
|
|
|
if (debug_OuterLoopDistribution(i) /= 0) then
|
|
|
|
|
integral = integral + i*debug_OuterLoopDistribution(i)
|
|
|
|
|
write(6,*) i,debug_OuterLoopDistribution(i)
|
|
|
|
|
endif
|
2008-02-19 18:28:46 +05:30
|
|
|
|
enddo
|
2009-03-16 23:08:33 +05:30
|
|
|
|
write(6,*) 'total',sum(debug_OuterLoopDistribution),integral
|
2008-02-19 18:28:46 +05:30
|
|
|
|
write(6,*)
|
|
|
|
|
|
|
|
|
|
END SUBROUTINE
|
2008-01-11 00:23:57 +05:30
|
|
|
|
|
|
|
|
|
END MODULE debug
|