separate (Tracker.Report_Generator.Calc_Pct_Done)
procedure Get_Ss_Totals is
    --------------------------------------------------------------------------------
    --|
    --|  NAME:  GET_SS_TOTALS
    --|
    --|  OVERVIEW:
    --|    This procedure computes the total amount of work, the amount done,
    --|    and the amount available at start for a subsystem.
    --|
    --|  EXCEPTIONS HANDLED:
    --|    others   error message is printed and execution continues
    --|
    --|  HISTORY:
    --|    written by   Bonnie Burkhardt   March 1985
    --------------------------------------------------------------------------------

    Done : Float range 0.0 .. 999_999.0 := 0.0;
    Size : Float range 0.0 .. 999_999.0 := 0.0;
    Start : Float range 0.0 .. 999_999.0 := 0.0;
    Ele_Start : Float range 0.0 .. 99_999.0;
    Ele_Size : Float range 0.0 .. 99_999.0;
    Ms_Index : Ms_Num_Type;

begin
    -- reset subsystem totals
    Ss_Tot_Size := 0.0;
    Ss_Tot_Done := 0.0;
    Ss_Tot_Start := 0.0;
    Ss_Size := (others => 0.0);
    Ss_Done := (others => 0.0);
    Ss_Start := (others => 0.0);

    -- set through each subsystem list and calculate each element
    Start_Walk (Ss_Ptr.Element_List);

    loop
        Walk (Ss_Ptr.Element_List, Ele_Ptr, End_List);
        exit when End_List;
        Ms_Index := Ele_Ptr.Milestone_Num;

        -- compute the size of this element (original or current)
        if Orig_Or_Cur = Current then
            Ele_Start := Float (Ele_Ptr.Size_Done_At_Start);
            Ele_Size := Float (Ele_Ptr.Current_Size) - Ele_Start;
        elsif (Ele_Ptr.Original_Size >= Ele_Ptr.Current_Size) or
              (Ele_Ptr.Current_Size = 0) then
            Ele_Start := Float (Ele_Ptr.Size_Done_At_Start);
            Ele_Size := Float (Ele_Ptr.Original_Size) - Ele_Start;
        else
            Ele_Start := Float (Ele_Ptr.Original_Size) *
                            Float (Ele_Ptr.Size_Done_At_Start) /
                            Float (Ele_Ptr.Current_Size);
            Ele_Size := Float (Ele_Ptr.Original_Size) - Ele_Start;
        end if;

        -- add the amount to the running totals for the subsystem
        Ss_Tot_Size := Ss_Tot_Size + Ele_Size * Ele_Ptr.Complexity;
        Ss_Tot_Start := Ss_Tot_Start + Ele_Start * Ele_Ptr.Complexity;

        -- calculate the amount of work done for each activity in the subsystem
        -- and for each milestone
        Start_Walk (Ac_List);
        Ac_Index := 0;

        loop
            Walk (Ac_List, Ac_Ptr, End_List);
            exit when End_List;
            Ac_Index := Ac_Index + 1;
            Size := Ele_Ptr.Complexity * Ele_Size *
                       Ac_Ptr.Percent_Tot_Proj / 100.0;
            Start := Ele_Ptr.Complexity * Ele_Start *
                        Ac_Ptr.Percent_Tot_Proj / 100.0;
            Done :=
               Size * Ac_Pct_Value (Ele_Ptr.Activity_Completeness (Ac_Index)) /
                  100.0;
            Ss_Size (Ac_Index) := Ss_Size (Ac_Index) + Size;
            Ss_Start (Ac_Index) := Ss_Start (Ac_Index) + Start;
            Ss_Done (Ac_Index) := Ss_Done (Ac_Index) + Done;
            Ms_Size (Ms_Index) := Ms_Size (Ms_Index) + Size;
            Ms_Done (Ms_Index) := Ms_Done (Ms_Index) + Done;
        end loop;
    end loop;

    -- calculate the total amount of work done
    for Ac_Index in 1 .. Num_Of_Activities loop
        Ss_Tot_Done := Ss_Tot_Done + Ss_Done (Ac_Index);
    end loop;
exception
    when others =>
        Put_Line ("exception raised in GET_SS_TOTALS.");
end Get_Ss_Totals;
