dealloc_ Subroutine

public subroutine dealloc_(A, rc)

Arguments

Type IntentOptional Attributes Name
type(PTR), intent(inout) :: A
integer, intent(out), optional :: rc

Calls

proc~~dealloc_~~CallsGraph proc~dealloc_ dealloc_ interface~mapl_assert MAPL_Assert proc~dealloc_->interface~mapl_assert proc~mapl_return MAPL_Return proc~dealloc_->proc~mapl_return 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

Called by

proc~~dealloc_~~CalledByGraph proc~dealloc_ dealloc_ proc~alloc_ alloc_ proc~alloc_->proc~dealloc_ proc~mapl_destroyfile MAPL_DestroyFile proc~mapl_destroyfile->proc~dealloc_ proc~mapl_destroystatesave MAPL_DestroyStateSave proc~mapl_destroystatesave->proc~mapl_destroyfile proc~mapl_destroystatesave->proc~mapl_destroystatesave proc~mapl_genericrefresh MAPL_GenericRefresh proc~mapl_genericrefresh->proc~mapl_destroyfile proc~mapl_genericrefresh->proc~mapl_genericrefresh

Source Code

  subroutine dealloc_(A,RC)
    type (Ptr), intent(INOUT)        :: A
    integer, optional, intent(out)   :: rc


    if(a%allocated/=not_allocated) then
       select case (a%allocated)
       case (R4_2)
          if(associated(A%r4_2)) then
             deallocate(A%r4_2)
             nullify(A%r4_2)
          end if
       case (R4_1)
          if(associated(A%r4_1)) then
             deallocate(A%r4_1)
             nullify(A%r4_1)
          end if
       case (R8_2)
          if(associated(A%r8_2)) then
             deallocate(A%r8_2)
             nullify(A%r8_2)
          end if
       case (R8_1)
          if(associated(A%r8_1)) then
             deallocate(A%r8_1)
             nullify(A%r8_1)
          end if
       case (i4_1)
          if(associated(A%i4_1)) then
             deallocate(A%i4_1)
             nullify(A%i4_1)
          end if
       case (i4_2)
          if(associated(A%i4_2)) then
             deallocate(A%i4_2)
             nullify(A%i4_2)
          end if
       case default
          _FAIL( 'unsupported tkr')
       end select
       a%allocated=not_allocated
    end if

    _RETURN(ESMF_SUCCESS)
  end subroutine dealloc_