test_basic Subroutine

public subroutine test_basic(this)

Arguments

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

Calls

proc~~test_basic~~CallsGraph proc~test_basic test_basic anyexceptions anyexceptions proc~test_basic->anyexceptions assert_that assert_that proc~test_basic->assert_that equal_to equal_to proc~test_basic->equal_to esmf_fieldget esmf_fieldget proc~test_basic->esmf_fieldget esmfregridderparam esmfregridderparam proc~test_basic->esmfregridderparam every_item every_item proc~test_basic->every_item geommanager geommanager proc~test_basic->geommanager none~get_regridder RegridderManager%get_regridder proc~test_basic->none~get_regridder proc~make_field make_field proc~test_basic->proc~make_field proc~make_geom make_geom proc~test_basic->proc~make_geom regrid regrid proc~test_basic->regrid sourcelocation sourcelocation proc~test_basic->sourcelocation find find none~get_regridder->find none~add_regridder RegridderManager%add_regridder none~get_regridder->none~add_regridder none~back~8 RegridderVector%back none~get_regridder->none~back~8 none~begin~141 RegridderSpecVector%begin none~get_regridder->none~begin~141 none~make_regridder~3 RegridderManager%make_regridder none~get_regridder->none~make_regridder~3 none~of~25 RegridderVector%of none~get_regridder->none~of~25 proc~mapl_return MAPL_Return none~get_regridder->proc~mapl_return proc~mapl_verify MAPL_Verify none~get_regridder->proc~mapl_verify proc~make_field->esmf_fieldget esmf_fieldemptycomplete esmf_fieldemptycomplete proc~make_field->esmf_fieldemptycomplete esmf_fieldemptycreate esmf_fieldemptycreate proc~make_field->esmf_fieldemptycreate esmf_fieldemptyset esmf_fieldemptyset proc~make_field->esmf_fieldemptyset ESMF_HConfigCreate ESMF_HConfigCreate proc~make_geom->ESMF_HConfigCreate get_geom get_geom proc~make_geom->get_geom get_mapl_geom get_mapl_geom proc~make_geom->get_mapl_geom

Source Code

   subroutine test_basic(this)
      class(ESMF_TestMethod), intent(inout) :: this
      type(GeomManager), target :: geom_mgr
      type(RegridderManager) :: regridder_mgr
      type(RegridderSpec) :: regridder_spec
      integer :: status
      class(Regridder), pointer :: my_regridder
      type(ESMF_Geom) :: geom

      type(ESMF_Field) :: f1, f2
      real(kind=ESMF_KIND_R4), pointer :: x(:,:)

      geom_mgr = GeomManager()
      regridder_mgr = RegridderManager()

      geom = make_geom(geom_mgr, _RC)

      ! use default esmf regrid parameters: method, zero region, etc
      regridder_spec = RegridderSpec(EsmfRegridderParam(), geom, geom)

      my_regridder => regridder_mgr%get_regridder(regridder_spec, _RC)

      f1 = make_field(geom, 'f1', value=3._ESMF_KIND_R4, _RC)
      f2 = make_field(geom, 'f2', value=0._ESMF_KIND_R4, _RC)

      call my_regridder%regrid(f1, f2, _RC)

      call ESMF_FieldGet(f1, farrayptr=x, _RC)

      @assert_that(x, every_item(is(equal_to(3._ESMF_KIND_R4))))

   end subroutine test_basic