test_make_grid_multi Subroutine

public subroutine test_make_grid_multi()

Arguments

None

Calls

proc~~test_make_grid_multi~~CallsGraph proc~test_make_grid_multi test_make_grid_multi ESMF_InfoGet ESMF_InfoGet proc~test_make_grid_multi->ESMF_InfoGet ESMF_InfoGetFromHost ESMF_InfoGetFromHost proc~test_make_grid_multi->ESMF_InfoGetFromHost assertequal assertequal proc~test_make_grid_multi->assertequal none~add_prototype GridManager%add_prototype proc~test_make_grid_multi->none~add_prototype none~delete GridManager%delete proc~test_make_grid_multi->none~delete none~make_grid~3 GridManager%make_grid proc~test_make_grid_multi->none~make_grid~3 none~insert~409 StringGridFactoryMap%insert none~add_prototype->none~insert~409 ESMF_GridDestroy ESMF_GridDestroy none~delete->ESMF_GridDestroy interface~mapl_assert MAPL_Assert none~delete->interface~mapl_assert proc~mapl_return MAPL_Return none~delete->proc~mapl_return none~make_grid_from_distgrid GridManager%make_grid_from_distGrid none~make_grid~3->none~make_grid_from_distgrid none~insert_pair~35 StringGridFactoryMap%insert_pair none~insert~409->none~insert_pair~35 none~make_grid_from_distgrid->ESMF_InfoGetFromHost none~make_grid_from_distgrid->none~make_grid~3 none~make_grid_from_distgrid->proc~mapl_return ESMF_InfoSet ESMF_InfoSet none~make_grid_from_distgrid->ESMF_InfoSet none~make_factory~3 GridManager%make_factory none~make_grid_from_distgrid->none~make_factory~3 proc~mapl_verify MAPL_Verify none~make_grid_from_distgrid->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 none~make_factory_from_distgrid GridManager%make_factory_from_distGrid none~make_factory~3->none~make_factory_from_distgrid proc~mapl_verify->proc~mapl_throw_exception

Source Code

   subroutine test_make_grid_multi()
      type (GridManager) :: grid_manager
      type (ESMF_Grid) :: grid

      integer :: status
      character(len=40) :: grid_name
      type(ESMF_Info) :: infoh

      call grid_manager%add_prototype('grid_type_1', MockGridFactory('foo'))
      call grid_manager%add_prototype('grid_type_2', MockGridFactory('bar'))

      grid = grid_manager%make_grid(config, prefix='default.', rc=status)
      @assertEqual(0, status)

      call ESMF_InfoGetFromHost(grid,infoh,rc=status)
      call ESMF_InfoGet(infoh,'GRID_NAME',grid_name,rc=status)
      if (status /= 0) then
         call grid_manager%delete(grid)
      end if
      @assertEqual(0, status)
      
      if ('mock' /= trim(grid_name)) then
         call grid_manager%delete(grid)
         return
      end if
      @assertEqual('foo', trim(grid_name))
      
      call grid_manager%delete(grid)


      grid = grid_manager%make_grid(config, prefix='other.', rc=status)

      call ESMF_InfoGetFromHost(grid,infoh,rc=status)
      call ESMF_InfoGet(infoh,'GRID_NAME',grid_name,rc=status)
      if (status /= 0) then
         call grid_manager%delete(grid)
         return
      end if
      @assertEqual(0, status)
      
      if ('mock' /= trim(grid_name)) then
         call grid_manager%delete(grid)
      end if
      @assertEqual('bar', trim(grid_name))
      
      call grid_manager%delete(grid)

   end subroutine test_make_grid_multi