<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_U1U2(self, U1, U2):
 """Set background zonal flow. Parameters U1 : number Upper layer flow. Units: m/s U2 : number Lower layer flow. Units: m/s """

        if len(np.shape(U1)) == 0:
          U1 = U1 * np.ones((self.ny)) 
        if len(np.shape(U2)) == 0:
          U2 = U2 * np.ones((self.ny)) 
        #self.Ubg = np.array([U1,U2])[:,np.newaxis,np.newaxis]
        self.U1 = U1
        self.U2 = U2
        self.Ubg = np.array([U1,U2])