f_esmf_compcollectgarbage1 Subroutine

recursive subroutine f_esmf_compcollectgarbage1(comp, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_CWrap) :: comp
integer, intent(out) :: rc

Source Code

recursive subroutine f_esmf_compcollectgarbage1(comp, rc)
  use ESMF_UtilTypesMod
  use ESMF_BaseMod
  use ESMF_LogErrMod
  use ESMF_CompMod
  
  implicit none

  type(ESMF_CWrap)     :: comp
  integer, intent(out) :: rc

  integer :: localrc
  integer :: timeout
  logical :: timeoutFlag

  ! initialize return code; assume routine not implemented
  localrc = ESMF_RC_NOT_IMPL
  rc = ESMF_RC_NOT_IMPL

  !print *, "collecting Component garbage #1"

  ! only wrap up the inter component communications, but do no take down
  ! data structures that may render this call collective
  timeout = 10  ! allow for 10s timeout
  ! calling with 'timeoutFlag' prevents timeout to propagate as error condition
  call ESMF_CompDestruct(comp%compp, interCompComm=.true., &
    fullShutdown=.false., timeout=timeout, timeoutFlag=timeoutFlag, rc=localrc)
  if (ESMF_LogFoundError(localrc, &
    ESMF_ERR_PASSTHRU, &
    ESMF_CONTEXT, rcToReturn=rc)) return

  ! return successfully  
  rc = ESMF_SUCCESS

end subroutine f_esmf_compcollectgarbage1