<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def calc_sbes_v1(self):
 """Calculate the frozen part of stand precipitation. Required control parameters: |NHRU| |TGr| |TSp| Required flux sequences: |TKor| |NBes| Calculated flux sequence: |SBes| Examples: In the first example, the threshold temperature of seven hydrological response units is 0 °C and the corresponding temperature interval of mixed precipitation 2 °C: The value of |NBes| is zero above 1 °C and equal to the value of |NBes| below -1 °C. Between these temperature values, |NBes| decreases linearly: sbes(4.0, 4.0, 3.0, 2.0, 1.0, 0.0, 0.0) Note the special case of a zero temperature interval. With the actual temperature being equal to the threshold temperature, the the value of `sbes` is zero: sbes(4.0, 4.0, 4.0, 0.0, 0.0, 0.0, 0.0) """

    con = self.parameters.control.fastaccess
    flu = self.sequences.fluxes.fastaccess
    for k in range(con.nhru):
        if flu.nbes[k] <= 0.:
            flu.sbes[k] = 0.
        elif flu.tkor[k] >= (con.tgr[k]+con.tsp[k]/2.):
            flu.sbes[k] = 0.
        elif flu.tkor[k] <= (con.tgr[k]-con.tsp[k]/2.):
            flu.sbes[k] = flu.nbes[k]
        else:
            flu.sbes[k] = ((((con.tgr[k]+con.tsp[k]/2.)-flu.tkor[k]) /
                            con.tsp[k])*flu.nbes[k])