_gfortran_caf_deregister (The GNU Fortran Compiler)

#### 7.2.9 `_gfortran_caf_deregister` — Deregistering coarrays ¶

Synopsis:

  `void _gfortran_caf_deregister (caf_token_t *token, caf_deregister_t type, int *stat, char *errmsg, size_t errmsg_len)`

Description:

  Called to free or deregister the memory of a coarray; the processor calls this function for automatic and explicit deallocation. In case of an error, this function shall fail with an error message, unless the STAT variable is not null. The library is only expected to free memory it allocated itself during a call to `_gfortran_caf_register`.

Arguments:

  token | the token to free.
  type | the type of action to take for the coarray. A `CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY` is allowed only for allocatable or pointer components of derived type coarrays. The action only deallocates the local memory without deleting the token.
  stat | intent(out) Stores the STAT=; may be NULL
  errmsg | intent(out) When an error occurs, this is set to an error message; may be NULL
  errmsg_len | the buffer size of errmsg.

Notes:

  For nonallocatable coarrays this function is never called. If a cleanup is required, it has to be handled via the finish, stop and error stop functions, and via destructors.