test_FieldConvertPrec_R4R8 Subroutine

public subroutine test_FieldConvertPrec_R4R8(this)

Arguments

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

Calls

proc~~test_fieldconvertprec_r4r8~~CallsGraph proc~test_fieldconvertprec_r4r8 test_FieldConvertPrec_R4R8 assertequal assertequal proc~test_fieldconvertprec_r4r8->assertequal esmf_fieldget esmf_fieldget proc~test_fieldconvertprec_r4r8->esmf_fieldget interface~fieldconvertprec FieldConvertPrec proc~test_fieldconvertprec_r4r8->interface~fieldconvertprec interface~initialize_array initialize_array proc~test_fieldconvertprec_r4r8->interface~initialize_array interface~mk_field mk_field proc~test_fieldconvertprec_r4r8->interface~mk_field proc~mapl_verify MAPL_Verify proc~test_fieldconvertprec_r4r8->proc~mapl_verify proc~initialize_array_r4 initialize_array_R4 interface~initialize_array->proc~initialize_array_r4 proc~initialize_array_r8 initialize_array_R8 interface~initialize_array->proc~initialize_array_r8 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~mapl_throw_exception MAPL_throw_exception proc~mapl_verify->proc~mapl_throw_exception interface~mapl_assert MAPL_Assert proc~initialize_array_r4->interface~mapl_assert proc~initialize_array_r8->interface~mapl_assert proc~mk_field_r4_2d->esmf_fieldget proc~mk_field_r4_2d->proc~mapl_verify proc~mapl_return MAPL_Return 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 proc~mapl_return->proc~mapl_throw_exception at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mk_field_common->proc~mapl_verify proc~mk_field_common->proc~mapl_return esmf_fieldcreate esmf_fieldcreate proc~mk_field_common->esmf_fieldcreate proc~mk_grid mk_grid proc~mk_field_common->proc~mk_grid

Source Code

   subroutine test_FieldConvertPrec_R4R8(this)
       class(MpiTestMethod), intent(inout) :: this
     integer, parameter :: NROWS = 2
      integer, parameter :: NCOLS = NROWS
      type(ESMF_Field) :: r4_field, r8_field
      real(kind=ESMF_KIND_R4) :: r4_data(NROWS,NCOLS)
      real(kind=ESMF_KIND_R8) :: r8_data(NROWS,NCOLS)
      real(kind=ESMF_KIND_R8) :: r8_converted(NROWS,NCOLS)
      real(kind=ESMF_KIND_R8), pointer :: r8_pointer(:,:)
      integer :: rc, status

      call initialize_array(r4_data, 0.0, 1.0)
      r8_data = 0.0
      r8_converted = r4_data
      r4_field = mk_field(r4_data, name = 'XR4', _RC)
      r8_field = mk_field(r8_data, name = 'YR8', _RC)
      call FieldConvertPrec(r4_field, r8_field, _RC)
      call ESMF_FieldGet(r8_field, farrayPtr = r8_pointer, _RC)
      @assertEqual(r8_converted, r8_pointer)

   end subroutine test_FieldConvertPrec_R4R8