test_FieldAddR8 Subroutine

public subroutine test_FieldAddR8(this)

Arguments

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

Calls

proc~~test_fieldaddr8~~CallsGraph proc~test_fieldaddr8 test_FieldAddR8 assertequal assertequal proc~test_fieldaddr8->assertequal esmf_fieldget esmf_fieldget proc~test_fieldaddr8->esmf_fieldget proc~fieldadd fieldAdd proc~test_fieldaddr8->proc~fieldadd proc~mapl_verify MAPL_Verify proc~test_fieldaddr8->proc~mapl_verify proc~mk_r8field mk_r8field proc~test_fieldaddr8->proc~mk_r8field 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_r8field->proc~mapl_verify interface~mk_field mk_field proc~mk_r8field->interface~mk_field proc~mk_r8field->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_FieldAddR8(this)
      class(MpiTestMethod), intent(inout) :: this
      type(ESMF_Field) :: x
      type(ESMF_Field) :: y
      real(kind=ESMF_KIND_R8), pointer :: x_ptr(:,:), y_ptr(:,:)
      real(kind=ESMF_KIND_R8), allocatable :: result_array(:,:)
      integer :: status, rc
      real(kind=ESMF_KIND_R8), allocatable :: y8array(:,:)

      allocate(y8array, source=R8_ARRAY_DEFAULT)
      x = mk_r8field(R8_ARRAY_DEFAULT, 'XR8', _RC)
      y = mk_r8field(y8array, 'YR8', _RC)
      call ESMF_FieldGet(x , farrayPtr = x_ptr, _RC)
      call ESMF_FieldGet(y , farrayPtr = y_ptr, _RC)

      x_ptr = 2.d0
      y_ptr = 3.d0
      result_array = x_ptr
      result_array = 5.d0
      call FieldAdd(y, x, y, _RC)
      @assertEqual(y_ptr, result_array)
   end subroutine test_FieldAddR8