test_FieldGetLocalElementCount Subroutine

public subroutine test_FieldGetLocalElementCount(this)

Arguments

Type IntentOptional Attributes Name
class(MpiTestMethod), intent(inout) :: this

Calls

proc~~test_fieldgetlocalelementcount~~CallsGraph proc~test_fieldgetlocalelementcount test_FieldGetLocalElementCount assertequal assertequal proc~test_fieldgetlocalelementcount->assertequal esmf_fieldget esmf_fieldget proc~test_fieldgetlocalelementcount->esmf_fieldget interface~fieldgetlocalelementcount FieldGetLocalElementCount proc~test_fieldgetlocalelementcount->interface~fieldgetlocalelementcount proc~mapl_verify MAPL_Verify proc~test_fieldgetlocalelementcount->proc~mapl_verify proc~mapl_throw_exception MAPL_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Source Code

   subroutine test_FieldGetLocalElementCount(this)
      class(MpiTestMethod), intent(inout) :: this
      type(ESMF_Field) :: x
      integer :: rank
      integer, allocatable :: expected_count(:)
      integer, allocatable :: actual_count(:)
      integer :: status, rc

      x = XR4
      call ESMF_FieldGet(x, rank=rank, _RC)
      allocate(expected_count(rank))
      call ESMF_FieldGet(x, localElementCount=expected_count, _RC)
      actual_count = FieldGetLocalElementCount(x, _RC)
      @assertEqual(actual_count, expected_count)

   end subroutine test_FieldGetLocalElementCount