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_AttributeGet ESMF_AttributeGet proc~test_make_grid_multi->ESMF_AttributeGet assertequal assertequal proc~test_make_grid_multi->assertequal none~add_prototype~5 GridManager%add_prototype proc~test_make_grid_multi->none~add_prototype~5 none~delete GridManager%delete proc~test_make_grid_multi->none~delete none~make_grid~4 GridManager%make_grid proc~test_make_grid_multi->none~make_grid~4 none~insert~34 StringGridFactoryMap%insert none~add_prototype~5->none~insert~34 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~4->none~make_grid_from_distgrid none~insert_pair~4 StringGridFactoryMap%insert_pair none~insert~34->none~insert_pair~4 none~make_grid_from_distgrid->none~make_grid~4 none~make_grid_from_distgrid->proc~mapl_return ESMF_AttributeSet ESMF_AttributeSet none~make_grid_from_distgrid->ESMF_AttributeSet 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

      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_AttributeGet(grid, '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_AttributeGet(grid, '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