ESMF_FeatureAllocFRet Function

public function ESMF_FeatureAllocFRet(n, rc) result(ret)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
integer, intent(out) :: rc

Return Value real, allocatable, (:)


Source Code

  function ESMF_FeatureAllocFRet (n, rc) result (ret)
    integer, intent(in)  :: n
    integer, intent(out) :: rc
    ! F2003 and F95+TR15581 allocatable function result
    real, allocatable :: ret(:)

    integer :: i
    integer :: memstat

    allocate (ret(n), stat=memstat)
    if (memstat /= 0) then
      rc = ESMF_RC_MEM_ALLOCATE
      return
    end if

    do, i=1, n
      ret(i) = i
    end do

    rc = ESMF_SUCCESS

  end function  ESMF_FeatureAllocFRet