GenericCplSetServices Subroutine

public subroutine GenericCplSetServices(CC, RC)

GenericCplSetServices — SetServices for generic couplers.

Arguments

Type IntentOptional Attributes Name
type(ESMF_CplComp) :: CC
integer, intent(out) :: RC

Calls

proc~~genericcplsetservices~~CallsGraph proc~genericcplsetservices GenericCplSetServices ESMF_CplCompGet ESMF_CplCompGet proc~genericcplsetservices->ESMF_CplCompGet ESMF_CplCompSetEntryPoint ESMF_CplCompSetEntryPoint proc~genericcplsetservices->ESMF_CplCompSetEntryPoint ESMF_CplCompSetInternalState ESMF_CplCompSetInternalState proc~genericcplsetservices->ESMF_CplCompSetInternalState proc~mapl_return MAPL_Return proc~genericcplsetservices->proc~mapl_return proc~mapl_verify MAPL_Verify proc~genericcplsetservices->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 GenericCplSetServices ( CC, RC )

! !ARGUMENTS:

    type (ESMF_CplComp  )                          :: CC  
    integer,                         intent(  OUT) :: RC
    
!EOPI

! ErrLog Variables

    character(len=ESMF_MAXSTR)    :: IAm
    character(len=ESMF_MAXSTR)    :: COMP_NAME
    integer                       :: STATUS

! Locals

    type (MAPL_GenericCplState), pointer :: STATE
    type (MAPL_GenericCplWrap )          :: CCWRAP

! Begin...

! Get this instance's name and set-up traceback handle.
! -----------------------------------------------------

    call ESMF_CplCompGet( CC, name=COMP_NAME, RC=STATUS )
    _VERIFY(STATUS)
    Iam = trim(COMP_NAME) // "GenericCplSetServices"

! Allocate this instance of the internal state and put it in wrapper.
! -------------------------------------------------------------------

    allocate(STATE, STAT=STATUS)
    _VERIFY(STATUS)

    CCWRAP%INTERNAL_STATE => STATE

! Have ESMF save pointer to the wrapped internal state in the C.C.
! ----------------------------------------------------------------

    call ESMF_CplCompSetInternalState(CC, CCWRAP, STATUS)
    _VERIFY(STATUS)

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

    call ESMF_CplCompSetEntryPoint ( CC, ESMF_METHOD_INITIALIZE,  Initialize, &
                                     rc=STATUS )
    _VERIFY(STATUS)

    call ESMF_CplCompSetEntryPoint ( CC, ESMF_METHOD_RUN,   Run,        &
                                     rc=STATUS )
    _VERIFY(STATUS)

    call ESMF_CplCompSetEntryPoint ( CC, ESMF_METHOD_FINALIZE, Finalize,   &
                                     rc=STATUS )
    _VERIFY(STATUS)

!ALT: Add these 2 IO methods to facilitate transparent checkpointing
!     to support monthly averages
    call ESMF_CplCompSetEntryPoint ( CC, ESMF_METHOD_READRESTART, ReadRestart,   &
                                     rc=STATUS )
    _VERIFY(STATUS)
    call ESMF_CplCompSetEntryPoint ( CC, ESMF_METHOD_WRITERESTART, WriteRestart,   &
                                     rc=STATUS )
    _VERIFY(STATUS)
! Put the inherited configuration in the internal state
! -----------------------------------------------------

!ALT not_used    call ESMF_CplCompGet( CC, CONFIG=STATE%CF, RC=STATUS )
!ALT not_used    _VERIFY(STATUS)

    _RETURN(ESMF_SUCCESS)
  end subroutine GenericCplSetServices