next up previous contents
Next: end_pause_watch Up: Reference Manual Previous: destroy_watch

destroy_watchgroup

DESTROY_WATCHGROUP

destroys a StopWatch watch group

SYNOPSIS
subroutine destroy_watchgroup (handle, err)


type (watchgroup), intent(INOUT) :: handle

integer, optional, intent(OUT) :: err

DESCRIPTION
Destroys a watch group. Only the group is destroyed, not the watches in the group. To avoid memory leaks, watch groups should be destroyed when no longer useful, before being recreated, and before returning from a subroutine in which the watch group is a local variable.

The argument handle is a variable of type watchgroup that is the handle for the group to be destroyed.

DIAGNOSTICS
If present, the optional intent OUT integer argument err returns a status code. The code is the sum of the values listed below.

An error message will be printed to a specified I/O unit (unit 6 by default) if print_errors is TRUE (default is TRUE). The error message contains more detail about the cause of the error than can be obtained from just the status code, so you should set print_errors to TRUE if you have trouble determining the cause of the error.

If abort_errors is TRUE (default is FALSE), the program will terminate on an error condition. Otherwise, the program will continue execution but the watch group will not be created.

See option_stopwatch(3) for further information on print_errors, abort_errors and I/O units.

The relevant status codes and messages are:

0
No errors; execution successful.

1024
Error occurred while deallocating memory. This error occurs if the Fortran deallocate statement returns a nonzero status while deallocating memory used for the group. The group is destroyed, but be aware that other problems could develop as a result of the deallocate error.

EXAMPLES
type (watchgroup) g1, g2
integer errcode

call destroy_watchgroup(g1)
call destroy_watchgroup(g2, errcode)

The first call destroys the group g1. The second call destroys the group g2 and returns a status code.

BUGS
None known.



next up previous contents
Next: end_pause_watch Up: Reference Manual Previous: destroy_watch