test_get_item Subroutine

public subroutine test_get_item()

Uses

  • proc~~test_get_item~~UsesGraph proc~test_get_item test_get_item module~mapl3g_stateitemspecmap mapl3g_StateItemSpecMap proc~test_get_item->module~mapl3g_stateitemspecmap module~mapl3g_stateitemspec mapl3g_StateItemSpec module~mapl3g_stateitemspecmap->module~mapl3g_stateitemspec gftl2_stringvector gftl2_stringvector module~mapl3g_stateitemspec->gftl2_stringvector module~mapl3g_actualptvector mapl3g_ActualPtVector module~mapl3g_stateitemspec->module~mapl3g_actualptvector module~mapl3g_extensionaction mapl3g_ExtensionAction module~mapl3g_stateitemspec->module~mapl3g_extensionaction module~mapl_errorhandling mapl_ErrorHandling module~mapl3g_stateitemspec->module~mapl_errorhandling module~mapl3g_actualconnectionpt mapl3g_ActualConnectionPt module~mapl3g_actualptvector->module~mapl3g_actualconnectionpt module~mapl3g_extensionaction->module~mapl_errorhandling ESMF ESMF module~mapl3g_extensionaction->ESMF module~mapl_throwmod MAPL_ThrowMod module~mapl_errorhandling->module~mapl_throwmod mpi mpi module~mapl_errorhandling->mpi

Arguments

None

Calls

proc~~test_get_item~~CallsGraph proc~test_get_item test_get_item assert_that assert_that proc~test_get_item->assert_that false false proc~test_get_item->false none~add_item~2 StateSpec%add_item proc~test_get_item->none~add_item~2 none~get_item~2 StateSpec%get_item proc~test_get_item->none~get_item~2 true true proc~test_get_item->true none~insert~223 StateItemSpecMap%insert none~add_item~2->none~insert~223 none~at~235 StateItemSpecMap%at none~get_item~2->none~at~235 none~at_rc~10 StateItemSpecMap%at_rc none~at~235->none~at_rc~10 none~insert_pair~19 StateItemSpecMap%insert_pair none~insert~223->none~insert_pair~19 none~find~61 StateItemSpecMap%find none~at_rc~10->none~find~61

Source Code

   subroutine test_get_item()
      use mapl3g_stateitemspecmap
      type(StateSpec) :: state_spec
      class(StateItemSpec), pointer :: item_spec

      type(FieldSpec) :: field_spec
      type(ESMF_Geom) :: geom
      type(BasicVerticalGrid) :: vertical_grid
      type(VerticalDimSpec) :: vertical_dim_spec

      field_spec = FieldSpec(geom=geom, vertical_grid=vertical_grid, vertical_dim_spec=vertical_dim_spec, &
           typekind=ESMF_TYPEKIND_R4, ungridded_dims=UngriddedDims())
      call state_spec%add_item('A', field_spec)

      ! Different name/key
      item_spec => state_spec%get_item('B')
      @assert_that(associated(item_spec), is(false()))

      ! Same name/key
      item_spec => state_spec%get_item('A')
      @assert_that(associated(item_spec), is(true()))

      
   end subroutine test_get_item