test_do_not_reuse_geom Subroutine

public subroutine test_do_not_reuse_geom(this)

Arguments

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

Calls

proc~~test_do_not_reuse_geom~~CallsGraph proc~test_do_not_reuse_geom test_do_not_reuse_geom ESMF_HConfigCreate ESMF_HConfigCreate proc~test_do_not_reuse_geom->ESMF_HConfigCreate ESMF_HConfigDestroy ESMF_HConfigDestroy proc~test_do_not_reuse_geom->ESMF_HConfigDestroy ESMF_InfoGetFromHost ESMF_InfoGetFromHost proc~test_do_not_reuse_geom->ESMF_InfoGetFromHost ESMF_InfoIsPresent ESMF_InfoIsPresent proc~test_do_not_reuse_geom->ESMF_InfoIsPresent ESMF_InfoSet ESMF_InfoSet proc~test_do_not_reuse_geom->ESMF_InfoSet assert_that assert_that proc~test_do_not_reuse_geom->assert_that assertfalse assertfalse proc~test_do_not_reuse_geom->assertfalse geommanager geommanager proc~test_do_not_reuse_geom->geommanager get_geom get_geom proc~test_do_not_reuse_geom->get_geom get_mapl_geom get_mapl_geom proc~test_do_not_reuse_geom->get_mapl_geom make_geom_spec make_geom_spec proc~test_do_not_reuse_geom->make_geom_spec

Source Code

   subroutine test_do_not_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 :: is_present

      ! geom a
      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))
      call ESMF_HConfigDestroy(hconfig, rc=status)
      @assert_that(status, is(0))
      mapl_geom_a => 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
      hconfig = ESMF_HConfigCreate(content="{class: latlon, im_world: 10, jm_world: 13, pole: PC, dateline: DC, nx: 1, ny: 1}", &
           rc=status)
      @assert_that(status, is(0))
      deallocate(spec)
      allocate(spec, source=geom_manager%make_geom_spec(hconfig, rc=status))
      @assert_that(status, is(0))
      call ESMF_HConfigDestroy(hconfig, rc=status)
      @assert_that(status, is(0))
      mapl_geom_b => geom_manager%get_mapl_geom(spec, 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))
      ! New grid so should not have the key set on the other.
      is_present = ESMF_InfoIsPresent(infoh, 'GeomManager was here', rc=status)
      @assert_that(status, is(0))

      @assertFalse(is_present)
      
   end subroutine test_do_not_reuse_geom