<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_am_um_v1(self):
 """Calculate the flown through area and the wetted perimeter of the main channel. Note that the main channel is assumed to have identical slopes on both sides and that water flowing exactly above the main channel is contributing to |AM|. Both theoretical surfaces seperating water above the main channel from water above both forelands are contributing to |UM|. Required control parameters: |HM| |BM| |BNM| Required flux sequence: |H| Calculated flux sequence: |AM| |UM| Examples: Generally, a trapezoid with reflection symmetry is assumed. Here its smaller base (bottom) has a length of 2 meters, its legs show an inclination of 1 meter per 4 meters, and its height (depths) is 1 meter: The first example deals with normal flow conditions, where water flows within the main channel completely (|H| < |HM|):
 am(2.0) um(6.123106) The second example deals with high flow conditions, where water flows over the foreland also (|H| > |HM|):
 am(11.0) um(11.246211) The third example checks the special case of a main channel with zero height: am(3.0) um(5.0) The fourth example checks the special case of the actual water stage not being larger than zero (empty channel):
 am(0.0) um(0.0) """

    con = self.parameters.control.fastaccess
    flu = self.sequences.fluxes.fastaccess
    if flu.h <= 0.:
        flu.am = 0.
        flu.um = 0.
    elif flu.h < con.hm:
        flu.am = flu.h*(con.bm+flu.h*con.bnm)
        flu.um = con.bm+2.*flu.h*(1.+con.bnm**2)**.5
    else:
        flu.am = (con.hm*(con.bm+con.hm*con.bnm) +
                  ((flu.h-con.hm)*(con.bm+2.*con.hm*con.bnm)))
        flu.um = con.bm+(2.*con.hm*(1.+con.bnm**2)**.5)+(2*(flu.h-con.hm))