ESMF_TimeIntervalSetStrCalTyp Subroutine

private subroutine ESMF_TimeIntervalSetStrCalTyp(timeinterval, calkindflag, timeIntervalString, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_TimeInterval), intent(inout) :: timeinterval
type(ESMF_CalKind_Flag), intent(in) :: calkindflag
character(len=*), intent(in) :: timeIntervalString
integer, intent(out), optional :: rc

Calls

proc~~esmf_timeintervalsetstrcaltyp~~CallsGraph proc~esmf_timeintervalsetstrcaltyp ESMF_TimeIntervalSetStrCalTyp proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_timeintervalsetstrcaltyp->proc~esmf_logfounderror proc~esmf_parsedurstring ESMF_ParseDurString proc~esmf_timeintervalsetstrcaltyp->proc~esmf_parsedurstring proc~esmf_timeintervalsetdurcaltyp ESMF_TimeIntervalSetDurCalTyp proc~esmf_timeintervalsetstrcaltyp->proc~esmf_timeintervalsetdurcaltyp esmf_breakpoint esmf_breakpoint proc~esmf_logfounderror->esmf_breakpoint proc~esmf_logrc2msg ESMF_LogRc2Msg proc~esmf_logfounderror->proc~esmf_logrc2msg proc~esmf_logwrite ESMF_LogWrite proc~esmf_logfounderror->proc~esmf_logwrite proc~esmf_parsedurstring->proc~esmf_logfounderror proc~esmf_logseterror ESMF_LogSetError proc~esmf_parsedurstring->proc~esmf_logseterror proc~esmf_parsedurdatestring ESMF_ParseDurDateString proc~esmf_parsedurstring->proc~esmf_parsedurdatestring proc~esmf_parsedurtimestring ESMF_ParseDurTimeString proc~esmf_parsedurstring->proc~esmf_parsedurtimestring proc~esmf_timeintervalsetdurcaltyp->proc~esmf_logfounderror c_esmc_timeintervalsetdurcaltyp c_esmc_timeintervalsetdurcaltyp proc~esmf_timeintervalsetdurcaltyp->c_esmc_timeintervalsetdurcaltyp proc~esmf_timeintervalinit ESMF_TimeIntervalInit proc~esmf_timeintervalsetdurcaltyp->proc~esmf_timeintervalinit c_esmc_loggeterrormsg c_esmc_loggeterrormsg proc~esmf_logrc2msg->c_esmc_loggeterrormsg proc~esmf_logseterror->esmf_breakpoint proc~esmf_logseterror->proc~esmf_logrc2msg proc~esmf_logseterror->proc~esmf_logwrite c_esmc_vmwtime c_esmc_vmwtime proc~esmf_logwrite->c_esmc_vmwtime proc~esmf_logclose ESMF_LogClose proc~esmf_logwrite->proc~esmf_logclose proc~esmf_logflush ESMF_LogFlush proc~esmf_logwrite->proc~esmf_logflush proc~esmf_logopenfile ESMF_LogOpenFile proc~esmf_logwrite->proc~esmf_logopenfile proc~esmf_utiliounitflush ESMF_UtilIOUnitFlush proc~esmf_logwrite->proc~esmf_utiliounitflush proc~esmf_utilstring2array ESMF_UtilString2Array proc~esmf_logwrite->proc~esmf_utilstring2array proc~esmf_parsedurdatestring->proc~esmf_logseterror proc~esmf_parsedurtimestring->proc~esmf_logseterror proc~esmf_logclose->proc~esmf_logflush proc~esmf_logflush->proc~esmf_utiliounitflush proc~esmf_utilarray2string ESMF_UtilArray2String proc~esmf_logflush->proc~esmf_utilarray2string proc~esmf_logopenfile->proc~esmf_utiliounitflush proc~esmf_utiliounitget ESMF_UtilIOUnitGet proc~esmf_logopenfile->proc~esmf_utiliounitget

Called by

