test_parent_user_items_created Subroutine

public subroutine test_parent_user_items_created(this)

Arguments

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

Calls

proc~~test_parent_user_items_created~~CallsGraph proc~test_parent_user_items_created test_parent_user_items_created assert_that assert_that proc~test_parent_user_items_created->assert_that esmf_stateget esmf_stateget proc~test_parent_user_items_created->esmf_stateget interface~get_outer_meta get_outer_meta proc~test_parent_user_items_created->interface~get_outer_meta none~get_states GriddedComponentDriver%get_states proc~test_parent_user_items_created->none~get_states none~get_state~2 MultiState%get_state proc~test_parent_user_items_created->none~get_state~2 none~get_user_gc_driver OuterMetaComponent%get_user_gc_driver proc~test_parent_user_items_created->none~get_user_gc_driver proc~setup~2 setup proc~test_parent_user_items_created->proc~setup~2 none~get_state_by_esmf_intent MultiState%get_state_by_esmf_intent none~get_state~2->none~get_state_by_esmf_intent proc~setup~2->assert_that ESMF_ClockCreate ESMF_ClockCreate proc~setup~2->ESMF_ClockCreate ESMF_GridCompInitialize ESMF_GridCompInitialize proc~setup~2->ESMF_GridCompInitialize ESMF_GridCreateNoPeriDim ESMF_GridCreateNoPeriDim proc~setup~2->ESMF_GridCreateNoPeriDim ESMF_HConfigCreate ESMF_HConfigCreate proc~setup~2->ESMF_HConfigCreate ESMF_TimeIntervalSet ESMF_TimeIntervalSet proc~setup~2->ESMF_TimeIntervalSet ESMF_TimeSet ESMF_TimeSet proc~setup~2->ESMF_TimeSet NUOPC_FieldDictionarySetup NUOPC_FieldDictionarySetup proc~setup~2->NUOPC_FieldDictionarySetup anyexceptions anyexceptions proc~setup~2->anyexceptions esmf_gridcompsetservices esmf_gridcompsetservices proc~setup~2->esmf_gridcompsetservices esmf_statecreate esmf_statecreate proc~setup~2->esmf_statecreate generic_init_phase_sequence generic_init_phase_sequence proc~setup~2->generic_init_phase_sequence interface~create_grid_comp create_grid_comp proc~setup~2->interface~create_grid_comp interface~user_setservices user_setservices proc~setup~2->interface~user_setservices mapl_gridcompsetgeom mapl_gridcompsetgeom proc~setup~2->mapl_gridcompsetgeom proc~mapl_gridcompsetverticalgrid MAPL_GridCompSetVerticalGrid proc~setup~2->proc~mapl_gridcompsetverticalgrid sourcelocation sourcelocation proc~setup~2->sourcelocation none~get_state_by_esmf_intent->none~get_state~2 proc~mapl_return MAPL_Return none~get_state_by_esmf_intent->proc~mapl_return proc~mapl_verify MAPL_Verify none~get_state_by_esmf_intent->proc~mapl_verify interface~mapl_gridcompgetoutermeta MAPL_GridCompGetOuterMeta proc~mapl_gridcompsetverticalgrid->interface~mapl_gridcompgetoutermeta none~set_vertical_grid OuterMetaComponent%set_vertical_grid proc~mapl_gridcompsetverticalgrid->none~set_vertical_grid proc~mapl_gridcompsetverticalgrid->proc~mapl_return proc~mapl_gridcompsetverticalgrid->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 proc~mapl_verify->proc~mapl_throw_exception

Source Code

   subroutine test_parent_user_items_created(this)
      class(MpiTestMethod), intent(inout) :: this

      integer :: status
      type(ESMF_GridComp) :: outer_gc

      type(OuterMetaComponent), pointer :: outer_meta
      type(MultiState) :: states
      type(ESMF_Field) :: f

      call setup(outer_gc, states, status)
      @assert_that(status, is(0))

      outer_meta => get_outer_meta(outer_gc, rc=status)
      @assert_that(status, is(0))

      @assert_that(check(outer_meta, 'import', expected_count=0), is(0))
      @assert_that(check(outer_meta, 'export', expected_count=0), is(0))
      @assert_that(check(outer_meta, 'internal', expected_count=0), is(0))

   contains

      integer function check(meta, state_intent, expected_count) result(status)
         type(OuterMetaComponent), intent(in) :: meta
         character(*), intent(in) :: state_intent
         integer, intent(in) :: expected_count

         type(MultiState) :: states
         type(ESMF_State) :: state
         integer :: itemCount
         type(GriddedComponentDriver), pointer :: user_component

         status = -1

         user_component => outer_meta%get_user_gc_driver()
         states = user_component%get_states()
         call states%get_state(state, 'import', rc=status)
         if (status /= 0) then
            status = -2
            return
         end if

         call ESMF_StateGet(state, itemCount=itemCount, rc=status)
         if (status /= 0) then
            status = -3
            return
         end if

         if (itemCount /= expected_count) then
            status = -4
            return
         end if
         status = 0
      end function check
   end subroutine test_parent_user_items_created