MAPL_CplCompSetAlarm Subroutine

public subroutine MAPL_CplCompSetAlarm(CC, ALARM, RC)

Arguments

Type IntentOptional Attributes Name
type(ESMF_CplComp), intent(inout) :: CC
type(ESMF_Alarm), intent(in), target :: ALARM
integer, intent(out), optional :: RC

Calls

proc~~mapl_cplcompsetalarm~~CallsGraph proc~mapl_cplcompsetalarm MAPL_CplCompSetAlarm ESMF_CplCompGet ESMF_CplCompGet proc~mapl_cplcompsetalarm->ESMF_CplCompGet ESMF_CplCompGetInternalState ESMF_CplCompGetInternalState proc~mapl_cplcompsetalarm->ESMF_CplCompGetInternalState interface~mapl_assert MAPL_Assert proc~mapl_cplcompsetalarm->interface~mapl_assert proc~mapl_return MAPL_Return proc~mapl_cplcompsetalarm->proc~mapl_return proc~mapl_verify MAPL_Verify proc~mapl_cplcompsetalarm->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 MAPL_CplCompSetAlarm ( CC, ALARM, RC )
    type (ESMF_CplComp  ),           intent(INOUT) :: CC  
    type (ESMF_Alarm), target,       intent(IN   ) :: ALARM
    integer, optional,               intent(  OUT) :: RC
    
! ErrLog Variables

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

! Locals

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


! 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) // "MAPL_CplCompSetAlarm"

! Retrieve the pointer to the internal state. It comes in a wrapper.
! ------------------------------------------------------------------

    call ESMF_CplCompGetInternalState ( CC, WRAP, STATUS )
    _VERIFY(STATUS)

    STATE  =>  WRAP%INTERNAL_STATE

    if (.not.associated(STATE%TIME2CPL_ALARM)) then
       STATE%TIME2CPL_ALARM => ALARM
    else
       _FAIL( "Alarm is already associated! Cannot set it again!")
    end if
    _RETURN(ESMF_SUCCESS)
  end subroutine MAPL_CplCompSetAlarm