Skip to content

Commit a038dfb

Browse files
committed
Apply Xylar's suggestions from code review
1 parent 523f61d commit a038dfb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

polaris/ocean/tasks/barotropic_gyre/forward.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import time
2-
from math import ceil
2+
from math import ceil, floor
33

44
from polaris.mesh.planar import compute_planar_hex_nx_ny
55
from polaris.ocean.model import OceanModelStep, get_time_interval_string
@@ -124,7 +124,7 @@ def dynamic_model_config(self, at_setup):
124124
rho_0 = config.getfloat("barotropic_gyre", "rho_0")
125125

126126
dt_max = compute_max_time_step(config)
127-
dt = dt_max / 3.
127+
dt = floor(dt_max / 3.)
128128
dt_str = get_time_interval_string(seconds=dt)
129129

130130
options = {'config_dt': dt_str,

polaris/ocean/tasks/barotropic_gyre/init.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ def setup(self):
5050
nu_2 = config.getfloat("barotropic_gyre", "nu_2")
5151

5252
# calculate the boundary layer thickness for specified parameters
53-
M = (np.pi * 2) / np.sqrt(3) * (nu_2 / beta)**(1. / 3.)
53+
m = (np.pi * 2) / np.sqrt(3) * (nu_2 / beta)**(1. / 3.)
5454
# ensure the boundary layer is at least 3 gridcells wide
55-
if M >= 3. * resolution * 1.e3:
55+
if m >= 3. * resolution * 1.e3:
5656
raise ValueError(f"Resolution {resolution} km is too coarse to "
5757
"properly resolve the lateral boundary layer "
58-
f"with anticipated width of {(M * 1e-3):03g} km")
58+
f"with anticipated width of {(m * 1e-3):03g} km")
5959

6060
# check whether viscosity suitable for stability
6161
stability_parameter_max = 0.6

0 commit comments

Comments
 (0)