F.1.3 Valid_State_Timer Procedure

The main documentation of the Valid_State_Timer Procedure contains additional explanation of this code listing.

  function Valid_State_Timer (Timer) result(Valid)

    ! Input variables.

    ! Variable to be checked.
    type(Timer_type), intent(in) :: Timer  

    ! Output variables.

    type(logical) :: Valid             ! Logical state.

    !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ! Start out true.

    Valid = .true.

    ! Check for association of pointered internals.

    Valid = Valid .and. ASSOCIATED(Timer%Initialized)
    if (.not.Valid) return

    ! Check for validity of internals.

    Valid = Valid .and. Valid_State(Timer%CPU_Time%Start)
    Valid = Valid .and. Valid_State(Timer%CPU_Time%Statistics)
    Valid = Valid .and. Valid_State(Timer%Wall_Clock_Time%Start)
    Valid = Valid .and. Valid_State(Timer%Wall_Clock_Time%Statistics)
    Valid = Valid .and. Valid_State(Timer%Running)
    Valid = Valid .and. Valid_State(Timer%Name)
    if (.not.Valid) return

    ! Consistency checks.

    Valid = Valid .and. Timer%CPU_Time%Start >= zero
   ! These are giving errors -- I don't know why -- so they are commented
   ! out for now.
   ! Valid = Valid .and. (Minimum(Timer%CPU_Time%Statistics) >= zero)
    Valid = Valid .and. Timer%Wall_Clock_Time%Start >= zero
   ! Valid = Valid .and. (Minimum(Timer%Wall_Clock_Time%Statistics) >= zero)

    return
  end function Valid_State_Timer



Michael L. Hall