f_esmf_fbundlecollectgarbage Subroutine

subroutine f_esmf_fbundlecollectgarbage(fb, rc)

Uses

  • proc~~f_esmf_fbundlecollectgarbage~~UsesGraph proc~f_esmf_fbundlecollectgarbage f_esmf_fbundlecollectgarbage ESMF_FieldBundleMod ESMF_FieldBundleMod proc~f_esmf_fbundlecollectgarbage->ESMF_FieldBundleMod module~esmf_basemod ESMF_BaseMod proc~f_esmf_fbundlecollectgarbage->module~esmf_basemod module~esmf_logerrmod ESMF_LogErrMod proc~f_esmf_fbundlecollectgarbage->module~esmf_logerrmod module~esmf_utiltypesmod ESMF_UtilTypesMod proc~f_esmf_fbundlecollectgarbage->module~esmf_utiltypesmod module~esmf_basemod->module~esmf_logerrmod module~esmf_basemod->module~esmf_utiltypesmod iso_c_binding iso_c_binding module~esmf_basemod->iso_c_binding module~esmf_initmacrosmod ESMF_InitMacrosMod module~esmf_basemod->module~esmf_initmacrosmod module~esmf_ioutilmod ESMF_IOUtilMod module~esmf_basemod->module~esmf_ioutilmod module~esmf_vmmod ESMF_VMMod module~esmf_basemod->module~esmf_vmmod module~esmf_logerrmod->module~esmf_utiltypesmod module~esmf_logerrmod->module~esmf_ioutilmod module~esmf_utilstringmod ESMF_UtilStringMod module~esmf_logerrmod->module~esmf_utilstringmod module~esmf_utiltypesmod->iso_c_binding module~esmf_initmacrosmod->module~esmf_logerrmod module~esmf_initmacrosmod->module~esmf_utiltypesmod module~esmf_ioutilmod->module~esmf_utiltypesmod module~esmf_vmmod->module~esmf_logerrmod module~esmf_vmmod->module~esmf_utiltypesmod module~esmf_vmmod->iso_c_binding module~esmf_vmmod->module~esmf_initmacrosmod module~esmf_vmmod->module~esmf_ioutilmod module~esmf_f90interfacemod ESMF_F90InterfaceMod module~esmf_vmmod->module~esmf_f90interfacemod module~esmf_f90interfacemod->module~esmf_logerrmod module~esmf_f90interfacemod->module~esmf_utiltypesmod

Arguments

Type IntentOptional Attributes Name
type(ESMF_FieldBundle) :: fb
integer, intent(out) :: rc

Calls

proc~~f_esmf_fbundlecollectgarbage~~CallsGraph proc~f_esmf_fbundlecollectgarbage f_esmf_fbundlecollectgarbage esmf_fieldbundledestruct esmf_fieldbundledestruct proc~f_esmf_fbundlecollectgarbage->esmf_fieldbundledestruct proc~esmf_logfounddeallocerror ESMF_LogFoundDeallocError proc~f_esmf_fbundlecollectgarbage->proc~esmf_logfounddeallocerror proc~esmf_logfounderror ESMF_LogFoundError proc~f_esmf_fbundlecollectgarbage->proc~esmf_logfounderror esmf_breakpoint esmf_breakpoint proc~esmf_logfounddeallocerror->esmf_breakpoint proc~esmf_logrc2msg ESMF_LogRc2Msg proc~esmf_logfounddeallocerror->proc~esmf_logrc2msg proc~esmf_logwrite ESMF_LogWrite proc~esmf_logfounddeallocerror->proc~esmf_logwrite proc~esmf_logfounderror->esmf_breakpoint proc~esmf_logfounderror->proc~esmf_logrc2msg proc~esmf_logfounderror->proc~esmf_logwrite c_esmc_loggeterrormsg c_esmc_loggeterrormsg proc~esmf_logrc2msg->c_esmc_loggeterrormsg c_esmc_vmwtime c_esmc_vmwtime proc~esmf_logwrite->c_esmc_vmwtime proc~esmf_logclose ESMF_LogClose proc~esmf_logwrite->proc~esmf_logclose proc~esmf_logflush ESMF_LogFlush proc~esmf_logwrite->proc~esmf_logflush proc~esmf_logopenfile ESMF_LogOpenFile proc~esmf_logwrite->proc~esmf_logopenfile proc~esmf_utiliounitflush ESMF_UtilIOUnitFlush proc~esmf_logwrite->proc~esmf_utiliounitflush proc~esmf_utilstring2array ESMF_UtilString2Array proc~esmf_logwrite->proc~esmf_utilstring2array proc~esmf_logclose->proc~esmf_logflush proc~esmf_logflush->proc~esmf_utiliounitflush proc~esmf_utilarray2string ESMF_UtilArray2String proc~esmf_logflush->proc~esmf_utilarray2string proc~esmf_logopenfile->proc~esmf_utiliounitflush proc~esmf_utiliounitget ESMF_UtilIOUnitGet proc~esmf_logopenfile->proc~esmf_utiliounitget

Source Code

  subroutine f_esmf_fbundlecollectgarbage(fb, rc)
#undef  ESMF_METHOD
#define ESMF_METHOD "f_esmf_fbundlecollectgarbage"
    use ESMF_UtilTypesMod
    use ESMF_BaseMod
    use ESMF_LogErrMod
    use ESMF_FieldBundleMod

    implicit none

    type(ESMF_FieldBundle):: fb
    integer, intent(out)  :: rc
  
    integer :: localrc
  
    ! initialize return code; assume routine not implemented
    localrc = ESMF_RC_NOT_IMPL
    rc = ESMF_RC_NOT_IMPL

    !print *, "collecting FieldBundle garbage"
  
    if (associated(fb%this)) then
      ! destruct internal data allocations
      call ESMF_FieldBundleDestruct(fb%this, localrc)
      if (ESMF_LogFoundError(localrc, &
        ESMF_ERR_PASSTHRU, &
        ESMF_CONTEXT, &
        rcToReturn=rc)) return
      ! deallocate actual FieldBundleType allocation
      deallocate(fb%this, stat=localrc)
      if (ESMF_LogFoundDeallocError(localrc, msg="Deallocating FieldBundle", &
        ESMF_CONTEXT, &
        rcToReturn=rc)) return
    endif
    nullify(fb%this)

    ! return successfully
    rc = ESMF_SUCCESS

  end subroutine f_esmf_fbundlecollectgarbage