Skip to content

Commit

Permalink
remove print statements and lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nhartney committed Jul 27, 2023
1 parent 73b6548 commit db42049
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions gusto/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,15 +869,13 @@ def __init__(self, equation, saturation_curve, L=None,
if self.convective_feedback:
self.VD_idx = equation.field_names.index("D")
VD = W.sub(self.VD_idx)
test_D = equation.tests[self.VD_idx]
self.D = Function(VD)
V_idxs.append(self.VD_idx)

# buoyancy needed if thermal feedback
if self.thermal_feedback:
self.Vb_idx = equation.field_names.index("b")
Vb = W.sub(self.Vb_idx)
test_b = equation.tests[self.Vb_idx]
self.b = Function(Vb)
V_idxs.append(self.Vb_idx)

Expand All @@ -903,16 +901,11 @@ def __init__(self, equation, saturation_curve, L=None,

# Saturation adjustment expression, adjusted to stop negative values
sat_adj_expr = (self.water_v - self.saturation_curve) / self.tau
print(sat_adj_expr)
sat_adj_expr = conditional(sat_adj_expr < 0,
max_value(sat_adj_expr,
-self.cloud / self.tau),
min_value(sat_adj_expr,
self.water_v / self.tau))
print(sat_adj_expr)
sat_adj_func = Function(self.water_v.function_space())
sat_adj_func.interpolate(sat_adj_expr)
print(sat_adj_func.dat.data.max())

# If gamma_v depends on variables
if self.time_varying_gamma_v:
Expand Down Expand Up @@ -945,7 +938,6 @@ def __init__(self, equation, saturation_curve, L=None,
equation.residual += physics(subject(test * source * dx,
equation.X), self.evaluate)


def evaluate(self, x_in, dt):
"""
Evaluates the source term generated by the physics.
Expand All @@ -971,10 +963,5 @@ def evaluate(self, x_in, dt):
self.cloud.assign(x_in.split()[self.Vc_idx])
if self.time_varying_gamma_v:
self.gamma_v.interpolate(self.gamma_v_computation(x_in))
int_func = Function(self.b.function_space())
for interpolator in self.source_interpolators:
interpolator.interpolate(output=int_func)
print("max interpolator:")
print(int_func.dat.data.max())
print("min interpolator:")
print(int_func.dat.data.min())
interpolator.interpolate()

0 comments on commit db42049

Please sign in to comment.