f_esmf_localarrayf90allocate Subroutine

subroutine f_esmf_localarrayf90allocate(arrayPtr, rank, typekind, counts, lbounds, ubounds, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Pointer) :: arrayPtr
integer :: rank
type(ESMF_TypeKind_Flag) :: typekind
integer :: counts(rank)
integer :: lbounds(rank)
integer :: ubounds(rank)
integer :: rc

Source Code

subroutine f_esmf_localarrayf90allocate(arrayPtr, rank, typekind, counts, &
  lbounds, ubounds, rc)
  use ESMF_UtilTypesMod     ! ESMF base class
  use ESMF_BaseMod          ! ESMF base class
  use ESMF_LogErrMod        ! ESMF error logging
  use ESMF_LocalArrayMod
  
  implicit none

  type(ESMF_Pointer) :: arrayPtr
  integer :: rank
  type(ESMF_TypeKind_Flag) :: typekind
  integer :: counts(rank)
  integer :: lbounds(rank)
  integer :: ubounds(rank)
  integer :: rc

  type(ESMF_LocalArray) :: array

  array%this = arrayPtr
  ESMF_INIT_SET_CREATED(array)

  ! Beware - these args are not in the same order
  call ESMF_LocalArrConstrF90Ptr(array, counts, typekind, rank, &
    lbounds, ubounds, rc=rc)
  if (ESMF_LogFoundError(rcToCheck=rc, &
    ESMF_ERR_PASSTHRU, &
    ESMF_CONTEXT)) return

end subroutine f_esmf_localarrayf90allocate