test_FieldAXPY_R4 Subroutine

public subroutine test_FieldAXPY_R4(this)

Arguments

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

Calls

proc~~test_fieldaxpy_r4~~CallsGraph proc~test_fieldaxpy_r4 test_FieldAXPY_R4 assertequal assertequal proc~test_fieldaxpy_r4->assertequal esmf_fieldget esmf_fieldget proc~test_fieldaxpy_r4->esmf_fieldget interface~fieldaxpy FieldAXPY proc~test_fieldaxpy_r4->interface~fieldaxpy proc~mapl_verify MAPL_Verify proc~test_fieldaxpy_r4->proc~mapl_verify proc~mapl_throw_exception MAPL_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Source Code

   subroutine test_FieldAXPY_R4(this)
      class(MpiTestMethod), intent(inout) :: this
      real(kind=ESMF_KIND_R4), parameter :: a = 2.0
      type(ESMF_Field) :: x
      type(ESMF_Field) :: y
      real(kind=ESMF_KIND_R4), dimension(:,:), allocatable :: x_array
      real(kind=ESMF_KIND_R4), dimension(:,:), pointer :: x_ptr
      real(kind=ESMF_KIND_R4), dimension(:,:), allocatable :: y_array
      real(kind=ESMF_KIND_R4), dimension(:,:), pointer :: y_ptr
      integer :: status, rc

      x = XR4
      y = YR4
      call ESMF_FieldGet(x, farrayPtr = x_ptr, _RC)
      x_array = x_ptr
      call ESMF_FieldGet(y, farrayPtr = y_ptr, _RC)
      y_array = y_ptr
      call FieldAXPY(a, x, y, _RC)
      call ESMF_FieldGet(x, farrayPtr = x_ptr, _RC)
      call ESMF_FieldGet(y, farrayPtr = y_ptr, _RC)
      @assertEqual(y_ptr, a*x_array+y_array)

   end subroutine test_FieldAXPY_R4