MAPL_StateAlarmGet Subroutine

public subroutine MAPL_StateAlarmGet(STATE, ALARM, NAME, RC)

Arguments

Type IntentOptional Attributes Name
type(MAPL_MetaComp), intent(inout) :: STATE
type(ESMF_Alarm), intent(out) :: ALARM
character(len=*), intent(in) :: NAME
integer, intent(out), optional :: RC

Calls

proc~~mapl_statealarmget~~CallsGraph proc~mapl_statealarmget MAPL_StateAlarmGet ESMF_AlarmGet ESMF_AlarmGet proc~mapl_statealarmget->ESMF_AlarmGet proc~mapl_return MAPL_Return proc~mapl_statealarmget->proc~mapl_return proc~mapl_verify MAPL_Verify proc~mapl_statealarmget->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_StateAlarmGet(STATE,ALARM,NAME,RC)
      type (MAPL_MetaComp),        intent(INOUT) :: STATE
      type (ESMF_Alarm),           intent(  OUT) :: ALARM
      character(len=*),            intent(IN   ) :: NAME
      integer, optional,           intent(  OUT) :: RC     ! Error code:

      character(len=ESMF_MAXSTR), parameter :: IAm = "MAPL_StateAlarmGet"
      integer :: status, I
      character(len=ESMF_MAXSTR) :: ANAME

      do I=0,STATE%ALARMLAST
         call ESMF_AlarmGet(STATE%ALARM(I), name=ANAME, RC=status)
         _VERIFY(status)
         if(trim(NAME)/=trim(ANAME)) cycle
         ALARM=STATE%ALARM(I)
         _RETURN(ESMF_SUCCESS)
      end do

      _RETURN(ESMF_FAILURE)
   end subroutine MAPL_StateAlarmGet