subroutine test_reuse_geom(this)
class(ESMF_TestMethod), intent(inout) :: this
type(GeomManager), target :: geom_manager
type(ESMF_HConfig) :: hconfig
integer :: status
class(GeomSpec), allocatable :: spec
type(MaplGeom), pointer :: mapl_geom_a, mapl_geom_b
type(ESMF_Geom) :: geom_a, geom_b
type(ESMF_Info) :: infoh
logical :: flag
hconfig = ESMF_HConfigCreate(content="{class: latlon, im_world: 12, jm_world: 13, pole: PC, dateline: DC, nx: 1, ny: 1}", &
rc=status)
@assert_that(status, is(0))
geom_manager = GeomManager()
allocate(spec, source=geom_manager%make_geom_spec(hconfig, rc=status))
@assert_that(status, is(0))
mapl_geom_a => geom_manager%get_mapl_geom(spec, rc=status)
@assert_that(status, is(0))
mapl_geom_b => geom_manager%get_mapl_geom(spec, rc=status)
@assert_that(status, is(0))
geom_a = mapl_geom_a%get_geom()
call ESMF_InfoGetFromHost(geom_a, infoh, rc=status)
@assert_that(status, is(0))
call ESMF_InfoSet(infoh, 'GeomManager was here', .true., rc=status)
@assert_that(status, is(0))
geom_b = mapl_geom_b%get_geom()
call ESMF_InfoGetFromHost(geom_b, infoh, rc=status)
@assert_that(status, is(0))
flag = .false.
call ESMF_InfoGet(infoh, 'GeomManager was here', flag, rc=status)
@assert_that(status, is(0))
@assertTrue(flag)
call ESMF_HConfigDestroy(hconfig, rc=status)
@assert_that(status, is(0))
end subroutine test_reuse_geom