alloc_ Subroutine

public subroutine alloc_(A, TYPE, IM, JM, rc)

Arguments

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

Calls

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

Source Code

  subroutine alloc_(A,type,im,jm,rc)
    type (Ptr),        intent(INOUT) :: A
    integer,           intent(IN)    :: TYPE
    integer,           intent(IN)    :: IM
    integer, optional, intent(IN)    :: JM
    integer, optional, intent(out)   :: rc

    integer :: status

    call dealloc_(A,RC=STATUS)
    _VERIFY(STATUS)

    select case (type)
    case (R4_2)
       _ASSERT(present(jm), 'jm not present for 2d')
       allocate(A%r4_2(IM,JM))
    case (R4_1)
       _ASSERT(.not.present(jm), 'jm is present for 1d')
       allocate(A%r4_1(IM))
    case (R8_2)
       _ASSERT(present(jm), 'jm not present for 2d')
       allocate(A%r8_2(IM,JM))
    case (R8_1)
       _ASSERT(.not.present(jm),'jm is present for 1d')
       allocate(A%r8_1(IM))
    case (i4_1)
       _ASSERT(.not.present(jm), 'jm present for 1d')
       allocate(A%I4_1(IM))
    case (i4_2)
       _ASSERT(present(jm), 'jm not present for 2d')
       allocate(A%I4_2(IM,JM))
    case default
       _FAIL( 'unsupported tkr')
    end select

    a%allocated=type

    _RETURN(ESMF_SUCCESS)
  end subroutine alloc_