MAPL_CFIOGetTimeString Subroutine

public subroutine MAPL_CFIOGetTimeString(MCFIO, Clock, Date, rc)

Arguments

Type IntentOptional Attributes Name
type(MAPL_CFIO), intent(inout) :: MCFIO
type(ESMF_Clock), intent(in) :: Clock
character(len=ESMF_MAXSTR), intent(inout) :: Date
integer, intent(out), optional :: rc

Calls

proc~~mapl_cfiogettimestring~~CallsGraph proc~mapl_cfiogettimestring MAPL_CFIOGetTimeString ESMF_AlarmIsRinging ESMF_AlarmIsRinging proc~mapl_cfiogettimestring->ESMF_AlarmIsRinging ESMF_ClockGet ESMF_ClockGet proc~mapl_cfiogettimestring->ESMF_ClockGet ESMF_ClockGetAlarm ESMF_ClockGetAlarm proc~mapl_cfiogettimestring->ESMF_ClockGetAlarm ESMF_TimeGet ESMF_TimeGet proc~mapl_cfiogettimestring->ESMF_TimeGet ESMF_TimeIntervalGet ESMF_TimeIntervalGet proc~mapl_cfiogettimestring->ESMF_TimeIntervalGet ESMF_TimeSet ESMF_TimeSet proc~mapl_cfiogettimestring->ESMF_TimeSet proc~mapl_return MAPL_Return proc~mapl_cfiogettimestring->proc~mapl_return proc~mapl_verify MAPL_Verify proc~mapl_cfiogettimestring->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_CFIOGetTimeString(mcfio,Clock,Date,rc)

    type(MAPL_CFIO  ),          intent(inout) :: MCFIO
    type(ESMF_Clock),           intent(in   ) :: Clock
    character(len=ESMF_MAXSTR), intent(inout) :: Date
    integer, optional,          intent(out  ) :: rc

    integer :: status

    type(ESMF_Time) :: time
    integer :: YY,MM,DD,H,M,S
    integer :: noffset
    logical :: LPERP
    type(ESMF_Alarm)           :: PERPETUAL
    character(len=ESMF_MAXSTR) :: ClockName


    call ESMF_ClockGet       (CLOCK, name=ClockName, CurrTime =TIME, RC=STATUS)
    _VERIFY(STATUS)

     call ESMF_TimeIntervalGet( MCFIO%OFFSET, S=noffset, rc=status )
     _VERIFY(STATUS)
     if( noffset /= 0 ) then
         LPERP = ( index( trim(clockname),'_PERPETUAL' ).ne.0 )
        if( LPERP ) then
            call ESMF_ClockGetAlarm ( clock, alarmName='PERPETUAL', alarm=PERPETUAL, rc=status )
            _VERIFY(STATUS)
            if( ESMF_AlarmIsRinging(PERPETUAL) ) then
                call ESMF_TimeGet ( Time, YY = YY, &
                                          MM = MM, &
                                          DD = DD, &
                                          H  = H , &
                                          M  = M , &
                                          S  = S, rc=status )
                                          MM = MM + 1
                call ESMF_TimeSet ( Time, YY = YY, &
                                          MM = MM, &
                                          DD = DD, &
                                          H  = H , &
                                          M  = M , &
                                          S  = S, rc=status )
            endif
        endif
     endif

    TIME = TIME - MCFIO%OFFSET

    call ESMF_TimeGet        (TIME,     timeString=DATE,     RC=STATUS)
    _VERIFY(STATUS)

    _RETURN(ESMF_SUCCESS)

    end subroutine MAPL_CFIOGetTimeString