test_FieldGetLocalSize Subroutine

public subroutine test_FieldGetLocalSize()

Arguments

None

Calls

proc~~test_fieldgetlocalsize~~CallsGraph proc~test_fieldgetlocalsize Test_FieldBLAS::test_FieldGetLocalSize assertequal assertequal proc~test_fieldgetlocalsize->assertequal esmf_fieldget esmf_fieldget proc~test_fieldgetlocalsize->esmf_fieldget interface~fieldgetlocalsize MAPL_FieldPointerUtilities::FieldGetLocalSize proc~test_fieldgetlocalsize->interface~fieldgetlocalsize proc~mapl_verify MAPL_ErrorHandlingMod::MAPL_Verify proc~test_fieldgetlocalsize->proc~mapl_verify proc~mapl_throw_exception MAPL_ThrowMod::MAPL_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Source Code

   subroutine test_FieldGetLocalSize()
      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