test_grid_type Subroutine

public subroutine test_grid_type()

Arguments

None

Calls

proc~~test_grid_type~~CallsGraph proc~test_grid_type test_grid_type ESMF_AttributeGet ESMF_AttributeGet proc~test_grid_type->ESMF_AttributeGet assertequal assertequal proc~test_grid_type->assertequal none~add_prototype~2 GridManager%add_prototype proc~test_grid_type->none~add_prototype~2 none~delete GridManager%delete proc~test_grid_type->none~delete none~make_grid~4 GridManager%make_grid proc~test_grid_type->none~make_grid~4 none~insert~9 StringGridFactoryMap%insert none~add_prototype~2->none~insert~9 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 StringGridFactoryMap%insert_pair none~insert~9->none~insert_pair 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_grid_type()
      type (GridManager) :: grid_manager
      type (ESMF_Grid) :: grid

      integer :: status
      character(len=40) :: grid_type

      call grid_manager%add_prototype('grid_type_1', MockGridFactory('foo'))
      grid = grid_manager%make_grid(config, prefix='default.', rc=status)
      @assertEqual(0, status)

      call ESMF_AttributeGet(grid, 'GridType', grid_type, rc=status)
      if (status /= 0) then
         call grid_manager%delete(grid)
         return
      end if
      @assertEqual(0, status)
      
      if ('mock' /= trim(grid_type)) then
         call grid_manager%delete(grid)
         return
      end if
      @assertEqual('grid_type_1', trim(grid_type))
      
      call grid_manager%delete(grid)

   end subroutine test_grid_type