test_FieldGetLocalSize Subroutine

public subroutine test_FieldGetLocalSize(this)

Arguments

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

Calls

proc~~test_fieldgetlocalsize~~CallsGraph proc~test_fieldgetlocalsize test_FieldGetLocalSize assertequal assertequal proc~test_fieldgetlocalsize->assertequal esmf_fieldget esmf_fieldget proc~test_fieldgetlocalsize->esmf_fieldget interface~fieldgetlocalsize FieldGetLocalSize proc~test_fieldgetlocalsize->interface~fieldgetlocalsize proc~mapl_verify MAPL_Verify proc~test_fieldgetlocalsize->proc~mapl_verify proc~mapl_throw_exception MAPL_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Source Code

   subroutine test_FieldGetLocalSize(this)
      class(MpiTestMethod), intent(inout) :: this
      type(ESMF_Field) :: x
      integer :: status, rc
      integer :: rank
      integer :: expected_size
      integer :: actual_size
      integer, allocatable :: element_count(:)

      x = XR4
      call ESMF_FieldGet(x, rank=rank, _RC)
      allocate(element_count(rank))
      call ESMF_FieldGet(x, localElementCount=element_count, _RC)
      expected_size = sum(element_count)
      actual_size=FieldGetLocalSize(x, _RC)
      @assertEqual(actual_size, expected_size)
      if(allocated(element_count)) deallocate(element_count)

   end subroutine test_FieldGetLocalSize