adds a StopWatch
watch to a watch group
subroutine join_watchgroup (watch, handle, err)
Adds the specified watch(es) to the specified watch group. The watch(es) and group must have been previously created with create_watch and create_watchgroup.
One or more watches must be specified. The argument watch can be a single variable of type watchtype (see stopwatch(3)) to add one watch, an array of type watchtype to add several watches.
The watch group is specified by handle, a variable of type watchgroup.
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(es) will not be added to the group.
See option_stopwatch(3) for further information on print_errors, abort_errors and I/O units.
The relevant status codes and messages are:
type (watchtype) w1, w2(3)
type (watchgroup) g1
call join_watchgroup(w1, g1)
call join_watchgroup(w2, g1, errcode)
The first call adds the watch w1 to watch group g1.
The second call adds three watch to g1 and returns a status code.
It cannot be determined whether or not a watch variable or watch group has been created (passed as an argument to create_watch or create_watchgroup). If a watch or watch group that has never been created is passed into join_watchgroup, it might generate a Fortran error due to passing a pointer with undefined association status to the Fortran intrinsic function associated. Some compilers will allow this as an extension to the Fortran 90 standard and recognize that the pointer is not associated, in which case the ``Watch needs to be created'' error message is generated.