def compute_timestep(self):
        """
        The timestep() function computes the advective timestep
        (CFL) constraint.  The CFL constraint says that information
        cannot propagate further than one zone per timestep.

        We use the driver.cfl parameter to control what fraction of the CFL
        step we actually take.
        """

        myg = self.cc_data.grid

        cfl = self.rp.get_param("driver.cfl")

        u = self.cc_data.get_var("x-velocity")
        v = self.cc_data.get_var("y-velocity")

        # the timestep is min(dx/|u|, dy|v|)
        xtmp = ytmp = 1.e33
        if not abs(u).max() == 0:
            xtmp = myg.dx/abs(u.v()).max()
        if not abs(v).max() == 0:
            ytmp = myg.dy/abs(v.v()).max()

        dt = cfl*min(xtmp, ytmp)

        # We need an alternate timestep that accounts for buoyancy, to
        # handle the case where the velocity is initially zero.
        rho = self.cc_data.get_var("density")
        rho0 = self.base["rho0"]
        rhoprime = self.make_prime(rho, rho0)

        g = self.rp.get_param("lm-atmosphere.grav")

        F_buoy = (abs(rhoprime*g).v()/rho.v()).max()

        dt_buoy = np.sqrt(2.0*myg.dx/F_buoy)

        self.dt = min(dt, dt_buoy)
        if 0 > self.verbose: print("timestep is {}".format(dt))
dataset/ETHPy150Open zingale/pyro2/lm_atm/simulation.py/Simulation.compute_timestep/swapped operands of `>`