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-06-15 18:41:21 +05:30
|
|
|
integer(pInt), dimension(:), allocatable :: debug_StressLoopDistribution
|
|
|
|
integer(pInt), dimension(:), allocatable :: debug_StateLoopDistribution
|
|
|
|
integer(pInt), dimension(:), allocatable :: debug_StiffnessStateLoopDistribution
|
|
|
|
integer(pInt), dimension(:), allocatable :: debug_CrystalliteLoopDistribution
|
2009-03-31 14:21:14 +05:30
|
|
|
integer(pLongInt) :: debug_cumLpTicks = 0_pInt
|
|
|
|
integer(pLongInt) :: debug_cumDotStateTicks = 0_pInt
|
2009-07-01 15:59:35 +05:30
|
|
|
integer(pLongInt) :: debug_cumDotTemperatureTicks = 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
|
2009-07-01 15:59:35 +05:30
|
|
|
integer(pInt) :: debug_cumDotTemperatureCalls = 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
|
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
subroutine debug_init()
|
|
|
|
|
|
|
|
use prec, only: pInt
|
|
|
|
use numerics, only: nStress, &
|
|
|
|
nState, &
|
|
|
|
nCryst
|
|
|
|
implicit none
|
2009-06-18 19:58:02 +05:30
|
|
|
|
|
|
|
write(6,*)
|
|
|
|
write(6,*) '<<<+- debug init -+>>>'
|
|
|
|
write(6,*)
|
2009-06-15 18:41:21 +05:30
|
|
|
|
|
|
|
allocate(debug_StressLoopDistribution(nStress)) ; debug_StressLoopDistribution = 0_pInt
|
|
|
|
allocate(debug_StateLoopDistribution(nState)) ; debug_StateLoopDistribution = 0_pInt
|
|
|
|
allocate(debug_StiffnessStateLoopDistribution(nState)) ; debug_StiffnessStateLoopDistribution = 0_pInt
|
|
|
|
allocate(debug_CrystalliteLoopDistribution(nCryst)) ; debug_CrystalliteLoopDistribution = 0_pInt
|
|
|
|
endsubroutine
|
|
|
|
|
2009-05-07 21:57:36 +05:30
|
|
|
!********************************************************************
|
|
|
|
! reset debug distributions
|
|
|
|
!********************************************************************
|
2009-06-15 18:41:21 +05:30
|
|
|
subroutine debug_reset()
|
2009-05-07 21:57:36 +05:30
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
use prec
|
|
|
|
implicit none
|
2009-05-07 21:57:36 +05:30
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
debug_StressLoopDistribution = 0_pInt ! initialize debugging data
|
|
|
|
debug_StateLoopDistribution = 0_pInt
|
|
|
|
debug_StiffnessStateLoopDistribution = 0_pInt
|
|
|
|
debug_CrystalliteLoopDistribution = 0_pInt
|
|
|
|
debug_cumLpTicks = 0_pInt
|
|
|
|
debug_cumDotStateTicks = 0_pInt
|
2009-07-01 15:59:35 +05:30
|
|
|
debug_cumDotTemperatureTicks = 0_pInt
|
2009-06-15 18:41:21 +05:30
|
|
|
debug_cumLpCalls = 0_pInt
|
|
|
|
debug_cumDotStateCalls = 0_pInt
|
2009-07-01 15:59:35 +05:30
|
|
|
debug_cumDotTemperatureCalls = 0_pInt
|
2009-05-07 21:57:36 +05:30
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
endsubroutine
|
2008-02-19 18:28:46 +05:30
|
|
|
|
|
|
|
!********************************************************************
|
|
|
|
! write debug statements to standard out
|
|
|
|
!********************************************************************
|
2009-06-15 18:41:21 +05:30
|
|
|
subroutine debug_info()
|
2008-02-19 18:28:46 +05:30
|
|
|
|
|
|
|
use prec
|
2009-06-15 18:41:21 +05:30
|
|
|
use numerics, only: nStress, &
|
|
|
|
nState, &
|
|
|
|
nCryst
|
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-31 14:21:14 +05:30
|
|
|
integer(pLongInt) tickrate
|
2009-06-15 18:41:21 +05:30
|
|
|
|
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
|
2009-07-01 15:59:35 +05:30
|
|
|
write(6,*)
|
|
|
|
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,i12)') 'total CPU ticks :',debug_cumDotTemperatureTicks
|
|
|
|
endif
|
2009-05-07 21:57:36 +05:30
|
|
|
|
2009-03-16 23:08:33 +05:30
|
|
|
integral = 0_pInt
|
2009-05-07 21:57:36 +05:30
|
|
|
write(6,*)
|
|
|
|
write(6,*) 'distribution_StressLoop :'
|
|
|
|
do i=1,nStress
|
|
|
|
if (debug_StressLoopDistribution(i) /= 0) then
|
|
|
|
integral = integral + i*debug_StressLoopDistribution(i)
|
2009-05-28 22:08:40 +05:30
|
|
|
write(6,'(i25,i10)') i,debug_StressLoopDistribution(i)
|
2009-03-16 23:08:33 +05:30
|
|
|
endif
|
2008-02-19 18:28:46 +05:30
|
|
|
enddo
|
2009-05-28 22:08:40 +05:30
|
|
|
write(6,'(a15,i10,i10)') ' total',sum(debug_StressLoopDistribution),integral
|
2008-02-19 18:28:46 +05:30
|
|
|
|
2009-03-16 23:08:33 +05:30
|
|
|
integral = 0_pInt
|
2009-05-07 21:57:36 +05:30
|
|
|
write(6,*)
|
|
|
|
write(6,*) 'distribution_StateLoop :'
|
2009-05-28 22:08:40 +05:30
|
|
|
do i=1,nState
|
2009-05-07 21:57:36 +05:30
|
|
|
if (debug_StateLoopDistribution(i) /= 0) then
|
|
|
|
integral = integral + i*debug_StateLoopDistribution(i)
|
2009-05-28 22:08:40 +05:30
|
|
|
write(6,'(i25,i10)') i,debug_StateLoopDistribution(i)
|
2009-05-07 21:57:36 +05:30
|
|
|
endif
|
|
|
|
enddo
|
2009-05-28 22:08:40 +05:30
|
|
|
write(6,'(a15,i10,i10)') ' total',sum(debug_StateLoopDistribution),integral
|
2009-05-07 21:57:36 +05:30
|
|
|
|
|
|
|
integral = 0_pInt
|
|
|
|
write(6,*)
|
|
|
|
write(6,*) 'distribution_StiffnessStateLoop :'
|
2009-05-28 22:08:40 +05:30
|
|
|
do i=1,nState
|
2009-05-07 21:57:36 +05:30
|
|
|
if (debug_StiffnessStateLoopDistribution(i) /= 0) then
|
|
|
|
integral = integral + i*debug_StiffnessStateLoopDistribution(i)
|
2009-05-28 22:08:40 +05:30
|
|
|
write(6,'(i25,i10)') i,debug_StiffnessStateLoopDistribution(i)
|
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
write(6,'(a15,i10,i10)') ' total',sum(debug_StiffnessStateLoopDistribution),integral
|
|
|
|
|
|
|
|
integral = 0_pInt
|
|
|
|
write(6,*)
|
|
|
|
write(6,*) 'distribution_CrystalliteLoop :'
|
|
|
|
do i=1,nCryst
|
|
|
|
if (debug_CrystalliteLoopDistribution(i) /= 0) then
|
|
|
|
integral = integral + i*debug_CrystalliteLoopDistribution(i)
|
|
|
|
write(6,'(i25,i10)') i,debug_CrystalliteLoopDistribution(i)
|
2009-03-16 23:08:33 +05:30
|
|
|
endif
|
2008-02-19 18:28:46 +05:30
|
|
|
enddo
|
2009-05-28 22:08:40 +05:30
|
|
|
write(6,'(a15,i10,i10)') ' total',sum(debug_CrystalliteLoopDistribution),integral
|
2008-02-19 18:28:46 +05:30
|
|
|
write(6,*)
|
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
endsubroutine
|
2008-01-11 00:23:57 +05:30
|
|
|
|
|
|
|
END MODULE debug
|