set_ESMF_TimeInterval_from_datetime_duration Subroutine

public subroutine set_ESMF_TimeInterval_from_datetime_duration(interval, duration, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_TimeInterval), intent(inout) :: interval
class(datetime_duration), intent(in) :: duration
integer, intent(out), optional :: rc

Calls

proc~~set_esmf_timeinterval_from_datetime_duration~~CallsGraph proc~set_esmf_timeinterval_from_datetime_duration set_ESMF_TimeInterval_from_datetime_duration ESMF_TimeIntervalSet ESMF_TimeIntervalSet proc~set_esmf_timeinterval_from_datetime_duration->ESMF_TimeIntervalSet day_is_set day_is_set proc~set_esmf_timeinterval_from_datetime_duration->day_is_set hour_is_real hour_is_real proc~set_esmf_timeinterval_from_datetime_duration->hour_is_real hour_is_set hour_is_set proc~set_esmf_timeinterval_from_datetime_duration->hour_is_set minute_is_real minute_is_real proc~set_esmf_timeinterval_from_datetime_duration->minute_is_real minute_is_set minute_is_set proc~set_esmf_timeinterval_from_datetime_duration->minute_is_set month_is_set month_is_set proc~set_esmf_timeinterval_from_datetime_duration->month_is_set proc~mapl_return MAPL_Return proc~set_esmf_timeinterval_from_datetime_duration->proc~mapl_return proc~mapl_verify MAPL_Verify proc~set_esmf_timeinterval_from_datetime_duration->proc~mapl_verify second_is_real second_is_real proc~set_esmf_timeinterval_from_datetime_duration->second_is_real second_is_set second_is_set proc~set_esmf_timeinterval_from_datetime_duration->second_is_set year_is_set year_is_set proc~set_esmf_timeinterval_from_datetime_duration->year_is_set 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

Called by

proc~~set_esmf_timeinterval_from_datetime_duration~~CalledByGraph proc~set_esmf_timeinterval_from_datetime_duration set_ESMF_TimeInterval_from_datetime_duration interface~set_esmf_timeinterval set_ESMF_TimeInterval interface~set_esmf_timeinterval->proc~set_esmf_timeinterval_from_datetime_duration

Source Code

   subroutine set_ESMF_TimeInterval_from_datetime_duration(interval, duration, rc)
      type(ESMF_TimeInterval), intent(inout) :: interval
      class(datetime_duration), intent(in) :: duration
      integer, optional, intent(out) :: rc
      integer :: status

      ! Get duration(s) from datetime_duration

      ! Set ESMF_TimeInterval

      if(duration % year_is_set()) then
         call ESMF_TimeIntervalSet(interval, yy = duration % year, _RC)
      end if

      if(duration % month_is_set()) then
         call ESMF_TimeIntervalSet(interval, yy = duration % month, _RC)
      end if

      if(duration % day_is_set()) then
         call ESMF_TimeIntervalSet(interval, yy = duration % day, _RC)
      end if

      if(duration % hour_is_real()) then
         call ESMF_TimeIntervalSet(interval, h_r8 = duration % hour_real, _RC)
      else if(duration % hour_is_set()) then
         call ESMF_TimeIntervalSet(interval, h = duration % hour, _RC)
      end if
         
      if(duration % minute_is_real()) then
         call ESMF_TimeIntervalSet(interval, m_r8 = duration % minute_real, _RC)
      else if(duration % minute_is_set()) then
         call ESMF_TimeIntervalSet(interval, m = duration % minute, _RC)
      end if

      if(duration % second_is_real()) then
         call ESMF_TimeIntervalSet(interval, s_r8 = duration % second_real, _RC)
      else if(duration % second_is_set()) then
         call ESMF_TimeIntervalSet(interval, s = duration % second, _RC)
      end if

      _RETURN(_SUCCESS)

   end subroutine set_ESMF_TimeInterval_from_datetime_duration