SetServices Subroutine

public subroutine SetServices(gc, rc)

Sets Initialize, Run and Finalize services for the MAPL_HistoryGridComp component.

Arguments

Type IntentOptional Attributes Name
type(ESMF_GridComp), intent(inout) :: gc

composite gridded component

integer, intent(out), optional :: rc

return code


Calls

proc~~setservices~6~~CallsGraph proc~setservices~6 SetServices ESMF_GridCompSetInternalState ESMF_GridCompSetInternalState proc~setservices~6->ESMF_GridCompSetInternalState proc~mapl_genericsetservices MAPL_GenericSetServices proc~setservices~6->proc~mapl_genericsetservices proc~mapl_gridcompsetentrypoint MAPL_GridCompSetEntryPoint proc~setservices~6->proc~mapl_gridcompsetentrypoint proc~mapl_return MAPL_Return proc~setservices~6->proc~mapl_return proc~mapl_verify MAPL_Verify proc~setservices~6->proc~mapl_verify

Source Code

  subroutine SetServices ( gc, rc )
    type(ESMF_GridComp), intent(inout) :: gc     !! composite gridded component
    integer, intent(out), optional     :: rc     !! return code

    integer                         :: status
    type (HISTORY_wrap)             :: wrap
    type (HISTORY_STATE), pointer   :: internal_state

! Register services for this component
! ------------------------------------

    call MAPL_GridCompSetEntryPoint ( gc, ESMF_METHOD_INITIALIZE, Initialize, _RC)

    call MAPL_GridCompSetEntryPoint ( gc, ESMF_METHOD_RUN,   Run,       _RC)

    call MAPL_GridCompSetEntryPoint ( gc, ESMF_METHOD_FINALIZE, Finalize,  _RC)

    call MAPL_GridCompSetEntryPoint ( gc, ESMF_METHOD_WRITERESTART, RecordRestart, _RC)

! Allocate an instance of the private internal state...
!------------------------------------------------------

    allocate(internal_state, _STAT)

! and save its pointer in the GC
!-------------------------------

    wrap%ptr => internal_state
    call ESMF_GridCompSetInternalState(gc, wrap, status)

! Generic Set Services
! --------------------
    call MAPL_GenericSetServices ( gc,_RC )

    _RETURN(ESMF_SUCCESS)

  end subroutine SetServices