auto_time_unit Function

public pure function auto_time_unit(span_sec) result(k)

Return largest time unit in which span is at least 1.

UNAME index from s to Gyr, s if none fits. Unit of units auto (docs/commands.md).

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: span_sec

Visible time span (s).

Return Value integer(kind=int32)


Source Code

   pure function auto_time_unit(span_sec) result(k)
      !! Return largest time unit in which span is at least 1.
      !!
      !! `UNAME` index from `s` to `Gyr`, `s` if none fits. Unit of `units auto` (docs/commands.md).
      ! Arguments
      real(real64), intent(in) :: span_sec
         !! Visible time span (s).
      integer(int32) :: k
      do k = IGYR, 2, -1
         if (span_sec >= UFAC(k)) return
      end do
      k = 1
   end function auto_time_unit