SetServices Subroutine

public subroutine SetServices(GC, RC)

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

Arguments

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

gridded component

integer, intent(out), optional :: RC

return code


Calls

proc~~setservices~5~~CallsGraph proc~setservices~5 SetServices ESMF_GridCompGet ESMF_GridCompGet proc~setservices~5->ESMF_GridCompGet ESMF_UserCompSetInternalState ESMF_UserCompSetInternalState proc~setservices~5->ESMF_UserCompSetInternalState interface~mapl_timeradd MAPL_TimerAdd proc~setservices~5->interface~mapl_timeradd proc~mapl_genericsetservices MAPL_GenericSetServices proc~setservices~5->proc~mapl_genericsetservices proc~mapl_gridcompsetentrypoint MAPL_GridCompSetEntryPoint proc~setservices~5->proc~mapl_gridcompsetentrypoint proc~mapl_return MAPL_Return proc~setservices~5->proc~mapl_return proc~mapl_verify MAPL_Verify proc~setservices~5->proc~mapl_verify

Source Code

   SUBROUTINE SetServices ( GC, RC )

    type(ESMF_GridComp), intent(INOUT) :: GC  !! gridded component
    integer, optional,   intent(OUT)   :: RC  !! return code

!-------------------------------------------------------------------------

!   Local derived type aliases
!   --------------------------
    type (MAPL_ExtData_State), pointer  :: self   ! internal, that is
    type (MAPL_ExtData_wrap)            :: wrap

    character(len=ESMF_MAXSTR)          :: comp_name
    integer                             :: status

!                              ------------

!   Get my name and set-up traceback handle
!   ---------------------------------------
    call ESMF_GridCompGet( GC, name=comp_name, _RC )

!   Wrap internal state for storing in GC; rename legacyState
!   -------------------------------------
    allocate ( self, _STAT )
    wrap%ptr => self

!                       ------------------------
!                       ESMF Functional Services
!                       ------------------------

!   Set the Initialize, Run, Finalize entry points
!   ----------------------------------------------
    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 )

!   Store internal state in GC
!   --------------------------
    call ESMF_UserCompSetInternalState ( GC, 'MAPL_ExtData_state', wrap, STATUS )

    call MAPL_TimerAdd(gc,name="Initialize", _RC)
    call MAPL_TimerAdd(gc,name="Run", _RC)
    call MAPL_TimerAdd(gc,name="-Read_Loop", _RC)
    call MAPL_TimerAdd(gc,name="--CheckUpd", _RC)
    call MAPL_TimerAdd(gc,name="--Read", _RC)
    call MAPL_TimerAdd(gc,name="--GridCreate", _RC)
    call MAPL_TimerAdd(gc,name="--IclientWait", _RC)
    call MAPL_TimerAdd(gc,name="--PRead", _RC)
    call MAPL_TimerAdd(gc,name="---CreateCFIO", _RC)
    call MAPL_TimerAdd(gc,name="---prefetch", _RC)
    call MAPL_TimerAdd(gc,name="----add-collection", _RC)
    call MAPL_TimerAdd(gc,name="----make-reference", _RC)
    call MAPL_TimerAdd(gc,name="----RegridStore", _RC)
    call MAPL_TimerAdd(gc,name="----request", _RC)
    call MAPL_TimerAdd(gc,name="---IclientDone", _RC)
    call MAPL_TimerAdd(gc,name="----RegridApply", _RC)
    call MAPL_TimerAdd(gc,name="---read-prefetch", _RC)
    call MAPL_TimerAdd(gc,name="--Swap", _RC)
    call MAPL_TimerAdd(gc,name="--Bracket", _RC)
    call MAPL_TimerAdd(gc,name="-Interpolate", _RC)
!   Generic Set Services
!   --------------------
    call MAPL_GenericSetServices ( GC, _RC )

!   All done
!   --------

    _RETURN(ESMF_SUCCESS)

  END SUBROUTINE SetServices