Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(VariableSpec), | intent(in) | :: | variable_spec | |||
type(StateRegistry), | intent(in), | pointer | :: | registry | ||
integer, | intent(out), | optional | :: | rc |
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