subroutine test_change_geom(this)
class(ESMF_TestMethod), intent(inout) :: this
type(ESMF_Field) :: f
type(ESMF_Grid), target :: grid1, grid2
type(ESMF_Geom) :: geom1, geom2
integer :: status
type(ESMF_FieldStatus_Flag) :: field_status
type(ESMF_TypeKind_Flag) :: typekind
real(kind=ESMF_KIND_R4), pointer :: x(:,:)
type(FieldDelta) :: delta
grid1 = ESMF_GridCreateNoPeriDim(maxIndex=[4,4], name='I_AM_GROOT', _RC)
geom1 = ESMF_GeomCreate(grid1, _RC)
f = ESMF_FieldCreate(geom1, typekind=ESMF_TYPEKIND_R4, name='in', _RC)
call MAPL_FieldSet(f, num_levels=ORIG_VGRID_LEVELS+1, vert_staggerloc=VERTICAL_STAGGER_EDGE, _RC)
grid2 = ESMF_GridCreateNoPeriDim(maxIndex=[3,5], name='I_AM_GROOT', _RC)
geom2 = ESMF_GeomCreate(grid2, _RC)
delta = FieldDelta(geom=geom2)
call delta%reallocate_field(f, _RC)
call ESMF_FieldGet(f, status=field_status, typekind=typekind, _RC)
@assert_that(field_status == ESMF_FIELDSTATUS_COMPLETE, is(true()))
@assert_that(typekind == ESMF_TYPEKIND_R4, is(true()))
call ESMF_FieldGet(f, fArrayPtr=x, _RC)
@assert_that(shape(x),is(equal_to([3,5])))
call ESMF_FieldDestroy(f, _RC)
call ESMF_GridDestroy(grid1, _RC)
call ESMF_GridDestroy(grid2, _RC)
call ESMF_GeomDestroy(geom2, _RC)
_UNUSED_DUMMY(this)
end subroutine test_change_geom