ESMF_TimeSetString Subroutine

private subroutine ESMF_TimeSetString(time, timeString, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Time), intent(inout) :: time
character(len=*), intent(in) :: timeString
integer, intent(out), optional :: rc

Calls

proc~~esmf_timesetstring~~CallsGraph proc~esmf_timesetstring ESMF_TimeSetString interface~esmf_timeset ESMF_TimeSet proc~esmf_timesetstring->interface~esmf_timeset proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_timesetstring->proc~esmf_logfounderror interface~esmf_timeset->proc~esmf_timesetstring proc~esmf_timesetdefault ESMF_TimeSetDefault interface~esmf_timeset->proc~esmf_timesetdefault 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 c_esmc_loggeterrormsg c_esmc_loggeterrormsg proc~esmf_logrc2msg->c_esmc_loggeterrormsg 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_timesetdefault->proc~esmf_logfounderror c_esmc_timeset c_esmc_timeset proc~esmf_timesetdefault->c_esmc_timeset proc~esmf_calendargetinit ESMF_CalendarGetInit proc~esmf_timesetdefault->proc~esmf_calendargetinit proc~esmf_imerr ESMF_IMErr proc~esmf_timesetdefault->proc~esmf_imerr proc~esmf_timeinit ESMF_TimeInit proc~esmf_timesetdefault->proc~esmf_timeinit proc~esmf_imerr->proc~esmf_logfounderror proc~esmf_initcheckdeep ESMF_InitCheckDeep proc~esmf_imerr->proc~esmf_initcheckdeep 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_timesetstring~~CalledByGraph proc~esmf_timesetstring ESMF_TimeSetString interface~esmf_timeset ESMF_TimeSet interface~esmf_timeset->proc~esmf_timesetstring

Source Code

      subroutine ESMF_TimeSetString(time, timeString, rc)

! !ARGUMENTS:
      type(ESMF_Time),         intent(inout)         :: time
      character(*),            intent(in)            :: timeString
      integer,                 intent(out), optional :: rc

!
! !DESCRIPTION:
!     Initializes an {\tt ESMF\_Time} with a set of user-specified string.
!
!     The arguments are:
!     \begin{description}
!     \item[time]
!          The object instance to initialize.
!     \item[timeString]
!          ISO format time string. E.g. 2012-10-24T18:00:00.
!     \item[{[rc]}]
!          Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!     \end{description}
!
!EOP
      integer :: localrc                        ! local return code
      integer :: yy, mm, dd, h, m, s

      ! Assume failure until success
      if (present(rc)) rc = ESMF_RC_NOT_IMPL
      localrc = ESMF_RC_NOT_IMPL

      ! transform from string to integer components
      read (timeString(1:4), "(I4.4)") yy
      read (timeString(6:7), "(I2.2)") mm
      read (timeString(9:10), "(I2.2)") dd
      read (timeString(12:13), "(I2.2)") h
      read (timeString(15:16), "(I2.2)") m
      read (timeString(18:19), "(I2.2)") s

      ! set the time using integer components
      call ESMF_TimeSet(time, yy=yy, mm=mm, dd=dd, h=h, m=m, s=s, 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_TimeSetString