set_start_stop_time Function

public function set_start_stop_time(clock, hconfig, rc) result(start_stop_time)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Clock), intent(inout) :: clock
type(ESMF_HConfig), intent(in) :: hconfig
integer, intent(out), optional :: rc

Return Value type(ESMF_Time), (2)


Calls

proc~~set_start_stop_time~~CallsGraph proc~set_start_stop_time set_start_stop_time ESMF_ClockGet ESMF_ClockGet proc~set_start_stop_time->ESMF_ClockGet ESMF_TimeSet ESMF_TimeSet proc~set_start_stop_time->ESMF_TimeSet esmf_hconfigasstring esmf_hconfigasstring proc~set_start_stop_time->esmf_hconfigasstring esmf_hconfigcreateat esmf_hconfigcreateat proc~set_start_stop_time->esmf_hconfigcreateat esmf_hconfigisdefined esmf_hconfigisdefined proc~set_start_stop_time->esmf_hconfigisdefined proc~mapl_return MAPL_Return proc~set_start_stop_time->proc~mapl_return proc~mapl_verify MAPL_Verify proc~set_start_stop_time->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

Called by

proc~~set_start_stop_time~~CalledByGraph proc~set_start_stop_time set_start_stop_time proc~test_set_start_stop_time test_set_start_stop_time proc~test_set_start_stop_time->proc~set_start_stop_time

Source Code

   function set_start_stop_time(clock, hconfig, rc) result(start_stop_time)
      type(ESMF_Time) :: start_stop_time(2)
      type(ESMF_Clock), intent(inout) :: clock
      type(ESMF_HConfig), intent(in) :: hconfig
      integer, intent(out), optional :: rc

      integer :: status
      logical :: has_start, has_stop, has_timespec
      character(len=:), allocatable :: time_string
      type(ESMF_HConfig) :: time_hconfig

      time_hconfig = ESMF_HConfigCreateAt(hconfig, keyString='time_spec', _RC)
      call ESMF_ClockGet(clock, startTime=start_stop_time(1), stopTime=start_stop_time(2), _RC)
      has_start = ESMF_HConfigIsDefined(time_hconfig, keyString='start', _RC)
      has_stop = ESMF_HConfigIsDefined(time_hconfig, keyString='stop', _RC)
      if (has_start) then
         time_string = ESMF_HConfigAsString(time_hconfig, keyString='start', _RC)
         call ESMF_TimeSet(start_stop_time(1), timeString=time_string, _RC)
      end if
      if (has_stop) then
         time_string = ESMF_HConfigAsString(time_hconfig, keyString='stop', _RC)
         call ESMF_TimeSet(start_stop_time(2), timeString=time_string, _RC)
      end if
      _RETURN(_SUCCESS)
   end function set_start_stop_time