setServices Subroutine

public subroutine setServices(gridcomp, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_GridComp) :: gridcomp
integer, intent(out) :: rc

Calls

proc~~setservices~8~~CallsGraph proc~setservices~8 setServices interface~mapl_assert MAPL_Assert proc~setservices~8->interface~mapl_assert interface~mapl_connectall MAPL_ConnectAll proc~setservices~8->interface~mapl_connectall interface~mapl_gridcompsetentrypoint MAPL_GridCompSetEntryPoint proc~setservices~8->interface~mapl_gridcompsetentrypoint interface~mapl_resourceget MAPL_ResourceGet proc~setservices~8->interface~mapl_resourceget interface~mapl_usercompgetinternalstate MAPL_UserCompGetInternalState proc~setservices~8->interface~mapl_usercompgetinternalstate interface~mapl_usercompsetinternalstate MAPL_UserCompSetInternalState proc~setservices~8->interface~mapl_usercompsetinternalstate proc~mapl_return MAPL_Return proc~setservices~8->proc~mapl_return proc~mapl_verify MAPL_Verify proc~setservices~8->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 setServices(gridcomp, rc)
      type(ESMF_GridComp) :: gridcomp
      integer, intent(out) :: rc

      integer :: status
      type(CapGridComp), pointer :: cap
      character(:), allocatable :: extdata, history
      type(OuterMetaComponent), pointer :: outer_meta

      ! Set entry points
      call MAPL_GridCompSetEntryPoint(gridcomp, ESMF_METHOD_INITIALIZE, init, phase_name='GENERIC::INIT_USER', _RC)
      call MAPL_GridCompSetEntryPoint(gridcomp, ESMF_METHOD_RUN, run, phase_name='run', _RC)

      ! Attach private state
      _SET_NAMED_PRIVATE_STATE(gridcomp, CapGridComp, PRIVATE_STATE)
      _GET_NAMED_PRIVATE_STATE(gridcomp, CapGridComp, PRIVATE_STATE, cap)

      ! Disable extdata or history
      call MAPL_ResourceGet(gridcomp, keystring='run_extdata', value=cap%run_extdata, default=.true., _RC)
      call MAPL_ResourceGet(gridcomp, keystring='run_history', value=cap%run_history, default=.true., _RC)

      ! Get Names of children
      call MAPL_ResourceGet(gridcomp, keystring='extdata_name', value=cap%extdata_name, default='EXTDATA', _RC)
      call MAPL_ResourceGet(gridcomp, keystring='root_name', value=cap%root_name, _RC)
      call MAPL_ResourceGet(gridcomp, keystring='history_name', value=cap%history_name, default='HIST', _RC)

      if (cap%run_extdata) then 
         call MAPL_ConnectAll(gridcomp, src_comp=cap%extdata_name, dst_comp=cap%root_name, _RC)
      end if
      if (cap%run_history) then
         call MAPL_ConnectAll(gridcomp, src_comp=cap%root_name, dst_comp=cap%history_name, _RC)
      end if
      _RETURN(_SUCCESS)
   end subroutine setServices