proc~~esmf_timeintervalsetstrcaltyp~~CalledByGraph proc~esmf_timeintervalsetstrcaltyp ESMF_TimeIntervalSetStrCalTyp interface~esmf_timeintervalset ESMF_TimeIntervalSet interface~esmf_timeintervalset->proc~esmf_timeintervalsetstrcaltyp

Source Code

      subroutine ESMF_TimeIntervalSetStrCalTyp(timeinterval, calkindflag, &
           timeIntervalString, rc)

! !ARGUMENTS:
      type(ESMF_TimeInterval), intent(inout)         :: timeinterval
      type(ESMF_CalKind_Flag), intent(in)            :: calkindflag
      character(*),            intent(in)            :: timeIntervalString  
      integer,                 intent(out), optional :: rc

!
!
! !DESCRIPTION:
!  Sets the value of an {\tt ESMF\_TimeInterval} using a
!  string in ISO 8601 duration format P[y]Y[mm]M[d]DT[h]H[m]M[s]S. See ~\cite{ISO} and ~\cite{ISOnotes} for
!  information about the format. Also, see the description for the method
! {\tt ESMF\_TimeIntervalSetStr()}~\ref{API:TimeIntervalSetStr}
! for the specific types supported by ESMF for the values in the duration string. 
!
!     The arguments are:
!     \begin{description}
!     \item[timeinterval]
!          The object instance to initialize.
!     \item[calkindflag]
!          Alternate to, and mutually exclusive with, 
!          calendar above.  More convenient way of specifying a built-in 
!          calendar kind.
!     \item[timeIntervalString]
!          ISO 8601 format duration string (e.g. P[y]Y[mm]M[d]DT[h]H[m]M[s]S).
!     \item[{[rc]}]
!          Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!     \end{description}
!
!EOP
! !REQUIREMENTS:
!     TMGn.n.n
      integer :: localrc                        ! local return code
      integer(ESMF_KIND_I8) :: yy_i8
      integer(ESMF_KIND_I8) :: mm_i8
      integer(ESMF_KIND_I8) :: d_i8
      integer(ESMF_KIND_I8) :: s_i8
      real(ESMF_KIND_R8)    :: d_r8
      real(ESMF_KIND_R8)    :: h_r8
      real(ESMF_KIND_R8)    :: m_r8
      real(ESMF_KIND_R8)    :: s_r8
           
      ! Assume failure until success
      if (present(rc)) rc = ESMF_RC_NOT_IMPL
      localrc = ESMF_RC_NOT_IMPL

       ! Parse string into values for each time unit
      call ESMF_ParseDurString(timeintervalString, &
           yy_i8=yy_i8, mm_i8=mm_i8, d_i8=d_i8, d_r8=d_r8, &
           h_r8=h_r8, m_r8=m_r8, s_i8=s_i8, s_r8=s_r8, rc=localrc)      
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
           ESMF_CONTEXT, rcToReturn=rc)) return
      
      ! Set time interval using time unit values parsed above
      
      ! NOTE: Just use I8 for integer values, since it looks like integer values
      !       are stored that way anyway. Also, for times (h,m,s), it looks like both R8
      !       and I8 are added together, so you can just
      !       use both and whichever isn't needed set to 0.
      !       An R8 can exactly represent an I4, so just use R8 for hours and minutes
      !       where an I4 is all that's available.
      call ESMF_TimeIntervalSetDurCalTyp(timeinterval, calkindflag, &
           yy_i8=yy_i8, &
           mm_i8=mm_i8, &
           d_i8=d_i8, &
           s_i8=s_i8, &
           d_r8=d_r8, &
           h_r8=h_r8, &
           m_r8=m_r8, &
           s_r8=s_r8, &
           rc=localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
           ESMF_CONTEXT, rcToReturn=rc)) return

      ! Return success
      if (present(rc)) rc = ESMF_SUCCESS
      end subroutine ESMF_TimeIntervalSetStrCalTyp