test_FieldAddR4 Subroutine

public subroutine test_FieldAddR4(this)

Arguments

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

Calls

proc~~test_fieldaddr4~~CallsGraph proc~test_fieldaddr4 test_FieldAddR4 assertequal assertequal proc~test_fieldaddr4->assertequal esmf_fieldget esmf_fieldget proc~test_fieldaddr4->esmf_fieldget proc~fieldadd fieldAdd proc~test_fieldaddr4->proc~fieldadd proc~mapl_verify MAPL_Verify proc~test_fieldaddr4->proc~mapl_verify proc~mk_r4field mk_r4field proc~test_fieldaddr4->proc~mk_r4field proc~fieldadd->esmf_fieldget proc~fieldadd->proc~mapl_verify interface~assign_fptr assign_fptr proc~fieldadd->interface~assign_fptr interface~fieldsareconformable FieldsAreConformable proc~fieldadd->interface~fieldsareconformable interface~getfieldsundef GetFieldsUndef proc~fieldadd->interface~getfieldsundef interface~mapl_assert MAPL_Assert proc~fieldadd->interface~mapl_assert proc~fieldshaveundef FieldsHaveUndef proc~fieldadd->proc~fieldshaveundef proc~mapl_return MAPL_Return proc~fieldadd->proc~mapl_return proc~mapl_throw_exception MAPL_throw_exception proc~mapl_verify->proc~mapl_throw_exception proc~mk_r4field->proc~mapl_verify interface~mk_field mk_field proc~mk_r4field->interface~mk_field proc~mk_r4field->proc~mapl_return proc~mk_field_r4_2d mk_field_r4_2d interface~mk_field->proc~mk_field_r4_2d proc~mk_field_r8_2d mk_field_r8_2d interface~mk_field->proc~mk_field_r8_2d proc~fieldshaveundef->proc~mapl_verify proc~fieldshaveundef->proc~mapl_return ESMF_AttributeGet ESMF_AttributeGet proc~fieldshaveundef->ESMF_AttributeGet proc~mapl_return->proc~mapl_throw_exception at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mk_field_r4_2d->esmf_fieldget proc~mk_field_r4_2d->proc~mapl_verify proc~mk_field_r4_2d->proc~mapl_return proc~mk_field_common mk_field_common proc~mk_field_r4_2d->proc~mk_field_common proc~mk_field_r8_2d->esmf_fieldget proc~mk_field_r8_2d->proc~mapl_verify proc~mk_field_r8_2d->proc~mapl_return proc~mk_field_r8_2d->proc~mk_field_common

Source Code

   subroutine test_FieldAddR4(this)
      class(MpiTestMethod), intent(inout) :: this
      type(ESMF_Field) :: x
      type(ESMF_Field) :: y
      real(kind=ESMF_KIND_R4), pointer :: x_ptr(:,:), y_ptr(:,:)
      real(kind=ESMF_KIND_R4), allocatable :: result_array(:,:)
      integer :: status, rc
      real(kind=ESMF_KIND_R4), allocatable :: y4array(:,:)

      allocate(y4array, source=R4_ARRAY_DEFAULT)
      x = mk_r4field(R4_ARRAY_DEFAULT, 'XR4', _RC)
      y = mk_r4field(y4array, 'YR4', _RC)
      call ESMF_FieldGet(x , farrayPtr = x_ptr, _RC)
      call ESMF_FieldGet(y , farrayPtr = y_ptr, _RC)

      x_ptr = 2.0
      y_ptr = 3.0
      result_array = x_ptr
      result_array = 5.0
      call FieldAdd(y, x, y, _RC)
      @assertEqual(y_ptr, result_array)

   end subroutine test_FieldAddR4