MAPL_SimpleBundleDestroy Subroutine

public subroutine MAPL_SimpleBundleDestroy(self, rc)

Destructor for the MAPL Simple Bundle. It is assumed that the bundle has been created from an ESMF Field Bundle.

Arguments

Type IntentOptional Attributes Name
type(MAPL_SimpleBundle) :: self
integer, intent(out), optional :: rc

Calls

proc~~mapl_simplebundledestroy~~CallsGraph proc~mapl_simplebundledestroy MAPL_SimpleBundleDestroy interface~mapl_fieldbundledestroy MAPL_FieldBundleDestroy proc~mapl_simplebundledestroy->interface~mapl_fieldbundledestroy proc~mapl_return MAPL_Return proc~mapl_simplebundledestroy->proc~mapl_return proc~mapl_verify MAPL_Verify proc~mapl_simplebundledestroy->proc~mapl_verify at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Source Code

  subroutine MAPL_SimpleBundleDestroy (self, rc )

    type(MAPL_SimpleBundle)                    :: self ! Simple Bundle
    integer, OPTIONAL,           intent(out)   :: rc

!-----------------------------------------------------------------------------

    integer :: status

    deallocate(self%coords%Lons, self%coords%Lats, self%coords%Levs, __STAT__)
!    deallocate(self%r1, self%r2, self%r3, __STAT__)
    if(associated(self%r1)) deallocate(self%r1)
    if(associated(self%r2)) deallocate(self%r2)
    if(associated(self%r3)) deallocate(self%r3)

    if (associated(self%bundle)) then
       call MAPL_FieldBundleDestroy(self%bundle, _RC)
    end if

    if (self%bundleAlloc) then
       deallocate(self%bundle, __STAT__)
    end if

    _RETURN(_SUCCESS)

  end subroutine MAPL_SimpleBundleDestroy