def tmy_daily_total(datalist):
    """
    from a TMY list with 8760 hourly values of cumulative variables
    (e.g., solar irradiation) calculate the daily total

   input data:
    - list with 8760 values of cumulative values

    output:
    - list with 365 total values

    """
    day_total = []
    for d in range(0, 365):
        day_sum = 0
        for h in range(0, 24):
            h_idx = d * 24 + h
            day_sum = day_sum + datalist[h_idx]
        day_total.append(day_sum)
    return day_total
