38 INTEGER :: number_of_calls = 0
40 REAL (rprec) :: total_time = 0.0
42 REAL (rprec) :: average_time = 0.0
44 CHARACTER (len=profiler_string_size) :: symbol_name =
''
123 CHARACTER (len=*),
INTENT(in) :: symbol_name
124 REAL (rprec),
INTENT(in) :: start_time
133 time = time - start_time
138 IF (
buckets(i)%symbol_name .eq.
'')
THEN
139 buckets(i)%symbol_name = symbol_name
145 ELSE IF (
buckets(i)%symbol_name .eq. symbol_name)
THEN
158 IF (
buckets(i)%symbol_name .eq.
'')
THEN
159 buckets(i)%symbol_name = symbol_name
165 ELSE IF (
buckets(i)%symbol_name .eq. symbol_name)
THEN
176 WRITE (*,*)
'Profile table full: ' // trim(symbol_name) //
177 &
' could not be profiled.'
225 INTEGER,
INTENT(in) :: low_index
226 INTEGER,
INTENT(in) :: high_index
236 IF (high_index - low_index .lt. 2)
THEN
238 IF (
buckets(high_index)%average_time .gt.
239 &
buckets(low_index)%average_time)
THEN
241 swap_bucket =
buckets(low_index)
243 buckets(high_index) = swap_bucket
249 mid_index = (high_index + low_index)/2
257 ALLOCATE(temp_buckets(low_index:high_index))
259 DO i = low_index, high_index
260 IF (
buckets(i1)%average_time .gt.
261 &
buckets(i2)%average_time)
THEN
265 IF (i1 .gt. mid_index - 1)
THEN
268 temp_buckets(i + 1:high_index) =
buckets(i2:high_index)
275 IF (i2 .gt. high_index)
THEN
278 temp_buckets(i + 1:high_index) =
285 buckets(low_index:high_index) = temp_buckets(low_index:high_index)
287 DEALLOCATE(temp_buckets)
311 CHARACTER (len=*),
INTENT(in) :: symbol_name
314 INTEGER (kind=8) :: hash
319 DO i = 1, len_trim(symbol_name)
320 hash = (lshift(hash, 5) + hash) + ichar(symbol_name(i:i))
340 INTEGER,
INTENT(in) :: iou
348 WRITE (iou,*)
' *** Code Profile Information'
355 IF (
buckets(i)%symbol_name .ne.
'')
THEN
356 WRITE (iou, 1001)
buckets(i)%symbol_name,
363 1000
FORMAT(
'Symbol Name',59x,
'Average Time',2x,
'TotalTime',5x,
365 1001
FORMAT(a68,2x,es12.5,2x,es12.5,2x,i9)