make_itemSpec Function

public function make_itemSpec(variable_spec, registry, rc) result(item_spec)

Uses

  • proc~~make_itemspec~~UsesGraph proc~make_itemspec make_itemSpec module~mapl3g_actualptvector mapl3g_ActualPtVector proc~make_itemspec->module~mapl3g_actualptvector module~mapl3g_variablespec mapl3g_VariableSpec proc~make_itemspec->module~mapl3g_variablespec module~mapl3g_actualconnectionpt mapl3g_ActualConnectionPt module~mapl3g_actualptvector->module~mapl3g_actualconnectionpt module~mapl3g_variablespec->module~mapl3g_actualptvector ESMF ESMF module~mapl3g_variablespec->ESMF NUOPC NUOPC module~mapl3g_variablespec->NUOPC gFTL2_StringVector gFTL2_StringVector module~mapl3g_variablespec->gFTL2_StringVector mapl3g_EsmfRegridder mapl3g_EsmfRegridder module~mapl3g_variablespec->mapl3g_EsmfRegridder module~mapl3g_variablespec->module~mapl3g_actualconnectionpt module~mapl3g_fielddictionary mapl3g_FieldDictionary module~mapl3g_variablespec->module~mapl3g_fielddictionary module~mapl3g_horizontaldimsspec mapl3g_HorizontalDimsSpec module~mapl3g_variablespec->module~mapl3g_horizontaldimsspec module~mapl3g_stateitem mapl3g_StateItem module~mapl3g_variablespec->module~mapl3g_stateitem module~mapl3g_stateregistry mapl3g_StateRegistry module~mapl3g_variablespec->module~mapl3g_stateregistry module~mapl3g_ungriddeddims mapl3g_UngriddedDims module~mapl3g_variablespec->module~mapl3g_ungriddeddims module~mapl3g_verticaldimspec mapl3g_VerticalDimSpec module~mapl3g_variablespec->module~mapl3g_verticaldimspec module~mapl3g_verticalgrid mapl3g_VerticalGrid module~mapl3g_variablespec->module~mapl3g_verticalgrid module~mapl3g_virtualconnectionpt mapl3g_VirtualConnectionPt module~mapl3g_variablespec->module~mapl3g_virtualconnectionpt module~mapl_errorhandling mapl_ErrorHandling module~mapl3g_variablespec->module~mapl_errorhandling module~mapl_keywordenforcermod mapl_KeywordEnforcerMod module~mapl3g_variablespec->module~mapl_keywordenforcermod

Arguments

Type IntentOptional Attributes Name
class(VariableSpec), intent(in) :: variable_spec
type(StateRegistry), intent(in), pointer :: registry
integer, intent(out), optional :: rc

Return Value class(StateItemSpec), allocatable


Calls

proc~~make_itemspec~~CallsGraph proc~make_itemspec make_itemSpec interface~mapl_assert MAPL_Assert proc~make_itemspec->interface~mapl_assert none~make_dependencies VariableSpec%make_dependencies proc~make_itemspec->none~make_dependencies none~set_active StateItemSpec%set_active proc~make_itemspec->none~set_active none~set_dependencies StateItemSpec%set_dependencies proc~make_itemspec->none~set_dependencies none~set_raw_dependencies StateItemSpec%set_raw_dependencies proc~make_itemspec->none~set_raw_dependencies proc~mapl_return MAPL_Return proc~make_itemspec->proc~mapl_return proc~mapl_verify MAPL_Verify proc~make_itemspec->proc~mapl_verify none~make_dependencies->proc~mapl_return none~push_back~70 ActualPtVector%push_back none~make_dependencies->none~push_back~70 of of none~make_dependencies->of 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 none~capacity~415 ActualPtVector%capacity none~push_back~70->none~capacity~415 none~resize~140 ActualPtVector%resize none~push_back~70->none~resize~140 none~resize_size_kind~21 ActualPtVector%resize_size_kind none~resize~140->none~resize_size_kind~21

Called by

proc~~make_itemspec~~CalledByGraph proc~make_itemspec make_itemSpec proc~setup~6 setup proc~setup~6->proc~make_itemspec proc~test_created_fields_have_num_levels test_created_fields_have_num_levels proc~test_created_fields_have_num_levels->proc~setup~6 proc~test_get_coordinate_field_change_units_center test_get_coordinate_field_change_units_center proc~test_get_coordinate_field_change_units_center->proc~setup~6 proc~test_get_coordinate_field_change_units_edge test_get_coordinate_field_change_units_edge proc~test_get_coordinate_field_change_units_edge->proc~setup~6 proc~test_get_coordinate_field_simple test_get_coordinate_field_simple proc~test_get_coordinate_field_simple->proc~setup~6

Source Code

   function make_itemSpec(variable_spec, registry, rc) result(item_spec)
      use mapl3g_VariableSpec, only: VariableSpec
      use mapl3g_ActualPtVector, only: ActualPtVector
      class(StateItemSpec), allocatable :: item_spec
      class(VariableSpec), intent(in) :: variable_spec
      type(StateRegistry), pointer, intent(in) :: registry
      integer, optional, intent(out) :: rc

      integer :: status
      type(FieldSpec) :: field_spec
      type(ActualPtVector) :: dependencies

      select case (variable_spec%itemtype%ot)
      case (MAPL_STATEITEM_FIELD%ot)
         allocate(FieldSpec :: item_spec)
         item_spec = FieldSpec(variable_spec)
      case (MAPL_STATEITEM_SERVICE%ot)
         allocate(ServiceSpec :: item_spec)
         item_spec = ServiceSpec(variable_spec, registry)
      case (MAPL_STATEITEM_WILDCARD%ot)
         allocate(WildcardSpec :: item_spec)
         field_spec = FieldSpec(variable_spec)
         item_spec = WildcardSpec(field_spec)
      case (MAPL_STATEITEM_BRACKET%ot)
         allocate(BracketSpec :: item_spec)
         field_spec = FieldSpec(variable_spec)
         item_spec = BracketSpec(field_spec, variable_spec%bracket_size)
      case (MAPL_STATEITEM_STATE%ot)
         allocate(StateSpec :: item_spec)
      case default
         allocate(InvalidSpec :: item_spec)
         _FAIL('Unsupported type.')
      end select

      if (variable_spec%state_intent == ESMF_STATEINTENT_INTERNAL) then
         call item_spec%set_active()
      end if

      dependencies = variable_spec%make_dependencies(_RC)
      call item_spec%set_dependencies(dependencies)
      call item_spec%set_raw_dependencies(variable_spec%dependencies)

      _RETURN(_SUCCESS)

   end function make_itemSpec