test_filter_default_2d Subroutine

public subroutine test_filter_default_2d(this)

Arguments

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

Calls

proc~~test_filter_default_2d~~CallsGraph proc~test_filter_default_2d test_filter_default_2d ESMF_ConfigCreate ESMF_ConfigCreate proc~test_filter_default_2d->ESMF_ConfigCreate ESMF_HConfigCreate ESMF_HConfigCreate proc~test_filter_default_2d->ESMF_HConfigCreate assertequal assertequal proc~test_filter_default_2d->assertequal esmf_fieldget esmf_fieldget proc~test_filter_default_2d->esmf_fieldget interface~statefilteritem StateFilterItem proc~test_filter_default_2d->interface~statefilteritem proc~mapl_return MAPL_Return proc~test_filter_default_2d->proc~mapl_return proc~mapl_verify MAPL_Verify proc~test_filter_default_2d->proc~mapl_verify at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Source Code

   subroutine test_filter_default_2d(this)
      class(ESMF_TestMethod), intent(inout) :: this

      integer :: status, rc
      real(ESMF_KIND_R4), pointer :: ptr2d(:,:), extra_ptr(:,:)
      real(ESMF_KIND_R4), allocatable :: expected_array(:,:), masked_array(:,:) 
      real(ESMF_KIND_R4) :: rval
      type(ESMF_Config) :: cf
      type(ESMF_HConfig) :: hcf

      hcf = ESMF_HConfigCreate(content='{FILTER.@: "@+extra_2d"}', _RC)
      cf = ESMF_ConfigCreate(hconfig=hcf, _RC)

      call ESMF_FieldGet(extra_2d, 0, farrayPtr=extra_ptr, _RC)
      call ESMF_FieldGet(field_2d, 0, farrayPtr=ptr2d, _RC)
      rval = 17.0 
      ptr2d = rval
      extra_ptr = 2.0*rval

      rval=3.0*rval

      allocate(expected_array(3,3),_STAT)
      expected_array = rval

      call MAPL_StateFilterItem(state, cf, "field_2d", masked_array, _RC)
      @assertEqual(expected_array, masked_array)
      _RETURN(_SUCCESS)

   end subroutine test_filter_default_2d