tem_time_default_zero Function

public pure function tem_time_default_zero(time, dependency) result(zeroed)

Function to find a default for time, if it is not defined already.

Depending on dependency set the value in time to a zero time, if it is set to never. This is useful to find a suitable minimum, where an interval is defined in the timeControl, but no minimum.

Arguments

Type IntentOptional Attributes Name
type(tem_time_type), intent(in) :: time

The time to find a default 0 for, if not define, but dependency is.

type(tem_time_type), intent(in) :: dependency

A time definition where we set a 0 default in time for, if the corresponding component is defined, but the time component is not.

Return Value type(tem_time_type)

Resulting time, with zeroed components where dependency is defined, but time not.


Called by

proc~~tem_time_default_zero~~CalledByGraph proc~tem_time_default_zero tem_time_default_zero proc~tem_timecontrol_load tem_timeControl_load proc~tem_timecontrol_load->proc~tem_time_default_zero proc~tem_balance_load tem_balance_load proc~tem_balance_load->proc~tem_timecontrol_load proc~tem_load_adapt tem_load_adapt proc~tem_load_adapt->proc~tem_timecontrol_load proc~tem_load_convergenceheader tem_load_convergenceHeader proc~tem_load_convergenceheader->proc~tem_timecontrol_load proc~tem_load_output tem_load_output proc~tem_load_output->proc~tem_timecontrol_load proc~tem_load_restart tem_load_restart proc~tem_load_restart->proc~tem_timecontrol_load proc~tem_load_surfdata tem_load_surfData proc~tem_load_surfdata->proc~tem_timecontrol_load proc~tem_load_trackingconfig tem_load_trackingConfig proc~tem_load_trackingconfig->proc~tem_timecontrol_load proc~tem_simcontrol_load tem_simControl_load proc~tem_simcontrol_load->proc~tem_timecontrol_load proc~tem_convergence_load tem_convergence_load proc~tem_convergence_load->proc~tem_load_convergenceheader proc~tem_load_general tem_load_general proc~tem_load_general->proc~tem_balance_load proc~tem_load_general->proc~tem_simcontrol_load proc~tem_load_tracking tem_load_tracking proc~tem_load_tracking->proc~tem_load_trackingconfig proc~tem_abortcriteria_load tem_abortCriteria_load proc~tem_abortcriteria_load->proc~tem_convergence_load

Source Code

  pure function tem_time_default_zero(time, dependency) result(zeroed)
    ! -------------------------------------------------------------------- !
    !> The time to find a default 0 for, if not define, but dependency is.
    type(tem_time_type), intent(in) :: time

    !> A time definition where we set a 0 default in time for, if the
    !! corresponding component is defined, but the time component is
    !! not.
    type(tem_time_type), intent(in) :: dependency

    !> Resulting time, with zeroed components where dependency is defined,
    !! but time not.
    type(tem_time_type) :: zeroed
    ! -------------------------------------------------------------------- !

    zeroed = time

    if (.not. time%sim < huge(time%sim)) then
      ! Time set to never.
      if (dependency%sim < huge(dependency%sim)) then
        ! But dependency not!
        zeroed%sim = 0.0_rk
      end if
    end if
    if (.not. time%iter < huge(time%iter)) then
      ! Time set to never.
      if (dependency%iter < huge(dependency%iter)) then
        ! But dependency not!
        zeroed%iter = 0
      end if
    end if
    if (.not. time%clock < huge(time%clock)) then
      ! Time set to never.
      if (dependency%clock < huge(dependency%clock)) then
        ! But dependency not!
        zeroed%clock = 0.0_rk
      end if
    end if

  end function tem_time_default_zero